[Wikidata-bugs] [Maniphest] [Commented On] T162540: Edit entity special pages are too interwoven making it impossible to properly inject dependencies.
gerritbot added a comment. Change 350229 merged by jenkins-bot: [mediawiki/extensions/Wikibase@master] Move setServices in specials to constructor params https://gerrit.wikimedia.org/r/350229TASK DETAILhttps://phabricator.wikimedia.org/T162540EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: Lucas_Werkmeister_WMDE, gerritbotCc: gerritbot, Lucas_Werkmeister_WMDE, daniel, Aklapper, Lydia_Pintscher, Ladsgroup, Adik2382, Th3d3v1ls, Ramalepe, Liugev6, QZanden, Lewizho99, Maathavan, Izno, Wikidata-bugs, aude, Mbch331, Jay8g___ Wikidata-bugs mailing list Wikidata-bugs@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs
[Wikidata-bugs] [Maniphest] [Commented On] T162540: Edit entity special pages are too interwoven making it impossible to properly inject dependencies.
gerritbot added a comment. Change 350229 had a related patch set uploaded (by Lucas Werkmeister (WMDE)): [mediawiki/extensions/Wikibase@master] Move setServices in specials to constructor params https://gerrit.wikimedia.org/r/350229TASK DETAILhttps://phabricator.wikimedia.org/T162540EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: Lucas_Werkmeister_WMDE, gerritbotCc: gerritbot, Lucas_Werkmeister_WMDE, daniel, Aklapper, Lydia_Pintscher, Ladsgroup, QZanden, Izno, Wikidata-bugs, aude, Mbch331, Jay8g___ Wikidata-bugs mailing list Wikidata-bugs@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs
[Wikidata-bugs] [Maniphest] [Commented On] T162540: Edit entity special pages are too interwoven making it impossible to properly inject dependencies.
daniel added a comment. A newFromGlobalState method isn't needed. We use this in classes that have or represent "static entry points", e.g. hook handlers. You are right that for a special page, this can be done by the factory class (or wiring file).TASK DETAILhttps://phabricator.wikimedia.org/T162540EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: danielCc: Lucas_Werkmeister_WMDE, daniel, Aklapper, Lydia_Pintscher, Ladsgroup, QZanden, Izno, Wikidata-bugs, aude, Mbch331, Jay8g___ Wikidata-bugs mailing list Wikidata-bugs@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs
[Wikidata-bugs] [Maniphest] [Commented On] T162540: Edit entity special pages are too interwoven making it impossible to properly inject dependencies.
Lucas_Werkmeister_WMDE added a comment. So instead of the setXyzServices call in the constructor, the constructor should accept the services as parameters. Should a newFromGlobalState function also be added to the pages, which would do roughly what the constructor does now? That’s what I’ve seen in WikibaseQualityConstraints, but as far as I can tell, it might not be necessary here, since repo/Wikibase.php can call the constructor with the right arguments when it sets up the special pages.TASK DETAILhttps://phabricator.wikimedia.org/T162540EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: Lucas_Werkmeister_WMDECc: Lucas_Werkmeister_WMDE, daniel, Aklapper, Lydia_Pintscher, Ladsgroup, QZanden, Izno, Wikidata-bugs, aude, Mbch331, Jay8g___ Wikidata-bugs mailing list Wikidata-bugs@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs
[Wikidata-bugs] [Maniphest] [Commented On] T162540: Edit entity special pages are too interwoven making it impossible to properly inject dependencies.
daniel added a comment. FTR, the setXyzServices() methods were introduced to allow services to be overwritten for testing, before proper injection was possible for SpecialPages. They can and indeed should be replaced by proper constructor injection now.TASK DETAILhttps://phabricator.wikimedia.org/T162540EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: danielCc: daniel, Aklapper, Lydia_Pintscher, Ladsgroup, QZanden, Izno, Wikidata-bugs, aude, Mbch331, Jay8g___ Wikidata-bugs mailing list Wikidata-bugs@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs