starting to get my head around the node revision code for the save as draft feature, and it seems that logging in the node revision code is buggy.
first, a versioned node's log has its div's stripped on pages that use the restricted html filter. i think this is a bug. moving the appending of the log message to the node body after node_prepare() in node_view() seems to fix this. if this doesn't sound bad, i'll roll a patch.
second, a versioned node displays the last revision log message by default, and there doesn't seem to be any way to turn it off. seems like there should be a way for an admin to control this.
third, the content of the log is just wrong. if i edit a versioned node that has a log associated with it, then the log from the edited revision is inherited by the new revision, regardless of whether its accurate.
i'm happy to roll some patches for these, because i'll be knee deep in the node code for the next few weeks, but i'd like some feedback.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | node_revision_log.1.patch.txt | 654 bytes | Anonymous (not verified) |
| #4 | node_revision_log.patch.txt | 654 bytes | Anonymous (not verified) |
| #3 | node_log.1.patch.txt | 1.07 KB | Anonymous (not verified) |
| #1 | node_log.patch.txt | 635 bytes | Anonymous (not verified) |
Comments
Comment #1
Anonymous (not verified) commentedhere's a patch for the log having its div stripped problem.
Comment #2
killes@www.drop.org commentedWould you mind to re-roll that patch as a nufied patch? diff -up
Comment #3
Anonymous (not verified) commentedattached.
Comment #4
Anonymous (not verified) commentedjust tested eaton's $node->body with arrays patch, and it doesn't fix any of the revision log bugs, so here's a patch that ensures that if a $node->log is saved, it came from a revision operation, and not just from the node being updated.
Comment #5
dries commentedNot tested, but the variable name in the code comment doesn't match. Personally, this looks like a strange fix (a bit of a hack). How come the value is set incorrectly in the first place? Needs more investigation, IMO.
Comment #6
Anonymous (not verified) commentednew patch with typo in comment attached.
the value is not so much set incorrectly as just carried over from node_load(). backtracking a bit - node_revision_revert is the only code in node.module that sets a value for $node->log:
problem is, when the node with the revision log is updated, if $node->log on the $node passed in to node _save is not set, then the log message is just carried over, because of this code in node_save:
so, my first thought was to patch node_save to make sure it didn't save the log from the old revision if the node being passed in doesn't have a log value.
alternatively, we could:
- ensure that the $node passed in to node_save always has $node->log set, even if its empty
- implement hook_load or hook_nodeapi in node.module to handle the unsetting $node->log
suggestions as to which way to go?
Comment #7
moshe weitzman commentedthe current behavior where you see the last log message upon editing is odd to me. i think this field should always be blank when you start editing. it is a place for entering the *new* log message. So, I suggest setting #default_value to '' for the log textarea.
my .02
Comment #8
pwolanin commentedProbably will need to be changed to accomodate this:
http://drupal.org/node/74326
I think Moshe's suggestion that each revision should have a separate/empty log message is a pretty reasonable one.
Comment #9
dwwthis has been previously reported in http://drupal.org/node/39124.
i was just about to submit my own issue and patch for this, but found these duplicates, instead. ;)
so, i posted my patch in #39124. i had come to the exact same conclusion it seems folks in here have converged on: just don't fill in the #default_value for the 'log message' field and all is well.
anyway, please stop using this issue, and move any further discussion/review/patches to the older, original issue.
thanks,
-derek
Comment #10
Anonymous (not verified) commented