-
Notifications
You must be signed in to change notification settings - Fork 325
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
A global block in a global block leads to 500 errors #7414
Comments
Do you have a favorite approach? Then I would try to implement it myself. But right now I don't really know how to solve the recursion. |
I ran into the same problem, but my findings are slightly different: my container was able to handle 2 global blocks inside another global block, but not more. |
@flogado Thank you for the reproducer this helps. @wachterjohannes will have a look at this, currently not sure but we think recursion happening here: sulu/src/Sulu/Component/Content/Types/Metadata/GlobalBlocksTypedFormMetadataVisitor.php Line 80 in 5f79200
@lubomirfiala if you have another example we should check please let us know. |
@flogado @lubomirfiala maybe you can give #7423 a try to test if this solve all your issues. |
The recursion is gone, but now I get the following error in the browser:
Admin build was successful
|
I have found the special case that leads to problems. Whenever a regular block comes first, which then contains a block that loads global blocks, this leads to an error. Example page template: <?xml version="1.0" ?>
<template
xmlns="http://schemas.sulu.io/template/template"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://schemas.sulu.io/template/template http://schemas.sulu.io/template/template-1.0.xsd"
>
<!-- ... -->
<properties>
<!-- ... -->
<block name="foo" default-type="bar">
<types>
<type name="bar">
<properties>
<block name="baz" default-type="app-card">
<types>
<type ref="app-card" />
</types>
</block>
</properties>
</type>
</types>
</block>
</properties>
</template> This results in:
|
Actual Behavior
If a global block (e.g.
foo
) is loaded into another global block (e.g.bar
), this results in a 500 error for/admin/config
due to a recursion. This was not a problem with includes.Steps to Reproduce
I have created a small example (with text_block and text_block2):
https://github.com/flogado/sulu-global-blocks/commit/adaab4a398e975de089e9265a019f0f1f74ff26c
Possible Solutions
The recursion seems to happen in the
GlobalBlocksTypedFormMetadataVisitor::getGlobalBlockMetadata
.The text was updated successfully, but these errors were encountered: