Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check if bake is loaded in BakeSimpleMigrationCommand #808

Merged
merged 1 commit into from
Jan 19, 2025

Conversation

LordSimal
Copy link
Contributor

@LordSimal LordSimal commented Jan 19, 2025

A community member reported in slack/discord, that there is a strange error when trying to bake a migration with

bin/cake migrations create CreateSomeTable  
Stacktrace
2025-01-19 22:06:01 error: [Cake\View\Exception\MissingTemplateException] Template file `No bake template found for "Migrations.config/skeleton" skipping file generation.` could not be found. in /Users/kevin/Documents/sunlime/alfred/vendor/cakephp/bake/src/Utility/TemplateRenderer.php on line 104
Exception Attributes: array (
  'file' => 'No bake template found for "Migrations.config/skeleton" skipping file generation.',
  'paths' => 
  array (
  ),
)
Stack Trace:
- ROOT/vendor/cakephp/migrations/src/Command/BakeSimpleMigrationCommand.php:129
- ROOT/vendor/cakephp/migrations/src/Command/BakeMigrationCommand.php:55
- ROOT/vendor/cakephp/migrations/src/Command/BakeSimpleMigrationCommand.php:92
- CORE/src/Console/BaseCommand.php:202
- CORE/src/Console/CommandRunner.php:330
- CORE/src/Console/CommandRunner.php:168
- ROOT/bin/cake.php:11
- [main]:

[Cake\View\Exception\MissingTemplateException] Template file `No bake template found for "Migrations.config/skeleton" skipping file generation.` could not be found. in /Users/kevin/Documents/sunlime/alfred/vendor/cakephp/bake/src/Utility/TemplateRenderer.php on line 104

Exception Attributes

array (
  'file' => 'No bake template found for "Migrations.config/skeleton" skipping file generation.',
  'paths' => 
  array (
  ),
)

Stack Trace:

Bake\Utility\TemplateRenderer->generate() - ROOT/vendor/cakephp/migrations/src/Command/BakeSimpleMigrationCommand.php, line 129
Migrations\Command\BakeSimpleMigrationCommand->bake() - ROOT/vendor/cakephp/migrations/src/Command/BakeMigrationCommand.php, line 55
Migrations\Command\BakeMigrationCommand->bake() - ROOT/vendor/cakephp/migrations/src/Command/BakeSimpleMigrationCommand.php, line 92
Migrations\Command\BakeSimpleMigrationCommand->execute() - CORE/src/Console/BaseCommand.php, line 202
Cake\Console\BaseCommand->run() - CORE/src/Console/CommandRunner.php, line 330
Cake\Console\CommandRunner->runCommand() - CORE/src/Console/CommandRunner.php, line 168
Cake\Console\CommandRunner->run() - ROOT/bin/cake.php, line 11
[main] - [main], line 0

the main problem was the fact, that the Bake Plugin was not loaded in his main app.

We don't check that in our base class, therefore this PR adds this check.

@LordSimal LordSimal added this to the 4.x (CakePHP 5) milestone Jan 19, 2025
@LordSimal LordSimal changed the title check if bake is loaded in BakSimpleMigrationCommand check if bake is loaded in BakeSimpleMigrationCommand Jan 19, 2025
@LordSimal LordSimal force-pushed the 4.x-require-bake-for-baking branch from fa050b6 to ea6d12f Compare January 19, 2025 21:23
@markstory markstory merged commit efb563a into 4.x Jan 19, 2025
16 checks passed
@markstory markstory deleted the 4.x-require-bake-for-baking branch January 19, 2025 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants