Function node_configure() (http://api.drupal.org/api/function/node_configure/6) generates the Post settings page and decides whether or not to display the Rebuild permissions button, which it does so if either
1. a node access module is active
2. the {node_access} table doesn't contain precisely 1 row

In 6.x/7.x, the 2nd test should be node_access_needs_rebuild().

In 5.x, the 2nd test should also check whether the 1 existing row is the default grant (it is possible for a node access module to leave a single row in the table which is not the default grant). Whether this check would also be useful for 6.x/7.x I'm not sure - it might catch edge cases but probably should not be necessary in theory (because in 6.x+ when all node access modules are disabled the permissions are automatically rebuilt).

Also the frequent absence of the Rebuild permissions button is a significant usability problem (witness the large number of forum topics on this). Therefore a suitable message should be output when the Rebuild permissions function is not available, explaining that the node access permissions do not need rebuilding. Haven't we all at some time been confused by the comings and goings of the Rebuild button?

Comments

brianV’s picture

Assigned: Unassigned » brianV
Status: Active » Needs review
StatusFileSize
new2.09 KB
new42.08 KB

Here is a patch to change the check as suggested for D7. It also includes a message informing the user if the permissions cache does not need to be rebuilt (see screenshot).

brianV’s picture

Issue tags: +D7UX

tagging for D7 User Experience

brianV’s picture

Issue tags: -D7UX +Usability
Bojhan’s picture

Can we get a before and after screenshot for this, and places other then this page where this button occurs.

brianV’s picture

Bojhan,

Without this patch, the 'Node Access Settings' fieldset, with the message inside, doesn't display. Just picture it gone, and there is your 'before' shot.

Also, this is the only place the button occurs.

Bojhan’s picture

Oke, so we might concider making this a drupal_set_message rather then a fieldset.

brianV’s picture

We could, but I see a benefit in the message being exactly where the user would expect to find the form if it had generated. Of course, this is just one man's opinion.

dries’s picture

I was actually going to suggest that we can _remove_ the fieldset. If nothing needs to be done, we don't need to tell the user anything. I'm tempted to mark this patch "won't fix".

catch’s picture

Status: Needs review » Needs work

I don't think we need a message saying that permissions are fine. It seems like if you had a batch update of node access interrupted, the proposed patch would leave your table in a half-built state with no button to push - similar to if it timed out in D5. I think like the search index button we should just leave this there all the time - if you press it when you don't need to, you waste some cycles.

brianV’s picture

Status: Needs work » Needs review
StatusFileSize
new2.8 KB

catch,

You raise some good points.

Here is a new revision removing the check altogether, so the field set and button display all the time, regardless of whether or not the permissions actually need to be rebuilt.

catch’s picture

Patch looks good to me. Going to let yoroy or Bojhan (or anyone else interested) rtbc it though.

yoroy’s picture

Status: Needs review » Reviewed & tested by the community

yoroy: does the patch make it show even if no node acces is happening?
ah yes, so it seems. remove the check altogether

catch: yeah it shows it all the time. there's a chance you could remove a node access module, leave the rows in your table, and end up locking your users out. pressing the button should set it back to normal.

yoroy: right. well, if the check is untrustworthy and you might need it to fix something horrible, better always be able to access it

yoroy’s picture

And then get to relocating the button asap, we want to get rid of this Post Settings screen entirely: #361277: Remove the 'post settings' admin screen and relocate contents

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks!

gpk’s picture

Version: 7.x-dev » 6.x-dev
Status: Fixed » Needs review
Issue tags: +Needs backport to D6, +Needs backport to D5

I've not checked whether this applies to D6, otherwise would have set to RTBC.

For D5 I think some sort of status message would still be needed (probably on the post settings page in the permissions fieldset) for the avoidance of confusion. In D6 you get the status message when a permissions rebuild is needed and so the absence of this message is probably sufficient indication of whether Drupal thinks there is likely to be a problem with the current permissions cache. If we suddenly make this fieldset appear permanently in D5 then I think it needs a bit of explanation.

But first, D6.

brianV’s picture

D6 patch attached.

What text should we have for the d5 version?

brianV’s picture

Status: Needs review » Reviewed & tested by the community
gábor hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Committed yesterday in http://drupal.org/cvs?commit=222608 but forgot to make note here. Thanks!

gpk’s picture

Version: 6.x-dev » 5.x-dev
Status: Fixed » Patch (to be ported)

@16: the consensus here might well actually be for the same approach as in 6.x, i.e. just show the fieldset at all times. I only hesitate to agree with this approach because it is adding an extra control that on simple sites (with no node access considerations) adds nothing except another button to confuse the site admin and a couple of paras of text that are basically irrelevant/largely meaningless -> more confusion. If the permissions definitely don't need rebuilding then suppose I'd do something like showing the fieldset with the Rebuild button disabled and the simple text "The permissions cache does not need to be rebuilt."

A slightly separate point - per the original issue post, in http://api.drupal.org/api/function/node_configure/5 the test count(module_implements('node_grants')) > 0 also needs to check that the single row *is* the default grant. If not then a rebuild is *definitely* needed.

marcingy’s picture

Status: Patch (to be ported) » Closed (won't fix)

Marking as won't fix as d5 is end of life.