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)

All
Other
defect
Not set
major

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&macros&section=Summary For de: https://developer.mozilla.org/de/docs/MDN/Doc_status/DevTools?raw&macros&section=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&macros&section=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.
Blocks: 968736
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.
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&macros: <h2>test</h2> <p>test</p> Without the id in the raw view, section extracting can not work.
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.
(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
Severity: normal → major
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&section=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
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.