| Amire80 added a subscriber: daniel. Amire80 edited the task description. (Show Details) |
EDIT DETAILS
//Edit by @Amire80, 2017-01-23://
I discussed this with @daniel and @Lydia_Pintscher at Dev Summit 2017, and we more or less agree that the addition of the sitelink should be moved from the frontend to the backend, although it has a few challenges.
The current process is that the article is published [[ https://phabricator.wikimedia.org/diffusion/ECTX/browse/master/api/ApiContentTranslationPublish.php | using the cxpublish API ]]. It's a simple process that uses the usual edit API to save a wiki page with a bit of extra processing—edit summary, change tag, Echo notification, etc. Then the [[ https://phabricator.wikimedia.org/diffusion/ECTX/browse/master/modules/publish/ext.cx.wikibase.link.js | Wikibase _javascript_ Library is invoked ]] to add the sitelink.
This advantage of using the Wikibase _javascript_ Library is that it is simple—it just takes source and target titles and does everything else. The disadvantage is that is may fail silently if the user closes the window too quickly, and possibly because of other reasons.
It would be better to stop using _javascript_ for this and make the sitelink adding part of the publishing API. Wikibase's LinkTitles class can be used for the actual linking in a job similar to UpdateRepoOnMoveJob. However, doing this is more complicated than using the Wikibase _javascript_ Library. In particular, the linking should be done with the same username as the one that was used for publishing the translated article, but since the repo is on another site, it's non-trivial to reuse the log-in session in a backend job.
...
Probably the process that adds the missing link in the background could be similar to the move implementation we currently have//Edit by @Amire80, 2017-01-23://
I discussed this with @daniel and @Lydia_Pintscher at Dev Summit 2017, and we more or less agree that the addition of the sitelink should be moved from the frontend to the backend, although it has a few challenges.
The current process is that the article is published [[ https://phabricator.wikimedia.org/diffusion/ECTX/browse/master/api/ApiContentTranslationPublish.php | using the cxpublish API ]]. It's a simple process that uses the usual edit API to save a wiki page with a bit of extra processing—edit summary, change tag, Echo notification, etc. Then the [[ https://phabricator.wikimedia.org/diffusion/ECTX/browse/master/modules/publish/ext.cx.wikibase.link.js | Wikibase _javascript_ Library is invoked ]] to add the sitelink.
This advantage of using the Wikibase _javascript_ Library is that it is simple—it just takes source and target titles and does everything else. The disadvantage is that is may fail silently if the user closes the window too quickly, and possibly because of other reasons.
It would be better to stop using _javascript_ for this and make the sitelink adding part of the publishing API. Wikibase's LinkTitles class can be used for the actual linking in a job similar to UpdateRepoOnMoveJob. However, doing this is more complicated than using the Wikibase _javascript_ Library. In particular, the linking should be done with the same username as the one that was used for publishing the translated article, but since the repo is on another site, it's non-trivial to reuse the log-in session in a backend job.
TASK DETAIL
EMAIL PREFERENCES
To: Amire80
Cc: daniel, santhosh, hoo, KartikMistry, Ladsgroup, Lydia_Pintscher, Amire80, Jane023, Wittylama, Aklapper, Multichill, D3r1ck01, Nizil, Ixocactus, Izno, Wikidata-bugs, aude, Jsahleen, Arrbee, Mbch331
Cc: daniel, santhosh, hoo, KartikMistry, Ladsgroup, Lydia_Pintscher, Amire80, Jane023, Wittylama, Aklapper, Multichill, D3r1ck01, Nizil, Ixocactus, Izno, Wikidata-bugs, aude, Jsahleen, Arrbee, Mbch331
_______________________________________________ Wikidata-bugs mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs
