[development] Change in status

Dan Ziemecki dan at ziemecki.com
Sun Oct 1 00:32:19 UTC 2006


Not sure what Moshe intended, but I added a "value" form element to all
nodes called "_currentstatus" storing the $node->status.  Then, I compare it
to the nodeapi $node->status on update/submit, and 0 changing to 1
represents a new publish.

Yes, it's quite "hack-ish" but it works well enough.  An argument could be
made to store this state change information in the default node, but I guess
that'll happen when enough people want it.

-- 
Dan Ziemecki
Philosopher. Curmudgeon. Nerd.


On 9/30/06, Peter Wolanin <pwolanin at gmail.com> wrote:
>
> With the caveat that you may have problems under PHP5 (see my previous
> message), one possible way to check this would be to call node_load in
> your hook_nodeapi to get the cached node object that would have the
> pre-edit value for publication status.
>
> However, this (and most possible solutions) are a little hackish.
> I'm not sure I know exactly what Moshe has in mind.  For an example
> where the moderation status is preserved via the hook_nodeapi
> implementation see this module of mine:
>
> http://drupal.org/project/content_moderator
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20061001/41d60592/attachment.htm


More information about the development mailing list