-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Investigate .RenderString regression #9383
Comments
Thanks for the heads up. I’ll have time to look into this over the weekend and possibly today. |
FYI I discovered this issue (with @jmooring's help) through another route: Quoting Joe:
The full discussion is in https://discourse.gohugo.io/t/0-92-new-warning-when-section-has-no-index/36590 |
PR gohugoio#9342 introduced a regression in which calling .Translations in a template and calling RenderString on a translated Page caused a nil pointer dereference. The issue was that not all Pages returned from .Translations had initialized ContentProviders at the time the calling template was being executed. While PR gohugoio#9342 had attempted to ensure that all ContentProviders were initialized for translations at build time, it only performed the initialization for receivers of ContentProvider methods such as .Summary. However, the ContentProvider's *pageState.pageOutput.cp would remain uninitialized, causing the nil pointer dereference. This change edits the .Translations and .AllTranslations methods to ensure that all of a page's translations have an initialized content provider in time for a template to be executed. Since LazyContentProvider is no longer needed with this approach, this change also reverts the following commits: - cdcd15b - 25d645f Fixes gohugoio#9383
PR gohugoio#9342 introduced a regression in which calling .Translations in a template and calling RenderString on a translated Page caused a nil pointer dereference. The issue was that some Pages returned from .Translations had a nil cp field at the time the calling template was being executed. While PR gohugoio#9342 had attempted to ensure that all ContentProviders were initialized for translations at build time, it only performed the initialization for receivers of ContentProvider methods such as .Summary. However, the ContentProvider's *pageState.pageOutput.cp would remain uninitialized, causing the nil pointer dereference. This change edits the .Translations and .AllTranslations methods to ensure that all of a page's translations have an initialized content provider in time for a template to be executed. Since LazyContentProvider is no longer needed with this approach, this change also reverts the following commits: - cdcd15b - 25d645f Fixes gohugoio#9383
PR gohugoio#9342 introduced a regression in which calling .Translations in a template and calling RenderString on a translated Page caused a nil pointer dereference. The issue was that some Pages returned from .Translations had a nil cp field at the time the calling template was being executed. While PR gohugoio#9342 had attempted to ensure that all ContentProviders were initialized for translations at build time, it only performed the initialization for receivers of ContentProvider methods such as .Summary. However, the ContentProvider's *pageState.pageOutput.cp would remain uninitialized, causing the nil pointer dereference. This change edits the .Translations and .AllTranslations methods to ensure that all of a page's translations have an initialized content provider in time for a template to be executed. Since LazyContentProvider is no longer needed with this approach, this change also reverts the following commits: - cdcd15b - 25d645f Fixes gohugoio#9383
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
See https://discourse.gohugo.io/t/multilingual-related-page-renderstring-regression-in-0-92/36555/16?u=bep
I'm pretty sure this came from #9342 -- but I'm also pretty sure that that PR surfaced an already existing bug re output formats and
.Translations
, so I think we need to understand and fix the real issue rather than reverting the above.@ptgott
The text was updated successfully, but these errors were encountered: