@Krassotkin reported this page fails to show any graphs.
Men's Health is for some reason gets url path encoded as Men%26%2339%3Bs%20Health -- in other words the title of the page is HTML encoded (' => ') before url encoding.
(full url)
@Krassotkin reported this page fails to show any graphs.
Men's Health is for some reason gets url path encoded as Men%26%2339%3Bs%20Health -- in other words the title of the page is HTML encoded (' => ') before url encoding.
(full url)
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
Add {{urlencode:...|REPATH}} magic keyword | mediawiki/core | master | +16 -1 |
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | Yurik | T129346 Unable to get pageviews for the title with ' in the name | |||
Open | None | T129901 Encode '/' as part of the {{*E}} magic keywords like PAGENAMEE |
I'm not sure if this is analytics it wiki escaping issue. The HTML escaping
happens before URL encoding
Hi,
This requests works: https://wikimedia.org/api/rest_v1/metrics/pageviews/per-article/ru.wikipedia/all-access/all-agents/Men's%20Health/daily/2016010100/2016010123
We don't have knowledge of russian characters, can you help us precise the issue?
Thanks
{{Graph:PageViews|100|Men's Health}} on en wiki works fine, encoding the value as https://wikimedia.org/api/rest_v1/metrics/pageviews/per-article/en.wikipedia.org/all-access/user/Men%27s%20Health/daily/2015120517/2016031417
or another words -- Men%27s%20Health
{{Graph:PageViews}} on the Men's Health article tries to get the data from https://wikimedia.org/api/rest_v1/metrics/pageviews/per-article/en.wikipedia.org/all-access/user/Men%26%2339%3Bs%20Health/daily/2015120517/2016031417
which is incorrect: Men%26%2339%3Bs%20Health
The problem is in the template itself - {{urlencode:{{{2|{{ARTICLEPAGENAME}} }}}|PATH}} produces Men%26%2339%3Bs%20Health. Suggestions?
This problem can easily be solved with Lua, or decoding html entries, e.g. {{#htmldecode | {{ARTICLEPAGENAME}} }} (doesn't exist). The {{ARTICLEPAGENAMEE}} is not good because it uses URL query encoding, not URL path encoding (first does not encode the '/' symbol). The problem is that having Lua reduces portability of the template - lua code has to be kept in sync as well.
Sorry, no suggestions from me, I think the pageview API is doing the right thing, just blindly decoding.
Change 289131 had a related patch set uploaded (by Yurik):
Add {{urlencode:...|REPATH}} magic keyword