5099 Posts in 1519 Topics by 1116 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 775 Views |
-
[Resolved] SS 2.3.1 - Issue with CurrencyField in Custom page type

8 May 2009 at 1:09am Last edited: 9 May 2009 1:25am
I have a very frustrating issue where Silverstripe won't properly create a custom page type in a section within the CMS.
When I select the page type from the dropdown and click "Go", nothing happens. However, when I refresh the page has been created. This only happens with the custom page type - if I try and create a regular page under the section, it works absolutely fine. The section doesn't have an $allowed_children array defined, so I can create anything within it.
I would really really appreciate some help with this - it's driving me nuts!!!! Code for the extended page type as below:
<?php
class ProductDetail extends Page {static $db = array(
'Code' => 'Text',
'Price' => 'Currency',
'PriceDescription' => 'Text'
);static $has_one = array(
'Photo' => 'Image'
);function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Content.Main', new TextField('Code'), 'Content');
$fields->addFieldToTab('Root.Content.Main', new CurrencyField('Price'), '');
$fields->addFieldToTab('Root.Content.Main', new TextField('PriceDescription'), '');
$fields->addFieldToTab("Root.Content.Photo", new ImageField('Photo'));
$fields->renameField("PriceDescription", "Price Description");
$fields->renameField("Content","Product Description");
return $fields;
}}
class ProductDetail_Controller extends Page_Controller {
}?>
-
Re: [Resolved] SS 2.3.1 - Issue with CurrencyField in Custom page type

8 May 2009 at 5:41am
your page code looks ok.
do you get any javascript errors? do you have firebug installed to see what ajax requests are made an what they return? -
Re: [Resolved] SS 2.3.1 - Issue with CurrencyField in Custom page type

8 May 2009 at 10:05pm
It makes a call to AddPageOptionsForm and returns an error on that call... I have no further information on the error though, other than "There has been an Error"
-
Re: [Resolved] SS 2.3.1 - Issue with CurrencyField in Custom page type

9 May 2009 at 12:11am
Okay after reinstalling and dissecting the code I've discovered that it's only the currency field type that's causing this issue. Does anyone have any idea why this would be? I've used this field type in install 3.0 with no problems. Any help with this would be greatly appreciated.
-
Re: [Resolved] SS 2.3.1 - Issue with CurrencyField in Custom page type

9 May 2009 at 1:25am
Okay it's resolved - MySql was corrupt. It's reinstalled and is now working fine.
| 775 Views | ||
|
Page:
1
|
Go to Top |


