getFileStorageLocationObject() on null

Permalink
I was just moving Images into folders in v8.1 and afterwards some of my pages got corrupted.



Error
Call to a member function getFileStorageLocationObject() on null

On updates/concrete5.8.1.0/concrete/src/File/Image/BasicThumbnailer.php

public function getThumbnail($obj, $maxWidth, $maxHeight, $crop = false)
{
$storage = $obj->getFileStorageLocationObject();

I'm not able to edit the page.

extensi
 
noogen replied on at Permalink Reply
You probably already guested that, because of the image moves, it probably can't find the image since $obj is null in this case. Hopefully, you have a file system backup to restore.

And since it's a file in the concrete/src folder, it is difficult be directly overridden. So your second choice is to update the code in that file directly to return a dummy $thumbnail image when $obj is null. This is option is not recommended because it might fix it or it might open a can of worm on other errors.
extensi replied on at Permalink Reply
extensi
I do understand what happened but the file editor should update the references in the database if a file is moved otherwise the functionality can't be used.

Bug?