Merge "Make runLegacyHooks work around bug in Hooks." into Wikidata