Issue Bug Closed

#52765Image upload fails to be indexed

Xavier Perseguers 10/13/13, 21:15 updated 10/23/17, 21:45

Description

When uploading an image in any directory, the following flash message pops up:

1: Uploaded file could not be moved! Write-permission problem in "/"?

but the image is properly uploaded (although post-processor hooks do not work, see below).

This is caused by the indexer trying to write image metadata into DB and storing its height into a DB column “height” which does not exist anymore in master.

Relevant code is causing the issue and preventing post-processor to receive the uploaded file info:

$fileObject = $targetFolderObject->addUploadedFile($fileInfo, $conflictMode);
$this->getIndexerService()->indexFile($fileObject, FALSE);
$resultObjects[] = $fileObject;

Method ->indexFile() throws an exception which is catched and an error message which has nothing to do with the actual error is shown. As such $resultObjects is not extended with the uploaded file and post-processor hooks will get an empty array of uploaded files and will thus not be able to do anything.

In this case, I would expect the indexer to index file after the $resultObjects being extended because the file was actually uploaded and the indexer should not prevent a post-processor to do its job, even if it crashes.

Example of post-processor: EXT:image_autoresize

Reviews 1