Overview

One of the things that @phenaproxima has expressed multiple times as being very hard to understand for somebody proficient-at-Drupal-but-new-to-Canvas, is Canvas' concept of "dangling component trees".

#3571116: PageRegion's cache tags not bubbling, resulting in stale results being served by (Dynamic) Page Cache already got us a good chunk of the way there to eliminating/eradicating this altogether.

Proposed resolution

Completely eradicate it.

User interface changes

None.

Comments

wim leers created an issue. See original summary.

wim leers’s picture

Drupal >=11.3 added the following in #3317769: Add support for linking to entities in CKEditor 5:

  #[Hook('field_widget_single_element_form_alter')]
  public function fieldWidgetSingleElementFormAlter(&$element, FormStateInterface $form_state, $context): void {
    // Add an attribute so that CKEditor 5 plugins can vary their behavior based
    // on host entity type, host entity bundle and host entity language.
    if (!empty($element['#type']) && $element['#type'] == 'text_format') {
      $items = $context['items'];
      assert($items instanceof FieldItemListInterface);
      $host_entity = $items->getEntity();
      $element['#attributes']['data-ckeditor5-host-entity-type'] = $host_entity->getEntityTypeId();
      $element['#attributes']['data-ckeditor5-host-entity-bundle'] = $host_entity->bundle();
      $element['#attributes']['data-ckeditor5-host-entity-langcode'] = $host_entity->language()->getId();
    }
  }

… which assumes no "text" field type is ever dangling.

All the more reason to do this.

Ran into this at #3582478: Symmetrically translatable config-defined component trees, STEP 2: change config schema type for `inputs` to allow translating via core's Config Translation UI.

wim leers’s picture