A deprecation warning now shows up on master when referencing an item using wikitext on the client.
Steps to reproduce:
- Setup repo/client (followed this guide)
- Create an item on repo
- Reference the item on client with something like this
{{#statements:P1|from=Q1}}
The deprecation warning shows up as
Deprecated: Deprecated cross-wiki access to MediaWiki\Revision\RevisionRecord. Expected: the local wiki, Actual: 'default'. Pass expected $wikiId. [Called from MediaWiki\Revision\RevisionRecord::getId in /var/www/mediawiki/includes/Revision/RevisionRecord.php at line 286] in /var/www/mediawiki/includes/debug/MWDebug.php on line 376
Seems to stem from a change in core https://gerrit.wikimedia.org/r/c/mediawiki/core/+/666519 and after some discussion yesterday and @hoo had a chat with @daniel
[17:25:23] <hoo> So, we were just looking into https://gerrit.wikimedia.org/r/c/mediawiki/core/+/666519/21/includes/Revision/RevisionRecord.php#114 [17:27:02] <duesen> did it call any problems? [17:27:09] <hoo> So Wikibase is tripping these off, by calling RevisionStore::getRevisionById [17:27:28] <hoo> AFAICT we have the wiki ids set correctly throughout [17:28:19] <duesen> Are you passing Title objects? If yes, that would be the issue. Title is always local. You need to use a PageIdentityValue instead. [17:28:40] <hoo> We don't, but something in core is creating titles here [17:28:56] <hoo> I had the snippet handy… one sec [17:29:31] <hoo> RevisionStore::newRevisionFromRowAndSlots has $page = $this->getTitle( $pageId, $revId, $queryFlags ); [17:30:33] <hoo> So that will never work for non-local wikis (if it's not supposed to, I guess we should warn right there) [17:30:50] <duesen> Ok, let me have a look. [17:33:18] <duesen> The simple solution is to pass a PageIdentity yourself, instead of relying on the default. [17:33:33] <hoo> I guess RevisionStore should be creating PageIdentityValue instead of Title // TODO: WikiPageEntityMetaDataLookup should use RevisionStore::getQueryInfo, [17:33:33] <hoo> // then we could use RevisionStore::newRevisionFromRow here! [17:33:41] <duesen> But you are right that falling back to getTitle() isn't working correctly. [17:33:58] <hoo> That's from Wikibase [17:34:13] <hoo> so doing it right(tm) there will be a bit more involved [17:34:30] <hoo> Or we allow passing a page to getRevisionById [17:36:09] <duesen> hm yea, that would actually be kind of nice [17:36:30] <duesen> I'll poke around a bit, I'll have a patch up in half an hour or so I hope. [17:36:37] <duesen> will ping you then [17:36:46] <hoo> Cool, thanks :) [18:22:13] <duesen> Making progress, writing tests now [19:02:38] <duesen> hoo: i'm running into trouble with how the tests are written. Nearly there... [19:15:11] <duesen> hoo: I made two patches, one allowing a page to be passed to getRevisionById, and one that makes getRevisionById work correctly cross-wiki even when no page is provided. [19:15:14] <duesen> https://gerrit.wikimedia.org/r/c/mediawiki/core/+/672499/1 [19:15:24] <duesen> https://gerrit.wikimedia.org/r/c/mediawiki/core/+/672462/1 [19:16:22] <duesen> I see odd test failures. Will deal with them in a bit