Allow revision log messages to be required
deviantintegral - September 14, 2008 - 18:11
| Project: | Drupal |
| Version: | 7.x-dev |
| Component: | node system |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Description
Hi,
It was discussed on the documentation list that this would be a useful feature for both documentation and user sites. This patch adds a new option to the workflow form called "Require log messages". If this is enabled, the textarea is set to required, and the fieldset is expanded. Otherwise, nothing else is changed.
Enjoy!
--Andrew
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| allow_required_log_messages.patch | 2.02 KB | Ignored | None | None |

#1
Patch failed to apply. More information can be found at http://testing.drupal.org/node/14354. If you need help with creating patches please look at http://drupal.org/patch/create
#2
Bah, made the patch against the node folder instead of the drupal root.
#3
Looks good to me. I haven't had a chance to test it yet. My only nit-picky thing (since this is core) is that comments should end in a period.
#4
Your second patch adds a line with nothing more than two spaces.
I'm also attempting to review it more in depth, but I'm currently trying to get past http://drupal.org/node/299661.
Everything looks fine, but I want to verify one validity check.
#5
Okay, as I suspected, there are not enough validation checks being done. Here are the things I found wrong with the proposed patch:
#6
Also, not to sound like a broken record or anything, but we'll need tests for this. There's a lot of tweaky logic, as evidenced by oadaeh's #5. In fact, this might be a great case where "test-driven development" (writing tests that document the logic first, then filling in code so they pass) could shine.
#7
http://drupal.org/node/120207 marked as a duplicate... though it was the predecessor since the patches/work is here keeping this one.
#8
subscribing as author of predecessor request
#9
So I traced this down. The problem is that node_validate is being called by the edit form when you hit the delete button, validating all of the filled in form elements. Since any changes will be lost when you click the delete button, can't validation just be removed for that case? Or am I missing something more complex?
This brings up a more interesting case. I suppose it's possible to want to force log messages without revisions. If that's a valid case, then I guess the 'Revisions' tab could be changed to a 'Log messages' tab when revisions are disabled. Otherwise, the workflow form can be changed so that the option is only available if revisions are enabled.
As for doing tests, I totally agree, but unfortunately I'm rather new at testing in general. I'll take this as an opportunity to learn and see what I can come up with :).
--Andrew
#10
@deviantintegral: Awesome! Don't hesitate to stop by #drupal and ask testing questions if you get stuck. There are lots and lots of people who would love to help you out. :)
#11
#265259: Node form is validated before deletion should probably be resolved before this then.
#12
AFAIK, there is no way to view the saved log message if revisions are disabled. Saving them is fine, but kind of pointless w/o a UI.