Last modified: 2007-07-23 12:05:24 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 9595 - Add revisionId to ArticleSaveComplete hook
Add revisionId to ArticleSaveComplete hook
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Page editing (Other open bugs)
1.10.x
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
http://svn.wikimedia.org/viewvc/media...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-04-16 19:06 UTC by Christian Neubauer
Modified: 2007-07-23 12:05 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Christian Neubauer 2007-04-16 19:06:21 UTC
I use an extension on my local wiki that requires access to the revision id of
an inserted article after the article is saved.  I am requesting that it be
added to the ArticleSaveComplete hook fired in Article->doEdit().  There don't
seem to be any downsides to this unless there are issues with databases other
than mySQL that I'm unaware of.  The new hook would look something like this:

wfRunHooks( 'ArticleSaveComplete',
  array( &$this, &$wgUser, $text,
    $summary, $flags & EDIT_MINOR,
    null, null, &$flags, $revisionId )
);

Alternately, the revision object that is created in doEdit before
ArticleSaveComplete is fired could be attached to the Article object's mRevision
member variable so that an extension could call $article->mRevision->mId or
something along those lines.
Comment 1 Rob Church 2007-06-06 03:17:48 UTC
You have an Article object. Use it.
Comment 2 Christian Neubauer 2007-06-08 13:06:15 UTC
Thanks for the suggestion.  As far as I can tell, there is no point in the doEdit() function where the $article->mRevision is updated with the new revision information.  updateRevisionOn() updates the revision information in the database, but apparently does not set $article->mRevision to the new revision.  editUpdates() updates site stats and such but again doesn't appear to update $article->mRevision.

So the $article passed to the ArticleSaveComplete hook still points to the old revision.  Perhaps you are suggesting I recall $article->fetchContent() and then check the revision information?  If that's what you are recommending I will try that, but I would suggest that it would make more sense to update the mRevision member of $article before the hook is called so that the hook recipient has the most recent version of the saved $article.

If I am misunderstanding your terse, jackass-y comment please let me know.
Comment 3 Rob Church 2007-07-22 23:17:44 UTC
The new Revision is passed as the ninth argument to the ArticleSaveComplete (and ArticleInsertComplete) hook as of r24323.
Comment 4 Christian Neubauer 2007-07-23 12:05:24 UTC
Thanks.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links