Add test setComponentTreeValue to ComponentTreeEntityInterface

Created on 6 September 2025, about 2 months ago

Overview

Follow-up to πŸ“Œ Refactor(or attempt to) all or most ApiLayoutController*Test classes to also test ContentTemplate entities Active

In that issue we had to do this

if ($entity instanceof ComponentTreeEntityInterface && $entity instanceof ConfigEntityInterface) {
        $tree = $entity->getComponentTree();
        foreach ($tree as $component) {
          assert($component instanceof ComponentTreeItem);
          $component->optimizeInputs();
        }
        // @todo This only works because we assume 'component_tree'. Should we
        //   add `setComponentTreeValue(ComponentTreeItemList $tree)` to the
        //   ComponentTreeEntityInterface?
        $entity->set('component_tree', $tree->getValue());
      }

There is not a good way to see the value of the component tree of a `ComponentTreeEntityInterface` object without assuming the property name

Proposed resolution

Add setComponentTreeValue to ComponentTreeEntityInterface

User interface changes

πŸ“Œ Task
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States tedbow Ithaca, NY, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024