Hi.

If I am logged as admin user, I can create AF album, mass import images (5 at a time) with no problems. But when I am logged as normal user, I can create AF album, but when I select images for mass import and try to import them, I get following:

Fatal error: Cannot use string offset as an array in /data/www/1zsfm.cz/www.1zsfm.cz/sites/all/modules/acidfree/types/acidfree_image/acidfree_image.module on line 72

It is not permissions thing I guess, since normal users have these enabled:

* acidfree mass import
* acidfree mass update
* create acidfree albums
* edit own acidfree albums

CommentFileSizeAuthor
#4 rotate.patch1.07 KBmwheinz

Comments

mwheinz’s picture

I'm happy to help you try to isolate the issue, but I'm not sure this is acidfree's fault - because I don't have a problem using mass import as a non-admin user. In addition, the error indicates that the arguments passed to the image import function are corrupted. The thing that comes to my mind are problems with file upload permissions.

Are you comfortable editing modules yourself? If so, try this. Edit the acidfree_image.module, and go to line 72. You should see a function that looks like this:

function acidfree_import_image($node, $file) {
    $node = image_create_node_from($file->filepath, $node->title, '', $node->taxonomy);
    return $node;
}

Add 2 new lines so that it looks like this:

function acidfree_import_image($node, $file) {
    drupal_set_message(__FUNCTION__ . " node: " . print_r($node,1));
    drupal_set_message(__FUNCTION__ . " file: " . print_r($file,1));
    $node = image_create_node_from($file->filepath, $node->title, '', $node->taxonomy);
    return $node;
}

Do that, and when you do a mass import you should see a big block of diagnostic messages. Cut and paste those into this bug report and we'll see if we can figure out what's going on.

mwheinz’s picture

No - wait - I take it back. I was able to duplicate the problem. the data is being corrupted, and it is related to permissions, but it is in acidfree, not your site.

I'm looking at a fix now.

mwheinz’s picture

StatusFileSize
new1.07 KB

Okay - I have no freaking idea why, but Drupal 6 appears to process forms differently for different users. The upshot of this is that sometimes there's a "rotate" field in the mass import form and sometimes there's not - and when it's not there, it causes the bug you reported.

After looking at the issue, I've decided that the safest quick fix is to make sure image import can survive if rotate is missing. The attached patch file fixes the bug, or try today's dev build, when it comes out.

mwheinz’s picture

Status: Active » Fixed
lakyljuk’s picture

That was quick :) I for one don't need rotating images during mass import, so I am grateful for this patch.

Thanks

mwheinz’s picture

It helped when I switched to another user and immediately got the error and, like you, I don't know why Mass Import is showing that field in the first place - it's not normally something you want to have happen.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

pepemty’s picture

Thank you!
This was exactly what I was looking for ; )

Warm regards from sunny México!
: )
Pepe