Movatterモバイル変換


[0]ホーム

URL:


Jump to content
MediaWiki
Search

Manual talk:$wgEnableScaryTranscluding

Add topic
From mediawiki.org
Latest comment:10 years ago by Nemo bis in topicMITRE uses

Transcluding from Wikimedia projects

[edit]

I can't get these to work at all. I'm using MediaWiki 1.9.3 with PHP 5.2.1. Whenever I try to include an external template, I get an error message that looks like this:

[Template fetch failed forw:en:Template:User_en?action=render; sorry]

I don't think I'm the only personwith this problem. I've googled the phrase"Template fetch failed for" and have found several other wikis with this problem as well. The setup for this feature is so simple and so straightforward -- I can't imagine how I could be doing it wrong. -Big Brother 198408:24, 11 April 2007 (UTC)Reply

Alter theinterwiki table and change the URL for Wikipedia (assuming the above example) tohttp://en.wikipedia.org/w/index.php?title=$1; I recall some problems with the rewritten form. There should also be some more on this in themediawiki-l mailing list archives.robchurch |talk08:30, 11 April 2007 (UTC)Reply
Changing the URL for Wikipedia made the difference for me. I had to create a new interwiki prefix though to get the system to recognize it.Jlerner22:07, 19 March 2009 (UTC)Reply
Update - I found the problem. It appears that Wikipedia doesn't allow scripts to access its site. Take a look at theuser_agent setting in yourphp.ini. ^>^ However, the function still doesn't work like it's supposed to. Instead of grabbing just the template, it grabseverything that appears onthe 'render' page. (Including template usage information) --Big Brother 198408:35, 11 April 2007 (UTC)Reply
Another Update - It appears that the software is ignoring the <noinclude> tag. Or rather, the 'render' action causes the template to be returned from the external sitewithout any <noinclude> tags. In other words, when my site requests a template with the parameter"action=render", the external site sends me the everything on the template page, including the text between the <noinclude> tags. This should not be how this works. Perhaps another "action=" parameter needs to be added to the software that will cause the external site to return the template without the data between the <noinlude> tags??? --Big Brother 198409:52, 11 April 2007 (UTC)Reply
3rd Update -- InParser.php there is a boolean named$forceRawInterwiki. I'm wondering if this could provide a solution to this problem. I tried setting it to TRUE, but that only results in the following error message:
[Template fetch failed forw:en:Template:user_en?action=raw; sorry]
When I try navigating tothat page manually I get aHTTP Error 403 - Forbidden message in my browser. I can't find any documentation for this "raw" feature anywhere, so it's entirely possible that I may be barking up the wrong tree. The only clue as to what$forceRawInterwiki does is a comment in the source code that says that this variable"Forces interwiki transclusion to be done in raw mode not rendered". Can anybody enlighten me as to what this option is actually supposed to do? --Big Brother 198410:55, 11 April 2007 (UTC)Reply
Solution -- If you're trying to pull your templates from Wikipedia you'll need to up the $wgHTTPTimeout from 3 to a higher number like 20. To fix up your personal wiki you'll then need to set the $wgTranscludeCacheExpiry to 0 and then you can resave so it'll cache a copy local to your mediawiki. Afterwards set the $wgTranscludeCacheExpiry back to 3600 (1 hour). Cheers -- (ddarcy@digipen.edu)64.183.53.16606:25, 25 November 2008 (UTC)Reply
4th Update -- Regarding the 3rd update above. The $forceRawInterwiki variable in Parser.php is relavent. When this is false, the transcluded template is not parsed as template from the local wiki would be. In particular, template parameters are not substituted. It will only work as you would like if $forceRawInterwiki is true. This can be done by setting it directly in Parser.php, but the intention appears to be that you force it by starting the template declaration with theTemplate Modifierraw. So while {{otherwiki:tmpl|value}} will fail to substitute {{{1}}} in the template, we will get the desired effect with {{raw:otherwiki:tmpl|value}}. This raw modifier will result in the error reported above if your interwiki URL is configured incorrectly. Thedocumentation onaction=raw states that it may only be allowed when the page is accessed as aprimary script access point, that is, when using the "ugly" URL form withindex.php?title=.... Changing the URL in your interwiki table to use the ugly form should fix the problem. This whole thing seems nasty, does anyone have a nicer solution? --Mbmcloughlin19:56, 13 June 2009 (UTC)Reply
after following these steps, the pages pulling the templates are full of errors and markup stuff, for example
Template:Infobox{{#if:|}}{{#if:|}}{{#if:|}}{{#if:|}}{{#if:|}}{{#if:|}}{{#if:|}} ...
I've activated interwiki and corrected the wiki link in the database to the long ugly format, set $forceRawInterwiki to true. I did not see a difference when using {{raw:wiki:Infobox}} and {{wiki:Infobox}}. Please Help! --24.140.145.4220:13, 29 June 2011 (UTC)Reply

What syntax  ?

[edit]

Everything is in the title : can anyone give an example of inter-wiki transcluding ? How should it be written to get a transclusion from here tow:Wikipedia:Transclusion ? --NewMorning12:55, 29 June 2008 (UTC)Reply

Switch the [[ and ]] with {{ and }} in your link above, and you've got it. --Skizzerz12:58, 6 August 2008 (UTC)Reply

Turning on other namespaces

[edit]

Is there related work to make this support transclusion from other namespaces?Sj22:31, 5 August 2008 (UTC)Reply

Transclusion from other namespaces is always possible (unless you explicitly forbid it using $wgNonincludableNamespaces). To include a user page, use {{User:Foo}}. To include from the main namespace, use {{:Foo}}. HTH --Duesentrieb08:35, 6 August 2008 (UTC)Reply
I'm reading Sj's request as being able to transclude from foreign wikis in namespaces other than Template:. For example, I run two wikis on a site that are very similar and that share the user table via $wgSharedDB and $wgSharedTables. I'd like for a user to optionally be able to transclude their user page in one wiki to the other so that they only have to maintain one user page. But right now, it's not possible because everything is being forced through a Template: prefix. --TonyV16:37, 22 March 2009 (UTC)Reply
Solution -- Just add a colon to the beginning after the site prefix. For example, {{w::User:Me}} (that's a double colon). If you use only {{w:User:Me}}, it'll fetch Template:User:Me. The reason for this is that the server has no way of knowing what is and isn't a namespace on the other Wiki, so it just assumes it isn't one. --71.112.238.18400:25, 24 March 2009 (UTC)Reply

Is it scary because it doesn't work?

[edit]

Tisane09:50, 29 March 2010 (UTC)Reply

it's scary because it is totally inefficient and perhaps even broken (I'm not sure). SeeGSOC#Reasonably_efficient_interwiki_template_transclusion for an alternative we hope to have soon --Church of emacstalk ·contrib16:33, 30 May 2010 (UTC)Reply
this is the updated link for the one aboveSummer_of_Code_2010#Reasonably_efficient_interwiki_template_transclusion --24.140.145.4218:51, 29 June 2011 (UTC)Reply

Does not work on MW 1.16.x

[edit]
  • MediaWiki 1.16.2, the same in 1.16.4 and 1.16.5
  • PHP 5.2.17 (apache2handler), the same in 5.3.6
  • MySQL 5.0.77-log

Got an error in php error log:

PHP Fatal error:  Cannot redeclare class HttpRequest in /local_path_to_site/w/includes/HttpFunctions.php on line 122

when try to transclude template from another wiki in the same wiki-farm

{{WikiName:Template:TemplateName}}

WikiName is in interwiki table

In another installation of MediaWiki 1.16.4 it does not work with a different error. In browser I have:[Template fetch failed forhttp://my.domain/wiki/Template:TemplateName&action=render]

and with the "ugly URL" in interwiki table:

[Template fetch failed forhttp://my.domain/w/index.php?title=Template:TemplateName&action=render]

Does anybody have a suggestion, please? Is it a PHP configuration problem or a MediaWiki bug?Pavel Malakhov10:24, 4 May 2011 (UTC)Reply

The issue was due to HMTL extention for PHP, disabling it solved the problem. Seebugzilla for details.Pavel Malakhov09:39, 20 May 2011 (UTC)Reply

Searchable?

[edit]

Will the pages transcluded from another site show up in my search index? I'm currently using SphinxSearch, and the answer appears to be no. Do I need to switch to Lucene, or is there no hope for indexing transcluded pages?

Thanks!

--Jlemley17:34, 11 November 2011 (UTC)Reply

  • External/third party search enginesshould index the transcluded content to your site, Google indexes Wikisource mainspace even when the content is transcluded from pagespace. The internal mediawiki search engine apparently looks directly at the database and therefore does not index transcluded content to the page that it transcludes to, only to the page it comes from (which are only local pages in the case of WMF) and this is a known and quite serious issue (seebug 18861). I don't know about SphinxSearch, especially when used as an extension, but there is some mention (no solutions) of this issue atExtension talk:SphinxSearch. These should be the same for scary transclusion as the search engine shouldn't make any distinction. I will research it further though. Does your SpinxSearch index locally transcluded content to the page where it's transcluded?--Doug.(talkcontribs)10:09, 7 December 2011 (UTC)Reply

oldwikisource:MediaWiki:InterWikiTransclusion.js

[edit]

Wikisource has implemented a JavaScript solution.Nemo19:41, 14 November 2011 (UTC)Reply

This is awesome

[edit]

This works incredibly well, especially considering all the bad press. I have no problems with it and have successfully transcludednon-mediawiki wikis; specificallyMoinMoin wikis - I've even successfully substituted them. It doesn't quite work if you try to transclude from an html site and it does really poorly if you try to transclude a text or code page that includes wikimarkup (e.g. a page of python code for thePywikipediabot will look really messy because it will recognize elements of wikitext and html included in the code).Extension:Interwiki is a good way to manage what is and what isn't transcludable. --Doug.(talkcontribs)20:29, 6 December 2011 (UTC)Reply

Interlanguage Transcluding

[edit]

Is there a way for interwiki-interlanguage transclusions too. I did expected sth like{{wikipedia:de::user:xqt}} or{{wikipedia::de:user:xqt}} likewise normal interwiki-interlanguage link[[wikipedia::de:user:xqt]] works for me.Xqt05:26, 14 January 2012 (UTC)Reply

Thanks for the question, this would be helpful for me, too. I'm maintaining a wiki in German (SMBwiki) where transclusions of Wikipedia articles would be a great help. The error message (e.g.[Vorlageneinbindung fürhttp://en.wikipedia.org/wiki/de:Wikimedia_Commons?action=render ist gescheitert]) contains a working link (http://en.wikipedia.org/wiki/de:Wikimedia_Commons), therefore I'm hopeful, that there is a solution. --ThT (talk)14:31, 5 March 2012 (UTC)Reply

check if transclusion successful

[edit]

hi folks, is there a possibility to check if the scary transclusion was successful?

background: I am transcluding a page with the same name from another wiki. If this page is not available I get following error:

[Vorlageneinbindung fürhttp://www.cnc-ktn.net/wiki/index.php/G%C3%BCnter_Gr%C3%B6ssl?action=raw ist gescheitert]

That's ok, but I want to provide additional information to the user if the transclusion fails.

thx for any hints,cheers, --Rolze (talk)07:32, 1 August 2012 (UTC)Reply

MITRE uses

[edit]

MITREtold us that they are using transclusion from Wikipedia pages to their enterprise wikis without issues. --Nemo10:59, 25 May 2015 (UTC)Reply

Transcluding and SSL Self Signed Certificate

[edit]

Mediawiki 1.26, Ubuntu 16.04.1.

Transcluding stopped working when we moved Wikis to HTTPS only. Were getting error scarytranscludefailed ("[Template fetch failed for $1]").

Turned out being that we are using self signed certificates.

Had to dive into includes/parser/Parser.php, function fetchScaryTemplateMaybeFromCache, and var_dump($status) after line 4125 to understand what was going on:

object(Status)#405 (6) { ["sv":protected]=> object(StatusValue)#403 (6) {   ["ok":protected]=>   bool(false)   ["errors":protected]=>   array(1) {     [0]=>     array(3) {       ["type"]=>       string(5) "error"       ["message"]=>       string(15) "http-curl-error"       ["params"]=>       array(1) {         [0]=>string(113) "error setting certificate verify locations: CAfile: /etc/ssl/certs/ca-certificates.crt CApath: /etc/ssl/certs"       }     }   }

After importing the certificate into /etc/ssl/certs/ca-certificates.crt it began working again.

openssl s_client -showcerts -connect domain:443 </dev/null 2>/dev/null|openssl x509 -outform PEM >mycertfile.pemsudo sucat mycertfile.pem >>/etc/ssl/certs/ca-certificates.crt

Remember to set $wgTranscludeCacheExpiry = 0 during tests, or the cache will drive you mad.

Retrieved from "https://www.mediawiki.org/w/index.php?title=Manual_talk:$wgEnableScaryTranscluding&oldid=4693639"

[8]ページ先頭

©2009-2025 Movatter.jp