Minimal duplicate create hook implementation
2 unresolved threads
2 unresolved threads
Closes #3040556
Merge request reports
Activity
added 1 commit
- 535575cc - Change to alter hook, add content entity test
- Resolved by Sascha Grossenbacher
- Resolved by Sascha Grossenbacher
698 698 } 699 699 } 700 700 701 /** 702 * Implements hook_entity_duplicate_alter(). 703 */ 704 #[Hook('entity_duplicate_alter')] 705 public function entityDuplicateAlter(EntityInterface $duplicate, EntityInterface $entity) : void { 706 if ($duplicate instanceof ContentEntityInterface && $duplicate->label() === 'UUID CRUD test entity' && $duplicate->hasField('name')) { Nit: think it's more readable multi-line.
705 if ($duplicate instanceof ContentEntityInterface && $duplicate->label() === 'UUID CRUD test entity' && $duplicate->hasField('name')) { 705 if ($duplicate instanceof ContentEntityInterface && 706 $duplicate->label() === 'UUID CRUD test entity' && 707 $duplicate->hasField('name')) { changed this line in version 7 of the diff
698 698 } 699 699 } 700 700 701 /** 702 * Implements hook_entity_duplicate_alter(). 703 */ 704 #[Hook('entity_duplicate_alter')] 705 public function entityDuplicateAlter(EntityInterface $duplicate, EntityInterface $entity) : void { I thought about that, but it would be a bit weird. we'd need pick one of the tested entity types and then exclude them in the generic hook. or do a completely separate test with yet another entity type. I'm not entirely sure if that's really worth it. If we add a custom Hook class maybe?
added 126 commits
-
92a11dd7...69f22495 - 118 commits from branch
project:11.x
- 9b83e055 - Minimal duplicate create hook implementation
- b3dc55d9 - phpcs fixes
- e3238220 - Add hook invocation to ContenEntityBase
- e0a0e747 - Change to alter hook, add content entity test
- 87341bbd - Apply 1 suggestion(s) to 1 file(s)
- aea9cb98 - Apply 1 suggestion(s) to 1 file(s)
- 7d1c63fb - extend test coverage
- 44760c7c - change back to non-alter hook
Toggle commit list-
92a11dd7...69f22495 - 118 commits from branch
added 101 commits
-
4e94448b...6e30fe2f - 92 commits from branch
project:11.x
- 140e6755 - Minimal duplicate create hook implementation
- 3e3fa9a4 - phpcs fixes
- f68bcd11 - Add hook invocation to ContenEntityBase
- a3322de3 - Change to alter hook, add content entity test
- 9785026a - Apply 1 suggestion(s) to 1 file(s)
- 054da355 - Apply 1 suggestion(s) to 1 file(s)
- febd8ee7 - extend test coverage
- a0be330e - change back to non-alter hook
- c30a1174 - Also update hook in EntityBase
Toggle commit list-
4e94448b...6e30fe2f - 92 commits from branch
Please register or sign in to reply