Closed (fixed)
Project:
modr8
Version:
5.x-2.2
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
6 Jan 2007 at 09:47 UTC
Updated:
30 Aug 2007 at 03:04 UTC
Jump to comment: Most recent file
I have ported arthurf's patch to 5.x.
Since the original patch is in "needs review" I have also marked this patch this way although it seems to work fine.
This also updates the block query to show unpublished posts in the moderation queue block.
| Comment | File | Size | Author |
|---|---|---|---|
| #25 | handle_unpub.patch | 6.33 KB | pwolanin |
| #22 | modr8_administer_nodes.patch | 4.31 KB | David Lesieur |
| #9 | obey_status_1.diff | 1.27 KB | pwolanin |
| #4 | publish.patch_0.txt | 1.28 KB | robin t |
| publish.patch.txt | 2.33 KB | robin t |
Comments
Comment #1
pwolanin commentedI'm a little ambivalent about this, since not displaying unpublished nodes to moderators could also be considered a security issue. Currently, those with just the moderator permission cannot actually view the full node if it is unpublished, right.
Comment #2
robin t commentedOK, I get your drift. I think the fine grained security approach in drupal gets in the way of the intention here.
I assume that moderators also have the power to publish stuff (and therefore should be able to see unpublished stuff). Otherwise the workflow get overly complex (besides, what do you call the poor fellow who has to publish already moderated OK'ed stuff?)
There are a lot of other possible permission settings that doesen't make sense either.
Consider the other workflow.
If moderators could see only published stuff, the default content creation would have published set as default. In that case everyone can see the content on the main page and linked stuff (because the moderate flag is not an access control). Moderation looses its value because the content is already "set free". It's possible that the core functionality needs update to check the moderate flag, but currently this is not done.
Thoughts? (And please forgive me if my assumptions are way off - I'm about 2 days into drupal code)
Comment #3
pwolanin commentedIn the 5.x version of Modr8, it implements hook_db_rewrite_sql() so posts in moderation will NOT show up on the front page, etc unless you're a moderator or the author of the post. Try it out. It's not really access control (anyone can still navigate to it if they know the URL), but rather exclusion from listing.
In Drupal 4.7 the question of whether or not to display a post in moderation was implemented in core and varied by module, so setting to unpublished was more sensible.
Comment #4
robin t commentedSorry, I thought I tried this already. I may have confused myself during testing it (you need quite many user combinations to get into all corners ;-)
The new patch is down to the raw port.
Is there a reason why the core disregards the moderate flag? The field is there from the basic install.
Comment #5
robin t commentedOn second thought, I would actually stand by my first attempt.
Here goes why:
1) If you create content with published set by default, you would not need this patch (*poof* - I do not exist).
2) Thus, content is created with published unset.
3) The user with moderate powers can already see unpublished content in "moderated content".
4) The "Moderation Queue" block must not show unpublished sufff to non moderators.
5) From 4 and 2 follows that the block is always empty for non moderators.
6) Thus, the block is only interesting for moderators, so the visibility should be limited to a moderator role.
7) Thus, the block could show unpublished stuff anyway (as in 3)
My point is that the block is only for moderators and they need to se the unpublished stuff.
I get the feeling that the main issue here is my brainless port from 4.x to 5.x where the basic function is different.
The question is how we want the functionality of the block in 5.x.
If content is supposed to be created published, then 1) applies, and I will drop this issue.
This implies that everyone with the block visible can see the unmoderated contents.
Otherwise, if content is created unpublished, the block is for moderators only and shows the unpublished stuff also.
Does my reasoning make any sense or do I still not understand the workflow?
Comment #6
pwolanin commentedI think in 4.7, it was sort of left-over from 4.5 or 4.6 where there was some other moderation core in code.
so in 4.7, the various core modules handle moderation inconsistently. The powers that be decided in 5.x to leave the column in the table, but remove all other moderation-related code from core.
As far as your other comment, if you look at the SQL unpublished nodes will not even show up in the queue (right?). Again, since only users will 'administer node' permission can view unpublished content, I think that if you really think this is important, then the block and other form code need to special case users with 'administer nodes'.
Comment #7
robin t commentedUsers with 'moderate content' and not 'administer node' can see unpublished stuff on the moderate page (admin/content/modr8)!
The query is "SELECT nid FROM {node} n WHERE moderate = 1 ORDER BY created DESC".
This is probably why I am confused about all this ;-)
Is that unwanted?
Comment #8
pwolanin commenteddoh! You're right- the queries don't match up in the block and the administration page.
I must have missed that in the 4.7 -> 5.0 upgrade. In the upgrade I added db_rewrite_sql() so that this module would respect access control.
Comment #9
pwolanin commentedOk, attached patch is a first step to at least make these queries consistent. I'll commit as soon as I test ti.
After that, you could add a patch for the admin setting and setting status, and for splitting out the queries so that those with 'administer nodes' will see unpublished nodes in the block/queue.
Comment #10
robin t commentedSo, to sum it up.
Content should be created published (because moderate access control works in all the places).
This patch can be committed to /dev/null (because of #1 in post 5).
Comment #11
robin t commentedOK, I might have been too fast to change the issue status.
Your patch 'obey_status_1.diff' looks a bit weird. The patch is for file modr8.module but contents looks like something destined for modr8_admin.inc.
Are you on the 5.x branch?
Comment #12
pwolanin commentedsetting back to active (so I can see it)
Yes I'm on the DRUPAL-5 branch- the query is done in .module and then passed to a function in the .inc file.
Note also a missing
;in the patch- a working version will be in CVS in 500 ms.Comment #13
robin t commentedHmm, changed status back again to be able to find it again...
Comment #14
pwolanin commentedYour idea may be valuable if your site has a complex workflow (e.g. you're using some other module to set the content to be published on a certain date.) Otherwise, the 5.x version of modr8 itself *should* be doing a good enough job of hiding the content, so you can set your to be published by default.
Comment #15
robin t commentedCVS HEAD looks correct and also works fine.
If you're happy with this, I'll close this issue.
Comment #16
dami commentedSorry to be late in this discussion, but I still think this whole 'node-needs-to-be-published-to-be-moderated-but-still-viewable-if-you-know-theURL' setup is quite confusing. It took me quite a while to realize this, while I think a more natual (at least to me) way is nodes-only-get-published-after-approval. I even almost submitted a bug report when I found a node is still viewable while in moderation, until I saw this line on the project page:"This is NOT an access control module..."
I agree with pwolanin's comment that moderators being able to view unpublished nodes may be an security(un-wanted access) problem. But I think we need a better solution than the current one. My initial suggesion of the workflow setup is:
1) node set to unpublished by default
2) a user writes a post then he/she could decide whether save a draft (simple save) or submit to moderation queue
3) only nodes submitted to mod queue are viewable to moderators
4) When a node is approved, it gets published, then can be viewed publicly
5) If a post is rejected, moderator could either delete it directly (this permission should be configurable by admin), or simply mark the node as 'rejected' but not deleted, so the author could refine and re-submit.
Forgive me if it's off-topic or any of the above functions are already available in HEAD, it's all based on a 4.7 version I tried out a few weeks ago
Thanks!
Comment #17
pwolanin commentedIn 4.7 the restrictions on listing moderated nodes all falls to core or each contrib code (though I suppose I could backport the hook_db_rewrite_sql()). Please try out the 5.x version - I've been adding lots more features than the 4.7.x.
I'm also open to the idea of adding a "publish when approved" option for the 4.7.x version (but not the 5.x, as per above).
Comment #18
dami commentedthanks for the quick reply, I am cheking out HEAD and will report back.
Comment #19
pwolanin commentedActually, thinking about this more, the most logical solution for the 5.x version might be to show unpublished nodes in the queue if the user has "administer nodes" permission, and then make it so that approval can publish in both 4.7.x and 5.x.
Note that since in 5.x only users with "administer nodes" would see the unpublished items in the queue, users with only the "moderate content" permission will still not be able to publish unpublished nodes (by design).
Comment #20
wim leers+1 for dami's point of view
I do not see the draft status as a requirement though: one could simply expect that his users would make drafts in a simple text editor (Notepad/Textedit/gedit). But of course, this would make the modr8 module a more complete module IMO. Although it's quite some more work as well, since another table would be required to mark a node being in the "draft" state. Alternatively, we could alter the node table, but that might be against the Drupal module policy?
For now I'll keep set my nodes to published by default, the site isn't live yet anyways.
Comment #21
pwolanin commenteduntil I get around to implementing #19.
Comment #22
David Lesieur commentedWould this be satisfying?
With this patch, users with the 'administer nodes' permission can see unpublished nodes in the moderation queue, and approving a node publishes it. The behavior remains unchanged for users without the 'administer nodes' permission.
Comment #23
pwolanin commentedThat sounds like the right behavior - I'll have to check the patch code.
Comment #24
pwolanin commentedpatch code looks good, except $is_published and $publish should be assigned a default value of ''
Comment #25
pwolanin commentedcommitted attached patch. Thanks David.- there will be a 5.x-2.3 release soon with this added
Comment #26
(not verified) commented