From 27307ddbbe32a37672cc115eced86028563b6a05 Mon Sep 17 00:00:00 2001 From: Kevin Pfeifer Date: Fri, 17 Jul 2026 08:10:14 +0200 Subject: [PATCH 1/2] add docs about command event hooks change --- docs/en/appendices/5-4-migration-guide.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/en/appendices/5-4-migration-guide.md b/docs/en/appendices/5-4-migration-guide.md index 7f23cfc5c2..a0cd2b6006 100644 --- a/docs/en/appendices/5-4-migration-guide.md +++ b/docs/en/appendices/5-4-migration-guide.md @@ -19,6 +19,8 @@ bin/cake upgrade rector --rules cakephp54 ### Commands - `BaseCommand::initialize()` is now being triggered **AFTER** arguments and options have been parsed. +- Command instances are now added to the event manager by default. This means, that event hook methods +like `beforeExecute` and `afterExecute` are always triggered. ### Console From 7e0aa5b326f2a97b7338dc56355f0f7942e6ef80 Mon Sep 17 00:00:00 2001 From: Kevin Pfeifer Date: Fri, 17 Jul 2026 09:37:23 +0200 Subject: [PATCH 2/2] Update docs/en/appendices/5-4-migration-guide.md Co-authored-by: ADmad --- docs/en/appendices/5-4-migration-guide.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/en/appendices/5-4-migration-guide.md b/docs/en/appendices/5-4-migration-guide.md index a0cd2b6006..296ed8fcd4 100644 --- a/docs/en/appendices/5-4-migration-guide.md +++ b/docs/en/appendices/5-4-migration-guide.md @@ -20,7 +20,8 @@ bin/cake upgrade rector --rules cakephp54 - `BaseCommand::initialize()` is now being triggered **AFTER** arguments and options have been parsed. - Command instances are now added to the event manager by default. This means, that event hook methods -like `beforeExecute` and `afterExecute` are always triggered. +like `beforeExecute` and `afterExecute` are always triggered. To avoid duplicate triggering you should remove +any existing calls attaching a command to the event manager from your app code. ### Console