- Issue created by @tedbow
- First commit to issue fork.
- Merge request !1477Draft: #3543188 - ContentTemplate status should be used to determine if it should be used β (Open) created by thoward216
Right now if a Content exists for a view mode and the bundle has a Component Tree field the content template will take effect.
This will be problem in π± [META] Content templates Active as soon as the UI adds a new ContentTemplate but before it is published it will take effect
In `\Drupal\experience_builder\EntityHandlers\ContentTemplateAwareViewBuilder::buildComponents` after the component is loaded it should only be used if the status is true.
So something like
$template = ContentTemplate::loadForEntity($entity, $view_mode);
if ($template && $template->status()) {
$displays[$bundle] = $template;
}
\Drupal\Tests\experience_builder\Kernel\NodeTemplatesTest::testOptContentTypeIntoXb should be updated to test a with the status of the template first false, it should not take effect and then once set to true it should take effect.
Bonus
Additionally it would be great if even though ApiLayoutController won't work with ContentTemplate entities until
π
Refactor ApiLayoutController into 2 sub-class to support Content Templates
Active
in this issue we can still update \Drupal\experience_builder\Controller\ApiAutoSaveController::post to set the status to true on publish. \Drupal\Tests\experience_builder\Kernel\ApiAutoSaveControllerTest::testPost will need to be updated to assert that a ContentTemplate actually has it's status updated.We can't use `ApiLayoutController` in this test but we can still add a ContentTemplate entity using \Drupal\experience_builder\AutoSave\AutoSaveManager::saveEntity
None
Active
1.0
Page builder