21309 Posts in 5738 Topics by 2603 members
| Go to End | Next > | |
| Author | Topic: | 590 Views |
-
debugging why a page wont "save & publish"

1 November 2011 at 12:15am
Hi everyone
I have built a page "property details", however it now wont save and publish and of my "properties", i just get the little ajax loading symbol over the button, but it doesnt save... how do I debug where it might be getting stuck? I already have
Director::set_environment_type("dev");
turned on. This is my code....
<?php
class PropertyDetail extends Page {public static $db = array(
'PropertyName' => 'Text',
'RentPerMonth' => 'Currency',
'NumberOfBeds' => 'Int',
'Location' => 'Text',
'Postcode' => 'Text',
'StreetName' => 'Text',
'Lat' => 'Text',
'Long' => 'Text'
);public static $has_one = array(
'SearchResultPicture' => 'Image'
);public static $has_many = array(
'ImageResources' => 'ImageResource'
);function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Content.Main", new ImageField('SearchResultPicture'));
$fields->addFieldToTab("Root.Content.Main", new TextField('PropertyName'));
$fields->addFieldToTab("Root.Content.Main", new CurrencyField('RentPerMonth'));
$fields->addFieldToTab("Root.Content.Main", new NumericField('NumberOfBeds'));
$fields->addFieldToTab("Root.Content.Main", new TextField('Location'));
$fields->addFieldToTab("Root.Content.Main", new TextField('Postcode'));
$fields->addFieldToTab("Root.Content.Main", new TextField('StreetName'));
$fields->addFieldToTab("Root.Content.Main", new TextField('Lat'));
$fields->addFieldToTab("Root.Content.Main", new TextField('Long'));$managerimages = new ImageDataObjectManager(
$this, // Controller
'Images', // Source name
'ImageResource', // Source class
'Attachment', // File name on DataObject
array(
'Title' => 'Title'
), // Headings
'getCMSFields_forPopup' // Detail fields
// Filter clause
// Sort clause
// Join clause
);
$fields->addFieldToTab("Root.Content.Image Gallery",$managerimages);return $fields;
}}
class PropertyDetail_Controller extends Page_Controller {
public static $allowed_actions = array (
);public function init() {
parent::init();
}
}Thanks!
-
Re: debugging why a page wont "save & publish"

1 November 2011 at 1:50am
Hi,
Do you use an IDE for development? (Eg. I use Netbeans with XDebug enabled, and I'm able to set breakpoints in code and and step through.)
If you're able to set a breakpoints and debug, set a breakpoint on AssetAdmin::save(...) [line 686 of cms/code/AssetAdmin.php] or its parent LeftAndMain::save(...) [line 624 of cms/code/LeftAndMain.php]. Then single-step through and see what's going on.
VWD.
-
Re: debugging why a page wont "save & publish"

1 November 2011 at 1:52am
I do use netbeans, i am new to using it tho... and I dont run the site locally, its run on our live server, so I dont think this will work? If i can get it running locally then this might be doable?
-
Re: debugging why a page wont "save & publish"

1 November 2011 at 2:03am
yes if you run locally you can debug easily and quickly with net beans
-
Re: debugging why a page wont "save & publish"

1 November 2011 at 2:05am
what would i need to run locally.... xamp, mysql.... anything else?
-
Re: debugging why a page wont "save & publish"

1 November 2011 at 2:08am
depends on your system - i use wampserver (that includes evenything needed)
-
Re: debugging why a page wont "save & publish"

1 November 2011 at 2:08am
I am running windows 7 Ultimate edition... thanks
-
Re: debugging why a page wont "save & publish"

1 November 2011 at 3:02am
ok i set the site up locally and it saves perfectly! How odd?!?
| 590 Views | ||
| Go to Top | Next > |



