Jump to:

7937 Posts in 1537 Topics by 944 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Bad RecordClassName '' and $baseClass not set Error

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1 2
Go to End
Author Topic: 3654 Views
  • Andrew Houle
    Avatar
    Community Member
    132 Posts

    Bad RecordClassName '' and $baseClass not set Error Link to this post

    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

  • UncleCheese
    Avatar
    4085 Posts

    Re: Bad RecordClassName '' and $baseClass not set Error Link to this post

    Can I see the code you're using?

  • FullWebService
    Avatar
    Community Member
    38 Posts

    Re: Bad RecordClassName '' and $baseClass not set Error Link to this post

    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.

  • Andrew Houle
    Avatar
    Community Member
    132 Posts

    Re: Bad RecordClassName '' and $baseClass not set Error Link to this post

    I forgot to post that here. Yup, it was an empty ClassName field. Thanks!

  • Fairfax71
    Avatar
    Community Member
    13 Posts

    Re: Bad RecordClassName '' and $baseClass not set Error Link to this post

    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?

  • UncleCheese
    Avatar
    4085 Posts

    Re: Bad RecordClassName '' and $baseClass not set Error Link to this post

    What version of DOM? If you were running 2.3, you're going to have to upgrade DOM for 2.4 compatibility.

  • Fairfax71
    Avatar
    Community Member
    13 Posts

    Re: Bad RecordClassName '' and $baseClass not set Error Link to this post

    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.

  • UncleCheese
    Avatar
    4085 Posts

    Re: Bad RecordClassName '' and $baseClass not set Error Link to this post

    Did you try the suggestion from FullWebService above?

    3654 Views
Page: 1 2
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.