Question by RTH, moved from other thread to its own topic - RdB
How does the moderator proceed after he has reviewed the revision, decides not to publish it as it stands, and tells the author to revise it? How does he remove it from Pending until it has been edited again?
It seems that 'current' status is used to flag which revision has been checked by moderator (a newer one flags pending again) but with unpublished work, there doesn't seem to be a way for moderator to shift the current flag onto the one he has rejected. Publishing does it, but he doesn't want to do that. Also, by using current status in this way, when only a single revision (the original) exists, it must be current, so it is taken as pending. Even with a way to shift the 'current' flag, a moderator can never get that article out of the Pending tray until a second revision is made. This is likely the most common case.
Comments
Comment #1
rdeboerQ: "How does the moderator proceed after he has reviewed the revision, decides not to publish it as it stands, and tells the author to revise it? How does he remove it from Pending until it has been edited again?"
A: He doesn't.
Good penetrative thinking RTH! Until you install Workflow you won't be able to differentiate between "in draft" (i.e. with the author) and "in review" (with the moderator), let alone transition to and from these states.
Basically without Workflow "in draft" equal "pending moderation/in review", and both author and moderator can simultaneously touch it. Without Workflow we don't have distinct states, so we cannot assign distinct access permissions for author and moderator either. Some users (e.g. midkemia) have indicated that this is exactly the way they like it, as there's not the overhead/formality/complexity of to-ing and fro-ing between author and moderator (author submits, moderator rejects, author resubmits, moderator rejects again, author resubmits one more time, moderator publishes)... for every little change. But if you'd like to explore a stricter model that may be more like what you seem to be after, have a look at the 3 tutorials on the Revisioning project page.
Aside:
I feel we can blame the lack of core support for the grey area between "draft" and "in moderation". Have you noticed the
nodetable has amoderateflag that is now obsolete? While core cleanly implements the concept of revisions (using thenode_revisionstable), it has few 'hooks' to support the concepts of "drafts" and "pending revisions". That's why we have to fake it, with this wishy-washy rule: "pending revision = revision.vid > node.vid". We should really have a status code on each revision in thenode_revisiontable, which would unequivocally tell us whether the revision is "in draft", "in moderation" or "published". Something for the next version of Revisioning, perhaps, a simplified version of what one can do with Workflow in a more heavy-weight fashion?Comment #2
rhouse commentedHi Rik,
Okay, let's assume we are only doing an approximate simulation of the full cycle, and that we don't want Workflow. Do I have this correct:
If I have that right, it leads to the situation I explained in #470682: Revision message repeated, where, for unpublished nodes, a naive author will see a node marked as current, but it is not their latest version - confusion clearly possible.
How about this simpler rule:
For unpublished content, the latest version will by definition not be the published version (because there isn't one), so all unpublished work appears in Pending (this is the case anyway with the present rule, because we force the (meaningless) 'current' version to always be the first one), and it is safe to allow 'current' to be the latest revision. For published content, it will only be Pending if a later version than the 'current (published) one has been created.
Another way of looking at this proposed rule is: For unpublished content, consider a non-existent 'version zero' to be the 'published' version; then in all cases, the existence of a later version than the published version means it is Pending. Different code will be needed upon version creation, because published nodes should revert the current version whereas unpublished nodes should not, but the concept is clean and therefore likely to lead to fewer hidden gotchas.
Actually, I for one would find that quite adequate for the limited numbers of authors and articles I will have to deal with, so count me in with midkemia. So a question for all interested parties: Does the rule I propose raise any hidden problems that you face?
Ron.
Comment #3
rdeboerHi Ron,
Thanks for collectively trying to get our brains around this!
First, a quick note... the word "current" from a user point of view is indeed confusing, in the case where a node is NOT published. It doesn't really mean much, since when a node isn't published, the public cannot see ANY revision.
"current" is merely a (bad) reflection of the way the database is organised in core and that is that for data integrity reasons every node (published or not) must point to a revision (aka
$node->vid) and for lack of a better word we call the revision "current", even when the node/revision is not published. I have tried setting a node'svidto zero/NULL/0 and **bad** things happened.Maybe in the case of a node that is not published we should change the label "current" to
o "current candidate for publication" (when there is only a single revision, not published)
o "previously published revision" (when the latest revision is the one
$node->vidpoints to, not published)o "archived" (when a more recent revision exists, not published, i.e. the same label we give to revisions older than 'current')
TRUE
First, in the light of the above, I guess we should read this as:
For ALL content, if the latest revision is not the one
$node->vidpoints to, consider that latest revision Pending.I don' t quite follow the second part of your comment.
Are you saying that the simpler rule results in different behaviour or that the simpler rule simply rephrases the double rule in a single sentence?
Comment #4
rhouse commentedHi again Rik, Thanks for confirming my understanding of the rule as being used.
I think you misunderstood my suggestion. I was not saying to ever make vid zero, I said that one could consider that all nodes have a published version by imagining that unpublished nodes have a fictional published "node zero" prior to the first version that actually exists. That doesn't imply actually trying to invent such a node or make anything refer to it. But the fiction allows one to adopt the simpler rule I propose. It is not the same as the existing rule because in the case of unpublished nodes, it allows the 'current' pointer to refer to the latest node, which in turn prevents the bad user interface problems that will confront the most naive users, namely untrusted guests. The following things are important:
Thus for your specific question:
No, because the fictional node zero is fictional, and so that fact must be coded around; the rule is simple, the code might not be (but should have a benefit anyway because simple concepts have a way of paying off).
Here is another way to look at it that does not involve the fictional node zero:
In order to try to think through how this might be coded, I discovered I need to understand something that I can't find in the drupal docs: When status is 1, does that mean that this node (but not necessarily this version) is a published node (meaning that it has somewhere a published version), or does it mean that specifically this version of this node is published (and therefore, if it is zero, tells us nothing about whether a different version somewhere might be published)?
Ron.
Comment #5
rdeboerHi Ron,
To start with your last question... A node itself doesn't have versions. It just has some basic info, but no content. For its content a node has a pointer into a table (i.e. collection) of node_revisions. In programming terms, the revision pointed to from the node (the vid) is referred to as the 'current' revision, even if that doesn't make sense to end-users when the node isn't published (node->status=0), which means that none of the revisions are shown. To 'publish a node' means 'to make the current revision publicly visible'. There are no versions somewhere else.
Both the current rule and the proposed rule make all nodes Pending if the latest version of the node is unpublished.
Not quite right -- if the node is unpublished, then
a) if the node vid points to the latest revision, the node is considered unpublished or previously published
b) if the node vid points to a revision that is not the latest, then the node (i.e. the latest revision) is considered pending
Examples of a) and b):
a) previously published, not pending: nodes that show this pattern show up under the "Not published" tab
"Some title", rev #201 <--- node.vid ('current, unpublished', but should perhaps be labeled 'latest, unpublished' or 'previously published')
"Some title", rev #200 <--- archived
b) pending, nodes that show this pattern show up under the "Pending" and "Not published" tabs
"Some title", rev #201 <--- pending moderation
"Some title", rev #200 <--- node.vid ('current, unpublished', but should perhaps be labeled 'archived')
The current behaviour of showing their original node will obviously lead to confusion and error...
I agree.
I am very much leaning towards the addition of a column on the
node_revisionstable, i.e. adding a status-code on each revision which would unequivocally tell us in what state the revision is in, e.g.:0 = "in draft": author is still working on it, not ready to give to moderator for review, yet
1 = "pending moderation": author has indicated their draft is ready for review
2 = "current, published"
3 = "unpublished/archived": i.e. was published before, but taken from public view
That way we can have the node point to the latest revision (or any revision in fact) without getting into discussions like we're having now. It would be clear-cut.
The author would have 2 buttons on his edit screen:
"Save as draft" (not ready for moderation yet)
"Save and submit for moderation" (setting revision status code to 1)
Hence, it would be clear to both author and moderator in whose "court the ball" is.
Comment #6
rhouse commentedHi Rik,
Yes, the "previously published" situation is one I wasn't considering. That would be the only way to shift the vid on an unpublished node (by publishing and then unpublishing). I agree with your idea that an extra column in node-revisions would be a good solution. Isn't that a table provided by drupal core? Is it allowable to add a module-specific column to it?
Ron.
Comment #7
rdeboerHi Ron,
Yes
node_revisionsis a drupal core table.I believe it is allowable to add a column (haven't done it before though).
Alternatively Revisioning could create its own small table and connect it to
node_revisionsvia an SQL join.Rik
Comment #8
Anonymous (not verified) commentedI would tend to go for a table of ours, not theirs :)
That way we have better control, if they change things, it also makes for a cleaner uninstall.
We also have options to add more columns as identified
Though already having 170+ tables do I really want another, yea why not :)
Comment #9
rhouse commentedHi Rik, John,
In my capacity as ordinary naive user, I would feel happier with a custom table, as I would know that there is no hocus pocus going on that I can't master - delete the module, delete the table, and it's gone. I don't think number of tables is of any concern, and because this module concerns preparation and publication, rather than display, efficiency is no concern either, as the bulk operation is site viewing, which doesn't concern it.
Cheers, Ron.
Comment #10
rdeboerI'll look into this, as either the extra column or extra table approach would also allow us to solve #472710: What is the difference between a "draft" and a "pending revision"?.
But before releasing any more development snapshots, I'd like to feel confident that the pending revisions alert block is the way we want it to be, the column sorting on the Accessible content page works and that #466930: New tabs for 'My content' menu: Pending,Editable,Published,Not published appears bug free, so that we can make an official release.
What do we think -- is the development snapshot stable enough?
Comment #11
rhouse commentedHi Rik,
It seems to be correct, but of course the issue of showing confusing unpublished content display to the naive user remains. It seems that until the wider changes go in, we have to choose between these situations:
As a stop-gap measure, I vote for (2), because I would rather the experienced user be slowed down than the naive user make errors - the latter will end up wasting the moderator's time anyway trying to sort out problems.
Since John has a big site already, perhaps his vote is more important than mine on this question.
Ron.
Comment #12
rdeboerRon,
I would say that on most sites, most nodes are either published or in their initial (unpublished) draft stage. Those would be the most common scenarios: creating new content, or modifying content that is currently live.
Editing content that has previously been taken off the site is less common, so while your gripe is justified, its occurrence isn't widespread -- or am I wrong?
Anyway, I'll fiddle with the wording a bit more.
In addition, when the Save button is pressed, I may get the code to redirect to either the revision summary table or to view the page just saved (rather than the current revision).
Watch this space.
Rik
Comment #13
rhouse commentedOops, found some bugs...
Sorry! Ron.
Comment #14
rdeboerDon't be sorry Ron -- that's what we need.
Better find them now than later.
point 1) I can reproduce this; it's strange but kind of expected
First of all, it seems to me that you have 'administer nodes' on for the moderator role -- this gives them God-like powers and is not necessary and is the reason why you ran into this, which is that you've ended up with two publication systems working at the same time (but not necessarily in harmony).
This is what happens? The 'Publish' tickbox belongs to the old (core) system of publishing a 'node', rather than the revisioning sense of publishing a revision. So when you published the node it makes whatever the node points to (vid, formerly known as 'current') the live version. You have also created a new revision (by pressing Save), but you haven't published that one yet. Hence the confusing behaviour.
It needs some more work (maybe the Published box should disappear from the form when Revisioning is installled), but there's no error in the logic, I don't think
point 2) and 3) I cannot reproduce -- did you update Module Grants as well as Revisioning?
Thanks for the testing!
Rik
Comment #15
rhouse commented"-- did you update Module Grants as well as Revisioning?"
Oops, no. I'll try that. Thanks,
Ron.
Addendum: Updated module_grants: the blank page still persists, the Pending tab behaviour is now strange:
Guest sees correct details under I created-Pending, but sees nothing under I can access-Pending.
Moderator sees all Pending content, including Guest's, under both I created and I can access.
PS: Moderator has admin nodes because moderator is me. (This will probably be common.)
Comment #16
Anonymous (not verified) commentedHi Rik
re #10
The only feature I personally need on the Block is to elimiate those that "dont need moderation". After your previous suggestion of crteating new revisions I was still left with unpublished nodes in the block for those that Do not require moderation and do not create revisions.
The code may also need to be re-addressed when we have better control, to accomodate "Revisions Deletion" module deleting all previous revisions
The way i see the future, is that for each node we need a revision number which identifies the latest version that is approved for viewing whether it be published or not ( I think this was mentioned elsewhere)
Comment #17
rhouse commentedHi Rik,
I have fixed my bugs 2 and 3 from #13: It was necessary to clear the cache. I should have done that, but perhaps we need to highlight it somehow, as these modules seem to need it - same also for the need to keep in step with module_grants.
I am now seeing a different display, very much improved! Many thanks for all your efforts on this.
Ron.
Comment #18
rdeboer@Ron, #15,
The behaviour you get is so weird that I can't imagine midkemia and I not having experienced at least a hint of what you're seeing.
How did you do the upgrade? Did you just download the latest copies over the top of the existing? This is fine, but you MUST also visit the Site building>>Modules page as this refreshes the menu structure and other bits and pieces.
@John, #16 Re: pending revisions block:
That one we cannot do much about at the moment, as we can't tell the difference between a node with a single revision that was unpublished (of a type that requires moderation) and a node with a single revision that is not published yet (i.e. is pending).
We need the much discussed future revision status code for that.
Comment #19
rhouse commentedHi Rik,
Yes, the weird bugs have gone as from when I cleared the cache, but I had not visited the Site building>>Modules page. AFAIK, the only remaining bug is the first one from #13, but now I'll redo the test to confirm. The new tab structure is really good, IMHO.
Ron.
(Update) Confirmed, the following is the only bug I can find that remains:
Comment #20
rdeboerHi Ron,
More improvements will be going in tonight. But the first point of #13 isn't one of them -- I'm not sure whether it can be fixed easily.
If you want the behaviour you're after, as an admin (i.e. publish the latest revision), you have to Untick "New revision in draft/moderation" on the form you're editing.
Rik
Comment #21
rhouse commentedThanks Rik, that's fine. Maybe I need to snoop in the code again. :-)
Ron.
Comment #22
rhouse commentedHi again Rik,
I just downloaded your latest changes from HEAD, and I notice that the issue from #13, #19, and #20 has been fixed. I noticed you changed the title from "current, unpublished" to "archived", which is a very nice improvement, thank you! But I am danged if I can figure out how you fixed the bug! Code looks the same to me. It must be a smart change somewhere I am NOT looking.
Many thanks!
Ron.
Comment #23
rdeboer