Last modified: 2014-08-22 06:38:51 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 T71647, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 69647 - TemplateData: "sets" don't come through in api when td is in a transcluded page
TemplateData: "sets" don't come through in api when td is in a transcluded page
Status: RESOLVED DUPLICATE of bug 50372
Product: MediaWiki extensions
Classification: Unclassified
TemplateData (Other open bugs)
unspecified
All All
: High normal (vote)
: ---
Assigned To: Moriel Schottlender
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-08-16 12:10 UTC by mvolz
Modified: 2014-08-22 06:38 UTC (History)
4 users (show)

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


Attachments

Description mvolz 2014-08-16 12:10:10 UTC
When the td is transcluded, the api returns an empty array for "sets". 

"sets" are getting eaten on transclusion. i.e. in the api they appear in, for instance, api.php?action=templatedata&titles=Template:Cite_journal/doc, but NOT in api.php?action=templatedata&titles=Template:Cite_journal, when the sets field is set in <templatedata> tags.
Comment 1 mvolz 2014-08-16 18:04:00 UTC
Additional info:

1. Sets are not currently being used, as far as I know.

2. So in order to test this, you'll have to add (on localhost) the set parameter. For instance, in my <templdatedata> I have: 

	"sets": [
		{
			"label": "SomeIDs",
			"params": ["id", "rfc"]
		}
	],

3. And then in the api, on Cite_journal/doc I get back:

            "sets": [
                {
                    "label": {
                        "en-gb": "SomeIDs"
                    },
                    "params": [
                        "id",
                        "rfc"
                    ]
                }
            ],

4. But in the api, on Cite_journal, I get back:

            "sets": []

Which is an empty array that is appended to what is returned from the api, since what the is retrieved from the database does not contain the sets parameter.
Comment 2 Moriel Schottlender 2014-08-19 20:07:59 UTC
I tested this on my local wiki by adding sets: [] to a local template. I was able to get the full information (with the sets I filled in) in the API response.

If this was tested in production, I wonder if it may have been a case of delay between updating some cache the API is using?

Am I misunderstanding the problem?
Comment 3 Krinkle 2014-08-22 01:28:55 UTC
Can't reproduce this on latest master.

Edited Unsigned/doc on my local wiki and added a sets section:

	"sets": [
		{
			"label": {
				"en": "Default",
				"nl": "Standaard"
			},
			"params": [
				"user",
				"timestamp"
			]
		}
	]

* w/api.php?format=jsonfm&action=templatedata&titles=Template:Unsigned/doc
* w/api.php?format=jsonfm&action=templatedata&titles=Template:Unsigned


Both included the new "sets" data.
Comment 4 mvolz 2014-08-22 06:38:51 UTC
Thanks for looking into this all.

I just realized this is actually a duplicate bug:

https://bugzilla.wikimedia.org/show_bug.cgi?id=50372

Basically the templatedata property in pp page gets updated when I save changes to cite_web/doc, but not cite_web, so when I made api requests I was getting old td from cite_web and the new changes to cite_web/doc. I can force the change by making a blank edit to the place where td is transcluded i.e. directly in Template:cite_web.

The fact that what I was editing was "sets" at the time was a red herring, so thanks for disabusing me of the notion this was a "sets" issue!

*** This bug has been marked as a duplicate of bug 50372 ***

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


Navigation
Links