Last modified: 2014-03-06 18:21:47 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 T52512, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 50512 - TemplateData: Page properties should not be stored twice (both Template and Template/doc)
TemplateData: Page properties should not be stored twice (both Template and T...
Status: ASSIGNED
Product: MediaWiki extensions
Classification: Unclassified
TemplateData (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Editing team bugs – take if you're interested!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-01 18:47 UTC by Helder
Modified: 2014-03-06 18:21 UTC (History)
6 users (show)

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


Attachments

Description Helder 2013-07-01 18:47:32 UTC
Consider the following links:
1) https://en.wikipedia.org/wiki/Special:PagesWithProp/templatedata?limit=100
2) https://pt.wikipedia.org/wiki/Special:PagesWithProp/templatedata?limit=100

As you can see, the same template data is being associated to more than one template:
1) On enwiki, both "Template:Foo" and "Template:Foo/doc"
2) On ptwiki, both "Template:Foo", "Template:Foo/doc" and "Template:Foo/dados"

Using <includeonly><templatedata>...JSON...</templatedata></includeonly> on "/doc" and "/dados" would make it impossible to preview the table in the same page.

I think a better approach would be to have a specific namespace, say "JSON:" (take this just as an example) such that "JSON:XYZ" would hold the JSON for "Template:XYZ" (and no other template). So it could be transcluded to "/doc" subpages IF the users want that table in the middle of the documentation (which is not always desirable, since it seems a little technical for newbie users, repetitive - because of the template name, its label and its description - and will be too big for templates with a lot of parameters and aliases)
Comment 1 Helder 2013-07-22 10:46:24 UTC
Another solution to the problem of the data being associated both to "Template:Foo" and to "Template:Foo/doc" (although I don't like it as much as a brand new namespace) would be to have an extra parameter which could be used to suppress the data on /docs and only get the table there.

Template:Foo/doc could use something like this:
<templatedata <noinclude>TABLEONLY=YES</noinclude> >...JSON...</templatedata>

or even

<templatedata {{#switch: {{FULLPAGENAME}}
                |Template:Foo|Template:Foo2|...|Template:Foo9
                |#default = TABLEONLY=YES
              }} >...JSON...</templatedata>

(when the same /doc is used for more than one template)
Comment 2 Krinkle 2013-07-23 12:21:39 UTC
Note that it being applied to both /doc and the Template page is not part of the design from TemplateData but part of the way en.wikipedia.org uses it.

Though there are good reasons for it to be that way (I mean, operations actually encourages to use /doc, as otherwise editing the <templatedata> block on Template:Foo will invalidate that template and as such a million articles instead of editing /doc which will only invalidate render cache for Template:Foo itself).
Comment 3 Krinkle 2013-07-23 12:23:58 UTC
I the spirit of avoiding bugs dictating solutions but instead asking to solve a problem, I'm renaming this bug to reflect the problem so that it can be marked as fixed regardless of how we end up solving it.
Comment 4 Helder 2013-07-23 13:19:17 UTC
(In reply to comment #2)
> Note that it being applied to both /doc and the Template page is not part of
> the design from TemplateData but part of the way en.wikipedia.org uses it.
I think the "/doc" structure is used in a lot of wikis (at least ptwiki and ptwikibooks uses this model)

> Though there are good reasons for it to be that way (I mean, operations
> actually encourages to use /doc, as otherwise editing the <templatedata>
> block
> on Template:Foo will invalidate that template and as such a million articles
> instead of editing /doc which will only invalidate render cache for
> Template:Foo itself).

Well.. we are having to do the null edits in the templates anyway because of bug 50372
Comment 5 James Forrester 2013-07-23 14:56:37 UTC
(In reply to comment #4)
> (In reply to comment #2)
> > Though there are good reasons for it to be that way (I mean, operations
> > actually encourages to use /doc, as otherwise editing the <templatedata>
> > block > on Template:Foo will invalidate that template and as such a million
> > articles instead of editing /doc which will only invalidate render cache
> > for Template:Foo itself).
> 
> Well.. we are having to do the null edits in the templates anyway because of
> bug 50372

Null edits. Actual content changes (like putting a <templatedata> block in) would cause a full re-render, I believe.
Comment 6 Richard Morris 2013-07-29 23:04:53 UTC
A lot of templates are protected or semi-protected this means there is a practical problem with people adding the templatedata to the actual template.

Null edits are now less of a problem since a change which makes null edits not request recursive page loads and added action=purge&forcerecursivelinkupdate=1 for when you want all transcluding page to be reloaded.
Comment 7 Helder 2013-08-17 12:34:36 UTC
About the "new namespace" proposal, see also:
https://www.mediawiki.org/wiki/Thread:Extension_talk:TemplateData/TemplateData_expansion_to_Data

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


Navigation
Links