Jump to:

5521 Posts in 1734 Topics by 1223 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Strange SiteConfig issue

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

Page: 1
Go to End
Author Topic: 1461 Views
  • Pigeon
    Avatar
    Community Member
    243 Posts

    Strange SiteConfig issue Link to this post

    I'm running SilverStripe 2.4 from the 2.4 svn branch (r106221)

    My SiteConfig started behaving strangely after a recent svn update. I am recieveing an error when attempting to save my SiteConfig. The issue seems to be that fields from the Page getCMSFields method are being 'saveInto'-ed the SiteConfig object causing this error:

    ERROR [User Error]: Uncaught Exception: DataObject->getComponent(): Could not find component 'WidgetArea'.
    IN POST /admin/EditForm
    Line 1225 in /xxxx/xxxx/public_html/sapphire/core/model/DataObject.php

    Source
    ======
    1216: if($joinID) {
    1217: $component = DataObject::get_one($class, "\"$joinField\" = $joinID");
    1218: }
    1219:
    1220: if(!isset($component) || !$component) {
    1221: $component = new $class();
    1222: $component->$joinField = $this->ID;
    1223: }
    1224: } else {
    * 1225: throw new Exception("DataObject->getComponent(): Could not find component '$componentName'.");
    1226: }
    1227:
    1228: $this->components[$componentName] = $component;
    1229: return $component;
    1230: }
    1231:

    Trace
    =====
    <ul>DataObject->getComponent(WidgetArea)
    line 66 of WidgetAreaEditor.php

    WidgetAreaEditor->saveInto(SiteConfig)
    line 998 of Form.php

    Form->saveInto(SiteConfig)
    line 379 of CMSMain.php

    CMSMain->save_siteconfig(Array,Form,SS_HTTPRequest)
    line 300 of Form.php

    Form->httpSubmission(SS_HTTPRequest)
    line 137 of RequestHandler.php

    RequestHandler->handleRequest(SS_HTTPRequest)
    line 155 of RequestHandler.php

    RequestHandler->handleRequest(SS_HTTPRequest)
    line 147 of Controller.php

    Controller->handleRequest(SS_HTTPRequest)
    line 282 of Director.php

    Director::handleRequest(SS_HTTPRequest,Session)
    line 127 of Director.php

    Director::direct(/admin/EditForm)
    line 127 of main.php

    </ul>

    My Page.php looks like this:

    class Page extends SiteTree {
       
       public static $db = array(
          
       );
       
       public static $has_one = array(
          'WidgetArea' => 'WidgetArea'
       );

       
       function getCMSFields() {
          $fields = parent::getCMSFields();
          
          //remove for clutter reasons clutter
          $fields->removeFieldFromTab('Root.Content','GoogleSitemap');
          
          $fields->addFieldToTab('Root.Content.Widgets', new WidgetAreaEditor('WidgetArea'));
          
          return $fields;
       }
       
    }

    This seems to have started since the latest svn update. I will roll back and report back, but it would be interesting to see if anyone else has this problem.

  • Pigeon
    Avatar
    Community Member
    243 Posts

    Re: Strange SiteConfig issue Link to this post

    Ok, I did some rolling back to find the revision that caused this, and r106083 seems to be the last working one for the SiteConfig.

    r106118 breaks it. Possibly a change in CMSMain.php in cms?

  • Lis@
    Avatar
    Community Member
    2 Posts

    Re: Strange SiteConfig issue Link to this post

    I consider your Tortoise SVN updating don't support given options of php form.
    http://phpforms.net/tutorial/html-basics/php-forms.html

  • joshy
    Avatar
    Community Member
    57 Posts

    Re: Strange SiteConfig issue Link to this post

    If I were an algorithm, I'd mark that as spam ^.

  • Pigeon
    Avatar
    Community Member
    243 Posts

    Re: Strange SiteConfig issue Link to this post

    Lis@: Thanks, i can't say i fully understand what you said, or how it is relevant... but thanks. By the way, want to go out for a drink? You look kinda hot...

    1461 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.