Hi All, I'm pretty new to Drupal so apologies if this problem is just me not understanding something.

I'm trying to use Drupal for a basic CMS. We don't need any community features, it's purely to allow internal people to add/update pages and stories and then have them approved later my the admin.

The problem I have is that I've defined a role where a user can author & edit pages. However those pages are unpublished by default and require an admin user to approve them. That's all good but there are two problems:

  1. Once the Author/Editor has made the page, they can't see it to re-edit it until it's approved by the admin.
  2. Once the page has been approved, if the Editor/Author edits the page it is then remarked as unpublished and disappears from the site altogether until it is re-approved by the admin.

Is there any way of allowing the page to be edited but keeping the original version until the admin approves the new one?

Thanks in advance for any ideas!

Comments

bmargulies’s picture

Try turning on the create new version flag by default for pages. We think that this will allow the author to set up a new version for moderation while the old version remains visible.

PixelNurse’s picture

Thanks for the suggestion, it still does the same thing though I'm afraid. I already tried it, just tried again. It does give the useful function of allowing the admin to rollback to the previous revision, but still unpublishes the page completely, both versions.

It seems like a really basic problem with the approval system, I'm surprised more people haven't run into this. Of course it still may be me missing something. It would seem like the only way to do it would be to make a new identical copied page, but the client wouldn't find that acceptable I don't think as they'll have to publish that and unpublish the original.

PixelNurse’s picture

So basically what I really want is Admin approval on the revisions independently I guess. I want the revision system, but I don't want the creation of a revision to unpublish the original.

Can anyone suggesting anything? Or if you know it's not possible I'd really appreciate your feedback. If it's not possible then does anyone have any suggestions for a CMS that can as I'm beginning to think I'm gonna have to make my own custom CMS. :(

bmargulies’s picture

It looks pretty straightforward to fix this. The revisions blob in the node has the old moderation flags ... backing up looking for an approved revision is just going to be a loop.

I'm not a core developer here, so when I post this patch you will be taking your life in my hands.

PixelNurse’s picture

Wow! If you could do that it would be amazing. So you think that each revision does have a approved status? They are not 'child' records of a 'parent' record which contains the approval status?

[edit] I just checked the db and you're right, there's a whopping array in their with the previous revisions and all the relevant fields[/edit]

My only problem is that I'm on a pretty tight deadline to get the CMS chosen. To be honest I've been pretty dismayed by the lack of this simple feature in pretty much all of the CMS' I've tried. And over the last 3 days I've tried about 20 of them, seriously. I like Drupal, so if I CAN stay with it then that's the number 1 choice.

PixelNurse’s picture

http://drupal.org/node/7582

Seems to be a patch to use a separate table for revisions (which makes a lot of sense IMHO), but I have trouble following where it ended up. It seems to suggest it had been implemented?

Could anyone point me in the direction of which file/s pulls out the static pages? And whether this patch could help simplify the process of pulling out the last approved revision?

rjung’s picture

1. Once the Author/Editor has made the page, they can't see it to re-edit it until it's approved by the admin.

One possibility is to create a page that lists all the nodes on your site (like a listing), whether published or not. Your authors can go to that listing page, find their unpublished material, then navigate to the desired page and edit as usual. Requires a little PHP code, but nothing too difficult IMO.

Once the page has been approved, if the Editor/Author edits the page it is then remarked as unpublished and disappears from the site altogether until it is re-approved by the admin.

This seems odd to me; if the administrator marked the page as "published" after reviewing it, doesn't that status remain if the author re-edits the page at a later time?

--R.J.
http://www.electric-escape.net/

--R.J.

PixelNurse’s picture

Hmm... Firstly thanks for your reply! I was beginning to get quite despondent.

Well your first point is a definite possibility that could get around problem 1.

The second problem is caused by the "Author" user having their role set to having to have their content approved, it seems to apply whether creating or editing.

rjung’s picture

The second problem is caused by the "Author" user having their role set to having to have their content approved, it seems to apply whether creating or editing.

Well, I don't have a test bed to test this out on, but if you're feeling gutsy enough to try a suggestion from a stranger on da intarnet... ;-)

1. Crack open your copy of node.module

2. Look for a part of the code that looks something like this:

// Force defaults in case people modify the form:
$node_options = variable_get('node_options_'. $node->type, array('status', 'promote'));
$node->status = in_array('status', $node_options);
$node->moderate = in_array('moderate', $node_options);
$node->promote = in_array('promote', $node_options);
$node->sticky = in_array('sticky', $node_options);

3. Comment out/disable the line that sets $node->status

If my guess is correct, this will preserve the node's published/unpublished status when a non-administrator edits it.

I don't know if this will work (though I think it will), and I don't know if it will cause problems elsewhere in the system, but if you're feeling daring enough, give it a shot -- worst comes to worst, just re-enable the line, and try another approach.

Let me know if this works!

--R.J.
http://www.electric-escape.net/

--R.J.

PixelNurse’s picture

Hey,

Thanks for the tip. Seems to stop the status being changed, which is a good thing, although it doesn't really solve the problem. Ideally I want the status to change ad for the site to pull out the last approved revision.

It's good to have options though, so now at least I know I can make it default to either way around.

PixelNurse’s picture

Just tried the latest beta, this problem is still the case. Worse still is that now they've moved the revisions to their own table (a good idea), they no longer have any 'status' value!!!

So a potential hack to fix this that could work in 4.6 will get broken by 4.7. C'mon guys, I understand the quest for efficiency, but would including one more Int(4) field in the revisions table really hurt?

To explain the problem again in case anyone didn't get me... An author/editor can add a page, have it approved by the admin and published, and then come back and do one of only two things depending on your settings.

1. Edit their page again and have it go live without ANY admin moderation.
2. Edit their page again and cause it to disappear from the site altogether until the admin gets around to re-approving it.

Can this really be called content management? Surely the whole point of revisions is to enable solutions to these kind of problems?

sepeck’s picture

Revisions behavior is a complex beast. You want to take a look at this patch http://drupal.org/node/38451 which needs some attention and work.

There are several reasons that the revisions stuff was changed and performance was one factor (a big factor) but from the very very long discussion it was significant.

The behavior you describe is the behavior that currently exists and has existed for some years. No one has seen fit to work on changing this behavior until recently and not many seem interested in working on testing it.

When phrasing your sentences consider, will such challanging phrases generate a response you want or desire?

The patch mentioned in http://drupal.org/node/7582 was commited to the CVS branch that will become 4.7 and was live through two released versions of Drupal. It was a complex issue that was finally resolved to a lot of peoples benefit.

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

bmargulies’s picture

Mr. Peck,

I think that drupal here is a victim of its own popularity. Some of us want to do something new and interesting: make the moderation system, which was pretty clearly designed for comments (see queue.module) work well for pages.

No one is criticizing the design decision to move revisions to a table, only asking that moderation be accounted for in that table.

-benson margulies

sepeck’s picture

That wasn't what I was refering to. Perhaps you may wish to reread my post in consideration with the previous before you decide to randomly cast judgement and ignore the provided links.

If you will actually follow my link provided it does in fact go to a patch that I beleive acheives the desired result. Edited nodes that are not unpublished and still exist in the revisions table.

Here is the relavant link again. http://drupal.org/node/38451

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

bmargulies’s picture

Indeed, both behaviors are desirable: the ability to 'delegate' a node to a user and let them edit it, and the desire to force remoderation of each new version.

I created http://drupal.org/node/50630 as an issue to more formally request this functionality.

PixelNurse’s picture

While I appreciate your reply I think you've rather misunderstood my sentiment. I understand that when someone criticises an element of something you are passionate about it is easy to take offence, however it wasn't my intention to attack Drupal.

Drupal is of course a very capable piece of software that no doubt serves many people well. However from my experience of it so far it is a community portal engine and not a traditional CMS suitable for corporate or enterprise purposes. If you read my posts again you'll see that I don't just reserve this criticism for Drupal, but for many of the popular CMS' out there. I can't overstate how surprised all the people I've talked to about this problem are when I tell them that neither Drupal nor Joomla are capable of handling this task.

My 'challenging' phrases were designed to illicit a response in a thread that was dying, which they did. I'm not trying to troll or to insult, purely trying to make it clear for the good of the project that this is something that Drupal could address that would put it in a different league. It's going to be too late for me even if a patch that works does turn up in the next week. However I'm sure (especially now revisions are in their own table) that it wouldn't be too hard to add this capability, and it would make Drupal useful to a whole new category of people for whom it is currently not applicable.

For the sake of future searchers I am now looking at Bricolage, or making my own system.

sepeck’s picture

I was merely suggesting that your phrasing can influence your responses. I was watching the thread and spending time on looking for the existing patch that would address your issue. I almost stopped and didn't bother continuing when I saw the sarcasm. Your thread was not dying, there just weren't a lot of people that could have answered it.

So, is the unpublishing behavior potentially undesired? Yes. Is there some patches to address this in existence? Yes. Is there a lot of attention on it? Not really and I've been distracted the last few weeks with illiness and work to follow up on it.

Happy hunting.

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

PixelNurse’s picture

I don't want to get into an argument about etiquette but I would just like to state for the record that I haven't been in the least sarcastic. I really don't know what you're talking about when you write that. Sarcasm is saying one thing when you mean the opposite.

they've moved the revisions to their own table (a good idea)

If you mean that, I was being genuine, it's a good idea for revisions to have their own table. I actually find it puzzling that they were ever kept in the node table in the first place.

Agreed I was 'challenging' in it's literal sense, asking the question 'would it hurt to add that field?' as a sincere question/request.

Without meaning to be disrespectful I think you should try and give people a little benefit of the doubt. Still I'm grateful for your assistance in this matter, although I couldn't seem to get any of the patches so far produced to work, although that is no doubt my own stupid fault.

Kieg Khan’s picture

I know this is a pretty old post, but it would seem strange that a person would "make my own system" when they are on a tight timeline. Either the person did not even try the patch at http://drupal.org/node/48731 or they were not really serious. Unfortunately the patch has not been committed to core yet (as far as I know), so I need to apply it every time I upgrade, and then test it to make sure it still works, but this patch actually decided me on using Drupal over the other systems.

The Draft Revision patch would not appear to have any impact on the traditional use of Drupal but adds the significant functionality of a drafting system that many people have expressed an interest in.

The code is written, it seems very straight forward, so why it cannot be incorporated is pretty surprising given that mostly Drupal development seems very helpful and innovative.

For a 10 minute patch, I find it hard to imagine that PixelNurse would dismiss Drupal given the indication that it satisfied all other needs.

Thanks.

chud’s picture

These are the same features I need in order to make Drupal a viable solution. My objective is also to use Drupal as a basic CMS without the community aspect. I have spent several days reading documentation and doing small proof of concept exercises, but unfortunately this inability to keep an unpublished draft copy of a node could cause a make or break situation for me.

PixelNurse- I'd be interested to find out how you end up solving your problem, and if you end up going with an alternative CMS please let me know which one you choose.

PixelNurse’s picture

For the sake of future googlers this problem with workflow in Drupal has been known about for a long time but it would seem that the focus of Drupal doesn't extend to traditional business CMS type functionality. This comment was made to the revisions table discussions way back in November 2004... http://drupal.org/node/7582#comment-15693

It's exactly the problem we're talking about. I can find quite a few similar posts after trawling for days through the archives so I don't think it'll be addressed anytime soon if it hasn't been by now.

Of course if this functionality ever does come to Drupal and I hear of it I'll update this thread accordingly. *Sigh* looks like I'm gonna have to give up my weekend to writing my own CMS. Oh well, lesson learned.

bmargulies’s picture

On the one hand, I'm not sure that I have the same interpretation of that comment that PixelNurse derived. Certainly, someone didn't want to tackle this issue while in the middle of something else.

On the other hand, the more I think about this feature, the more uncertain I become. Pages aren't isolated items, and changes to them don't necessarily stage naturally one-at-a-time. What we are really all looking for here is to give a user the ability to tee up an arbitrarily complex set of changes and have it held for review.

The nice thing about 'stories' and other things organized more by taxonomy is that they are generally more isolated.

Well, guys, I don't to see that level of complexity spring into existence in any particular hurry. I think that the current behavior of Drupal is counter-intuitive, but making this point fix will only enable us all to step in ever-deeper pools of, well, you-know-what.

I may still code the 4.6.x patch and try it out, but I am more inclined to set up a more labor-intensive process — setting up a second site where authors can create and modify their pages, and then copy the contents to the live site when checked by moderators.

PixelNurse’s picture

I certainly appreciate why the feature wasn't integrated in that particular patch, but I'm surprised that given how long ago it seems this problem was highlighted that it still hasn't been addressed, and it therefore seems as if the importance of this feature isn't recognised within the Drupal community. I really do feel it would be of benefit to Drupal as I'm convinced that many many potential users must have written off Drupal because of this.

All that is really required is one change to wherever pulls out the page in the front end. If the page isn't published and the revisions field isn't NULL, then loop back though the revisions array until a revision with an approved status is found. Then pull that out instead. I guess it would be nice if you could add a checkbox in the admin to say 'display previously published revisions', but for my purposes that wouldn't be essential.

I did try to do it myself, but I just couldn't find where to begin adding that hack. It turned into a game of follow-the-function which never seemed to end. If anyone could point me at the right bit of code I could give it another go.

For other people looking for a solution the main CMS' that seem to have this functionality are: Bricolage, Midgard, Plone and Lenya. I'm about to try Midgard (once it's downloaded), but Bricolage, Lenya and Plone are al either very unfriendly, or require a far more complex setup than Drupal.

If Drupal could add this it would be the easiest and most user friendly CMS to have this feature and would open up a whole new market.

calebgilbert’s picture

You know I've read this thread and the gazillion connected to the issues being discussed and I've got to say it reflects as poorly on Drupal as anything I've seen. And I've seen some pretty poorly-reflected stuff.

-1 on Drupal at this point for its after-launch support and getting/responding to feeback from it's user base. (a subject much bigger than this thread, of course)

=====
Bloggyland.com
Hosting for pre-tuned/pre-configured Drupal installations
No set-up time, instant fully-functioning site with many extra modules
Drupal specific support, SSH/FTP/cPanel

gatman’s picture

We have just come across the exact same requirement for use of this CMS - using 4.7.4

The "Story" author publishes and it goes on to be reviewed / moderation, but moments later they notice some typos or whatever and need to edit the content and re-submit for review and moderation.

Errors and over sites by the author are very typical and a frequent occurrence.

I have cross checked the links, but it doesn't seem clear if this is now a built-in capability, a stable patch exists or any success has been a result of an awkward hack process, or a module add-on resolves this.

If there is a method to this, perhaps somebody can make this clear.

Many Thanks
John

Pancho’s picture

See the Revision moderation module (http://drupal.org/project/revision_moderation) which resolves exactly this issue. Unfortunately it is only available for Drupal 4.7 right now, but as I need it for Drupal 5 I will try to convert it asap.