Gallery icon indicating copy to clipboard operation
Gallery copied to clipboard

Single image uploads do not work, .zip uploads do

Open BigBlockStudios opened this issue 11 years ago • 1 comments

Single image uploads do not work, I get an entry in the database tables but no file and no folder is created in assets/components/gallery/files/

If I upload a zip, the directories will be created, images will get placed in the directories and now multi-upload will work, but single image uploads still do not.

Also uploading a cover will create the gallery directory.

Modx 2.2.12, centos 5

BigBlockStudios avatar Mar 27 '14 17:03 BigBlockStudios

Hallo everybody, I had the same problem... I was working with modx revolution 2.2.13 and gallery 1.6.1

The solution was to rewrite part of code in core/components/gallery/model/gallery/galalbum.class.php back, like it was in previous version of gallery component.

Start at line 204 and replace next code:

/* if directory doesnt exist, create it */ if (!$mediaSource->createContainer($targetDir,'/')) { $this->xpdo->log(xPDO::LOG_LEVEL_ERROR,'[Gallery] Could not create directory (possibly already exists?): '.$targetDir); }

to:

/* if directory doesnt exist, create it */ if (!$this->ensurePathExists()) { $this->xpdo->log(xPDO::LOG_LEVEL_ERROR,'[Gallery] Could not create directory: '.$targetDir); return $fileName; } if (!$this->isPathWritable()) { $this->xpdo->log(xPDO::LOG_LEVEL_ERROR,'[Gallery] Could not write to directory: '.$targetDir); return $fileName; }

Have a nice day.

smahelos avatar Oct 15 '14 14:10 smahelos