Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Error saving content


Go to End


7 Posts   1781 Views

Avatar
Alessio

Community Member, 4 Posts

28 February 2011 at 11:59pm

I have the following class:

class Prodotti extends SlideshowProPage {
static $db = array(
"Prodotto" => "Text",
"Tipologia" => "Text",
"Specifiche" => "Text",
"Caratteristiche" => "HTMLText",
"Applicazioni" => "HTMLText"
);
static $has_one = array(
"SchedaTecnica" => "File",
"InfoProdotto" => "File"
);
static $has_many = array(
);

public function getCMSFields($cms) {
$fields = parent::getCMSFields($cms);
$fields->addFieldToTab("Root.Content.Main", new TextField("Prodotto", "Prodotto"), "Content");
$fields->addFieldToTab("Root.Content.Main", new TextField("Tipologia", "Tipologia"), "Content");
$fields->addFieldToTab("Root.Content.Main", new TextField("Specifiche", "Specifiche"), "Content");
$fields->addFieldToTab("Root.Content.Main", new HTMLEditorField("Caratteristiche", "Caratteristiche"), "Content");
$fields->addFieldToTab("Root.Content.Main", new HTMLEditorField("Applicazioni", "Applicazioni"), "Content");
$fields->addFieldToTab('Root.Content.Main', new FileIFrameField("SchedaTecnica"), "Content");
$fields->addFieldToTab('Root.Content.Main', new FileIFrameField("InfoProdotto"), "Content");
return $fields;
}
}

What happens is that when I click on Save all ok, but when I click on "save and publishing" generates "error saving content".
Does anyone know give me an explanation ?
Thanks

Avatar
biapar

Forum Moderator, 435 Posts

1 March 2011 at 1:27am

View with debug. <link>?debug=1

Avatar
swaiba

Forum Moderator, 1899 Posts

1 March 2011 at 1:29am

Could be many things... Ctrl+Shit+J in chrome/firefox for the console that reports error in more detail...

Avatar
Alessio

Community Member, 4 Posts

1 March 2011 at 2:35am

I used <link>?debug = 1, but now I get the error "javascript parse error". Only that I have not done changes to javascript

Avatar
swaiba

Forum Moderator, 1899 Posts

1 March 2011 at 3:31am

and without the ?debug, but lokoing at the javascript errors in the console? I'd image it is some SQL error (they usual are for me saving content) and are often solved with a deb/build

Avatar
Alessio

Community Member, 4 Posts

1 March 2011 at 8:51pm

It is very strange because I have two pages of this class and a against these problems and the other no

Avatar
Willr

Forum Moderator, 5523 Posts

2 March 2011 at 11:06pm

Firebug is a good tool for these errors. Ensure your site is running in devmode then try again with Firebugs Console window open, you should see the ajax request and the returned error message.