Note: I created the issue and code with the help of AI, everything is reviewed and checked.
Problem
`CanvasFormatter::build()` wraps `$items->toRenderable()` in
`catch (\Throwable)` and logs the exception away. `FormBuilder` throws
`FormAjaxException` on **every** AJAX form request — it is the flow-control
signal `FormAjaxSubscriber::onException()` turns into the AJAX response. Canvas
deliberately lets it through
(`RenderSafeComponentContainer::renderComponent()`, `ComponentTreeItemList`),
and the formatter one layer up then catches and drops it.
So a form rendered inside a canvas_page never gets an AJAX response: on
a webform `managed_file` upload silently did nothing, and submitting
produced *"File upload in progress. Uploaded file may be lost."*. Watchdog shows
it as `Canvas rendering failed for entity canvas_page/: ` with an empty
message — `FormAjaxException` has no message.
Fix
Rethrow `EnforcedResponseException`, `FormAjaxException` and
`HttpExceptionInterface` before the generic `catch (\Throwable)`, mirroring what
Canvas itself does one layer down. Genuine rendering errors are still logged and
swallowed.
Issue fork custom_elements-3618933
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
fagoComment #4
fagoComment #5
fagoComment #7
fagothis works well, is fully tested and code is good. merged.