Last modified: 2014-09-24 01:03:55 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T7278, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 5278 - Self-including templates should reflect changes on preview
Self-including templates should reflect changes on preview
Status: PATCH_TO_REVIEW
Product: MediaWiki
Classification: Unclassified
Templates (Other open bugs)
unspecified
All All
: Low normal with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
http://en.wikipedia.org/wiki/Template...
: patch, patch-need-review
: 11367 22341 63944 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-03-17 16:56 UTC by Patrick Doyle
Modified: 2014-09-24 01:03 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Patch for rendering (8.09 KB, patch)
2010-06-10 12:11 UTC, Conrad Irwin
Details

Description Patrick Doyle 2006-03-17 16:56:43 UTC
This is a feature request.

Templates sometimes include an example of their own usage inside <noinclude>
tags.  It would be nice if previewing a change to such a template would reflect
the changes.  In fact, as far as I know, there is currently no way to preview
the effect of a template aside from (1) submitting it, (2) picking a page that
includes it, (3) doing a null edit on said page, and (4) inspecting said page.

This suggestion would provide a way to preview template changes before they go
"live".
Comment 1 Brion Vibber 2006-03-17 19:52:04 UTC
There's no such thing as "self-including templates". If it appears to work, that's a bug.
Comment 2 Patrick Doyle 2006-03-17 21:02:57 UTC
Why not?  It's in a <noinclude>.  Seems reasonable to me.
Comment 3 Rob Church 2006-04-01 23:07:38 UTC
At the point of previewing, the template changes aren't saved in the database,
so the transclusion processor doesn't know about them, hence can't render them.
Comment 4 Patrick Doyle 2006-04-02 02:39:31 UTC
Ok, thanks.  That explains why it currently doesn't work.  Can the transclusion
processor be given access to the text of the page being previewed?  That
probably requires some interface changes, but it may be worthwhile if it allows
templates to be previewed.
Comment 5 Brion Vibber 2006-04-02 03:08:23 UTC
Self-inclusion would violate the recursion checks; once that bug is fixed there
would be nothing to show. Resolving INVALID.
Comment 6 Patrick Doyle 2006-04-02 17:06:45 UTC
Brion, I'm finding your approach to this bug very frustrating.  If you're going
to keep closing this bug, can you at least explain why you think this feature
should be disallowed?
Comment 7 Brion Vibber 2006-04-02 19:12:38 UTC
Recursive inclusions are disallowed as a standard protection against loops.
Comment 8 Alexandre Emsenhuber [IAlex] 2009-09-21 16:58:24 UTC
*** Bug 11367 has been marked as a duplicate of this bug. ***
Comment 9 Patrick Doyle 2009-09-21 17:08:31 UTC
Recursive inclusions inside <noinclude> can't cause loops.
Comment 10 Alexandre Emsenhuber [IAlex] 2010-02-01 16:05:14 UTC
*** Bug 22341 has been marked as a duplicate of this bug. ***
Comment 11 Conrad Irwin 2010-06-10 12:11:54 UTC
Created attachment 7454 [details]
Patch for rendering

This patch adds short-circuits to ParserOptions::mTemplateCallback during the parse() phase of preview, save, and parserTests (bug 8158), which includes the current text of the page instead of the previous revision from the database.

This means that it won't change the behaviour of {{subst:, which continues to use the previous page's revision, and any extensions that deal with the current version of the current article will not be able to see the pending revision (as who knows what they might do).

Is this approach the right way to do things, and, if so, is this patch sufficient?
Comment 12 Sumana Harihareswara 2012-08-17 10:48:03 UTC
Adding Derk-Jan & Gabriel to cc so they can comment on this patch.
Comment 13 Brad Jorsch 2014-04-15 18:39:48 UTC
*** Bug 63944 has been marked as a duplicate of this bug. ***
Comment 14 Gerrit Notification Bot 2014-06-03 20:14:19 UTC
Change 137153 had a related patch set uploaded by Jackmcbarn:
Use preview content when it transcludes itself

https://gerrit.wikimedia.org/r/137153

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links