Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single image uploads do not work, .zip uploads do #281

Open
BigBlockStudios opened this issue Mar 27, 2014 · 1 comment
Open

Single image uploads do not work, .zip uploads do #281

BigBlockStudios opened this issue Mar 27, 2014 · 1 comment

Comments

@BigBlockStudios
Copy link

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

@smahelos
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants