This module doesn't work with http://drupal.org/project/webform_protected_downloads

The download page just renders the normal attachments table.

Anyway to make this work?

Comments

dmsmidt’s picture

Category: bug » feature
Priority: Normal » Minor

I think this module doesn't work because WPD renders the attachmentlist through this function:
theme_private_upload_attachments instead of theme_upload_attachments.

Maybe iTweak can be tweaked to work on that function also ^_^?
Changed it to feature request and it's not that important to me anymore.

iva2k’s picture

Project: iTweak Upload » Webform Protected Downloads
Version: 6.x-2.4 » 6.x-1.x-dev
Status: Active » Postponed (maintainer needs more info)

I looked into WPD code and did not figure out how it protects (or suppose to protect) the files from being displayed on normal nodes. The only piece of code that seems to make it happen is webform_protected_downloads_adjust_upload_form(), but it is only called for 'webform_node_form' and 'upload_js'. Am I missing something? How WPD provides interoperability with other modules?

Changing queue to get attention from WPD maintainers.

berliner’s picture

WPD-6.x relies on the private_upload-module to hide the files. The function webform_protected_downloads_adjust_upload_form() is only used to disable some checkboxes on the node edit form, it is not supposed to hide the uploaded files in this spot. Resposible for the theming of the attachment list on a rendered node is the private_upload-module, based on the private setting of the file (which is handled by the same module). The theming on the WPD-specific downloads page is also piped through this module.

Isn't this related to #594114: Conflict with Private_upload?

I would be glad to give a hand making these modules compatible, but right now I have very limited time.

iva2k’s picture

If WPD works through private_upload, iTweak Upload was made interoperable with private_upload back in 2010, so everything is supposed to work.

>I would be glad to give a hand making these modules compatible, but right now I have very limited time.
Same here. If anyone can provide a patch, I will review and commit.

The only thought I have is the order of the modules. Perhaps WPD needs to run before iTweak Upload to set the private flag (system weight)? I don't have the time to even create a test setup with WPD - can anyone try this out?

berliner’s picture

Status: Postponed (maintainer needs more info) » Active

I'll have a look into it, hope it's something small.

berliner’s picture

Status: Active » Needs review

Ok, I found the culprit. For the display of the files list on the downloads page I have been calling theme('private_upload_attachments') directly up to now. I changed this to node_build_content, that way other modules, as itweak for example can do their manipulations as well.

I have just commited the changes to the dev branch. Please test it with the new code.
Btw: nice module your itweak_upload :-)

dmsmidt’s picture

That was my guess in #1 exactly, I will try it when I have the time and report back. Thanks

berliner’s picture

Status: Needs review » Fixed

suppose this works now

Status: Fixed » Closed (fixed)

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