-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Solve #18704 on front-end #26951
Solve #18704 on front-end #26951
Conversation
Is this implementation of the gutenberg/lib/class-wp-block.php Line 11 in 1d21b92
Once we enforce WordPress 5.5.0 as a requirement for the plugin, it will be removed. |
@gziolo to be honest, I actually tested this by applying these changes to the core class in wp-includes, but I get very confused about duplication of code between the core and the plugin and wasn't sure where was the correct place to submit the patch. Should I open a ticket on trac instead? |
Assuming that |
Note that I've just detected a side effect of the patch. Although it successfully escapes fatal errors, it also appears to wrongly escape some blocks that were not causing any fatal errors. I will have to investigate when I get time. |
I too noticed that problem. Before attempting to implement my own solution to the problem, which is individually applied to potentially recursive block types, I tried this solution. It incorrectly returned too early for blocks in a This was running my test case referenced here: bobbingwide/fizzie#27 (comment) |
Is there any mileage in Gutenberg extending the And/or instead of using |
@bobbingwide thank you for pointing out that unexpected result involving the query loop. I just added some commits that appear to fix this. |
@carlomanf I tried your fix. It got a bit further but still detected recursion too early. BTW. I'm making progress on a very similar solution with the ability to report where the problem occurred. See https://github.com/bobbingwide/fizzie/tree/main/includes This solution won't require changes to the WP_Block class, but will still require shimming once it's become part of core. |
@bobbingwide It looks like it's the post content and post title block that are getting caught this time. I was able to replicate it with the post content and added another commit to fix this, but I couldn't replicate it with the post title. Hopefully that too gets solved with this new commit. Thanks for testing this out. |
@carlomanf I retested latest your solution and still got too many false positives. I changed your recursion detection logic to return a recursion message:
Implemented as below:
My test case shows the call stack where the In the test results for PR #27012 the post titles are displayed because they don't need recursion checking. For both our solutions, there's still the problem that once the logic is in core it can't easily be altered in a newer version of Gutenberg. |
@bobbingwide I'm not able to reproduce the false positives with the post title. They're rendering fine for me. Maybe someone else could test to confirm whether they get these false positives? |
# Conflicts: # lib/class-wp-block.php
Closing this because it needs to be targeted at core instead. |
Description
Partially resolves #18704, only on front-end. Also resolves #26923, further info about this solution is available in my comments on that issue.
How has this been tested?
Tested it according to #25472, and saw the fatal error disappear and the front-end page load successfully. Without this patch, there was a fatal error.
I didn't attempt to fix the admin experience, but confirmed that it's NOT fixed by this.
Screenshots
Types of changes
Bug fix
Checklist: