I created an issue for this PHP5 problem with node_load and posted 5.0
and 4.7 patches that use drupal_clone():
http://drupal.org/node/86842
In response to Scott McLewin's solution:
>I encountered a similar problem when changing over to php5. I don't
>know that this was the only answer or even the best answer, but I
>changed that line to read:
>
>$node = node_load(array('nid' => $form_values['nid']));
looking at node_load, I think this will force the node to be re-loaded
from the DB (including all the hook_view and hook_nodeapi calls),
since the cached object is only returned if a numeric parameter is
passed. Thus, it may solve the problem but creates a potential
performance hit.
-Peter
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(a)ziemecki.com>
Subject: [development] Change in status
To: development(a)drupal.org
Message-ID:
<b628f4a80609301242se5a7703jc415d9db758e15dd(a)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.