- Issue created by @nicxvan
- π¦πΊAustralia mstrelan
Added some
hook_ENTITY_TYPE_*
hooks that had the entity type in place of ENTITY_TYPE. Note in many cases where ENTITY_TYPE is used correctly it specifies the entity type afterwards, e.g.Implements hook_ENTITY_TYPE_create() for 'config_test'.
We should probably do the same.
- πΊπΈUnited States nicxvan
We can, there is discussion about whether to keep implements or not, this is more about looking at them to make sure rector chose the right hook cause some form alters were weird.
There is also this: π [PP-1] Determine how to implement Form Alters with attributes. Active
- π¦πΊAustralia mstrelan
I'd be in favour of eventually dropping "implements" comments, but it does have some use at the moment, particularly with these
ENTITY_TYPE
replacements. For example, seeContentModerationHooks::workflowInsert
. It's not clear from#[Hook('workflow_insert')]
thatworkflow
is an entity type. Would need something like#[EntityTypeHook(hook: 'insert', entity_type: 'workflow')]
or#[Hook('ENTITY_TYPE_insert', replacements: ['ENTITY_TYPE' => 'workflow'])]
- πΊπΈUnited States nicxvan
Yes, please chime in on the form alter issue, it's an issue I'd like to solve.
I think eventually that would become:
[#EntityInsert('workflow')]
But when it's the base Hook attribute it can be confusing when there are replacements or extra types.
- πΊπΈUnited States nicxvan
I confirmed all of the ones I crossed out.
please add anymore you find.