Issue http://drupal.org/node/87474 restored the ability to add log messages to nodes. That was a very good thing!

However, the side-effect of that is that now this field is visible all the time for users with "administer nodes" privileges. While it's generally assumed that people with this permission will be technically proficient, this is not always the case; for example, forum moderators and such. They then start wondering what this field for, why it exists, what they're supposed to type in it, how to see what they typed, etc.

This therefore represents a bug in the UI, in that there's this field that's in most cases purely optional that's instead sitting there looking like a required field.

Proposed fix:

- Place log field in collapsible fieldset
- Make fieldset expanded by default if $node->revision is true.
- Otherwise, make it collapsed by default.

The downside is that enabling revisions one-time on a node involves four clicks: once to expand "Publishing Options", once to click "Create new revision", once to expand "Log message", and once to click in the box and begin to fill it in.

Generally though, I think the use case for revisions is to always leave them on or off for all nodes of a given type.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

webchick’s picture

Status: Active » Needs work
FileSize
1.24 KB

This was webernet's latest patch on this issue. Still needs some work.

forngren’s picture

Version: 5.x-dev » 6.x-dev

Keeping up with 6.x-dev.

forngren’s picture

Status: Needs work » Needs review
FileSize
1.21 KB

Forgot patch and status.

BioALIEN’s picture

This is perfect, subscribing.

I've always wondered why the log textarea wasn't shifted inside a fieldset. It always looked out of place so +1.

forngren’s picture

Assigned: Unassigned » forngren

Updated patch

forngren’s picture

And the patch...

forngren’s picture

And another flavor.

Dries’s picture

This:

+    if (!$node->revision) {
+      // Collapsed by default when "Create new revision" is unchecked
+      $form['revision_information']['#collapsed'] = TRUE;
+    }

looks like a complicate way to write:

    $form['revision_information']['#collapsed'] = !$node->revision;

An important usability improvement though!

forngren’s picture

Updated according to Dries.

Dries’s picture

Status: Needs review » Fixed

Committed to CVS HEAD. Thanks.

pwolanin’s picture

possible problem with the patch, this relocated checkbox:

    $form['revision_information']['revision'] = array(
      '#type' => 'checkbox',
      '#title' => t('Create new revision'),
      '#default_value' => $node->revision,
    ); 

no longer has an #access check, so normal users can decide whether or not to make a revision. Is that desired? to be consistent with the former method, it should have:

 '#access' => user_access('administer nodes'), 
forngren’s picture

Good catch.

forngren’s picture

Status: Fixed » Needs review
pwolanin’s picture

Also, this:

  // Always use the default revision setting.
  $node->revision = in_array('revision', $node_options); 

and associated code should move to node_object_prepare() , so that hook_nodapi can use $op='prepare' to change $node->revision, etc.

patch attached to clean up these 2 aspects of revisions on the node form

Dries’s picture

Status: Needs review » Fixed

Committed. Thanks.

pwolanin’s picture

@Dries -do you want the other part of #14 as a separate issue, or did you not see it?

BioALIEN’s picture

Status: Fixed » Reviewed & tested by the community

pwolanin, I think Dries missed your post and patch in #14 by a minute.

pwolanin’s picture

should a file a separate issue? I think the change makes sense (even for a backport).

Dries’s picture

Ah, I think we just crossed each other. A quick re-roll would be helpful.

pwolanin’s picture

re-rolled. Note again, the purpose of this change in the relative positioining of this piece of code is to let node/nodeapi modules set $node->revision, or potentially to change the node form based upon it.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)