There is an issue to add this option to core in 7 (#308352: Allow revision log messages to be required) but obviously we can't use that on d.o for a while. It would be nice to require the revision log to be filled out for the d.o handbooks. Most of the docs team agree. The only point of disagreement is that some feel that it is simply going to get meaningless entries from people who don't care. While that is true, I feel like a) many people don't even think about it and would use it if they were reminded (I find that I will often work on a page for a while and then completely forget to leave a log, to my own frustration.) and b) meaningless entries are no worse than the nothing at all we get now. So I don't see that as a compelling argument against it.

This would be a patch against drupalorg.module and I'll get a patch rolled up for it soon if no one beats me to it.

Comments

oadaeh’s picture

a) many people don't even think about it and would use it if they were reminded

I think part of this problem is that there is no continuity between the naming of the log box and the revision changes. While the filedset in D7 helps with this, I think if it were named and described better, that would help part of this issue. To that end, I've submitted this patch: http://drupal.org/node/308774. Obviously, it won't help totally forgetting about it when you know what it's there for.

dww’s picture

Good suggestions. I'd be happy to review, commit and deploy such a patch to drupalorg.module.

oadaeh’s picture

The patch to drupalorg.module will have to wait until the issues to http://drupal.org/node/308352 are corrected.

Also, I've just created a not-nearly-as-important patch that might also be nice to include: http://drupal.org/node/308820

add1sun’s picture

I don't see why we have to wait for that core patch in order to add the specific use-case feature to d.o. All we need for this is a hook_form_alter that adds validation on the revision log field for book pages. It doesn't have to be a general patch like the one going in to core, unless I'm missing something. This is a "site tweak" patch, not a general feature patch.

dww’s picture

I think oadaeh's point is that the logic regarding when to make the field required is still being sorted out. add1sun is right that we don't have to wait for the core patch to land to roll out this feature on d.o, but we might as well get the logic right. ;)

add1sun’s picture

Ahh, yeah OK I can see that. The logic issues raised make sense, but we can just go ahead and take care of that in our patch. To summarize for this patch to keep moving:

- Make sure that it is only required on revisions rather than new posts.
- Check that revisions are required ("Create new revision") on the node before requiring this too (that is already set for book pages on d.o but of course, it doesn't hurt to make sure the logic isn't "assuming" things).

Does that about sum it up?

jbrauer’s picture

Just noting that http://drupal.org/node/109197 seems to be the same request.

oadaeh’s picture

Status: Active » Needs review

Here's my initial stab at this. Having never actually modified drupal.org code itself, I'm sure I've probably done something wrong. Also, it seemed like it was less simple than it should have been, but I couldn't find a better way to do it.

The attached patch changes the wording based on my proposal, so if you don't want that, just say so.

It should require a log message for all node editing pages that have the 'Create new revision' checkbox checked. It should display(but not require) the form for all other node editing pages where the user has the ability to change that option. It should not display it if neither of those are true. It should also not be displayed on any node adding page.

oadaeh’s picture

StatusFileSize
new2.13 KB

Hmm, are we having a problem attaching files again? I know I added it on my previous comment.

add1sun’s picture

Status: Needs review » Needs work

Hm, well we don't want to require this on all node types so we need to check for node type equal to book. Also, can't we simply check for the revision log field (on a book node edit page) and then set '#required' => TRUE? I don't see why we should be recreating (or unsetting) the field ourselves when Drupal already does that for us.

oadaeh’s picture

Status: Needs work » Needs review
StatusFileSize
new824 bytes

So, really all you want is something like this:

  elseif ($form_id == 'book_node_form') {
    if (($node_revision || user_access('administer nodes')) && arg(1) != 'add') {
      $form['log']['#required'] = TRUE;
    }
  }

I was just trying to be complete and cover all the bases.

dww’s picture

That'd probably work. I was thinking of something even more simple, like this:

    elseif ($form_id == 'book_node_form' && isset($form['log'])) {
      $form['log']['#required'] = TRUE;
    }

Untested, but I think that's all we need.

add1sun’s picture

@dww, we don't want to force it on the node/add page though - that would be annoying. Other than that, yeah I think this is all we need.

oadaeh’s picture

StatusFileSize
new774 bytes

Here's the updated patch.

add1sun’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me. Thanks oadeah! @dww, look good to you?

dww’s picture

Assigned: Unassigned » dww
Status: Reviewed & tested by the community » Fixed

Reviewed, tested, committed, and deployed on d.o. Thanks oadaeh and add1sun. Enjoy. ;)

Amazon’s picture

Oh, does this ever suck!

Could we remove this for people with certain perms ;-) Seriously, I do a lot of editing and having to log every time drives me nuts.

Kieran

webchick’s picture

I'd love to get this feature into core for D7. #308352: Allow revision log messages to be required if you wanna help. :)

add1sun’s picture

@amazon for book pages? other than case studies, is there really a common reason for multiple edits? if that is the case (and also the "comment" reason, amongst others) should we not use book pages for case studies anyway?

The problem with excluding certain roles is that in "regular" handbook pages we still need to know what people changed and those with elevated rights are even harder to track. Diff does not tell us when things like weight or book parent changes and that is very important information. If we don't log it, no one knows.

michelle’s picture

Status: Fixed » Active

Per discussion with webchick on IRC, this needs to be changed to not require logging on preview.

Michelle

dww’s picture

Assigned: dww » Unassigned

I'm not 100% sure how to do that easily with FAPI, and I don't have time in the near future to think about it enough to deal with it.
If this "needs to be changed" someone else should roll a patch for it.

Honestly, I don't see how this is a UX improvement -- you're going to need the log message eventually, why not just fill it in? If you're creating a new page and you just enter a body but no title and hit preview, you get a validation error about title being required and don't see the preview of your body text, either. How/why is this any different?

michelle’s picture

If it's a pain to change, then I guess just leave it. It just came up on IRC along these lines:

addi: required logs Yay!
me: error messages on preview *grumble*
webchick: bug file issue

So if I'm the only one it's bugging and I'm not putting any code out there I'm fine with just setting this back to fixed unless webchick thinks it needs to be fixed further.

Michelle

Amazon’s picture

It's a pain, but I am living with it. Addi, can you assign this issue to yourself.

Kieran

add1sun’s picture

Status: Active » Fixed

Well I'm going to close it since AFAICT it is done.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.