[drupal-devel] Users self-publishing their content
Todd Grimason
todd at slack.net
Wed Aug 17 22:01:45 UTC 2005
Hi all-
I asked about this on the support list first and have been looking into
it, and wanted to see if you all could confirm my conclusions:
I'm running a site(s) which is largely a group weblog (also some
"stories"). The authors are trusted to not post nonsense or
inappropriate material, but not trusted enough (mostly technically) to
have full "admin nodes" privs where they can access each others' work.
What they (undestandably IMO) want is the ability to save drafts, i.e.
works in progress they don't yet want to publish.
With the unmodified core Drupal codebase, I can have the default
workflow be "publish" or not. And that works. They get once chance
to write it, polish over and over, and hit "submit" -- it's published.
Or I set the default to "not published", and they submit it, and then
have no way to publish it and I (or another admin) has to publish it.
So clearly (right?) I need to find another way to do this, it's not
"out-of-the-box-able". A long while ago I tried using workflow.module to
accomplish this, and had some issues I can't recall. So I hacked the
hell out of a bunch of files, made a mess, and got what I wanted. But
not in a resuable way.
So this time I've tried to create a clean add-on module, using nodeapi
hooks, and it *almost* works cleanly. I can easily get the 'Published'
checkbox to appear correctly when the author has the appropriate
permissions (in my lil' module), *but* node.module#validate resets the
node->status flag on every form interaction.
So at this point I stuck in:
// "publish my content" is a priv defined in my module
if (!user_access("publish my content")) {
$node->status = in_array('status', $node_options);
}
around line 1238 or so in node.module, 4.6.2.
Finally, my question: is there any way to do this cleanly -- without
modifying core Drupal code? (as currently publishing appears to be an
all-or-nothing situation).
thanks in advance!
===
PS: my understanding is workflow.module is in flux right now, with
issues with revisions. So I'd guess it won't be ready until post-4.7,
but of course I need this sooner - like a week or two.
--
________________________________
toddgrimason*todd[ at ]slack.net
More information about the drupal-devel
mailing list