<mediawiki xmlns="http://www.mediawiki.org/xml/export-0.11/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.11/ http://www.mediawiki.org/xml/export-0.11.xsd" version="0.11" xml:lang="en">
  <siteinfo>
    <sitename>MediaWiki-1.39</sitename>
    <dbname>eckfordc_mw19424</dbname>
    <base>https://mw.eckford.ca:443/index.php/Main_Page</base>
    <generator>MediaWiki 1.39.17</generator>
    <case>first-letter</case>
    <namespaces>
      <namespace key="-2" case="first-letter">Media</namespace>
      <namespace key="-1" case="first-letter">Special</namespace>
      <namespace key="0" case="first-letter" />
      <namespace key="1" case="first-letter">Talk</namespace>
      <namespace key="2" case="first-letter">User</namespace>
      <namespace key="3" case="first-letter">User talk</namespace>
      <namespace key="4" case="first-letter">MediaWiki-1.39</namespace>
      <namespace key="5" case="first-letter">MediaWiki-1.39 talk</namespace>
      <namespace key="6" case="first-letter">File</namespace>
      <namespace key="7" case="first-letter">File talk</namespace>
      <namespace key="8" case="first-letter">MediaWiki</namespace>
      <namespace key="9" case="first-letter">MediaWiki talk</namespace>
      <namespace key="10" case="first-letter">Template</namespace>
      <namespace key="11" case="first-letter">Template talk</namespace>
      <namespace key="12" case="first-letter">Help</namespace>
      <namespace key="13" case="first-letter">Help talk</namespace>
      <namespace key="14" case="first-letter">Category</namespace>
      <namespace key="15" case="first-letter">Category talk</namespace>
    </namespaces>
  </siteinfo>
  <page>
    <title>Main Page</title>
    <ns>0</ns>
    <id>1</id>
    <revision>
      <id>198</id>
      <parentid>195</parentid>
      <timestamp>2026-03-17T12:49:28Z</timestamp>
      <contributor>
        <ip>172.97.51.228</ip>
      </contributor>
      <comment>/* 1. Seed the ROUTINE in the DB */</comment>
      <origin>198</origin>
      <model>wikitext</model>
      <format>text/x-wiki</format>
      <text bytes="8497" sha1="pm1viuupbhq2uovythdfaffufz0uixt" xml:space="preserve">
{{Info|Updated March 16, 2026.}}

= ROUTINE troubleshooting notes =

These notes are for checking or changing the active ROUTINE in the Manual Procedures workflow.

== Normal workflow ==

# Log in.
# Open '''Approved manuals'''.
# Note the ROUTINE shown at the top of the page.
# Open '''ROUTINE tags'''.

=== To activate or roll back to an existing ROUTINE ===

Use the '''top ROUTINE field'''.

Enter the exact existing ROUTINE value you want to use, for example:

&lt;code&gt;ROUTINE_4.110&lt;/code&gt;

Then click '''Activate tag'''.

This can be used to:

* activate the current working ROUTINE
* return to a previous ROUTINE
* confirm that an existing ROUTINE bundle still works

'''Do not''' use '''Clone ROUTINE release''' for rollback.

=== To create the next ROUTINE ===

First make sure the current ROUTINE is correct in the '''top ROUTINE field'''.  
If needed, enter the current ROUTINE there and click '''Activate tag''' first.

Then use '''Clone ROUTINE release'''.

Enter:

* '''Source ROUTINE''': the current active release, for example &lt;code&gt;ROUTINE_4.110&lt;/code&gt;
* '''New ROUTINE''': the new release, for example &lt;code&gt;ROUTINE_4.111&lt;/code&gt;

Then submit the form.

This should:

* create the new ROUTINE tag
* copy the current bundle into the new ROUTINE
* activate the new ROUTINE automatically

== What to check immediately after ==

After activating or cloning:

# Stay on the page and note the message shown at the top.
# Open '''Approved manuals''' again.
# Confirm whether the ROUTINE heading changed.
# Confirm whether the manual list changed as expected.

== Important ==

* '''Activate tag''' uses an existing ROUTINE.
* '''Clone ROUTINE release''' creates a new ROUTINE from an existing one.
* '''Rollback''' means activating an existing ROUTINE in the top field.
* Enter the ROUTINE exactly as written, for example &lt;code&gt;ROUTINE_4.110&lt;/code&gt;.
* Changing approved document revisions does '''not''' by itself create a new ROUTINE label.
* A new ROUTINE appears only after it is cloned or otherwise created in the ROUTINE tables.

= Emergency fallback test in LocalSettings.php =

Use this only if the normal ROUTINE activation path is not working and you need to test whether the wiki is falling back to configuration.

== Method 1: Change the fallback ROUTINE in &lt;code&gt;LocalSettings.php&lt;/code&gt; ==

Edit this line in &lt;code&gt;LocalSettings.php&lt;/code&gt;:

&lt;syntaxhighlight lang="php"&gt;
$wgCustomQueryPageDefaultTag = 'ROUTINE_4.111';
&lt;/syntaxhighlight&gt;

Then:

# Save the file.
# Reload [[Special:RoutineTags]].
# Reload [[Special:ApprovedManuals]].

If nothing changes:

# Do a hard refresh in the browser.
# If it is still unchanged, ask the sysadmin to restart PHP or the container.
# Reload both special pages again.

Expected result:

* If the page starts showing &lt;code&gt;ROUTINE_4.111&lt;/code&gt;, the extension is reading the fallback value from configuration.
* If it still shows &lt;code&gt;ROUTINE_4.110&lt;/code&gt;, this change did not affect the current read path.

== Method 2: Quick page check ==

After Method 1, check both pages, not just one:

* [[Special:RoutineTags]]
* [[Special:ApprovedManuals]]

Things to confirm:

* Does [[Special:RoutineTags]] show &lt;code&gt;ROUTINE_4.111&lt;/code&gt; as the visible current or default tag?
* Does the heading on [[Special:ApprovedManuals]] change to the new ROUTINE?
* Does the document list appear to match the intended release?

== Method 3: See documentation ==

Use the ROUTINE workflow and recovery notes for deeper troubleshooting.

Known points:

* ROUTINE labels are stored in &lt;code&gt;mw_tags&lt;/code&gt;.
* ROUTINE membership is stored in &lt;code&gt;mw_tag_pages&lt;/code&gt;.
* The current approved set is stored in &lt;code&gt;mw_approved_revs&lt;/code&gt;.
* The active selected ROUTINE is stored in &lt;code&gt;mw_customquerypage_settings&lt;/code&gt;.
* Activating a ROUTINE rebuilds &lt;code&gt;mw_approved_revs&lt;/code&gt;.
* Rollback is done by reactivating the previous ROUTINE.

If the manual &lt;code&gt;LocalSettings.php&lt;/code&gt; edit and page refresh do not restore expected behaviour, continue with the documented extension workflow and technical recovery notes.

---
= DEBUG STEPS = 

== In a nutshell == 

* What ROUTINE is showing on Approved manuals?

* What ROUTINE tag displays on the ROUTINE tags page?

* What exact message appeared after clicking the button?

== Tech Fixes ==

Please let me know if this is fixed or if you need another step. Based on what's happening, I can probably help :)

-----------------------------------------------------------

{{Info| Released Vesion 1.0 is available as Latest Version released Feb 26, 2026}}
[[:File:CustomQueryPage-latest.tgz|CustomQueryPage – latest deployment bundle]]

File:CustomQueryPage-latest.tgz

'''Data model summary:''' &lt;code&gt;page_latest&lt;/code&gt; tracks the most recent edit, &lt;code&gt;mw_approved_revs&lt;/code&gt; identifies the revision currently approved for display, and each ROUTINE snapshot in &lt;code&gt;mw_tag_pages&lt;/code&gt; records which revision belongs to that release.

---------------------------------------------------------

The following information can be used as an installation guide. Only download files tagged latest

'''''

=  OBSOLETE Pre-release =
&lt;strong&gt;MediaWiki has been installed.&lt;/strong&gt;
{{Notice
| event_name  = Wiki launch
| date        = February 12th
| location    = Lisa's Desk 
| description = Count down to the retirement of the efs3 server!
}} 
{{{Hatnote|content is content}}}

== Import CustomQueryPage ==
This install is originally intended for the ROUTINE Manuals publication workflow. That's all it does now, but hey, it's a good place to keep notes too. Did you know for MediaWiki you create a page by writing the name in the address bar? How tricky is that?

== NOTE ==
See procedure for rollback to reset to a previous version. Set tag ONLY. 

== Let's Get Started ==

* [https://mw.eckford.ca/downloads/CustomQueryPage-mw1359.tar.gz CustomQueryPage for mw1359]



[[:File:CustomQueryPage-latest.tgz|CustomQueryPage – latest deployment bundle]]

=== Installing CustomQueryPage ===
* Download the bundle: &lt;code&gt;wget https://mw.eckford.ca/downloads/CustomQueryPage-mw1359.tar.gz&lt;/code&gt;
* Extract it into your extensions folder:
** &lt;code&gt;tar -xzf CustomQueryPage-mw1359.tar.gz -C /srv/mediawiki/extensions&lt;/code&gt;
* Edit &lt;code&gt;LocalSettings.php&lt;/code&gt; and add &lt;code&gt;wfLoadExtension( 'CustomQueryPage' );&lt;/code&gt;
* Run &lt;code&gt;php maintenance/update.php --quick&lt;/code&gt;.
* Visit &lt;code&gt;Special:CustomQuerySettings&lt;/code&gt;, set the ROUTINE tag (e.g., &lt;code&gt;ROUTINE_4.110&lt;/code&gt;), and confirm &lt;code&gt;Special:ApprovedManuals&lt;/code&gt;.

= Quick Start: ROUTINE Management =

=== 1. Seed the ROUTINE in the DB ===
Before first run of the UI, make sure the database has ROUTINE data.

* Use the import script or manual SQL method.
* Required tables:
** &lt;code&gt;mw_tags&lt;/code&gt; — one row per ROUTINE (e.g., &lt;code&gt;ROUTINE_4.111&lt;/code&gt;).
** &lt;code&gt;mw_tag_pages&lt;/code&gt; — one row per approved page.
* If needed, run: &lt;code&gt;php maintenance/update.php --quick&lt;/code&gt;
{{Note|Note: Only run &lt;code&gt;update.php&lt;/code&gt; if &lt;code&gt;mw_customquerypage_settings&lt;/code&gt; does not exist yet, or if you are intentionally applying the CustomQueryPage schema changes in a controlled maintenance window.}}

=== 2. Use the Special Page to Switch or Clone ===

Please note that the Revision is part of this query and display. Any documents that have been approved since the last release should have a new revision and this new revision should be included in the ROUTINE_tag 

* Go to: &lt;code&gt;Special:CustomQuerySettings&lt;/code&gt;
* Two options:
** '''Set Active Tag''' — type &lt;code&gt;ROUTINE_4.111&lt;/code&gt;, then Save.
** '''Clone ROUTINE → New ROUTINE''':
*** From: &lt;code&gt;ROUTINE_4.110&lt;/code&gt;
*** To: &lt;code&gt;ROUTINE_4.111&lt;/code&gt;
*** Submit → this copies rows and updates the active tag.

=== 3. Verify the Result ===

* Visit: &lt;code&gt;Special:ApprovedManuals&lt;/code&gt;
* Confirm the listing shows &lt;code&gt;ROUTINE_4.111&lt;/code&gt;
* Lisa can now publish or review the approved manuals.
* No DB access required.

= Optional: JSON/API Importer =

If you're ready to skip the SQL import:

* Define a JSON payload that includes:
** &lt;code&gt;page_id&lt;/code&gt;, &lt;code&gt;rev_id&lt;/code&gt;, &lt;code&gt;deploy_comment&lt;/code&gt;, &lt;code&gt;wikitext&lt;/code&gt;, etc.
* Build a:
** REST endpoint, or
** Action API module, or
** Maintenance script that reads JSON

Once defined, MediaWiki can import directly into &lt;code&gt;mw_tags&lt;/code&gt; / &lt;code&gt;mw_tag_pages&lt;/code&gt;.

{{Warning|Avoid touching the database manually if you want to adopt the JSON route. The importer will safely handle all insertions.}}</text>
      <sha1>pm1viuupbhq2uovythdfaffufz0uixt</sha1>
    </revision>
  </page>
</mediawiki>
