Hi,

I have the latest dev version of the module and I'm noticing the following bug.

Reproduction steps

  1. install the latest dev version on D7
  2. add a file field (ideally I think image field would work the same way) to the content type that is protected by protected nodes
  3. create a new node and set the password to anything
  4. edit the node, upload any file to the file field u have created, use the upload button to upload it via ajax
  5. 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

izus’s picture

Issue summary: View changes
Status: Active » Postponed (maintainer needs more info)

tested 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 ?

grimreaper’s picture

Status: Postponed (maintainer needs more info) » Reviewed & tested by the community

Hello,

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.

izus’s picture

Status: Reviewed & tested by the community » Postponed (maintainer needs more info)

i 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 ?

grimreaper’s picture

with 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 ?

grimreaper’s picture

hum ...

sha1('0b9c2625dc21ef05f6ad4ddf47c5f203837aa32c') == 0543a155d48eb3029f25fa0c800e48480ccfe87b

I think, fixing this issue will fix many other issue https://drupal.org/node/1559162

grimreaper’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new807 bytes

Hello,

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.

izus’s picture

Assigned: FooZee » Unassigned
Status: Needs review » Fixed

merged
thanks all

Status: Fixed » Closed (fixed)

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