diff --git a/apps/cms/composer.json b/apps/cms/composer.json index a9248445d..1699efb20 100644 --- a/apps/cms/composer.json +++ b/apps/cms/composer.json @@ -98,7 +98,7 @@ "Fix site install": "https://www.drupal.org/files/issues/2023-07-28/3349663-8.patch" }, "drupal/gutenberg": { - "Disable gutenberg flag": "patches/contrib/gutenberg/disable_gutenberg_flag.patch" + "Gutenberg enabled hook": "https://www.drupal.org/files/issues/2024-05-07/gutenberg_enabled_hook_3445677-2.patch" } }, "patchLevel": { diff --git a/apps/cms/patches/.gitkeep b/apps/cms/patches/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/apps/cms/patches/contrib/gutenberg/disable_gutenberg_flag.patch b/apps/cms/patches/contrib/gutenberg/disable_gutenberg_flag.patch deleted file mode 100644 index 56d6464d6..000000000 --- a/apps/cms/patches/contrib/gutenberg/disable_gutenberg_flag.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/gutenberg.module b/gutenberg.module -index dec6b80..173c424 100644 ---- a/gutenberg.module -+++ b/gutenberg.module -@@ -1042,6 +1042,10 @@ function _gutenberg_is_gutenberg_enabled(EntityInterface $entity = NULL) { - return FALSE; - } - -+ if (isset($entity->disableGutenberg) && $entity->disableGutenberg === TRUE) { -+ return FALSE; -+ } -+ - if ($entity->getEntityTypeId() !== 'node') { - return FALSE; - } diff --git a/packages/drupal/entity_create_split/README.md b/packages/drupal/entity_create_split/README.md index 51d58ef2c..12a79a2d2 100644 --- a/packages/drupal/entity_create_split/README.md +++ b/packages/drupal/entity_create_split/README.md @@ -8,6 +8,6 @@ To enable this feature, you must create a form mode with the machine name "split ## Special case for the Gutenberg editor -The Gutenberg editor does a lot of alterations on the create form. For this reason, it is better that the form alter hook of the gutenberg module to not run at all. This is not easy possible, so right now the easiest approach is to just patch the module. The patch is included in the _patches/gutenberg_ folder. +The Gutenberg editor does a lot of alterations on the create form. For this reason, it is better that the form alter hook of the gutenberg module to not run at all. This is not easy possible, so right now the easiest approach is to just patch the module with the patch from https://www.drupal.org/project/gutenberg/issues/3445677/ The functionality should also work without the patch, but the initial form will not look that nice. diff --git a/packages/drupal/entity_create_split/entity_create_split.module b/packages/drupal/entity_create_split/entity_create_split.module index 8b87b1145..2ae2e596f 100644 --- a/packages/drupal/entity_create_split/entity_create_split.module +++ b/packages/drupal/entity_create_split/entity_create_split.module @@ -8,6 +8,7 @@ */ use Drupal\Core\Entity\ContentEntityType; +use Drupal\Core\Entity\EntityInterface; /** * Implements hook_entity_type_build(). @@ -19,3 +20,12 @@ function entity_create_split_entity_type_build(array &$entity_types) { } } } + +/** + * Implements hook_gutenberg_enabled(). + */ +function entity_create_split_gutenberg_enabled(EntityInterface $entity) { + if (isset($entity->disableGutenberg) && $entity->disableGutenberg === TRUE) { + return FALSE; + } +}