Jump to:

22997 Posts in 11620 Topics by 2827 members

General Questions

SilverStripe Forums » General Questions » Error saving content

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

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

Page: 1
Go to End
Author Topic: 1119 Views
  • Alessio
    Avatar
    Community Member
    4 Posts

    Error saving content Link to this post

    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

  • biapar
    Avatar
    Forum Moderator
    435 Posts

    Re: Error saving content Link to this post

    View with debug. <link>?debug=1

  • swaiba
    Avatar
    Forum Moderator
    1769 Posts

    Re: Error saving content Link to this post

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

  • Alessio
    Avatar
    Community Member
    4 Posts

    Re: Error saving content Link to this post

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

  • swaiba
    Avatar
    Forum Moderator
    1769 Posts

    Re: Error saving content Link to this post

    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

  • Alessio
    Avatar
    Community Member
    4 Posts

    Re: Error saving content Link to this post

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

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: Error saving content Link to this post

    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.

    1119 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.