Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » File & Image Fatal error

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

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

Page: 1
Go to End
Author Topic: 2109 Views
  • guillem_l
    Avatar
    9 Posts

    File & Image Fatal error Link to this post

    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.

  • guillem_l
    Avatar
    9 Posts

    Re: File & Image Fatal error Link to this post

    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.

  • CodeGuerrilla
    Avatar
    Community Member
    105 Posts

    Re: File & Image Fatal error Link to this post

    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

  • abes
    Avatar
    Community Member
    9 Posts

    Re: File & Image Fatal error Link to this post

    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?

  • abes
    Avatar
    Community Member
    9 Posts

    Re: File & Image Fatal error Link to this post

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

  • Terminator4
    Avatar
    Community Member
    81 Posts

    Re: File & Image Fatal error Link to this post

    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

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