Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

DOM + Silverstripe Issue


Go to End


6 Posts   2208 Views

Avatar
aTTi

Community Member, 19 Posts

8 May 2010 at 1:14am

Hey guys,

I'm using the latest Version of the DOM and SS.
Every time I go under Files & Pictures I get the following error:

[User Error] Bad RecordClassName '' and $baseClass not set
GET /admin/assets/

Line 2705 in /data/aeschi/wwwroot/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,DataObjectSet)
Line 600 of File.php
* File->instance_get("File"."ParentID" = 1 AND "File"."ID" != 1,,,,DataObjectSet)
Line 2657 of DataObject.php
* DataObject::get(File,"File"."ParentID" = 1 AND "File"."ID" != 1,)
Line 522 of Hierarchy.php
* Hierarchy->stageChildren(1)
* call_user_func_array(Array,Array)
Line 693 of Object.php
* Object->__call(stageChildren,Array)
* Folder->stageChildren(1)
Line 433 of Hierarchy.php
* Hierarchy->doAllChildrenIncludingDeleted()
Line 416 of Hierarchy.php
* Hierarchy->AllChildrenIncludingDeleted()
* call_user_func_array(Array,Array)
Line 693 of Object.php
* Object->__call(AllChildrenIncludingDeleted,Array)
* Folder->AllChildrenIncludingDeleted()
Line 159 of Hierarchy.php
* Hierarchy->markChildren(Folder)
Line 217 of Hierarchy.php
* Hierarchy->markById(1,1)
Line 235 of Hierarchy.php
* Hierarchy->markToExpose(Folder)
* call_user_func_array(Array,Array)
Line 693 of Object.php
* Object->__call(markToExpose,Array)
* Folder->markToExpose(Folder)
Line 510 of AssetAdmin.php
* AssetAdmin->SiteTreeAsUL()
Line 369 of ViewableData.php
* ViewableData->obj(SiteTreeAsUL,,,1)
Line 445 of ViewableData.php
* ViewableData->XML_val(SiteTreeAsUL,,1)
Line 69 of .cache.data.aeschi.wwwroot.cms.templates.Includes.AssetAdmin_left.ss
* include(/tmp/silverstripe-cache-data-aeschi-wwwroot/.cache.data.aeschi.wwwroot.cms.templates.Includes.AssetAdmin_left.ss)
Line 392 of SSViewer.php
* SSViewer->process(AssetAdmin)
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.data.aeschi.wwwroot.cms.templates.LeftAndMain.ss
* include(/tmp/silverstripe-cache-data-aeschi-wwwroot/.cache.data.aeschi.wwwroot.cms.templates.LeftAndMain.ss)
Line 392 of SSViewer.php
* SSViewer->process(AssetAdmin)
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/assets/)
Line 127 of main.php

Has anyone a solution to my problem ??

Best regards, aTTi

Avatar
UncleCheese

Forum Moderator, 4102 Posts

8 May 2010 at 1:36am

What version of SS?

Avatar
aTTi

Community Member, 19 Posts

8 May 2010 at 1:45am

2.4.0 (stable)

Avatar
gp

Community Member, 5 Posts

9 June 2010 at 7:00am

Got the same error using SilverStripe 2.4.0 and dataobject_manager.

Avatar
UncleCheese

Forum Moderator, 4102 Posts

9 June 2010 at 7:38am

A lot of times, after 2.4 upgrades, the tables lose their ClassName fields. Check your File table and make sure non of those values are null.

Avatar
gp

Community Member, 5 Posts

9 June 2010 at 8:10am

Excellent! Problem solved. Thanks UncleCheese!