Skip to content

Instantly share code, notes, and snippets.

/**
* Implements hook_ENTITY_TYPE_presave().
*/
function [modulename]_media_media_presave(EntityInterface $entity) {
if ($entity->bundle() == 'document') {
foreach ($entity->field_media_file as $file_reference) {
$file = File::load($file_reference->target_id);
switch ($entity->status->value) {
// Unpublish, set to private.
case 0:
diff --git a/config/schema/layout_builder_styles.schema.yml b/config/schema/layout_builder_styles.schema.yml
index 3f5976a..02794a4 100644
--- a/config/schema/layout_builder_styles.schema.yml
+++ b/config/schema/layout_builder_styles.schema.yml
@@ -14,6 +14,9 @@ layout_builder_styles.style.*:
type:
type: string
label: 'Type'
+ group:
+ type: string