Closed indebit closed 5 months ago
Hi @indebit, thanks for the report!
Is Ibexa 4.6.3 you're using OSS version and is it a clean install or did you make any customizations? It would be useful if you could provide ng_site_api
, ng_content_view
and content_view
configurations, so I can try to reproduce the problem.
Sure.
I'm using Ibexa 4.6.3 DXP Experience version. I've migrated an existing project (still with NetGen Site API) from eZ Platform 2.5 (to latest OSS, then to Headless, then to Experience). Added the new version of Netgen Site API (6.1.2), so existing functionality will still work.
These are the configuration:
ng_site_api:
site_api_is_primary_content_view: true
ibexa:
system:
site:
ng_content_view:
mk_textblock:
template: '@ibexadesign/blocks/textblock.html.twig'
match:
Identifier\ContentType: mk_textblock
'/blocks/textblock.html.twig'
{{ ng_render_field(content.fields.text_area) }}
Basically, here I'm trying to render the richtext fields. I also tried to use the original Ibexa's method, but I got the same result:
{# {{ ibexa_render_field(content.innerContent, 'text_area') }} #}
I don't use any views from the original content_view
. All the views I'm rendering, are made through ng_content_view
.
I made some debugging and looks like the loop starts due to some Events within TraceableEventDispatcher
(vendor/symfony/event-dispatcher\Debug\TraceableEventDispatcher.php) on
preProcess()`.
Please let me know if you need additional info
I think I found the loop:
Basically, these 2 events: ezpublish.pre_content_view
and view.parameter_injection
are switching on and on. See following screenshots:
Thanks for the details, I'll try to reproduce this later today. Do you know if the same problem appeared on OSS as well?
I don't know, as I've only walked through OSS version to the final one (Experience) and didn't test on intermediary versions. Feel free to ask any additional info if you need, during your test later. Thanks for your support.
I've successfully reproduced the problem, it happens on the clean OSS install whenever the fallback mechanism is used without subrequest, even without image embed.
Looking into it now, will let you know when I have something.
I think I've found and fixed the problem. I made the fallback feature primarily for fallback from Ibexa to Site API, so it seems I've used a wrong View Builder (from Site API) for rendering Ibexa views and missed it because it only triggers for fallback from Site API to Ibexa.
This is now fixed in NGSTACK-904_view_fallback_fix
branch, in commit https://github.com/netgen/ibexa-site-api/commit/691db39b55123b074057dcabfed63b6e70be01f2. It will be a bit awkward to release, since you use Site API 6.1.2
and Ibexa 4.6.3
, and in Site API 6.1.4
there was a version limiting change introduced for a breaking change in Ibexa 4.6.5
(I think they don't consider it a part of BC promise). So I based the fix on Site API 6.1.2
and didn't made a pull request yet.
You should be able to install the fix from the branch, or, since the diff is quite small, you could patch the vendor directly. Can you test it out and let me know if it fixes the issue for you?
Also, is it an option for you to upgrade to Ibexa 4.6.7
, so I can make the final fix in a single patch release?
The fix worked.
Just for testing, I've patched the vendor directly.
Will check which option would be the best, but I'm also able to upgrade to 4.6.7
if that's the best/easiest way.
Thank you for your support
Yes, upgrading would be the best, and I think you shouldn't have any issues as the BC break I mentioned is in an internal part of the codebase that we're overriding here. I'll release it in 6.1.6
then :)
Here it is: https://github.com/netgen/ibexa-site-api/releases/tag/6.1.6
@indebit thanks for reporting this!
Great news.
Thank you for taking care @pspanja
I'm using ibexa-site-api 6.1.2 with Ibexa 4.6.3.
Steps to reproduce: In admin area, within a richtext field, embed an image. Save and publish. The image is rendered correctly in admin preview.
On front-end, I'm trying to render that field using:
{{ ng_render_field(content.fields.text_area) }}
inside the template, but when I'm trying to check/visit in browser the page that contains that field, it keeps loading on and on in a infinite loop until the memory limit is hit.I also tried with the Ibexa's default twig method and Ibexa's default Content type using:
{{ ibexa_render_field(content.innerContent, 'text_area') }}
but I get the same result => Infinite loop.The only solution I've found so far, is to disable somehow the Netgen's functionality, according to the documentation, by adding this parameter in a yaml file:
bexa.site_access.config.default.ng_site_api.fallback_without_subrequest: false
Then, the page loads correctly and the richtext is rendered correctly as well.
I've checked the field's value in the database directly, and it looks like this:
As it can be seen, the embed element is defined in this XML content using
ezembed
tag. If I remove the entireezembed
code: `after clearing the cache, the page loads correctly and the richtext field is rendered as expected. Of course, without the embed image. Then, if I put back the embed tag/element, the inifinite loop is happening again.