The Needs Review Queue Bot β tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide β to find step-by-step guides for working with issues.
- Status changed to Needs review
almost 2 years ago 12:00am 4 February 2023 - Status changed to Needs work
almost 2 years ago 2:39pm 9 February 2023 Thank you for this patch but I think it is actually not necessary to throw an exception for this issue.
I think it is not relevant to fail in EntityDisplayBase::calculateDependencies() because it breaks the saving of a new display.
Here is an example:
function create_a_new_display_programatically() { $entity_type_id = 'block_content'; $bundle_id = 'basic'; $view_mode_id = 'teaser'; $entity_display_repository = \Drupal::service('entity_display.repository'); // This method tries to load the view mode and if not found, creates it but not saved yet. $display = $entity_display_repository->getViewDisplay($entity_type_id, $bundle_id, $view_mode_id); // Should be successful but actually throws the ConfigEntityDependencyException. // It became impossible to programmatically create a new entity display with this exception being thrown. return $display->save(); }
Not sure what the best approach is but we should find a way to allow saving of new display and calculating dependencies without throwing exception.
- π¬π§United Kingdom rivimey
Sounds like two actions are needed:
1. add (a version of) the code in #44 as a test case, coupled with other rational variations if any.2. update the patch to permit (1) to be run, i.e. creating display programmatically.
For (2) I suggest replacing the new 'throw' with setting a flag on the EntityDIsplayBase object signalling that dependencies are out of date, and then on save() if the flag is set then update the dependencies and _at that time_ throw the exception, as I would expect by then everything to exist.
If this doesn't work I'm somewhat stumped - the exception is thrown when the entity display for this display mode can't be loaded, so in what circumstances is it ok to have a display config referencing an unloadable mode config?
- last update
over 1 year ago Patch Failed to Apply - π©πͺGermany Anybody Porta Westfalica
#43 sadly doesn't apply anymore on D10.1.2
- Merge request !6922Issue #3412959 by quietone, smustgrave, longwave: Fix 12 'un' words β (Closed) created by Anybody
- π©πͺGermany Anybody Porta Westfalica
Anybody β changed the visibility of the branch 2741429-calculate-dependencies-doesnt-check-mode-entity-10.3.x to hidden.
- π©πͺGermany Anybody Porta Westfalica
Static patch from MR!6923 for Drupal 10.2.x attached!