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

the baking of a custom action is not working #89

Closed
imagra opened this issue May 10, 2015 · 5 comments
Closed

the baking of a custom action is not working #89

imagra opened this issue May 10, 2015 · 5 comments
Assignees
Milestone

Comments

@imagra
Copy link

imagra commented May 10, 2015

It seems, that the backing custom action is not working:
bin/cake bake template roles reset --plugin Guard --theme Tools --force
but backing CRUD actions works well
bin/cake bake template roles view --plugin Guard --theme Tools --force

The action reset in a controller RolesController.php in plugin Guard (additionally to CRUD and other) exists.
The template for the action APP/plugins/Tools/src/Template/Bake/Template/reset.ctp exists too.

I think something wrong happens around APP/vendor/cakephp/bake/src/View/BakeView.php

@imagra imagra changed the title bake custom action not working the baking of a custom action is not working May 10, 2015
@lorenzo lorenzo added the bug label May 10, 2015
@markstory markstory added this to the 1.0.6 milestone May 10, 2015
@markstory markstory self-assigned this May 10, 2015
@markstory
Copy link
Member

I wasn't able to reproduce this with either app templates, or plugin templates. Both

bin/cake bake template Bookmarks test --theme Pluggy --plugin Photos
bin/cake bake template Bookmarks --theme Pluggy

resulted in a generated view file. In both instances the reset.ctp contained a no dynamic content, and just a simple string. Do you get any errors when bake fails?

@imagra
Copy link
Author

imagra commented May 11, 2015

Early morning I've repeated and logged all my actions to reproduce it on clean install and .... it works. Here is the all actions:

composer create-project --prefer-dist cakephp/app test4
cd test4
bin/cake bake plugin Article
bin/cake bake plugin Beauty
# database setup in app.php
mkdir -p plugins/Beauty/src/Template/Bake/Template
echo "view" > plugins/Beauty/src/Template/Bake/Template/view.ctp
echo "add" > plugins/Beauty/src/Template/Bake/Template/add.ctp
echo "edit" > plugins/Beauty/src/Template/Bake/Template/edit.ctp
echo "index" > plugins/Beauty/src/Template/Bake/Template/index.ctp
echo "test action" > plugins/Beauty/src/Template/Bake/Template/test_action.ctp
bin/cake bake all Articles --plugin Article  --theme Beauty
ls -lah plugins/Article/src/Template/Articles
bin/cake bake template Articles test_action --plugin Article  --theme Tools
ls -lah plugins/Article/src/Template/Articles

repeated steps related to Beauty plugin on the app where was errors - it works too.

repeated with this action - working
bin/cake bake template Roles test_action --plugin Guard --theme Tools

repeated with original action – not working!!!
bin/cake bake template Roles reset --plugin Guard --theme Tools

did
echo "reset" > plugins/Tools/src/Template/Bake/Template/reset.ctp
working... Hmm... going back in time on TimeMachine in this folder to check what was wrong with reset.ctp and found that yesterday's version of the file is not working....

No idea why it happens. Permissions are the same. The filename is the same. I've tried to empty the file - result the same: nothing generated. Devilry miracle...

Anyway it's a good idea to give some meaning output if there are something wrong with template.

@markstory
No errors produced. Output looks like this:

$ bin/cake bake template Articles test_action --plugin Article --theme Tools 
Welcome to CakePHP v3.0.4 Console
---------------------------------------------------------------
App : src
Path: /www/cake-3/dev-03/src/
---------------------------------------------------------------

@imagra
Copy link
Author

imagra commented May 11, 2015

I've updated cakephp/bake to 1.0.7. Now with the strange file I'm getting a message:
<warning>No generated content for 'reset.ctp', not generating template.
Thank you, markstory, it's enough for closing the issue. But still have no idea why this magic file is ignored...

@dereuromark
Copy link
Member

@imagra See #90
So in your case the content is empty.

@imagra
Copy link
Author

imagra commented May 11, 2015

Yea! I've found! The output of the ctp file is empty!!! I.e. between <% and %> there are a code but no output. And seems that the generator can't produce anything from the file and fails...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants