There is a problem if the user changes the vaule of an node_option_override field and previews the node. The value will be reset to the value of the node. This is because the name of the form fields differ from the ones of the node object fields. In case of a preview, the submitted values should be assigned to the proper node fields.

CommentFileSizeAuthor
override_node_options.patch2.7 KBmiruoss

Comments

timmillwood’s picture

Status: Needs review » Fixed

committed

timmillwood’s picture

Assigned: Unassigned » timmillwood
Status: Fixed » Needs work

Patch not working.

Needs investigation.

timmillwood’s picture

Status: Needs work » Fixed
fab65’s picture

Status: Fixed » Needs review

Thanks you very much for path. There is just a problem of internationalization.
if($node->op == t('Preview')) must be in place of if($node->op == 'Preview').

Otherwise it's perfect.
Thank you again

pinolo’s picture

Status: Needs review » Needs work

I can't say from the description if the bug relates to the form editing fields only, anyway I've just found out the bug affects also the preview's display. The patch carries a comment saying:
/* make sure the preview shows the correct values */
so I assumed it had taken on the task of fixing the display as well, but I'm not sure about that after quickly reading through the code.

You get a wrong flag for your preview and end users might get a wrong message/feedback.

I've seen this happen with ONO 6.x-1.9:
- A content type has "unpublished" as default state
- A node of that type is created and published
- A role (say "editor") is assigned permissions to edit any node and to override the publishing option for that content type (but not "administer nodes")
- When an user with "administer nodes" permission edits the node and previews it, he sees the preview as published (correct)
- When a user of role "editor" previews the node, he sees the preview as unpublished (wrong)
- If the ONO module is disabled, the behavior returns to normality (although, of course, the editor user can no longer manage the Publish state of the node)

igorik’s picture

yes, I can confirm this bad behaviour, with latest drupal version.
It is really annoying, users which can change publish/unpublish options but without administer node options got after click on preview unpublish flag for that node.

dave reid’s picture

Status: Needs work » Closed (duplicate)

I'm pretty sure this will be fixed with #644820: Use the same form element names, not new ones.