From 9670a5af88c65e662d4e3d602ae789107c0e293f Mon Sep 17 00:00:00 2001 From: ukk1337 Date: Tue, 4 Feb 2014 13:35:48 +0100 Subject: [PATCH] Added missing 'Session'-Compomnent in bake If a Controller was baked interactively and one want to use Session flash messages, the required 'Session'-Component wasn't added to the $components-Array --- lib/Cake/Console/Command/Task/ControllerTask.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Cake/Console/Command/Task/ControllerTask.php b/lib/Cake/Console/Command/Task/ControllerTask.php index 3c1079b8b..d80bb35f3 100644 --- a/lib/Cake/Console/Command/Task/ControllerTask.php +++ b/lib/Cake/Console/Command/Task/ControllerTask.php @@ -184,6 +184,10 @@ class ControllerTask extends BakeTask { $wannaUseSession = $this->in( __d('cake_console', "Would you like to use Session flash messages?"), array('y', 'n'), 'y' ); + + if (strtolower($wannaUseSession) === 'y') { + array_push($components, 'Session'); + } } } else { list($wannaBakeCrud, $wannaBakeAdminCrud) = $this->_askAboutMethods();