I'm getting this error... "[User Error] Bad RecordClassName '' and $baseClass not set" when I try to use the FileDataObjectManager on SS 2.4rc1 and DOM rev #392. Any ideas what the issue may be?
Thanks in advance,
Andy
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
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.
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Sean, Ed, biapar, Willr, Ingo, swaiba
I'm getting this error... "[User Error] Bad RecordClassName '' and $baseClass not set" when I try to use the FileDataObjectManager on SS 2.4rc1 and DOM rev #392. Any ideas what the issue may be?
Thanks in advance,
Andy
Can I see the code you're using?
If you still have this problem, check your File table in the database. At least one ClassName field is probably empty. Fix this, and you're good to go.
I forgot to post that here. Yup, it was an empty ClassName field. Thanks!
I'm getting a similar error -- I upgraded from v2.3.7 to v2.4.0. The only modules currently installed are the blog and DOM. The site itself seems to work OK, but the blog seems to have forgotten its entries and is also once again just "Blog" (I had renamed it to "Aktuelles", in German). When I try to access the CMS, I get:
[User Error] Bad RecordClassName '' and $baseClass not set
GET /admin/
Line 2705 in /srv/web/tal-15299/beta.alt-katholisch-hannover.de/sapphire/core/model/DataObject.php
Source
2696 foreach($records as $record) {
2697 if(empty($record['RecordClassName'])) {
2698 $record['RecordClassName'] = $record['ClassName'];
2699 }
2700 if(class_exists($record['RecordClassName'])) {
2701 $results[] = new $record['RecordClassName']($record);
2702 } else {
2703 if(!$baseClass) {
2704 user_error("Bad RecordClassName '{$record['RecordClassName']}' and "
2705 . "\$baseClass not set", E_USER_ERROR);
2706 } else if(!is_string($baseClass) || !class_exists($baseClass)) {
2707 user_error("Bad RecordClassName '{$record['RecordClassName']}' and bad "
2708 . "\$baseClass '$baseClass not set", E_USER_ERROR);
2709 }
2710 $results[] = new $baseClass($record);
2711 }
Trace
Bad RecordClassName '' and $baseClass not set
Line 2705 of DataObject.php
DataObject->buildDataObjectSet(MySQLQuery)
Line 569 of Hierarchy.php
Hierarchy->liveChildren(1,1)
call_user_func_array(Array,Array)
Line 693 of Object.php
Object->__call(liveChildren,Array)
SiteTree->liveChildren(1,1)
Line 438 of Hierarchy.php
Hierarchy->doAllChildrenIncludingDeleted(CMSMain)
Line 416 of Hierarchy.php
Hierarchy->AllChildrenIncludingDeleted(CMSMain)
call_user_func_array(Array,Array)
Line 693 of Object.php
Object->__call(AllChildrenIncludingDeleted,Array)
SiteTree->AllChildrenIncludingDeleted(CMSMain)
Line 159 of Hierarchy.php
Hierarchy->markChildren(SiteTree,CMSMain,AllChildrenIncludingDeleted,numChildren)
Line 94 of Hierarchy.php
Hierarchy->markPartialTree(30,CMSMain,AllChildrenIncludingDeleted,numChildren)
call_user_func_array(Array,Array)
Line 693 of Object.php
Object->__call(markPartialTree,Array)
SiteTree->markPartialTree(30,CMSMain,AllChildrenIncludingDeleted,numChildren)
Line 516 of LeftAndMain.php
LeftAndMain->getSiteTreeFor(SiteTree)
Line 168 of CMSMain.php
CMSMain->SiteTreeAsUL()
Line 369 of ViewableData.php
ViewableData->obj(SiteTreeAsUL,,,1)
Line 445 of ViewableData.php
ViewableData->XML_val(SiteTreeAsUL,,1)
Line 322 of .cache.srv.web.tal-15299.beta.alt-katholisch-hannover.de.cms.templates.Includes.CMSMain_left.ss
include(/tmp/silverstripe-cache-srv-web-tal-15299-beta.alt-katholisch-hannover.de/.cache.srv.web.tal-15299.beta.alt-katholisch-hannover.de.cms.templates.Includes.CMSMain_left.ss)
Line 392 of SSViewer.php
SSViewer->process(CMSMain)
Line 342 of ViewableData.php
ViewableData->renderWith(Array)
Line 483 of LeftAndMain.php
LeftAndMain->Left()
Line 369 of ViewableData.php
ViewableData->obj(Left,,,1)
Line 445 of ViewableData.php
ViewableData->XML_val(Left,,1)
Line 59 of .cache.srv.web.tal-15299.beta.alt-katholisch-hannover.de.cms.templates.LeftAndMain.ss
include(/tmp/silverstripe-cache-srv-web-tal-15299-beta.alt-katholisch-hannover.de/.cache.srv.web.tal-15299.beta.alt-katholisch-hannover.de.cms.templates.LeftAndMain.ss)
Line 392 of SSViewer.php
SSViewer->process(CMSMain)
Line 202 of Controller.php
Controller->handleAction(SS_HTTPRequest)
Line 134 of RequestHandler.php
RequestHandler->handleRequest(SS_HTTPRequest)
Line 147 of Controller.php
Controller->handleRequest(SS_HTTPRequest)
Line 283 of Director.php
Director::handleRequest(SS_HTTPRequest,Session)
Line 127 of Director.php
Director::direct(/admin/)
Line 127 of main.php
I did check to see if there were any empty ClassName fields in the Page table, but all the fields have a value in them.
Any ideas?
What version of DOM? If you were running 2.3, you're going to have to upgrade DOM for 2.4 compatibility.
I just upgraded it to DOM r395 this morning (which seems to be the latest version available on the website), but it didn't appear to make a difference.
Did you try the suggestion from FullWebService above?