Created a new content type(new_type), and allowed Webforms for that type.
In the new_type, added a private and public file field, plus the mandatory e-mail and some name fields.
When creating a node based on new type, displaying the public file is not possible, the Display checkbox get's unlatched after saving.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

berliner’s picture

Status: Active » Postponed (maintainer needs more info)

I need clarification on this one as I am not able to reproduce the issue with the given information.
I have followed your steps as I have understood them:
1. Create a node type
2. Add two file fields, one private, one public
3. Enable webform for the content type
4. Add a mandatory mail component and 2 text components
5. Create a node of the new type, upload 1 file for each file field
6. Enable Protected Downloads for the private file
7. Try to edit and change the display option for the public file

I can't see any problems with my setup, using webform_protected_downloads 7.x-1.x-beta1 on a drupal 7.14 with webform 7.x-3.18.

ejah’s picture

FileSize
11.15 KB
60.78 KB
23.04 KB

Thanks Berliner,

In my case, the same setup and steps, though Dutch language version, the public file does not show, and the checkbox (At the edit tab) which I checked to display the file, is unmarked again after saving the edits
The same applies if I have two files in the protected field, and (un)protect only one of them (which is BTW more elegant than working with two file fields, so I fixed my content type in between) (Screendump3).
I can't get the unprotected file to display (Screendump1), and the same checkbox automatically unchecks itself (Screendump2).

HTH.
Cheers,
Ernst

berliner’s picture

Status: Postponed (maintainer needs more info) » Needs review
FileSize
2.17 KB

Thanks for the details. I have been able to reproduce this with two private files in the same file field. And I have found the culprit for that. Please see the attached patch. Maybe this fixes the issue with multiple file fields as well.

ejah’s picture

Thanks for the fast service Berliner!

I can confirm the patch works fine for me.

Note however, that after setting certain documents to Secured in the Protected Documents Tab, I need to go back to the Edit Tab and save again to assure that the secured documents do not remain displayed.
The checkboxes are not marked, but the secured documents are displayed until you save again.

Cheers,
Ernst

berliner’s picture

Good feedback! See second version of the patch (you need to undo the changes from the first patch). That should get rid of the necessary second node edit. One thing that rests is that it creates a possible inconsistency concerning the display checkbox: If there is display checked for a non protected file and you protect it, that it won't be displayed. Once you unprotect it it will be displayed. But when you save the node in between the protection / unprotection then it won't be displayed again unless you edit the node again and check the display checkbox. I'm not sure how to cope with this, but I guess it's better that way than the other.

berliner’s picture

I have committed the last patch to the 7.x-1.x-dev. It would be nice if you could give me feedback on this and the new issues reported in comment #4.

berliner’s picture

Any news on this?

berliner’s picture

Status: Needs review » Fixed

closing the issue as no more feedback has been given, assuming that everything works fine

Status: Fixed » Closed (fixed)

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