Page MenuHomePhabricator

EntityChange must not use BasicEntityIdParser
Open, MediumPublic

Description

Currently, EntityChange::getEntityId() is implemented based on BasicEntityIdParser. This will not work for custom entity types.

The serialized representation of the EntityId would either need to contain the class name (e.g. by using native php serialization for this), or getEntityId() needs to have access to the correct (!) EntityIdParser somehow. Or we remove getEntityId(), or make it return a string.

Event Timeline

daniel triaged this task as Medium priority.Feb 9 2017, 12:25 PM

I failed to find where this code is called.
Can anyone help me?
What page should I open to get EntityChange::getEntityId() called?

It's called when the client wiki is processing repo notifications, which is done asynchronically via "jobs". In production, it is triggered by calling maintenance/runJobs.php on the client wiki (from chron), but in a vanilla setup, each web request processes one job, which makes it hard to know in advance which request will execute the job you are interested in (there are potentially many jobs in the queue).

Anyway, running jobs will only have an effect after changes have been posted to the client's job queue by calling extension/Wikibase/repo/maintenance/dispatchChanges.php on the repo wiki. dispatchChanges tracks progress in the changes_dispatch db table, so what I typically do during testing is: truncate changes_dispatch, run dispatchChanges.php, then run runJobs.php in the debugger, repeat.

References: