Closed (fixed)
Project:
Content moderation
Version:
6.x-1.4
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Apr 2010 at 14:16 UTC
Updated:
27 Sep 2010 at 09:40 UTC
This is a patch for hideing the revision messages (ex. This document has 1 pending revision) for Anonymous users.
There is a new permission called view content moderation messages that you need to have to se these messages on the nodes.
| Comment | File | Size | Author |
|---|---|---|---|
| conten_moderation_view_messages.patch | 2.68 KB | freakalis |
Comments
Comment #1
broonThank you for this, freakalis. A way more simple approach had been included in my patch (http://drupal.org/node/683336#comment-2789834) where these messages were only shown for the super admin user. Since this has been only a quick and dirty hack your patch does it the right way by creating a new permission.
Originally, I was just trying to hide it because it gets annoying when displaying a view with several node having a pending revision (then there is a message for EACH node with revisions pending). Maybe you even have a simple idea how to hide messages in views while you are on it? ;)
Nonetheless, I'm pretty sure this will find its way into the next release.
Regards,
Paul
Comment #2
eugenmayer commentedWell while iam not totaly fine with the appraoch sin.star took with hiding them for all user except the admin, iam fine with the permission approach.
E.g. for my use case it is very important to know, that there are pending revisions.
I guess you should be fine with that also, or sin.star, as we can cover your usecase also?
I do not include all messages with the permissions,
should be shown in any way (when you look on some not live revision).
The issue with views has been fixed by me already (not released)
the code looks that way now
So we have 2 permissions now
- 'view content moderation message pending'
- 'view content moderation message created by'
So you both are free to hide every message you dont like :)
Thanks for the contribution!
Comment #3
broonif(arg(0) == 'node' && is_numeric(arg(1))) {
Where did you put this if statement for views exclusion? Around the whole following block in your post, I assume?
I've changed/added the code on github.
Comment #4
eugenmayer commentedComment #5
eugenmayer commentedcurrent code in http://github.com/EugenMayer/content_moderation/tree/rewrite
Comment #6
eugenmayer commentedComment #7
devkinetic commentedUsing the latest release 6.x-1.4 (May 1 2010) I am still seeing these messages appearing to anonymous users.
Example: http://visioncore.cpunderconstruction.com/partners
I double checked and ensured that anonymous users had none of the content moderation module permissions.
Comment #8
devkinetic commentedThis is a hack but adding the following to your stylesheet will calm your clients down at least.
body.not-logged-in .warning{display:none;}Comment #9
eugenmayer commentedI will look into that, no its rather a bug.
Comment #10
devkinetic commentedThis looks to be fairly simple to fix... looking at hook_nodeapi () in case 'view' there is no permissions check for 2 of the 3 drupal_set_message(). The only one with permissions integration is the author info message.
I'm leaving for the day so I don't have time to touch on this.. anyone feel up to writing 2 if statements? :)
BUT i think the larger issue at hand is that anonymous users can see content that is not set to live!
Comment #11
eugenmayer commentedthat anons should not see "not live" version should be also an option, this is not the case for all use cases ( it is for mine e.g. )
We should try to make this all configureable so this module fits into several cases.
Comment #12
devkinetic commentedSince we are getting off-topic with this, I give you #861380
Comment #13
devkinetic commentedSee this patch for an all-in one fix http://drupal.org/node/861380#comment-3235962
Comment #14
eugenmayer commentedEventhough it was not a bug, i fixed it introducing a new permision. Devkinetic was totaly reight, only 2 of 3 had permission checks. We have no 3 permisisons:
'view content moderation message created by' -> thats the author message
'view content moderation message pending' -> thats the message that a live version has also pending revisions
'view content moderation message no live yet' -> thats actually the missing one, hiding the "no approved version" message
Iam not applying the patch of 861380 due to the named reasons. Hopefuly we will find a better solution there, so we can add this interesting functionality also