5121 Posts in 1527 Topics by 1119 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1263 Views |
-
Strange SiteConfig issue

8 June 2010 at 3:02am
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.phpSource
======
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.phpWidgetAreaEditor->saveInto(SiteConfig)
line 998 of Form.phpForm->saveInto(SiteConfig)
line 379 of CMSMain.phpCMSMain->save_siteconfig(Array,Form,SS_HTTPRequest)
line 300 of Form.phpForm->httpSubmission(SS_HTTPRequest)
line 137 of RequestHandler.phpRequestHandler->handleRequest(SS_HTTPRequest)
line 155 of RequestHandler.phpRequestHandler->handleRequest(SS_HTTPRequest)
line 147 of Controller.phpController->handleRequest(SS_HTTPRequest)
line 282 of Director.phpDirector::handleRequest(SS_HTTPRequest,Session)
line 127 of Director.phpDirector::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.
-
Re: Strange SiteConfig issue

8 June 2010 at 3:23am
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?
-
Re: Strange SiteConfig issue

9 June 2010 at 4:25am
I consider your Tortoise SVN updating don't support given options of php form.
http://phpforms.net/tutorial/html-basics/php-forms.html -
Re: Strange SiteConfig issue

9 June 2010 at 4:35am
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...
-
Re: Strange SiteConfig issue

10 June 2010 at 6:23pm Last edited: 10 June 2010 6:41pm
This relates to the bug here: http://open.silverstripe.org/ticket/5671
I'm now testing ajshort's patch and will commit once I've finished testing.
EDIT The patch is applied, and this issue should now be fixed.
See http://open.silverstripe.org/changeset/106351Thanks for reporting this.
Cheers,
- Luke
| 1263 Views | ||
|
Page:
1
|
Go to Top |




