Issue:Output nothing if using include in parser function version of DPL within template

From FollowTheScore
Jump to: navigation, search
Description: Output nothing if using include in parser function version of DPL within template
Extension / Version: DPL   /   1.7.4
Type / Status: Bug   /   open

Problem

When I use parser function version of DPL within a template, the "include" function will make the whole wiki page output nothing (i.e., empty HTML), and there seems no error in MediaWiki's debug log. I use it like this:

{{#dpl:
|category={{{1}}}
|include=#SomeSection
|titleregexp={{{2}}}
|format=,<h2>'''[[%PAGE%|%PAGE%]]'''</h2>
}}
  1. If I use debug=5, I can see the non-parsed Wiki text output correctly.
  2. If I use it individually (not within the template and replace those variable), it also works correctly.
  3. If I remove "include", it works.
  4. Since I have to pass parameters, I can only use the parser function version.

My MediaWiki version: 1.13.0. Is there any clue I can investigate further? Thanks!

Ericyu 09:36, 22 October 2008 (UTC)

Reply

I guess that you have a problem with the regexp.

The following example works correctly (here, using MW 1.13) as you can see:

{{test get chapter|fictitious country|.*un.*}}
#1 = fictitious country
#2 = .*un.*
{{#dpl:
|category={{{1}}}
|include=#Religion
|titleregexp={{{2}}}
|format=,<h2>'''[[%PAGE%|%PAGE%]]'''</h2>
}}

Nigunda

some facts about religious groups in Nigunda; some other facts about religious groups in Nigunda;

Nigunda Test

some facts about religious groups in Nigunda; some other facts about religious groups in Nigunda Test;

Reply 2

Thank you Gero. I did some more experience and found that template is not the root of this issue. This time I don't use template.

Both of the following methods are OK:

Method 1:
{{#dpl:
|category=Report
|include=#Eric
|count=5
}}

Method 2:
<dpl>
  category=Report
  include=#Eric
  count=5
</dpl>
  1. In method 1, if count > 5 (i.e., 6 and above), it makes the wiki output nothing. There seems no such limitation in method 2.
  2. In method 1, if I remove the include portion, it can also output the article list.
  3. I turn on the PHP error message and it reads:
    Fatal error: Call to a member function getPrefixedDBkey() on a non-object in /home/wiki/mediawiki/includes/parser/Preprocessor_DOM.php on line 994

You can try these example here.

Exp. 1 - OK

{{#dpl:
|category=Issue
}}

Exp. 2 - Fail (it's OK if adding count=2)

{{#dpl:
|category=Issue
|include=#Reply
}}

Exp. 3 - OK

<dpl>
  category=Issue
</dpl>

Exp. 4 - OK

<dpl>
  category=Issue
  include=#Reply
</dpl>

Thank you. Ericyu 14:35, 22 October 2008 (UTC)

Reply 3

I think it is the same issue of Issue:Call to a member function getPrefixedDBkey() on a non-object. However, at MW 1.13.0, this problem only occurs at DPL 1.7.3 and above, and it is OK with DPL 1.7.2. Ericyu 01:26, 23 October 2008 (UTC)