File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2727use Cake \Core \ConventionsTrait ;
2828use Cake \Event \Event ;
2929use Cake \Event \EventManager ;
30+ use Cake \ORM \Locator \TableLocator ;
3031use InvalidArgumentException ;
3132use function Cake \Core \pluginSplit ;
3233
@@ -48,6 +49,22 @@ abstract class BakeCommand extends Command
4849 */
4950 protected string $ pathFragment ;
5051
52+ /**
53+ * Initialize the command.
54+ *
55+ * @return void
56+ */
57+ public function initialize (): void
58+ {
59+ parent ::initialize ();
60+
61+ $ locator = $ this ->getTableLocator ();
62+ if ($ locator instanceof TableLocator) {
63+ $ locator ->allowFallbackClass (true );
64+ $ this ->setTableLocator ($ locator );
65+ }
66+ }
67+
5168 /**
5269 * Get the command name.
5370 *
Original file line number Diff line number Diff line change @@ -100,6 +100,8 @@ class TemplateCommand extends BakeCommand
100100 */
101101 public function initialize (): void
102102 {
103+ parent ::initialize ();
104+
103105 $ this ->path = current (App::path ('templates ' ));
104106 }
105107
You can’t perform that action at this time.
0 commit comments