Problem/Motivation
Currently if a component is removed or renamed, we throw an error.
In Display builder context this can cause a fatal error, it would be better for builder experience to follow Drupal error message display setting and inform or fail silently with a log.
Steps to reproduce
In Display builder add a component from a module or theme.
Remove or rename this component.
Proposed resolution
Intercept and replace with a status message and a log.
Display status message only if error level is set higher than 'none'.
Remaining tasks
User interface changes
None
API changes
None
Data model changes
None
Issue fork ui_patterns-3570294
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 #3
mogtofu33 commentedComment #4
mogtofu33 commentedComment #5
pdureau commentedI would advocate to not merge this proposal as it is:
statuscomponent (especially considering the hardcoded color codes), let's use the Drupal Core status message instead\Throwableseems too generic and it may not be the role of UI Patterns to handle missing plugins.Comment #6
mogtofu33 commentedProblem is that based on the code flow here and how ui patterns interact with SDC, we cannot print anything else than a real component. It's not possible to use a render array like Drupal status which do not integrate yet with SDC, we cannot use an inline template or an empty array, as
Drupal\Core\Render\Element\ComponentElement->preRenderComponent()will throw an error.The injection is based on verbosity setting, it print the status on the same level as PHP warning or errors on the page. When "Logging and errors" is set to none, nothing is printed.
Good catch, I changed the throwable to catch only ComponentNotFoundException.
As for what to do now:
A way longer alternative would be to have something on core, until then we need to address the WSOD here when a simple module with a component used somewhere is disabled.
As for now I don't see a simple way to handle this in a different way.
Comment #7
just_like_good_vibeshello,
the MR is red so i put this to needs work
Comment #8
just_like_good_vibesi see the work in this MR is required by display_builder composer.json
i have errors when using display_builder, do we really need that ?