Node Gallery version = "6.x-3.0-beta2" and modul Plupload 6.x-1.x-dev
All photos by guest on page view photo, but on page gallery I author.
Turns out that the author has galleries, but there is no author photo

CommentFileSizeAuthor
#5 node_gallery_author_reset_1229396_5.patch738 bytescrea
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

justintime’s picture

Category: bug » support

I'm sorry arturus, but I just can't understand what you're stating here. I'm bumping this down to a support request until a confirmed bug is found.

arturus-1’s picture

I created a gallery and added to this gallery photos.
Author Gallery I am, but the author photos - "guest"

crea’s picture

Title: photo by guest » Management of album images can reset author to guest
Category: support » bug
Priority: Normal » Critical

Confirming. The bug is caused by loose comparison in the in_array() function.

crea’s picture

Title: Management of album images can reset author to guest » Management of album images can reset managed images author to guest
crea’s picture

Status: Active » Needs review
FileSize
738 bytes

Patch attached.

crea’s picture

Version: 6.x-3.0-beta2 » 6.x-3.x-dev
justintime’s picture

Status: Needs review » Fixed

I don't see how any bad can come from this, and frankly, I don't have the time to test it myself. Committed to dev.

@crea, FYI: your patches are created as -p0, since the git migration they've changed the standard to -p1.

scroogie’s picture

We should filter these values out so we don't run the risk of commiting the comparison error again.

crea’s picture

@justintime
When author element was not present in the form, in_array() gave false positive, so the code was loading anonymous and was using it for managed nodes.
On p0 vs p1, I don't know, I make patches with git :)

@scroogie
Probably you're right, let's leave that up to Justin

crea’s picture

Actually, it's a shame. Thousands of websites are using this module, and this bug was still live.
Does anyone use manage images feature at all ?

scroogie’s picture

I think for the bug to occur there needs to be a zero value in the according drupal variable, which is probably the reason why so few people are hit by the bug.

fastforward’s picture

Confirming the bug. I have added new cck field (text - text field) to my gallery_image content type and decided to fill it out through "Manage Images" (great timesaver, by the way)) from one of my fake user account (i'm under construction now). After submitting the form all nodes from this user became "Anonymous" in node view, but still belong to this user in gallery view. I tried to reproduce this behavior with my second gallery_image content type. After submitting "Manage Images" form with pre existed cck-fields I didn't found any errors. But when I added the same new field (as in first case) "Anonymous" appears and "captured" all nodes in node view. Patch from crea worked (thanks a lot), but I had to edit every one node through "Manage Images" to return it to my user.

scroogie’s picture

Thanks for the report fastforward. That brings us a step ahead when searching for the real cause. So we should check the code that retrieves the fields for the option checkboxes on the relationship settings.

scroogie’s picture

Ah yes, I found it. We just save the whole result array of the checkboxes to the database, which contains zeros for all non-checked boxes. We should of course filter for values that are actually checked before saving them.

Status: Fixed » Closed (fixed)

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

deviantintegral’s picture

This is a pretty nasty bug in the 6.x-3.0 release. Any chance of rolling a 3.1 release so that users don't have to go back and reconstruct node authorship?

deviantintegral’s picture

Issue summary: View changes

add info