Page MenuHomePhabricator

Script to update the database with all necessary new templates that Flow needs upon installation
Closed, ResolvedPublic

Description

This is especially important for 3rd party installations (non Wikipedias) that install and use Flow; at some point the user may run into a template Flow considers necessary that the wiki doesn't have. We should preinstall those into the wiki.

Example, if using Special:EnableFlow on an existing talk page, the method works but the template "Template:Wikitext talk page converted to Flow" does not exist and is not rendered properly.

Event Timeline

Mooeypoo created this task.Jul 9 2015, 11:14 PM
Mooeypoo raised the priority of this task from to Needs Triage.
Mooeypoo updated the task description. (Show Details)
Mooeypoo added a subscriber: Mooeypoo.
Restricted Application added a project: Collaboration-Team-Triage. · View Herald TranscriptJul 9 2015, 11:14 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

https://gerrit.wikimedia.org/r/#/c/223363/2/maintenance/FlowCreateMentionTemplate.php already has a maintenance script that creates the new FlowMentions template if it doesn't yet exist. Maybe we should change that script and make it loop an array( templatename => callback-that-returns-content ) of prerequisite pages to create?

Catrope triaged this task as Normal priority.Aug 5 2015, 11:18 PM
Catrope set Security to None.

Change 232489 had a related patch set uploaded (by Matthias Mullie):
Create all templates Flow uses

https://gerrit.wikimedia.org/r/232489

matthiasmullie added a comment.EditedAug 19 2015, 5:49 PM

Current templates used by Flow, AFAIK:

  • Template:FlowMention
  • Template:LQT Moved thread stub converted to Flow
  • Template:LQT page converted to Flow
  • Template:Archive for converted LQT page
  • Template:LQT post imported with supressed user
  • Template:LQT post imported with different signature user
  • Template:Wikitext talk page converted to Flow
  • Template:Archive for converted wikitext talk page

For the creation script, I used their content from mediawiki.org. Is that content ok or do we want to simplify?

Below is the content of all import-related templates, as taken from mediawiki.org. What do we want to change these to?

I suggest we:

  • drop everything inside <noinclude> and <includeonly>, they mostly just reference categories & templates assumed to exist on that wiki.
  • drop <!-- --> comments
  • remove {{Ombox}} and {{hatnote}} templates and just use the text

OK?


Template:LQT Moved thread stub converted to Flow

This post by {{{author}}} was moved on {{{date}}}.  You can find it at [[{{{title}}}]].

Template:LQT page converted to Flow

{{hatnote|Previous page history was archived for backup purposes at [[{{{archive}}}]] on {{#time: Y-m-d|{{{date}}} }}.}}<noinclude>[[Category:Flow]]</noinclude>

Template:Archive for converted LQT page

{{Ombox|image=[[File:Replacement filing cabinet.svg|50px|Archive|alt=|link=]]|text=This page is an archived LiquidThreads page. '''Do not edit the contents of this page'''. Please direct any additional comments to the [[{{{from}}}|current talk page]].<!-- Template:Archive for converted LQT page -->
}}<noinclude>
==See also==
* [[Template:Archived]]

[[Category:Flow]]</noinclude>

Template:LQT post imported with supressed user

This revision was imported from LiquidThreads with a suppressed user. It has been reassigned to the current user.

Template:LQT post imported with different signature user

''This post was posted by [[User:{{{authorUser}}}|{{{authorUser}}}]], but signed as [[User:{{{signatureUser}}}|{{{signatureUser}}}]].''

Template:Wikitext talk page converted to Flow

Previous discussion was archived at [[{{{archive}}}]] on {{#time: Y-m-d|{{{date}}} }}.<noinclude>
[[Category:Flow]]</noinclude>

Template:Archive for converted wikitext talk page

{{Ombox|image=[[File:Replacement filing cabinet.svg|50px|Archive|alt=|link=]]|text=This page is an archive. '''Do not edit the contents of this page'''. Please direct any additional comments to the [[{{{from|{{TALKSPACE}}:{{BASEPAGENAME}}}}}|current talk page]].<!-- Template:Archived -->
}}<includeonly>[[Category:Archive]]</includeonly><noinclude>
This template includes pages in [[:Category:Archive]].
==See also==
* [[Template:Archive for converted LQT page]]

[[Category:Flow]]</noinclude>

Below is the content of all import-related templates, as taken from mediawiki.org. What do we want to change these to?
I suggest we:

  • drop everything inside <noinclude> and <includeonly>, they mostly just reference categories & templates assumed to exist on that wiki.
  • drop <!-- --> comments
  • remove {{Ombox}} and {{hatnote}} templates and just use the text

OK?

Sounds good to me.

Links in Template:LQT page converted to Flow and Template:Wikitext talk page converted to Flow should be wrapped in a span with a class. I think this could be the same for both. E.g.:

Previous page history was archived for backup purposes at <span class="flow-link-to-archive">[[{{{archive}}}]]</span> on {{#time: Y-m-d|{{{date}}} }}.

This is for https://gerrit.wikimedia.org/r/#/c/230924/6/modules/tours/flowOptIn.js .

Change 232489 merged by jenkins-bot:
Create all templates Flow uses

https://gerrit.wikimedia.org/r/232489

Checked in betalabs

  • the script was run there enwiki, testwiki, cawiki use the listed above template:

etonkovidova@deployment-bastion:~$ mwscript extensions/Flow/maintenance/FlowCreateTemplates.php --wiki=enwiki
...Update 'FlowCreateTemplates:26baf169ef42d3bfcec7f3f2d84634c6' already logged as completed.

  • checked for templates from the list that have been used already
e.g. 
[enwiki]> SELECT distinct(ref_target_title) FROM flow_wiki_ref  WHERE ref_type = 'template' and ref_target_title in ('LQT_Moved_thread_stub_converted_to_Flow', 'Wikitext_talk_page_converted_to_Flow','FlowMention', 'LQT_page_converted_to_Flow') ; 
+-----------------------------------------+
| ref_target_title                        |
+-----------------------------------------+
| Wikitext_talk_page_converted_to_Flow    |
| FlowMention                             |
| LQT_page_converted_to_Flow              |
| LQT_Moved_thread_stub_converted_to_Flow |
+-----------------------------------------+
4 rows in set (0.00 sec)
  • checked the templates that have been used yet - templates are displayed correctly and added to ref_target_title
DannyH closed this task as Resolved.Sep 1 2015, 5:17 PM
DannyH added a subscriber: DannyH.
Mattflaschen-WMF renamed this task from We should update the database with all necessary new templates that Flow needs upon installation to Script to update the database with all necessary new templates that Flow needs upon installation.Sep 1 2015, 8:14 PM