wp-mirror-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wp-mirror-list] Template expansion inconsistency


From: wp mirror
Subject: [Wp-mirror-list] Template expansion inconsistency
Date: Fri, 21 Feb 2014 17:21:18 -0500

Dear Sir or Madam,

I am not sure to which person or list I should address this question to.

0) Objective

I am in the process of building DEB packages for: WP-MIRROR 0.7, the
latest development version of MediaWiki 1.23, and a set of MediaWiki
extensions.

The objective is to this:  That a page rendered by a mirror should
look the same a that page rendered by the WMF site.

1) Problem

In the process of testing mirrors, I noticed that many templates were
not expanding, and instead being rendered as red-links.

2) Example

To illustrate, consider the Ndash template, which appears on many
pages such as <http://simple.wikipedia.org/wiki/August>.  It appears
in the underlying database:

mysql> select page_id,page_title,rev_len,old_text from
simplewiki.page,simplewiki.revision,simplewiki.text where
page_id=rev_page and rev_text_id=old_id and page_title like
'Template:Ndash' limit 10\G
*************************** 1. row ***************************
   page_id: 132985
page_title: Template:Ndash
   rev_len: 65
  old_text: &ndash;<noinclude>
[[Category:Formatting templates]]
</noinclude>
1 row in set (0.25 sec)

3) Special:ExpandTemplates

To test the above example ``Template:Ndash'', I use Special:ExpandTemplates.

3.1) Input text

Today is the {{CURRENTDAY}} day.</br>
This server is {{SERVER}}, script path {{SCRIPTPATH}}, current MW
version {{CURRENTVERSION}}.</br>
This site is {{SITENAME}}. Full page name is {{FULLPAGENAME}}.</br>
<table>
<tr><th>Template</th><th>Expanded</th><th>page_id</th><th>rev_len</th></tr>
<tr><td>Ndash</td><td>{{Ndash}}</td><td>{{PAGEID:
Ndash}}</td><td>{{PAGESIZE: Ndash}}</td></tr>
<tr><td>Template:Ndash</td><td>{{Template:Ndash}}</td>
    <td>{{PAGEID: Template:Ndash}}</td><td>{{PAGESIZE:
Template:Ndash}}</td></tr>
<tr><td>Template:Template:Ndash</td><td>{{Template:Template:Ndash}}</td>
     <td>{{PAGEID: Template:Template:Ndash}}</td><td>{{PAGESIZE:
Template:Template:Ndash}}</td></tr>
</table>

3.2) <http://simple.wikipedia.site/wiki/Special:ExpandTemplates> Preview

Here is the result from the WMF site:

Today is the 21 day.
This server is //simple.wikipedia.org, script path /w, current MW
version 1.23wmf14 (f8b9201).
This site is Wikipedia. Full page name is My template.
Template        Expanded        page_id rev_len
Ndash   –       0       0
Template:Ndash  –       132985  65
Template:Template:Ndash Template:Template:Ndash         0       0

Both {{Ndash}} and {{Template:Ndash}} expand as expected.

3.3) <http://simple.wikipedia.site/wiki/Special:ExpandTemplates> Preview

Here is the result from the mirrored site:

Today is the 21 day.
This server is http://simple.wikipedia.site, script path /w, current
MW version 1.23alpha.
This site is simplewiki. Full page name is My template.
Template        Expanded        page_id rev_len
Ndash   Template:Ndash  0       0
Template:Ndash  Template:Ndash  0       0
Template:Template:Ndash –       132985  65

Only {{Template:Template:Ndash}} expands!

4) Question

Why do I need to prepend an extra ``Template:'' to make the templates
work for the mirror?

Better yet: Could someone tell me where in the MediaWiki core I can
find the code that takes the template (e.g. {{Ndash}} or
{{Template:Ndash}}) and converts it into an SQL query that SELECTs the
template expansion from the underlying database?

Sincerely Yours,
Kent



reply via email to

[Prev in Thread] Current Thread [Next in Thread]