-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Good day,
This is my first post to this list and having read the last couple of
posts, my question might be a bit too low-level. But I still hope that
you might point me in the right direction.
I've been working on this extension that generates qrcode bitmaps and
displays them on a wiki page [0].
In that extension, I'm using the upload() method made available by the
LocalFile object, as documented on [1]. In my specific case, the
relevant code looks like this:
$ft = Title::makeTitleSafe( NS_FILE, $this->_dstFileName );
$localfile = wfLocalFile( $ft );
$saveName = $localfile->getName();
$pageText = 'QrCode [...]';
$status = $localfile->upload( $tmpName, $this->_label, $pageText,
File::DELETE_SOURCE, false, false, $this->_getBot() );
The extension is implemented as a parser function hooked into
ParserFirstCallInit.
Now, I haven't found any other explanation, so I suppose this use of the
upload() method leads to a peculiar behaviour on my wiki installation,
exhibited by these things:
1. QrCodes are generated for pages that do not have or transclude a
{{#qrcode:}} function call, in this case properties [2,3,4].
2. These uploaded files have properties [5] and they belong to a
category, which means they get linked in the categorylinks table. A
common result of this is that qrcode images turn up in i.e. semantic
queries [9,10].
3. Qrcodes are even generated for existing qrcodes [6,7]. One way to
trigger than behaviour is to visit a File's page and click on the Delete
link, without actually deleting the file. This leads to situations such
as [8].
4. The files get linked from several pages as this example shows [11].
None of the pages said to link to the file actually do include that
file, also those pages vary (2 days ago, 14 pages linked, today only 7 link)
5. Browsing the properties of the above file [12], you can see that it
got somehow mixed up with a completely different event.
6. Looking at the database, the mixup hypothesis is confirmed:
SELECT page_id,page_title,cl_sortkey FROM `page` INNER JOIN
`categorylinks` FORCE INDEX (cl_sortkey) ON ((cl_from = page_id)) LEFT
JOIN `category` ON ((cat_title = page_title AND page_namespace = 14))
WHERE (1 = 1) AND cl_to = 'Project' ORDER BY cl_sortkey
gives (among other data):
page_id page_title cl_sortkey
1403 SMS2Space File:QR-Ask.png
1244 Syn2Sat File:QR-LetzHack.png
1251 ChillyChill File:QR-Syn2cat-radio-ara.png.png
This behaviour occurs in both mw 1.15.5 and 1.16. I would be very
grateful if someone more experienced could have a look at this
situation. Maybe I'm using the upload() method in a way I should not.
sincerely,
David Raison
[0]
http://www.mediawiki.org/wiki/Extension:QrCode
[1]
http://svn.wikimedia.org/doc/classLocalFile.html#4b626952ae0390a7fa453a4bfe…
[2]
https://www.hackerspace.lu/wiki/File:QR-Is_U19.png
[3]
https://www.hackerspace.lu/wiki/File:QR-Has_SingleIssuePrice.png
[4]
https://www.hackerspace.lu/wiki/File:QR-Has_Issues.png
[5]
https://www.hackerspace.lu/wiki/Property:Has_SingleIssuePrice
[6]
https://www.hackerspace.lu/wiki/File:QR-QR-Location.png.png
[7]
https://www.hackerspace.lu/w/index.php?title=Special:RecentChanges&hide…
[8]
https://www.hackerspace.lu/wiki/File:QR-QR-QR-QR-Location.png.png.png.png
[9]
https://www.hackerspace.lu/wiki/Projects#Concluded_Projects
[10]
https://www.hackerspace.lu/wiki/Special:BrowseData#Q
[11]
https://www.hackerspace.lu/wiki/File:QR-Syn2cat.png
[12]
https://www.hackerspace.lu/wiki/Special:Browse/File:QR-2DSyn2cat.png
- --
The Hackerspace in Luxembourg!
syn2cat a.s.b.l. - Promoting social and technical innovations
11, rue du cimetière | Pavillon "Am Hueflach"
L-8018 Strassen | Luxembourg
http://www.hackerspace.lu
- ----
mailto:david@hackerspace.lu
xmpp:kwisatz@jabber.hackerspaces.org
mobile: +43 650 73 63 834 | +352 691 44 23 24
++++++++++++++++++++++++++++++++++++++++++++
Wear your geek:
http://syn2cat.spreadshirt.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla -
http://enigmail.mozdev.org/
iEYEARECAAYFAkydFFkACgkQYTtdUdP5zDe3ygCePV0b6tG9QZjQ8ZuytNWHQjR3
99IAn1e5mAP/k139J/yuzUPHMTTBjl85
=JAUx
-----END PGP SIGNATURE-----