Page MenuHomePhabricator

mw.wikibase.getReferencedEntityId() fails
Open, Needs TriagePublic

Description

Sometimes mw.wikibase.getReferencedEntityId() calls unexpectedly fail. For instance, a single

mw.wikibase.getReferencedEntityId( 'Q637739', 'P31', { 'Q7397', 'Q2095', 'Q55488' } )

call gives the German result

Lua-Fehler: Zu viele Aufrufe von „mw.wikibase.getReferencedEntityId“, nur bis zu 3 sind erlaubt.

(Too many mw.wikibase.getReferencedEntityId calls. Only three are allowed.)

I do not know what happened because it is only a single call, and there are only three P31 values. What can be done to prevent or to catch this error message?

This function restriction is not documented in the Wikibase documentation at https://www.mediawiki.org/wiki/Extension:Wikibase_Client/Lua.

Event Timeline

Missing Lua documentation is a big problem, see T225497, too.

This is possibly related to stashed edits, we might need to reset the limit on parser init, but that needs to be tested.

Addshore subscribed.

Leaving to be prioritized in the product column

@RolandUnger Do you have an example page that this is happening on?
That will help us figure out exactly what is going on here.

This might be related to T354647, so I'm adding that as a subtask.

I took a really quick look at this to try and at least describe / make it possible to replicate the issue. I believe it's simply related to calling (or rather loading?) this function (independent of the parameters) >3 times.

I tried to knock together a very simple reproduction on test wikidata. See https://test.wikidata.org/wiki/Wikidata:T226925 (vs https://test.wikidata.org/w/index.php?title=Wikidata:T226925&oldid=685688) and the module it invokes https://test.wikidata.org/wiki/Module:T226925-failure / https://test.wikidata.org/wiki/Module:T226925-success.