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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

ModelAdmin & HTML editor image manager bug?


Reply


2 Posts   636 Views

Avatar
SheaDawson

Community Member, 46 Posts

30 July 2011 at 11:07pm

Hey,

I have come across this problem a couple of times now, but this time I really need to solve it. In ModelAdmin, if I add an HTMLEditorField to the dataobject I am managing, everything appears to work at first glance... but, if I try to add an image through the image icon in the editors toolbar, and click on the folder dropdown that appears on the right hand side, I get an error and none of the folders load up in the dropdown.

Here's the error retrieved from the firebug console.

500//ERROR [User Error]: Bad RecordClassName '' and $baseClass not set IN GET /admin/artists/EditorToolbar/ImageForm/field/FolderID/tree?forceValue=&SecurityID=3d269b74c72b07df798ecfa8946a7be6e22328f9 Line 2762 in /Applications/MAMP/htdocs/silverstripe/delicious/sapphire/core/model/DataObject.php Source ====== 2753: foreach($records as $record) { 2754: if(empty($record['RecordClassName'])) { 2755: $record['RecordClassName'] = $record['ClassName']; 2756: } 2757: if(class_exists($record['RecordClassName'])) { 2758: $results[] = new $record['RecordClassName']($record); 2759: } else { 2760: if(!$baseClass) { 2761: user_error("Bad RecordClassName '{$record['RecordClassName']}' and " * 2762: . "\$baseClass not set", E_USER_ERROR); 2763: } else if(!is_string($baseClass) || !class_exists($baseClass)) {....

Has anyone else come across this before or have any suggestions?

Many thanks :)

Avatar
SheaDawson

Community Member, 46 Posts

30 July 2011 at 11:21pm

Typical. One moment after I finally resorting to posting this problem in the forum, I solve it. If anyone else gets stuck on this, make sure the records in your file table all have a ClassName value ;)