When a user creates a node and they enter a "Log message" an select "preview" the "log" variable is posted to the preview page however it isn't diplayed in the field. Therefore if they then post this new node it no longe has this "log message".

I haven't had time to look at the code but it's on my list once I get time.

Comments

Leonth’s picture

Version: 6.1 » 6.3
Status: Active » Needs review
StatusFileSize
new521 bytes

Got exactly the same problem with 6.2 and 6.3 (actually I found it in 6.2 and I hoped it got fixed in 6.3... seems its isn't). Here's the patch to fix the bug. (it's just one line...)

--- modules/node/node.pages.inc	2008-07-11 21:03:52.000000000 +0700
+++ modules/node/node.pages-log-disappear-when-previewing.inc	2008-07-11 20:59:52.000000000 +0700
@@ -160,6 +160,7 @@ function node_form(&$form_state, $node) 
       '#type' => 'textarea',
       '#title' => t('Log message'),
       '#rows' => 2,
+      '#default_value' => $node->log ? $node->log : '',
       '#description' => t('An explanation of the additions or updates being made to help other authors understand your motivations.'),
     );
   }

Leonth’s picture

StatusFileSize
new542 bytes

The last patch has a problem - if a node is edited for the first time, the log message is set from the latest revision. I don't know if this is what drupal wants - anyway, with this new patch the log message is reset when we're not doing preview. Please decide which behavior is more appropriate for drupal...

gpk’s picture

Status: Needs review » Closed (duplicate)

Marking as duplicate of #385602: Log message is lost on node preview since the latter has a more recent patch.