Page MenuHomePhabricator

Scary transclusion is non-intuitive and unreliable
Open, LowPublic

Description

Author: MediaWiki

Description:
Right now, if one transcludes a page from another wiki using the wgEnableScaryTranscluding functionality, it does not properly obey <noinclude>. I'm guessing this is because it's getting content from the other wikis using action=render?

Anyway, it should use action=raw to get the plain wikitext and parse it locally, calling in remote template source (also with action=raw) until the include is done, then put the fully-parsed, behaving-as-expected text in the including article.


Version: 1.16.x
Severity: normal

Details

Reference
bz12401

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:00 PM
bzimport set Reference to bz12401.
bzimport added a subscriber: Unknown Object (MLST).

if you use it as {{raw:interwiki:templatename}} it will parse the raw text.

MediaWiki wrote:

(In reply to comment #1)

if you use it as {{raw:interwiki:templatename}} it will parse the raw text.

I guess what I'm thinking is that parsing the raw text would be the logical default, so it behaves like other transclusions from the local wiki.

amtw-wikibugs wrote:

When I try <nowiki>{{raw:wikipedia:unsourced}}</nowiki>, I get:

Forbidden
Raw pages must be accessed through the primary script entry point.

It accesses <nowiki>http://en.wikipedia.org/wiki/Template:unsourced?action=raw</nowiki>

What is the markup for using Wikipedia's "Unsourced" template on
my wiki?
~~~~

jlerner wrote:

I ran into the same problem. Try setting iw_url to something like http://en.wikipedia.org/w/index.php?title=$1, in the interwiki table. Then the {{raw:wikipedia:unsourced}} syntax should work.

Note: I had trouble getting the system to recognize this change, so I just created a new prefix.

wikipedia wrote:

This bug still appears in 1.15.0. Things in <noinclude> still shows up during interwiki-transclusion.

I tried the suggestion in comment #4, but {{raw:wikipedia:unsourced}} shows the following line:

    • Start quote -----
  1. REDIRECT Template:Unreferenced
    • End quote ------

It does not give an expected result - gives the unsourced box.

The problems I see are twofold:

  1. The default action is confusing. Rather than just getting the wikitext and using it like a template, it grabs the action=render output and just includes the HTML.
  2. The "raw" usage uses ?action=raw, so breaks on wikis with "pretty URLs" and can't follow redirects.

The first could be fixed without too much work probably, but it would break backward compatibility for people who want the current behavior.

For the second, it would probably be best if scary transclusion used the API to get the page text, but that would be dependent on it being able to find the API, which would depend on bug 14024.

  • Bug 16137 has been marked as a duplicate of this bug. ***
  • Bug 16490 has been marked as a duplicate of this bug. ***

wikipedia wrote:

As of Mediawiki versions 1.16.2, this problem still persists.

When I do {{wikipedia:mbox|text=Test}}, that would transclude the whole Template:Mbox documentation page. The documentation page is in the <noinclude> tags. So it is still not working.