Hi,

I've been setting up Private Upload with Workflow for a client to keep their files properly embargoed until their release date. Thanks for your work!

However I've hit an issue when Workflow updates the node via the Workflow tab or via cron (but not via the main node form). Workflow node updates reset the privacy flag on files, causing Private Upload to try to move the file when no changes have been requested. Private Upload sets the flag for the private or public using the node update form, then moves the file on hook_nodeapi $op 'update' based on a comparison between this flag and the current filepath. However, when a node is updated by Workflow the node form is not submitted, so the privacy flag is not set. The hook_nodeapi code currently does not discriminate between an unset flag (ie. NULL on workflow changes) or set off flag (ie. 0 when the node form is submitted) - so the file is reset to public whenever a workflow change is made.

I've attached a patch to solve this problem in hook_nodeapi. It checks that the flag is set and equals 0 (ie. when the the private checkbox is explicitly turned off on the node form), excluding the case where the flag is NULL (ie. when workflow and other changes are made which do not go via the node update form).

Thanks, David Bassendine.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dbassendine’s picture

Rerolled for 1.0-rc3 (still an unresolved issue).

Cheers, David

dbassendine’s picture

Version: 6.x-1.0-rc2 » 6.x-1.0-rc3