Skip to content
This repository was archived by the owner on Sep 23, 2023. It is now read-only.

Commit 882836f

Browse files
edg2sMatmaRex
authored andcommitted
WikiLambda: Change 'mainpage' message to point to Project namespace
* Edit mainpage after import to use this new title * Use getPrefixedText to include the namespace Fixes #385
1 parent 7ff05d2 commit 882836f

3 files changed

Lines changed: 54 additions & 5 deletions

File tree

new/postinstall.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
#!/bin/bash
22
set -ex
33

4-
# update Main_Page
5-
sleep 1 # Ensure edit appears after creation in history
6-
MAINPAGETITLE=$( echo 'echo Title::newMainPage()->getDBkey();' | php $PATCHDEMO/wikis/$NAME/w/maintenance/eval.php 2> /dev/null )
7-
echo "$MAINPAGE" | php $PATCHDEMO/wikis/$NAME/w/maintenance/edit.php "$MAINPAGETITLE" || echo "Can't edit main page"
8-
94
# run update script (#166, #244)
105
php $PATCHDEMO/wikis/$NAME/w/maintenance/update.php --quick
116

@@ -79,6 +74,11 @@ if [ -f $PATCHDEMO/wikis/$NAME/w/maintenance/populateInterwiki.php ]; then
7974
php $PATCHDEMO/wikis/$NAME/w/maintenance/populateInterwiki.php
8075
fi
8176

77+
# Update Main_Page
78+
# Done after content import in case MediaWiki:Mainpage is changed
79+
MAINPAGETITLE=$( echo 'echo Title::newMainPage()->getPrefixedText();' | php $PATCHDEMO/wikis/$NAME/w/maintenance/eval.php 2> /dev/null )
80+
echo "$MAINPAGE" | php $PATCHDEMO/wikis/$NAME/w/maintenance/edit.php "$MAINPAGETITLE" || echo "Can't edit main page"
81+
8282
# update caches after import
8383
php $PATCHDEMO/wikis/$NAME/w/maintenance/rebuildrecentchanges.php
8484
php $PATCHDEMO/wikis/$NAME/w/maintenance/initSiteStats.php

pages/extensions-WikiLambda.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Project:Main Page

pages/extensions-WikiLambda.xml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<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">
2+
<siteinfo>
3+
<sitename>Patch demo (master)</sitename>
4+
<dbname>patchdemo_6edd61eea0</dbname>
5+
<base>https://patchdemo.wmflabs.org/wikis/6edd61eea0/wiki/Project:Main_Page</base>
6+
<generator>MediaWiki 1.38.0-alpha</generator>
7+
<case>first-letter</case>
8+
<namespaces>
9+
<namespace key="-2" case="first-letter">Media</namespace>
10+
<namespace key="-1" case="first-letter">Special</namespace>
11+
<namespace key="0" case="first-letter" />
12+
<namespace key="1" case="first-letter">Talk</namespace>
13+
<namespace key="2" case="first-letter">User</namespace>
14+
<namespace key="3" case="first-letter">User talk</namespace>
15+
<namespace key="4" case="first-letter">Project</namespace>
16+
<namespace key="5" case="first-letter">Project talk</namespace>
17+
<namespace key="6" case="first-letter">File</namespace>
18+
<namespace key="7" case="first-letter">File talk</namespace>
19+
<namespace key="8" case="first-letter">MediaWiki</namespace>
20+
<namespace key="9" case="first-letter">MediaWiki talk</namespace>
21+
<namespace key="10" case="first-letter">Template</namespace>
22+
<namespace key="11" case="first-letter">Template talk</namespace>
23+
<namespace key="12" case="first-letter">Help</namespace>
24+
<namespace key="13" case="first-letter">Help talk</namespace>
25+
<namespace key="14" case="first-letter">Category</namespace>
26+
<namespace key="15" case="first-letter">Category talk</namespace>
27+
</namespaces>
28+
</siteinfo>
29+
<page>
30+
<title>MediaWiki:Mainpage</title>
31+
<ns>8</ns>
32+
<id>1075</id>
33+
<revision>
34+
<id>1076</id>
35+
<timestamp>2021-12-09T14:31:54Z</timestamp>
36+
<contributor>
37+
<username>Patch Demo</username>
38+
<id>1</id>
39+
</contributor>
40+
<comment>Created page with "Project:Main Page"</comment>
41+
<origin>1076</origin>
42+
<model>wikitext</model>
43+
<format>text/x-wiki</format>
44+
<text bytes="17" sha1="i1kqeuz2x6jcxw6zp7a390nc7du1zs8" xml:space="preserve">Project:Main Page</text>
45+
<sha1>i1kqeuz2x6jcxw6zp7a390nc7du1zs8</sha1>
46+
</revision>
47+
</page>
48+
</mediawiki>

0 commit comments

Comments
 (0)