#7415 Creating a new page or importing a media file in wiki generates errors
Closed: Fixed 4 years ago Opened 4 years ago by renault.

In Fedora wiki, creating a new page or uploading a file generates this error:

[XAFnak7lFe2pp7j4U6UzJgAAAEQ] /w/index.php?title=Capitole_du_Libre_2018&action=submit ArgumentCountError from line 197 of /usr/share/mediawiki/extensions/fedmsg-emit.php: Too few arguments to function article_save(), 11 passed in /usr/share/mediawiki/includes/Hooks.php on line 186 and exactly 12 expected


#0 /usr/share/mediawiki/includes/Hooks.php(186): article_save(WikiPage, User, WikitextContent, string, integer, NULL, NULL, integer, Revision, Status, boolean)
#1 /usr/share/mediawiki/includes/page/WikiPage.php(1922): Hooks::run(string, array)
#2 [internal function]: WikiPage->{closure}(Wikimedia\Rdbms\DatabaseMysqli, string)
#3 /usr/share/mediawiki/includes/libs/rdbms/database/Database.php(2693): call_user_func_array(Closure, array)
#4 /usr/share/mediawiki/includes/deferred/AtomicSectionUpdate.php(35): Wikimedia\Rdbms\Database->doAtomicSection(string, Closure)
#5 /usr/share/mediawiki/includes/deferred/DeferredUpdates.php(257): AtomicSectionUpdate->doUpdate()
#6 /usr/share/mediawiki/includes/deferred/DeferredUpdates.php(210): DeferredUpdates::runUpdate(AtomicSectionUpdate, Wikimedia\Rdbms\LBFactorySimple, string, integer)
#7 /usr/share/mediawiki/includes/deferred/DeferredUpdates.php(127): DeferredUpdates::execute(array, string, integer)
#8 /usr/share/mediawiki/includes/MediaWiki.php(603): DeferredUpdates::doUpdates(string, integer)
#9 /usr/share/mediawiki/includes/MediaWiki.php(572): MediaWiki::preOutputCommit(RequestContext, Closure)
#10 /usr/share/mediawiki/includes/MediaWiki.php(879): MediaWiki->doPreOutputCommit(Closure)
#11 /usr/share/mediawiki/includes/MediaWiki.php(523): MediaWiki->main()
#12 /usr/share/mediawiki/index.php(43): MediaWiki->run()
#13 {main}

Of course, it should not be the case. But even with this error, the page and the media exists. So the operation works fine, this message is just disturbing for the user because the status of the action is not clear.

Indeed, I just noticed this too, and (combined with a minor flow control issue in wikitcms) it actually caused the 'current' redirect pages for release validation events not to get created :/

So it looks like @puiterwijk may have tried to fix this already, but if that was intended to fix exactly this problem (and not something similar but different), it wouldn't work, because the function still expects 12 arguments, and mediawiki is still only passing it 11.

I found something odd, digging into this upstream: the release we're running, 1.29.3, is actually inconsistent with this hook. One place where the PageContentSaveComplete hook is called passes it 12 args, including undidRevId. The other place where the same hook is called only passes it 11 args, not including undidRevId.

This was changed upstream in 1.30, so 1.30+ consistently pass 12 args. I guess we should either backport that patch to our deployment, or set a default value for $undidRevId in our plugin.

This commit should fix this, once the relevant play is run. I'd file a bug upstream too, but 1.29 is no longer a supported branch, and the bug doesn't appear in the supported 1.27 (both calls pass 11 args) or 1.30 or 1.31 (both calls pass 12 args) branches.

This seems to be fixed to me.

Metadata Update from @kevin:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

4 years ago

Login to comment on this ticket.