Closed
Bug 982942
Opened 11 years ago
Closed 11 years ago
Getting the raw section fails for non en-US docs
Categories
(developer.mozilla.org Graveyard :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: fs, Unassigned)
References
Details
(Whiteboard: [specification][type:bug])
What did you do?
================
I tried to include a page section using {{page(url, section)}}. That macro includes sections with these calls:
For en-US: https://developer.mozilla.org/en-US/docs/MDN/Doc_status/DevTools?raw¯os§ion=Summary
For de: https://developer.mozilla.org/de/docs/MDN/Doc_status/DevTools?raw¯os§ion=Summary
What happened?
==============
The English section is available. The same call at a localized page (here "de") is not returning any output.
The German page is this one: https://developer.mozilla.org/de/docs/MDN/Doc_status/DevTools
The JSON (https://developer.mozilla.org/de/docs/MDN/Doc_status/DevTools$json) of this page has the "Summary" section (thanks to bug 982174), but it also does not work for "TEST" which is a <h2> not generated from KumaScript.
What should have happened?
==========================
https://developer.mozilla.org/de/docs/MDN/Doc_status/DevTools?raw¯os§ion=Summary should return the "Summary" section of the German document.
Is there anything else we should know?
======================================
This is used internally in a lot of cases with the {{page}} macro. It seems unrelated to the recent fixed bug 982174, as it happens for non-KumaScript generated sections as well.
Comment 1•11 years ago
|
||
Hmm, seems like it's not the locale itself that's the issue. The en-US page has a plain <h2> for section, while that section is entirely kumascript-generated in the de page.
Do you have an example of a non-en-US page without kumascript-generated sections where this also doesn't work? Trying to narrow it down to locale vs kumascript being the problem.
Reporter | ||
Comment 2•11 years ago
|
||
So, let's have an English and a German page with and without kumascript-generated sections:
German:
https://developer.mozilla.org/de/docs/MDN/Doc_status/DevTools
Non-Kumascript generated:
https://developer.mozilla.org/de/docs/MDN/Doc_status/DevTools?raw¯os§ion=de
KumaScript generated:
https://developer.mozilla.org/de/docs/MDN/Doc_status/DevTools?raw¯os§ion=Summary
English:
https://developer.mozilla.org/en-US/docs/MDN/Doc_status/DevTools
Non-Kumascript generated:
https://developer.mozilla.org/en-US/docs/MDN/Doc_status/DevTools?raw¯os§ion=en
KumaScript generated:
https://developer.mozilla.org/en-US/docs/MDN/Doc_status/DevTools?raw¯os§ion=No_tags
So, now it seems neither related to the locale nor to kumascript-generated or not :-/
Caching issue?
Reporter | ||
Comment 3•11 years ago
|
||
I think I have found something. When viewing the normal document
https://developer.mozilla.org/en-US/docs/MDN/Doc_status/DevTools
A section looks like this:
<h2 id="test"></h2>
<p>test</p>
However, the raw view is different
https://developer.mozilla.org/en-US/docs/MDN/Doc_status/DevTools?raw¯os:
<h2>test</h2>
<p>test</p>
Without the id in the raw view, section extracting can not work.
Reporter | ||
Comment 4•11 years ago
|
||
Sorry the first example should be:
<h2 id="test">test</h2>
<p>test</p>
As a workaround I can at least add ids to kumascript-generated sections, but I think we need the section ids everywhere regardless of locale and whether kumascript-generated or not.
Comment 5•11 years ago
|
||
(In reply to Florian Scholz [:fscholz] (elchi3) from comment #3)
> I think I have found something.
Ah, yeah, I think that might be the issue... I suspect that the render-time caching I did for the view has left out section ID injection in the ?raw case after kumascript rendering. I'll take a look through that code and see what's what
Comment 6•11 years ago
|
||
Should have a fix submitted:
https://github.com/mozilla/kuma/pull/2147
Updated•11 years ago
|
Severity: normal → major
Comment 7•11 years ago
|
||
Commits pushed to master at https://github.com/mozilla/kuma
https://github.com/mozilla/kuma/commit/9f3156bad2f9db1c0dc4c6ce6c500925d694f13a
fix bug 982942: Ensure section IDs injected for ?raw; performance tweaks
* Ensure that section IDs are injected into content fetched via
?raw, which also fixes section extraction for ?raw§ion=foo
* Further reduce the instances where wiki.content.parse() is called
during the view critical path, limiting it to just the few remaining
cases in _filter_doc_html()
* Left some TODO comments as notes for some next steps in view
optimization
https://github.com/mozilla/kuma/commit/1a058afb5e44ae038f70047d00589d9596b9ec30
Merge pull request #2147 from lmorchard/982942-inject-section-ids-for-raw
fix bug 982942: Ensure section IDs injected for ?raw; performance tweaks
Updated•11 years ago
|
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Updated•4 years ago
|
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•