"Dave Grogan" dgrogan@gmail.com wrote in message news:elpvs2$umj$1@sea.gmane.org...
Mark Clements wrote: JsoAwUIsXouq+1Nelnf3ueG/Ez6ZCGd0@public.gmane.org
On 13/12/06, Dave Grogan
wrote:
Track Changes needs ArticleSaveComplete to also pass $revisionId (id
of
the newly-saved revision) and a flag that determines whether the
content
of the article changed.
I was under the impression that the article was never saved if the
content
hasn't changed, and therefore the hook wouldn't trigger in that
situation
anyway.
No new revision is saved but the hook is run. See Article.php, lines 1285-90 and 1359-63 in v1.8.2.
Is 'ArticleSave' also run? If not, you could set a variable in ArticleSave and check for it in ArticleSaveComplete. If it _is_ run then that sounds like an error.
Also, $revisionID should be available through the article object that is already passed to the hook. If not, then that is where it should be
added,
not as an extra hook parameter.
A revisionID is available through the article object, but it is the id of the previously retrieved page, not the newly inserted one. The id of the newly-inserted page is not passed to the hook in any of the current parameters, as far as I can tell (var_dumps and some ctrl-f-ing).
So does that mean that the $article passed to the function contains an invalid state - i.e. current content but old revision ID? Or is the whole object the pre-save version of the page? To be honest, both of those sound like a mistake.
Either way, my point still stands - this should be fixed (in whatever way is appropriate) by patching the Article class, not by adding an extra hook parameter.
- Mark Clements (HappyDog)