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
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.

AttachmentSize
override_node_options.patch2.7 KB

#1

timmillwood - April 3, 2009 - 20:58
Status:needs review» fixed

committed

#2

timmillwood - April 6, 2009 - 09:21
Assigned to:Anonymous» timmillwood
Status:fixed» needs work

Patch not working.

Needs investigation.

#3

timmillwood - April 7, 2009 - 10:10
Status:needs work» fixed

#4

fab65 - April 15, 2009 - 08:32
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

#5

Pinolo - June 29, 2009 - 18:51
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)

#6

igorik - November 12, 2009 - 23:06

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.

 
 

Drupal is a registered trademark of Dries Buytaert.