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.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Image Gallery not working in 2.3.4, bug?

Go to End

31 Posts   7096 Views


Community Member, 63 Posts

31 January 2011 at 6:42pm

ok in dev mode the error when i try to create a new gallery page is:

ERROR [User Error]: Bad RecordClassName '' and $baseClass not set
IN POST /admin/AddPageOptionsForm
Line 2762 in C:\Domains\\wwwroot\sapphire\core\model\DataObject.php

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)) {
2764: user_error("Bad RecordClassName '{$record['RecordClassName']}' and bad "
2765: . "\$baseClass '$baseClass not set", E_USER_ERROR);
2766: }
2767: $results[] = new $baseClass($record);
2768: }

<ul>user_error(Bad RecordClassName '' and $baseClass not set,256)
line 2762 of DataObject.php

line 745 of File.php

File->instance_get("File"."ParentID" = 19 AND "File"."ID" != 19,,,,DataObjectSet)
line 2714 of DataObject.php

DataObject::get(File,"File"."ParentID" = 19 AND "File"."ID" != 19,)
line 531 of Hierarchy.php


line 693 of Object.php


line 413 of Hierarchy.php


line 693 of Object.php


line 343 of Folder.php

line 345 of Folder.php

line 345 of Folder.php

line 355 of File.php

line 936 of DataObject.php

line 77 of ImageGalleryPage.php

line 63 of ImageGalleryPage.php

line 1056 of DataObject.php

line 559 of CMSMain.php

line 300 of Form.php

line 137 of RequestHandler.php

line 155 of RequestHandler.php

line 147 of Controller.php

line 281 of Director.php

line 124 of Director.php

line 127 of main.php



Forum Moderator, 4102 Posts

1 February 2011 at 3:58am

Check your File table and make sure there are no records with null ClassName fields.

SilverStripe tips, tutorials, screencasts and more:


Community Member, 63 Posts

1 February 2011 at 1:35pm

There are 4 images in there with blank ClassName fields, all from the assets/image-gallery/album folder that I couldn't delete ...
Should I delete these from the database?

Storm Striker

Community Member, 6 Posts

18 February 2011 at 8:22pm

Hi everybody.........!

Im using version SS 2.4.4

First Case :

Im also getting the same error. When i create a new image gallery page and click the go button, the gallery page doesn't appear in the site tree as the normal page types appear within a flash of second.
So what i do is, i'll refresh the the page once, then the gallery page appears in the site tree.

Second Case :

Any how the page is created after the page is refreshed, but here is the second error, When i save the page, it says ' Error Saving '.
This error is thrown for some time. and then n then when i change the page name by luck the gallery page gets saved.

Please Uncle Cheese ............ what is this, why is this problem occurring? and what is the sollution.
Any body with the answer, please help me out, i'll be thank full to u.



Community Member, 63 Posts

28 February 2011 at 7:08pm

I fixed the problem I was having by deleting the images with the blank class names from the database.

I've since had the problem again with another website and something similar with another website again. It seems that sometimes when you create a gallery page, it creates multiple 'Gallery' folders within the 'Files and Images' section of the CMS (for example, on one website I built, after creating a gallery page and then getting the error when trying to save, I looked at the Files and Images section and found that it had created one folder gallery 'Gallery' which was empty, and one folder called 'Image-Gallery' which contained 2 folders also called 'Gallery', one of which contained a folder called 'Default album')
I fixed the problem by deleting these folders from the Files and Images Section, then going back to the Gallery page and clicking Save again.
It seems that the image gallery gets confused when there are multiple folders called Gallery and so returns an error. As for why it's creating multiple folders in the first place? I have no idea.

I'm now getting a different but similar problem occuring where when creating albums it's sometimes creating duplicate album folders in the files and images section (these duplicate folders are appearing both inside the 'image-gallery' folder and outside it), and if I try to upload images to that album they're coming up blank. If I try to visit that album page on the website it tells me the page doesn't exist. I was hoping to fix this problem in the same way as I fixed the gallery problem, deleted the duplicate folders from the files and images section, and saved the album again, which created just one album folder this time, but it was outside of the 'image-gallery' folder, and the website is still telling me the page doesn't exist. Tried to delete the affected album from the albums list but nothing happened when I clicked delete. Am now trying to find some sort of error message.

Storm Striker

Community Member, 6 Posts

28 February 2011 at 7:21pm

Thank you ' @Scorpiankh ' for letting me know what was the problem. Let me try what u did.


Community Member, 9 Posts

19 April 2011 at 12:22am

I was getting the same error. I changed the page name, nav name and title then I was able to save and it changed the names under folders/files.

Then I created a gallery and added one image but the thumbnail is blank and the image doesn't show:

I know I've comes across this before but I just cannot for the life of me remember what I did to fix it. Any ideas anyone?



Community Member, 9 Posts

19 April 2011 at 5:38am

Got it, just edited the .htaccess file in the assets directory and it solved it.