Posted by NikLP on September 19, 2008 at 11:03am
| Project: | Revision Moderation |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
I have many node types created. I want all content moderated. I don't want to give anyone "administer nodes" permission for relatively obvious reasons.
So... I would have thought that when I create a new node, that is essentially a "new revision". Under the node type's workflow settings, I have "Create new revision" set - so why doesn't a revision get created? Or is the problem (which I suspect to be the case) that revision_moderation does not *count* a new node as a new revision?
IMO this should either be the default course of action, or configurable as so with a checkbox on the settings page.
Comments
#1
I'm having the same problem.
After some thinking, I changed the line 343 of the revision_moderation.module from
$sql = "SELECT n.nid, r.vid, n.type, r.title, r.body, r.uid, r.timestamp FROM {node} n INNER JOIN {node_revisions} r ON n.nid = r.nid WHERE r.vid > n.vid ORDER BY r.vid DESC LIMIT %d";to
$sql = "SELECT n.nid, r.vid, n.type, r.title, r.body, r.uid, r.timestamp FROM {node} n INNER JOIN {node_revisions} r ON n.nid = r.nid WHERE r.vid > n.vid OR n.status = 0 ORDER BY r.vid DESC LIMIT %d";So it shows not only "nodes with revisions higher than current published revision", but also any unpublished nodes.
It's not exactly related to revisions, but from the logic of moderation, a newly created node will be in the unpublished status, and thus fix the problem.
#2
Cool - that looks like it would solve the problem as I presented it. However, it does create a grey area. It is perfectly conceivable that a node could be left to one side, having been reviewed but remaining unpublished. However, if this node has no revisions awaiting moderation, it will still appear in the revisions queue.
Is there a happy medium between the two, or is making a new toggle setting between them going to be enough to manage this grey area on a per site basis?
#3
Yes, the work flow can be complicated. Actually I just finished some work on this and did a lot changes on revision_moderation module. It's changed too much thus I don't even think it's applicable to make a patch here. The basic idea is use a moderate flag to indicate if it should appear in the moderation queue, and users by default always edit the latest revision, unless being specified to use a revision.
I'll try to clean the code and make a patch if I have time.
#4
OK - it would be cool if someone could confirm or deny that the workflow is what's at fault here.
If we can confirm that's the case then I will double check this patch and mark it (tentatively) RTBC?
Addi...? :)
#5
my 2 cents
the patch is working, it shows the new created node in the revisions list, but if you're not the author of the node, you'll get an access denied, if I go to node/xxx/edit I'm able to see the nodes edit form and I can save it, I get a message that the node is updated and submitted for moderation (a new revision is created). After that I'm still unable to see the revision (access denied).
Update: When I edit the node and I select preview instead of save, I'll get the option to publish the revision, the revision gets published, only thing left is to publish node the node, but I guess that's another thing.
#6
I'll be checking through this in the next few days. After I've confirmed/denied any bugs etc I'll pester Addi to do a quick last check and any relevant commits.
#7
You also need to modify lines 206 & 207 so that it shows the options for new nodes such as publish edit delete. I am also working on the permissions issues associated with this since I need it for a new site I am developing. I think the view_unpublished module should be adopted by this as well if you are allowing unpublished nodes to be viewed in the first place.
old line 206 & 207
$current_vid = db_result(db_query('SELECT vid FROM {node} WHERE nid = %d', $node->nid));if ($node->vid != $current_vid) {
new line 206 & 207
$current_vid = db_result(db_query('SELECT vid, status FROM {node} WHERE nid = %d', $node->nid));if ($node->vid != $current_vid || $node->status == 0) {
edit:
Line 383 needs status = 1 to publish the node if it is unpublished.
old
db_query("UPDATE {node} SET vid = %d, title = '%s' WHERE nid = %d", $node->vid, $node->title, $ node->nid);new
db_query("UPDATE {node} SET status = 1, vid = %d, title = '%s' WHERE nid = %d", $node->vid, $node->title, $ node->nid);#8
I have a modified file that adds a new permission and alters several things that are displayed to the user as well as allows nodes to be included. I have also used view_unpublished to get things where i wanted them. I also needed to modify node.module to allow the unpublished revisions to be viewed correctly. I am not showing that modification because I don't like it.
#9
there isn't actually patch attached anywhere in this thread. I'm also not a fan of getting into node publish/unpublish state control on this. while related I don't necessarily see that as a role for RM to take on. A related thread (but not the same) here: #156269: Publishing a previously unpublished node with new revision moderation checked does not get published