Hi,
I'am writing a tag extension which declares several tags.
When with <sample>...</sample>
function renderTagSample( $input, array $args, Parser $parser, PPFrame
$frame ) { ... }
is called is there a way to get the tag name "sample" itself inside
renderTagSample?
Thanks in advance
Sigbert
Hi @raketa.me,
Do you have any views on how to go about the problem?
Thanks,
Palash
On Wed, Mar 9, 2016 at 2:06 AM, <mediawiki-l-request(a)lists.wikimedia.org>
wrote:
> Send MediaWiki-l mailing list submissions to
> mediawiki-l(a)lists.wikimedia.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
> or, via email, send a message with subject or body 'help' to
> mediawiki-l-request(a)lists.wikimedia.org
>
> You can reach the person managing the list at
> mediawiki-l-owner(a)lists.wikimedia.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of MediaWiki-l digest..."
>
>
> Today's Topics:
>
> 1. Special:UserLogin "REDIRECT" help MediaWiki (Palash Rastogi)
> 2. Re: Special:UserLogin "REDIRECT" help MediaWiki (Raketa Me)
> 3. Extension:SpamBlacklist (Ahmad Farooq)
> 4. Re: VirtualEditor: Error loading data from server: 404:
> parsoidserver-http: HTTP 404 (Herta Van den Eynde)
> 5. Re: Tag extension needs to know which tag is handled
> (Daniel Barrett)
> 6. Re: Extension:SpamBlacklist (Mlpearc)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 8 Mar 2016 18:36:07 +0530
> From: Palash Rastogi <rastogipalash24(a)gmail.com>
> To: mediawiki-l(a)lists.wikimedia.org
> Subject: [MediaWiki-l] Special:UserLogin "REDIRECT" help MediaWiki
> Message-ID:
> <
> CAJdGgoZGwUVCxZm9hpdeqdBLk67jQKpTbZZnvUi19HXPsRN1yg(a)mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> Hi Team,
>
> I am Palash Rastogi, an undergraduate student at Thapar University,
> Patiala, India. I am currently working on a website using the MediaWiki
> framework and Semantic MediaWiki.
>
> I have used a different skin template (bootstrap-mediawiki
> <https://github.com/borkweb/bootstrap-mediawiki>), to give the website an
> attractive look. When I use the normal skins provided by mediawiki, and
> follow the following steps:
> 1. I am *NOT* signed in.
> 2. I go to "Add Book" page, which is a form based page (semantic forms) to
> add a new book to my wiki.
> 3. The site asks me to sign-in to add information.
> 4. I click on log-in in he top-right corner.
> 5. As I click "Login", I am redirected to the "Add Book" page. (Perfect
> flow)
>
> The problem is: when I switch to the new skin, I am not redirected back tom
> the page from where I arrived on login page, i.e. the fifth point mentioned
> above changes as follows:
>
> 5. As I click "Login", I am redirected to the "Main Page" instead of the
> "Add Book".
>
>
> I tried to read a few related scripts, and I know that the new skin uses a
> simple login link in the top corner (Special:UserLogin link), but couldn't
> understand what
> and where exactly am I missing the redirect flow.
>
> Any help would be appreciated.
>
>
> Regards,
> --
> Palash Rastogi
> IV Year
> B.E. Computer Engineering
> Thapar University, Patiala.
> Mob.No. : +91-8437913912
>
>
> ------------------------------
>
> Message: 2
> Date: Tue, 8 Mar 2016 18:09:20 +0300
> From: Raketa Me <raketa.me(a)gmail.com>
> To: mediawiki-l(a)lists.wikimedia.org
> Subject: Re: [MediaWiki-l] Special:UserLogin "REDIRECT" help MediaWiki
> Message-ID: <ddf75ae9-f43b-890b-99ea-67e7b309e073(a)gmail.com>
> Content-Type: text/plain; charset=utf-8; format=flowed
>
> Hi, Palash.
>
> If it is related to Impactpreneurs wiki i suggest you to simply contact
> me directly about any questions.
>
> 08.03.2016 16:06, Palash Rastogi пишет:
> > Hi Team,
> >
> > I am Palash Rastogi, an undergraduate student at Thapar University,
> > Patiala, India. I am currently working on a website using the MediaWiki
> > framework and Semantic MediaWiki.
> >
> > I have used a different skin template (bootstrap-mediawiki
> > <https://github.com/borkweb/bootstrap-mediawiki>), to give the website
> an
> > attractive look. When I use the normal skins provided by mediawiki, and
> > follow the following steps:
> > 1. I am *NOT* signed in.
> > 2. I go to "Add Book" page, which is a form based page (semantic forms)
> to
> > add a new book to my wiki.
> > 3. The site asks me to sign-in to add information.
> > 4. I click on log-in in he top-right corner.
> > 5. As I click "Login", I am redirected to the "Add Book" page. (Perfect
> > flow)
> >
> > The problem is: when I switch to the new skin, I am not redirected back
> tom
> > the page from where I arrived on login page, i.e. the fifth point
> mentioned
> > above changes as follows:
> >
> > 5. As I click "Login", I am redirected to the "Main Page" instead of the
> > "Add Book".
> >
> >
> > I tried to read a few related scripts, and I know that the new skin uses
> a
> > simple login link in the top corner (Special:UserLogin link), but
> couldn't
> > understand what
> > and where exactly am I missing the redirect flow.
> >
> > Any help would be appreciated.
> >
> >
> > Regards,
>
>
>
>
>
> ------------------------------
>
> Message: 3
> Date: Tue, 8 Mar 2016 21:57:12 +0500
> From: Ahmad Farooq <ahmadfarooq123(a)gmail.com>
> To: "mediawiki-l(a)lists.wikimedia.org"
> <mediawiki-l(a)lists.wikimedia.org>
> Subject: [MediaWiki-l] Extension:SpamBlacklist
> Message-ID: <56df0471.030f1c0a.86a4f.5ef0(a)mx.google.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hi,
>
> MediaWiki 1.26.2
> PHP 5.4.41 (apache2handler)
> MySQL 5.6.27-76.0
> ICU 4.2.1
> Server OS Linux (32-Bit)
>
> I am having a lot of difficulty, setting up a blacklist aside from the
> default Meta-Wiki one (I.e. https://meta.wikimedia.org/wiki/Spam_blacklist
> ).
>
> Following the examples here:
> https://www.mediawiki.org/wiki/Extension:SpamBlacklist#Examples
>
> in LocalSettings.php I included the following lines:
>
> $wgSpamBlacklistFiles = array(
> "[[m:Spam blacklist]]",
> "https://en.wikipedia.org/wiki/MediaWiki:Spam-blacklist"
> );
>
> But when I test this, by entering the links that are blacklisted in the
> English Wikipedia blacklist, they don’t get blocked. To make sure I was
> using the correct links, I tested them in the English Wikipedia sandbox
> where they were successfully blocked.
>
> Additionally, according to the documentation, when “$wgSpamBlacklistFiles”
> is used, the blacklists are solely the ones defined in this array, so I
> deleted the link to the Meta-Wiki blacklist and tried inputting some junk
> link (I.e. "https://en.wikipedia.org/wiki/abc") in the array. From what I
> understand, no link should have blocked in such a scenario. But again the
> links defined in the Meta-Wiki blacklist were blocked. It appears that the
> “$wgSpamBlacklistFiles” is having absolutely no effect whatsoever.
>
> No matter what I do, the Meta-Wiki blacklist continues to work, but none
> of the other blacklists I try to include, work.
> I have even tried creating a similar blacklist page on my own Wiki to no
> avail. I also remembered to clear the cache before each try.
> What am I missing?
>
> Thanks in advance.
>
> Regards,
>
>
> ------------------------------
>
> Message: 4
> Date: Tue, 8 Mar 2016 20:05:14 +0100
> From: Herta Van den Eynde <herta.vandeneynde(a)gmail.com>
> To: MediaWiki announcements and site admin list
> <mediawiki-l(a)lists.wikimedia.org>
> Subject: Re: [MediaWiki-l] VirtualEditor: Error loading data from
> server: 404: parsoidserver-http: HTTP 404
> Message-ID:
> <CAB7a2LLnKWi3qnUK1=9h29ThkP+Zmx29jfOEDw3kW4nyOmc=
> 1Q(a)mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> Thanks for the suggestion, Victor.
>
> After much trial and error, I finally got it to work.
>
> In /var/www/html/wiki-hitit/LocalSettings.php, I had specified the location
> of our wiki:
>
> 'url' => 'http:/intranet.hit.local:8142/wiki-hitit',
>
> when I changed it to
>
> 'url' => 'http:/intranet.hit.local:8142',
>
> everything - finally - was fine.
>
> Kind regards,
>
> Herta
>
>
> On 7 March 2016 at 22:05, Victor Danilchenko <vdanilchenko(a)cimpress.com>
> wrote:
>
> > Even though Parsoid docs claim that you only need to set the ‘prefix’
> > value in localsettings.js, I found that I had to set both ‘prefix’ and
> > ‘domain’ attributes (to the same value) – and create a matching
> > configuration, with both parameters in MediaWiki.
> >
> > You can test it directly at a URL like the following:
> >
> > http://yourparsoidserver.localdomain:8142/wiki-hitit/v3/page/html/Home<
> > http://localhost:8142/wiki-hitit/v3/page/html/Home>
> >
> > If you configured everything correctly, you should see a kinda-sorta
> > rendering of your Wiki home page (or any other page). Otherwise, it will
> > probably tell you that the wiki ‘wiki-hitit’ doesn’t exist.
> >
> >
> > From: MediaWiki-l [mailto:mediawiki-l-bounces@lists.wikimedia.org] On
> > Behalf Of Herta Van den Eynde
> > Sent: Friday, February 26, 2016 12:32 PM
> > To: MediaWiki announcements and site admin list <
> > mediawiki-l(a)lists.wikimedia.org>
> > Subject: [MediaWiki-l] VirtualEditor: Error loading data from server:
> 404:
> > parsoidserver-http: HTTP 404
> >
> > Environment:
> >
> > OS: Ubuntu 14.04.4 LTS
> > MediaWiki: 1.26.2
> > wiki url: http://intranet.hit.local/wiki-hitit/<
> > http://intranet.hit.local/wiki-hitit/>
> > parsoid listener port: 8142
> >
> >
> > After a good day of trying to set up VirtualEditor, the above error is
> > still with us.
> >
> > I think I followed the instructions in
> > - https://www.mediawiki.org/wiki/Extension:VisualEditor<
> > https://www.mediawiki.org/wiki/Extension:VisualEditor>
> > - https://www.mediawiki.org/wiki/Parsoid/Setup<
> > https://www.mediawiki.org/wiki/Parsoid/Setup>
> >
> > though, I'm still uncertain about the url.
> >
> > /var/www/html/wiki-hitit/LocalSettings.php has the following entries for
> > VisualEditor:
> >
> > ### VisualEditor
> > require_once( "$IP/extensions/VisualEditor/VisualEditor.php" );
> > $wgDefaultUserOptions['visualeditor-enable'] = 1;
> > $wgSessionsInObjectCache = true;
> > $wgVirtualRestConfig['modules']['parsoid'] = array(
> > 'url' => 'http://localhost:8142/wiki-hitit/',
> > 'prefix' => 'wiki-hitit'
> > );
> >
> > /etc/mediawiki/parsoid/localsettings.js has the following entries:
> >
> > 'use strict';
> > exports.setup = function(parsoidConfig) {
> > parsoidConfig.setMwApi({ prefix: 'wiki-hitit', uri: '
> > http://localhost/wiki-hitit/api.php<http://localhost/wiki-hitit/api.php
> >'
> > });
> > parsoidConfig.useSelser = true;
> >
> > };
> >
> > /var/www/html/wiki-hitit/extensions/parsoid/localsettings.js has these:
> >
> > 'use strict';
> >
> > exports.setup = function(parsoidConfig) {
> > parsoidConfig.setMwApi({
> > prefix: 'wiki-hitit', // optional
> > uri: 'http://localhost/wiki-hitit/api.php<
> > http://localhost/wiki-hitit/api.php>'
> > });
> > parsoidConfig.useSelser = true;
> > };
> >
> > The api.php is accessible:
> >
> > $ curl 'http://localhost/wiki-hitit/api.php<
> > http://localhost/wiki-hitit/api.php>' | head
> > % Total % Received % Xferd Average Speed Time Time Time
> > Current
> > Dload Upload Total Spent Left
> > Speed
> > 0 0 0 0 0 0 0 0 --:--:-- --:--:--
> > --:--:-- 0
> > <!DOCTYPE html>
> > <html lang="en" dir="ltr" class="client-nojs">
> > <head>
> > <meta charset="UTF-8" />
> > <title>MediaWiki API help - Hitit</title>
> >
> > The wiki pages now have both an 'edit' and an 'edit source' tab. But when
> > you press the 'edit' tab, you get a pop-up with this error message:
> > "Error loading data from server: 404: parsoidserver-http: HTTP 404. Would
> > you like to retry?"
> >
> > I've found several articles about this issue, but none that helped.
> >
> > Is the url/uri definition correct? (All examples I found used simple
> urls.)
> >
> > Are there any log files I can check? I tried the parsoid and apache2
> logs,
> > but there's nothing there.
> >
> > Any other suggestions?
> >
> > Kind regards,
> >
> > Herta
> > _______________________________________________
> > MediaWiki-l mailing list
> > To unsubscribe, go to:
> > https://lists.wikimedia.org/mailman/listinfo/mediawiki-l<
> > https://lists.wikimedia.org/mailman/listinfo/mediawiki-l>
> > _______________________________________________
> > MediaWiki-l mailing list
> > To unsubscribe, go to:
> > https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
> >
>
>
>
> --
> "Life on Earth may be expensive,
> but it comes with a free ride around the Sun."
>
>
> ------------------------------
>
> Message: 5
> Date: Tue, 8 Mar 2016 20:00:01 +0000
> From: Daniel Barrett <danb(a)cimpress.com>
> To: MediaWiki announcements and site admin list
> <mediawiki-l(a)lists.wikimedia.org>
> Subject: Re: [MediaWiki-l] Tag extension needs to know which tag is
> handled
> Message-ID:
> <
> HE1PR01MB185094275E227CEFDB1F120DBCB20(a)HE1PR01MB1850.eurprd01.prod.exchangelabs.com
> >
>
> Content-Type: text/plain; charset=UTF-8
>
> Sigbert Klinke asks about <sample>:
> >is called is there a way to get the tag name "sample" itself inside [a
> tag extension]?
>
> I am pretty sure the answer is no. I worked around it by defining my
> callbacks dynamically, one per tag.
>
> Suppose you are writing 3 tags named <A>, <B>, and <C>.
> You can dynamically create a callback function for each one, passing the
> tag name to it, something like this:
>
> public static function initTags(Parser &$parser) {
> foreach (array('A', 'B', 'C') as $tagName) {
> $callback = function($argv) use ($tagName, $parser) {
> return Tags::processTag($tagName, $argv, $parser);
> };
> $parser->setHook($tagName, $callback);
> }
> return true;
> }
>
> Now the function processTag() knows the tag name, and you can write it to
> do whatever you want.
>
> DanB
>
> ------------------------------
>
> Message: 6
> Date: Tue, 8 Mar 2016 12:36:27 -0800
> From: Mlpearc <mlpearcwiki(a)gmail.com>
> To: MediaWiki announcements and site admin list
> <mediawiki-l(a)lists.wikimedia.org>
> Subject: Re: [MediaWiki-l] Extension:SpamBlacklist
> Message-ID:
> <CA+KVmKLy8uc0F6L0YHBUyW=
> TZoCkVoQHg3uzEMCbGE+tjZRBew(a)mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> I have this in my Localsettings.php
>
>
> wfLoadExtension( 'SpamBlacklist' );
> $wgSpamBlacklistFiles = array(
> "
>
> https://meta.wikimedia.org/w/index.php?title=Spam_blacklist&action=raw&sb_v…
> ",
> "
>
> https://en.wikipedia.org/w/index.php?title=MediaWiki:Spam-blacklist&action=…
> "
> );
>
> *Mlpearc*
> Administrator
> Account Creations
> <https://en.wikipedia.org/wiki/Wikipedia:Request_an_account>, English
> Wikipedia
> Wikipedia account <https://en.wikipedia.org/wiki/User_talk:Mlpearc>
>
>
> On Tue, Mar 8, 2016 at 8:57 AM, Ahmad Farooq <ahmadfarooq123(a)gmail.com>
> wrote:
>
> > Hi,
> >
> > MediaWiki 1.26.2
> > PHP 5.4.41 (apache2handler)
> > MySQL 5.6.27-76.0
> > ICU 4.2.1
> > Server OS Linux (32-Bit)
> >
> > I am having a lot of difficulty, setting up a blacklist aside from the
> > default Meta-Wiki one (I.e.
> https://meta.wikimedia.org/wiki/Spam_blacklist
> > ).
> >
> > Following the examples here:
> > https://www.mediawiki.org/wiki/Extension:SpamBlacklist#Examples
> >
> > in LocalSettings.php I included the following lines:
> >
> > $wgSpamBlacklistFiles = array(
> > "[[m:Spam blacklist]]",
> > "https://en.wikipedia.org/wiki/MediaWiki:Spam-blacklist"
> > );
> >
> > But when I test this, by entering the links that are blacklisted in the
> > English Wikipedia blacklist, they don’t get blocked. To make sure I was
> > using the correct links, I tested them in the English Wikipedia sandbox
> > where they were successfully blocked.
> >
> > Additionally, according to the documentation, when
> “$wgSpamBlacklistFiles”
> > is used, the blacklists are solely the ones defined in this array, so I
> > deleted the link to the Meta-Wiki blacklist and tried inputting some junk
> > link (I.e. "https://en.wikipedia.org/wiki/abc") in the array. From what
> I
> > understand, no link should have blocked in such a scenario. But again the
> > links defined in the Meta-Wiki blacklist were blocked. It appears that
> the
> > “$wgSpamBlacklistFiles” is having absolutely no effect whatsoever.
> >
> > No matter what I do, the Meta-Wiki blacklist continues to work, but none
> > of the other blacklists I try to include, work.
> > I have even tried creating a similar blacklist page on my own Wiki to no
> > avail. I also remembered to clear the cache before each try.
> > What am I missing?
> >
> > Thanks in advance.
> >
> > Regards,
> > _______________________________________________
> > MediaWiki-l mailing list
> > To unsubscribe, go to:
> > https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
> >
>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l(a)lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>
>
> ------------------------------
>
> End of MediaWiki-l Digest, Vol 150, Issue 7
> *******************************************
>
--
Palash Rastogi
IV Year
B.E. Computer Engineering
Thapar University, Patiala.
Mob.No. : +91-8437913912
Sent with MailTrack
<https://mailtrack.io/install?source=signature&lang=en&referral=rastogipalas…>
Environment:
OS: Ubuntu 14.04.4 LTS
MediaWiki: 1.26.2
wiki url: http://intranet.hit.local/wiki-hitit/
parsoid listener port: 8142
After a good day of trying to set up VirtualEditor, the above error is
still with us.
I think I followed the instructions in
- https://www.mediawiki.org/wiki/Extension:VisualEditor
- https://www.mediawiki.org/wiki/Parsoid/Setup
though, I'm still uncertain about the url.
/var/www/html/wiki-hitit/LocalSettings.php has the following entries for
VisualEditor:
### VisualEditor
require_once( "$IP/extensions/VisualEditor/VisualEditor.php" );
$wgDefaultUserOptions['visualeditor-enable'] = 1;
$wgSessionsInObjectCache = true;
$wgVirtualRestConfig['modules']['parsoid'] = array(
'url' => 'http://localhost:8142/wiki-hitit/',
'prefix' => 'wiki-hitit'
);
/etc/mediawiki/parsoid/localsettings.js has the following entries:
'use strict';
exports.setup = function(parsoidConfig) {
parsoidConfig.setMwApi({ prefix: 'wiki-hitit', uri: '
http://localhost/wiki-hitit/api.php' });
parsoidConfig.useSelser = true;
};
/var/www/html/wiki-hitit/extensions/parsoid/localsettings.js has these:
'use strict';
exports.setup = function(parsoidConfig) {
parsoidConfig.setMwApi({
prefix: 'wiki-hitit', // optional
uri: 'http://localhost/wiki-hitit/api.php'
});
parsoidConfig.useSelser = true;
};
The api.php is accessible:
$ curl 'http://localhost/wiki-hitit/api.php' | head
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:--
--:--:-- 0
<!DOCTYPE html>
<html lang="en" dir="ltr" class="client-nojs">
<head>
<meta charset="UTF-8" />
<title>MediaWiki API help - Hitit</title>
The wiki pages now have both an 'edit' and an 'edit source' tab. But when
you press the 'edit' tab, you get a pop-up with this error message:
"Error loading data from server: 404: parsoidserver-http: HTTP 404. Would
you like to retry?"
I've found several articles about this issue, but none that helped.
Is the url/uri definition correct? (All examples I found used simple urls.)
Are there any log files I can check? I tried the parsoid and apache2 logs,
but there's nothing there.
Any other suggestions?
Kind regards,
Herta
Hi Team,
I am Palash Rastogi, an undergraduate student at Thapar University,
Patiala, India. I am currently working on a website using the MediaWiki
framework and Semantic MediaWiki.
I have used a different skin template (bootstrap-mediawiki
<https://github.com/borkweb/bootstrap-mediawiki>), to give the website an
attractive look. When I use the normal skins provided by mediawiki, and
follow the following steps:
1. I am *NOT* signed in.
2. I go to "Add Book" page, which is a form based page (semantic forms) to
add a new book to my wiki.
3. The site asks me to sign-in to add information.
4. I click on log-in in he top-right corner.
5. As I click "Login", I am redirected to the "Add Book" page. (Perfect
flow)
The problem is: when I switch to the new skin, I am not redirected back tom
the page from where I arrived on login page, i.e. the fifth point mentioned
above changes as follows:
5. As I click "Login", I am redirected to the "Main Page" instead of the
"Add Book".
I tried to read a few related scripts, and I know that the new skin uses a
simple login link in the top corner (Special:UserLogin link), but couldn't
understand what
and where exactly am I missing the redirect flow.
Any help would be appreciated.
Regards,
--
Palash Rastogi
IV Year
B.E. Computer Engineering
Thapar University, Patiala.
Mob.No. : +91-8437913912
This is a somewhat complex problem so bear with me, I'll try to
describe it as concisely as possible.
Background:
I'm in the process of updating a large (20k pages), old (started ca
2004) MediaWiki site. It was running MediaWiki 1.18.3 and I thought a
good first step would be to update the site to the 1.19.x LTS version,
which I did (with the plan of moving to 1.23.x in March). Extensions
were updated as well. Everything seemed stable and pre-upgrade backups
were not kept after a month of no problem reports (big mistake, I
know!) There are nightly backups but only a week's worth are kept for
storage reasons. However, I have located some very old (3 year+)
database backups.
The site admins use a MW extension called "merge-and-delete" to deal
with spammers. There is a permanent, blocked user called "spammer" and
any time a new user account is created by a spammer, the editors merge-
and-delete that account into the "spammer" account. There are < 100
real editors on the site and this process kept them from being
overwhelmed by the thousands of spammers creating accounts on the site
in recent years.
The Problem
About a month after the 1.19.x update, a problem was discovered.
Somehow, all edits dated 2011 or earlier were altered such that they
are now credited to the "spammer" user rather than the actual user who
made the edits. The cause of the corruption appears to be a bug/problem
related to the merge-and-delete extension and MW 1.19. I'm not seeking
help for that here - I have turned off and removed the extension.
My problem is: how to restore the edit history so that edits are
credited to the correct users again. The timestamp and page names of
all edits are still correct, only the user name was corrupted. But the
only backup old enough to have uncorrupted edit history data is years
old and from a much older version of MW (maybe 1.16). And I need to fix
the problem without losing years of edits.
The Solution?
I can't see any easy fix for this. But I have thought of an approach
that might work. If I write a bot that reads the very old database,
extracts only <=2011 edit history, and then compares that data to the
corrupted live site, perhaps it could work its way through the edit
history making corrections. Does this seem plausible? And, if so, any
advice on what to look out for? If anyone has alternate suggestions,
I'm up for entertaining just about any idea on how to fix this.
-Steve
I've inherited an old mediawiki installation running 1.12, and would
like to migrate to 1.23.13, since there are packages for that release in
EPEL.
I've dumped the databases on the old PostgreSQL server and loaded them
on the new host, but the upgrade script fails. I added a debugging
statement, so I can see that the failure occurs when the upgrade script
is trying to change the default value of filearchive.fa_id.
# php maintenance/update.php --conf
/var/www/mediawiki123/LocalSettings.php --quick
MediaWiki 1.23.13 Updater
Going to run database updates for wiki_wiki
Depending on the size of your database this may take a while!
...skipping: 'mwuser' table doesn't exist yet.
...skipping: 'mwuser' table doesn't exist yet.
...skipping: 'pagecontent' table doesn't exist yet.
Creating sequence logging_log_id_seq
Creating sequence page_restrictions_pr_id_seq
Creating sequence filearchive_fa_id_seq
Changing 'filearchive.fa_id' default value to
"nextval"('"filearchive_fa_id_seq"'::"regclass")
PHP Fatal error: Call to a member function defaultValue() on a
non-object in
/usr/share/mediawiki123/includes/installer/PostgresUpdater.php on line 711
I've also enabled query loggging in PostgreSQL, and I can see that the
upgrade script runs this query to get info about filearchive.fa_id, but
gets no results, which appears to be the root of the problem.
# psql -h 127.0.0.1 -U wiki_wiki wiki_wiki
Password for user wiki_wiki:
psql (9.2.14)
Type "help" for help.
wiki_wiki=> SELECT /* DatabaseBase::query */ attnotnull, attlen,
conname AS conname,
wiki_wiki-> atthasdef,
wiki_wiki-> adsrc,
wiki_wiki-> COALESCE(condeferred, 'f') AS deferred,
wiki_wiki-> COALESCE(condeferrable, 'f') AS deferrable,
wiki_wiki-> CASE WHEN typname = 'int2' THEN 'smallint'
wiki_wiki-> WHEN typname = 'int4' THEN 'integer'
wiki_wiki-> WHEN typname = 'int8' THEN 'bigint'
wiki_wiki-> WHEN typname = 'bpchar' THEN 'char'
wiki_wiki-> ELSE typname END AS typname
wiki_wiki-> FROM pg_class c
wiki_wiki-> JOIN pg_namespace n ON (n.oid = c.relnamespace)
wiki_wiki-> JOIN pg_attribute a ON (a.attrelid = c.oid)
wiki_wiki-> JOIN pg_type t ON (t.oid = a.atttypid)
wiki_wiki-> LEFT JOIN pg_constraint o ON (o.conrelid = c.oid AND
a.attnum = ANY(o.conkey) AND o.contype = 'f')
wiki_wiki-> LEFT JOIN pg_attrdef d on c.oid=d.adrelid and
a.attnum=d.adnum
wiki_wiki-> WHERE relkind = 'r'
wiki_wiki-> AND nspname='mediawiki'
wiki_wiki-> AND relname='filearchive'
wiki_wiki-> AND attname='fa_id';
attnotnull | attlen | conname | atthasdef | adsrc | deferred |
deferrable | typname
------------+--------+---------+-----------+-------+----------+------------+---------
(0 rows)
However, if I change (pg_namespace.)nspname to "public", then I do get a
result:
wiki_wiki=> SELECT /* DatabaseBase::query */ attnotnull, attlen,
conname AS conname,
wiki_wiki-> atthasdef,
wiki_wiki-> adsrc,
wiki_wiki-> COALESCE(condeferred, 'f') AS deferred,
wiki_wiki-> COALESCE(condeferrable, 'f') AS deferrable,
wiki_wiki-> CASE WHEN typname = 'int2' THEN 'smallint'
wiki_wiki-> WHEN typname = 'int4' THEN 'integer'
wiki_wiki-> WHEN typname = 'int8' THEN 'bigint'
wiki_wiki-> WHEN typname = 'bpchar' THEN 'char'
wiki_wiki-> ELSE typname END AS typname
wiki_wiki-> FROM pg_class c
wiki_wiki-> JOIN pg_namespace n ON (n.oid = c.relnamespace)
wiki_wiki-> JOIN pg_attribute a ON (a.attrelid = c.oid)
wiki_wiki-> JOIN pg_type t ON (t.oid = a.atttypid)
wiki_wiki-> LEFT JOIN pg_constraint o ON (o.conrelid =
c.oid AND a.attnum = ANY(o.conkey) AND o.contype = 'f')
wiki_wiki-> LEFT JOIN pg_attrdef d on c.oid=d.adrelid
and a.attnum=d.adnum
wiki_wiki-> WHERE relkind = 'r'
wiki_wiki-> AND nspname='public'
wiki_wiki-> AND relname='filearchive'
wiki_wiki-> AND attname='fa_id';
attnotnull | attlen | conname | atthasdef | adsrc |
deferred | deferrable | typname
------------+--------+---------+-----------+--------------------------------------------+----------+------------+---------
t | 4 | | t |
nextval('filearchive_fa_id_seq'::regclass) | f | f | integer
(1 row)
I'm guessing that's related to the $wgDBts2schema setting from the old
installation:
https://www.mediawiki.org/wiki/Manual:$wgDBts2schema
...but I'm not sure how to fix it. Do I need to download some
intermediate version of mediawiki and upgrade the database in two stages?