Skip to content

Commit

Permalink
chore(SLB-328): move the gutenberg module patch to contrib
Browse files Browse the repository at this point in the history
  • Loading branch information
chindris committed May 7, 2024
1 parent 86f7f4f commit efcd14b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 17 deletions.
2 changes: 1 addition & 1 deletion apps/cms/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
Empty file removed apps/cms/patches/.gitkeep
Empty file.
15 changes: 0 additions & 15 deletions apps/cms/patches/contrib/gutenberg/disable_gutenberg_flag.patch

This file was deleted.

2 changes: 1 addition & 1 deletion packages/drupal/entity_create_split/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
10 changes: 10 additions & 0 deletions packages/drupal/entity_create_split/entity_create_split.module
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/

use Drupal\Core\Entity\ContentEntityType;
use Drupal\Core\Entity\EntityInterface;

/**
* Implements hook_entity_type_build().
Expand All @@ -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;
}
}

0 comments on commit efcd14b

Please sign in to comment.