Node preview resets changed fields to the default value
miruoss - March 17, 2009 - 16:49
| Project: | Override Node Options |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | timmillwood |
| Status: | needs work |
Jump to:
Description
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.
| Attachment | Size |
|---|---|
| override_node_options.patch | 2.7 KB |

#1
committed
#2
Patch not working.
Needs investigation.
#3
#4
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
#5
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)
#6
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.