Hi,
I have the latest dev version of the module and I'm noticing the following bug.
Reproduction steps
- install the latest dev version on D7
- add a file field (ideally I think image field would work the same way) to the content type that is protected by protected nodes
- create a new node and set the password to anything
- edit the node, upload any file to the file field u have created, use the upload button to upload it via ajax
- Keep the password field empty, while keeping the This Page is protected checked
Expected behavior
Nothing special, passwourd should remain the same!
Actual Behavior
Password gets reset to something I'm not sure where does it come from
the following patch addresses and fixes this (as far as I've tested it with the aforementioned scenario)
p.s: same goes for when deleting files or combining the deletion and addition of files at one edit, but this should be addressed by the patch too!
Comments
Comment #1
izus commentedtested the steps in the description with the last code base and i can't reproduce it.
i also edited the node, deleted the file and saved : it works, the password didn't change and the protection is ok
can you please give it a try again with last code base ?
Comment #2
grimreaperHello,
When you tell about ajax you mean "Bar with progress meter" option ?
I found the bug you mentionned using your reproduice path. I tested the patch and it works.
Thank you.
Comment #3
izus commentedi did another test and i really can't reproduce this.
here are the steps:
1) install news drupal 7
2) enable the protected nod emodule
3) add a file field to basic page content type using the default File widget
4) crate a node of type page filling only the body and title + protect it with a password
5) in the database, check and not the password hash in the protected_node table
6) edit the node and fill the file field with a pdf and hit the upload ajaxified button
7) save the node without altering anything related to the protected password fieldset and go checking again in the database
=> the password hash didn't change at all
do you double confirm these steps have a different result for you ?
Comment #4
grimreaperwith the last protected node dev version from this morning.
1) OK installation profil : standard
2) OK Absolutely no module like admin menu enable or disable
3) OK fieldconfiguration with all default values except add the pdf extension to allowed extensions
4) OK : password : toto
5) OK : 0b9c2625dc21ef05f6ad4ddf47c5f203837aa32c
6) OK
7) OK : 0543a155d48eb3029f25fa0c800e48480ccfe87b
=> the password has changed...
Sorry...
Do you want I try with the patch ?
Comment #5
grimreaperhum ...
sha1('0b9c2625dc21ef05f6ad4ddf47c5f203837aa32c') == 0543a155d48eb3029f25fa0c800e48480ccfe87b
I think, fixing this issue will fix many other issue https://drupal.org/node/1559162
Comment #6
grimreaperHello,
After testing with Izus on IRC. It shows that ajax alter the $form['#id']. For exemple :
page-node-form becomes page-node-form--2
So a test on $form_id is better because $form_id is not altered. The most strange thing is that we tested with the same browser with the same version : firefox 24.1.0 and I have the bug and he doesn't have it.
Here is the patch to go with.
Thanks Izus.
Comment #7
izus commentedmerged
thanks all