Prevent AssetPresent from throwing a FileNotFoundException
Permalink
A file has been deleted from the server and is causing a File not found Exception.
The exception is triggered within a assertPresent method. In the Filesystem class (League\Flysystem)
I'm struggling to see how the config 'disable_asserts' can be overridden, as the Exception is currently preventing the whole site from loading.
I've tried setting a disable_asserts parameter in the config file but unable to get anything to trigger.
(update:) I've just noticed this is loaded from the vendor folder now and not within the core files. So I guess that's part of the cause here
The exception is triggered within a assertPresent method. In the Filesystem class (League\Flysystem)
I'm struggling to see how the config 'disable_asserts' can be overridden, as the Exception is currently preventing the whole site from loading.
if ($this->config->get('disable_asserts', false) === false && ! $this->has($path)) { throw new FileNotFoundException($path); }
I've tried setting a disable_asserts parameter in the config file but unable to get anything to trigger.
(update:) I've just noticed this is loaded from the vendor folder now and not within the core files. So I guess that's part of the cause here
We've had to do the same, we just used some small flat coloured images to get them to show up then deleted them from the file manager.
Better solution: Just delete all entries in the table "FileImageThumbnailPaths" and the problem is gone.
Additional Information:
Because of the constraints you need to delete the entries also form the following tables.
1. atFile
2. FileVersions
3. Files
4. FileImageThumbnailPaths
Additional Information:
Because of the constraints you need to delete the entries also form the following tables.
1. atFile
2. FileVersions
3. Files
4. FileImageThumbnailPaths
I'll give this a go, thanks for the tip
As soon as you pass the config to the league\Filesystem and disabled the mentioned exception, another exception will be raised. In my case this one was thrown as next.
SplFileInfo::getType(): Lstat failed for /var/www/html/intranet/application/files/5014/9026/0155/bridge.jpg
So I ended up creating the missing folders and files by hand. (In total 4 folders and files were missing.)