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've moved the forum!

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.

Archive /

Our old forums are still available as a read-only archive.

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

File & Image Fatal error


Go to End


6 Posts   3050 Views

Avatar
guillem_l

9 Posts

17 February 2008 at 7:35am

Hi all,

I'm using last version of SS, it works great except everytime I try to access to the File & Images tab I get this error:

Fatal error: Class name must be a valid object or a string in /mnt/gs02/herd03/29966/domains/eobikes.com/html/sapphire/core/model/DataObject.php on line 1474

I have to do a ?flush=1 to access to this section. I've got the same error when I try to browse the files from the select field of the Gallery module or Image sidebar.

Please can somebody help me to solve this problem, I'm in the final process of a web and we have to solve it before the launch.

Thanks in advance.

Avatar
guillem_l

9 Posts

19 February 2008 at 11:34am

Edited: 19/02/2008 11:36am

Hi,

I have to put this if sentence to make it works and solve the Fatal error I get every time I try to access to "File & Images" tab. I'm testing and seem all works correctly:

// line 1474 /shaphire/core/module/DataObject.php
if ($baseClass != null) // added to protect possible null value of $baseClass
    $results[] = new $baseClass($record);

$baseClass is a param of the function and by default is null, if is null can not be created as with new $baseClass

Hope some SS developer can check the code and say if this fix the bug.

Avatar
CodeGuerrilla

Community Member, 105 Posts

27 October 2008 at 2:49pm

I just had the same problem, I found that ClassName was NULL for one of the images uploaded I really can't guess on how this happened, I am reluctant to touch anything in the SS core so far I haven't had to, I fixed this by simply editing the record manually and adding Image (as it was an image) as the ClassName, hopefully doesn't happen again :)

Avatar
abes

Community Member, 11 Posts

28 October 2008 at 11:17pm

I have the same problem: The class name in the file table is empty and the assets management is falling on a fatal error.

What I did:
I have a dataobject, which is in a many-to-many relationship to a page. The dataobjects are editable within a popup window in the cms. I added a standard image field to this popup. On selection of a file from the local filesystem, everything works fine. But if the image is added from the assets management, the classname field in the file table is set to null.

Can anybody suggest, where the failure can be?

Avatar
abes

Community Member, 11 Posts

28 October 2008 at 11:33pm

Sry, I found the error. Just a small spelling mistake. =(

Avatar
Terminator4

Community Member, 81 Posts

24 November 2008 at 3:04pm

I am also getting this issue but in SS 2.2.3

Please could someone let me know how to fix it since I really need to get this working.

Thanks