Okay, it seems an article can become in this locked state if it already has an edit awaiting moderation and someone performs an undo action before that other moderated edit is approved or denied. It should not be possible to make any changes, including undo, while moderation is pending. It is also an issue that the logic for the article's locked state differs from the logic for 'can-approve' (if an edit is not the newest edit, it is assumed that it is not waiting for moderation, but the code that removes the edit lock checks for any pending edit without checking how new it is).
This would get you into the state you have now where there is an edit waiting for moderation but no one is allowed to approve it.
The first thing you need to do is make sure this doesn't happen again. In
vault/core/controller/dm/revision/vw.php, find:
Code:
$pending = vw_DB::get()->query()->select(array(
'fields' => array(
'revisionid',
'userid'
),
'table' => 'vw_revision',
'where' => array(
vw_DB::get()->query()->eq('pageid', $pageid),
vw_DB::get()->query()->eq('visible', 0)
),
'order' => array('dateline' => 'DESC'),
'first' => 1
));
Replace with:
Code:
$pending = vw_DB::get()->query()->select(array(
'fields' => array(
'revisionid',
'visible',
'userid'
),
'table' => 'vw_revision',
'where' => vw_DB::get()->query()->eq('pageid', $pageid),
'order' => array('dateline' => 'DESC'),
'first' => 1
));
if ($pending AND $pending['visible'] != 0)
{
$pending = false;
}
Next you will need to remove the lock from the affected page with a query like so:
Code:
UPDATE vw_page
SET has_pending = NULL
WHERE pageid = 8298
LIMIT 1
This fix is now included in 4.0.3 build 002.
Regarding the user you mentioned... The permission that says whether a user can approve edits or not is in the wiki permissions under the "Moderator Permissions" heading. It asks "Can moderate wiki content?" There is only one usergroup that I have seen that has been given this permission, and it is the Administrators group. I checked all the usergroups that the user in question is part of, and this permission is set to No for all of them. If you want the user to be able to approve or deny moderated content, including edits, then he needs to be in a group that has this permission. And that is not the case currently.
Another issue I see that may creep up eventually. It is not related to this issue but I wanted to point it out. The user is listed on the Wiki Moderators page, however when I look at that user's settings in the regular user settings admin page, it looks like you manually removed at least that one user from the related "Wiki Moderators" usergroup after adding him as a moderator. So he is listed as a moderator but will not gain any permissions from being a moderator (all the permissions for the "Wiki Moderators" group are set to No anyway, so it does not matter right now). However, if you start changing the permissions of the "Wiki Moderators" group or give the user personal overrides on the Moderators page, those changes will have absolutely no effect and this will be the reason.