After updating to 6.x-1.0-alpha2 "Exempt administrators from revision moderation" does not work. After updating a node, as user 1 admin, I get a message: "

* Your changes have been submitted for moderation.
* content type.... title .... has been updated.
while before the update as an administrator I only saw a message that the node has been updated.
Node shows in revisions for me to approve...
My settings: "Exempt administrators from revision moderation" still remain the same...
I did run update.php after the upgrade

Comments

gleich’s picture

Well, I have the same problem here.

What I've figured out:

1. First of all, there was no 'revision_moderation_exempt' variable in db (i.e. no such row in 'variable' table). I suppose it should be, since I performed clean install of alpha2. Anyway, setting this checkbox once again manually via UI fixed this problem. Something wrong with install script?

2. Since problem was still persisting, I looked into the code. And it seems like this bug was introduced with following patch, committed to alpha2:

http://drupal.org/node/433608#comment-1556528

There is following condition on line 234:

else if ($node->nid && $node->revision_moderation == 1 && end($args) == 'edit')

which doesn't consider the exempt flag. I've changed it to

 else if ($node->nid && $node->revision_moderation == 1 && end($args) == 'edit')  &&
(!user_access('administer nodes') || !variable_get('revision_moderation_exempt', 1)))

and it seems to work OK. But it should be checked more thoroughly.

UPD By the way, it would be nice to have separate permission for this purpose, so that users like "trusted" editors could publish their changed without approval, still not having "administer nodes" permission (which is too high). Actually, it'd be better to have 2 permissions:

1. Post without approval (ie auto-publish changes of this user)
2. Approve revisions (ie moderate and publish others' changes)

What do you think about it?

Ela’s picture

Thank you for the info :)
I rolled back to alpha 1 for now, waiting to see how this issue will close...
I agree with the requests, these features would be great!

jbrauer’s picture

Please put new feature requests in separate issues.

I'll take a look at the conditional after a cup of coffee...

nirbhasa’s picture

StatusFileSize
new3.02 KB

This patch checks if there already exists a pending revision - if so, it warns the 'exempt admin' user that there exists other pending revisions which will be overwritten by their revision. if not, it just goes ahead and publishes the revision without any problems.

(edit: after reading #1 i realised that this patch has not been tested on new install: to do)

Ela’s picture

any updates? :)

Ela’s picture

oh well... :)
Used the patch above.. seems to do it's job :)
Thank you for providing it

sign’s picture

Status: Active » Reviewed & tested by the community
StatusFileSize
new3.41 KB

tested on a new installation and works well for me
cleaned it a bit (coding standards - spaces, tabs,...)

marking as RTBC

jackalope’s picture

I had the same problem, and the patch in #7 worked nicely. Thanks!

steve02476’s picture

Me too, I saw the problem after updating to alpha2, and the patch in #7 seems to have fixed the problem. Thanks for publishing it.

auberdjinn’s picture

This patch seems to have fixed the problem in our existing installation. Thankyou!

jbrauer’s picture

Status: Reviewed & tested by the community » Fixed

Committed thanks!

Status: Fixed » Closed (fixed)

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