re: [development] Change in status
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 --------------------------- Date: Sat, 30 Sep 2006 15:42:00 -0400 From: "Dan Ziemecki" <dan@ziemecki.com> Subject: [development] Change in status To: development@drupal.org Message-ID: <b628f4a80609301242se5a7703jc415d9db758e15dd@mail.gmail.com> When a node is submitted, it's current status is sent, but not it's previous status. As such, I can not perform actions on newly published nodes, since I can't tell if it's state has changed. Am I correct in my understanding, or is there a hook I'm missing. Thanks, -- Dan Ziemecki Philosopher. Curmudgeon. Nerd.
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@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:
participants (2)
-
Dan Ziemecki -
Peter Wolanin