7911 Posts in 1354 Topics by 930 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » Error when trying out the FileDataObjectManager
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 1101 Views |
-
Error when trying out the FileDataObjectManager

2 July 2009 at 11:08pm
Hi,
I am following the tutorial for this module in the documentation. The DataObjectManager (Testimonial stuff) works fine. However, the next bit for the ResourcePage comes up with this error when adding a new page in the CMS:
ERROR [User Error]: getCMSFields returned null on a 'Page' object - it should return a FieldSet object. Perhaps you forgot to put a return statement at the end of your method?
IN POST /silverstripe/admin/getitem?ID=6&ajax=1
Line 392 in /home/adrianw/PROJECTS/sandbox/silverstripe/cms/code/CMSMain.phpSource
======
383:384: public function getEditForm($id) {
385: $record = $this->getRecord($id);
386:
387: if($record) {
388: if($record->IsDeletedFromStage) $record->Status = _t('CMSMain.REMOVEDFD',"Removed from the draft
site");389:
390: $fields = $record->getCMSFields($this);
391: if ($fields == null) {
* 392: user_error("getCMSFields returned null on a 'Page' object - it should return a FieldSet object.
Perhaps you forgot to put a return statement at the end of your method?", E_USER_ERROR);393: }
394: $fields->push($idField = new HiddenField("ID"));
395: $fields->push($liveURLField = new HiddenField("LiveURLSegment"));
396: $fields->push($stageURLField = new HiddenField("StageURLSegment"));
397:
398: /*if( substr($record->ID, 0, 3 ) == 'new' )*/
<ul>user_error(getCMSFields returned null on a 'Page' object - it should return a FieldSet object. Perhaps you forgot to put a return statement at the end of your method?,256)
line 392 of CMSMain.phpCMSMain->getEditForm(6)
line 925 of LeftAndMain.phpLeftAndMain->EditForm()
line 380 of LeftAndMain.phpLeftAndMain->getitem(HTTPRequest)
line 162 of Controller.phpController->handleAction(HTTPRequest)
line 129 of RequestHandler.phpRequestHandler->handleRequest(HTTPRequest)
line 122 of Controller.phpController->handleRequest(HTTPRequest)
line 277 of Director.phpDirector::handleRequest(HTTPRequest,Session)
line 121 of Director.phpDirector::direct(/admin/getitem)
line 118 of main.php</ul>
Can you help? I am using the latest version of Silverstripe (2.3.2)
Adrian
-
Re: Error when trying out the FileDataObjectManager

2 July 2009 at 11:26pm
Apologies, have realised the error. The two lines are missing from the tutorial code:
$f->addFieldToTab("Root.Content.Resources", $manager);
return $f;Cheers,
Adrian
-
Re: Error when trying out the FileDataObjectManager

3 July 2009 at 1:38am
Thanks for pointing that out. I'll make the update.
| 1101 Views | ||
|
Page:
1
|
Go to Top |

