The issue is that the private property of the file object is missing when nodes are modified via a VBO operation. Because of this missing attribute, the logic in the nodeapi hook moves previously private files to the public folder as if the private checkbox was unchecked. I haven't tested this too extensively with lots of VBO actions, but it does occur when adding/removing a node from organic groups or changing og status to/from public.

Because all my file attachments will be private, I just disabled the bit of code that causes private files to get moved to public folder, but there should be a more elegant fix.

Comments

slucas’s picture

Please can you tell me which part of the code we need to comment to make a similar fix than yours ?
Do you know if it occur also with the dev version of the module ?

davemaxg’s picture

Not sure why I didn't include that. :P

Line 291
elseif (false && !$file->private && $file_is_private) { // modified 2012.02.03 because vbo operations were moving private files to public

It's been working well since the modification. I can't recall if I tried the dev version of the module.

dtecson’s picture

This also seemed to fix an issue i was having regarding revisioning moderation of a node. When attempting to publish a revision in moderation with a file attachment that was set to private, the private setting would stay on preview, but then be removed on confirmation of publish.

dtecson’s picture

Issue summary: View changes

Added information regarding reproducing the issue - may be due to an incompatibility with the organic groups module, however that seems unlikely.