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

InvalidArgumentException: The "template" option does not exist. #53

Closed
pascalruscher opened this issue Feb 9, 2015 · 10 comments
Closed
Labels
Milestone

Comments

@pascalruscher
Copy link

Hi guys,

I have a problem with the new cakephp 3 migrations plugin.

I am getting this error:
[InvalidArgumentException]
The "template" option does not exist.

After executing this in the project root dir on command line:
bin/cake migrations create Initial

@AD7six
Copy link
Member

AD7six commented Feb 9, 2015

That's a problem of version mis-match - what version of bake, cakephp and migrations are you using?

The template option was renamed theme a long time ago, nothing should be trying to use template.

@AD7six AD7six added the question label Feb 9, 2015
@AD7six AD7six added this to the 1.0.0 milestone Feb 9, 2015
@nntgwww
Copy link

nntgwww commented Feb 9, 2015

I have this problem too. i also clone the newest plugin right now. I'm using cake php RC-2

@pascalruscher
Copy link
Author

I am using Cake 3.0 RC-1 and latest migrations files

@segy
Copy link

segy commented Feb 9, 2015

Hello. The same problem here. I have the latest cakephp and migrations plugin
cakephp/cakephp (3.0.x-dev 2da74bd)
cakephp/migrations (dev-master 0acd5ac)

@AD7six
Copy link
Member

AD7six commented Feb 9, 2015

Can either of you please say what version of bake you are using?

@AD7six
Copy link
Member

AD7six commented Feb 9, 2015

nvm I misread the command in the ticket - it's reproducible.

Note however that bin/cake bake migration Initial is how you'd normally generate your first populated migration file.

www-data @ dev [ /tmp ]
-> composer create-project cakephp/app -s dev
Installing cakephp/app (dev-master 7639bdbf4761d867dcbb5abcbe36f74e97025fea)
  - Installing cakephp/app (dev-master master)
    Cloning master

Created project in /tmp/app
Loading composer repositories with package information
Installing dependencies (including require-dev)
  - Installing aura/installer-default (1.0.0)
    Loading from cache

  - Installing cakephp/plugin-installer (0.0.11)
    Downloading: 100%         

  - Installing symfony/yaml (v2.6.4)
    Loading from cache

  - Installing symfony/filesystem (v2.6.4)
    Loading from cache

  - Installing symfony/config (v2.6.4)
    Loading from cache

  - Installing symfony/console (v2.6.4)
    Loading from cache

  - Installing robmorgan/phinx (v0.4.2.1)
    Downloading: 100%         

  - Installing nesbot/carbon (1.13.0)
    Loading from cache

  - Installing psr/log (1.0.0)
    Loading from cache

  - Installing aura/intl (1.1.1)
    Loading from cache

  - Installing ircmaxell/password-compat (v1.0.4)
    Loading from cache

  - Installing cakephp/cakephp (3.0.x-dev 2da74bd)
    Cloning 2da74bd405a7c809b964870a45b1952ae5baba77

  - Installing cakephp/migrations (dev-master 0acd5ac)
    Cloning 0acd5acfe61591967eecadbb9cf547c8a603227e

  - Installing cakephp/debug_kit (3.0.x-dev 64a1033)
    Cloning 64a1033ccd1fc0f914a08ff083e690c72d30d3d6

  - Installing cakephp/bake (dev-master c31e157)
    Cloning c31e15747f090906bd6110f743c708d65786655c

  - Installing mobiledetect/mobiledetectlib (2.8.11)
    Loading from cache

  - Installing d11wtq/boris (v1.0.8)
    Loading from cache

symfony/console suggests installing symfony/event-dispatcher ()
symfony/console suggests installing symfony/process ()
Writing lock file
Generating autoload files
Created `config/app.php` file
Set Folder Permissions ? (Default to Y) [Y,n]? Y
Permissions set on /tmp/app/tmp/cache
Permissions set on /tmp/app/tmp/cache/models
Permissions set on /tmp/app/tmp/cache/persistent
Permissions set on /tmp/app/tmp/cache/views
Permissions set on /tmp/app/tmp/sessions
Permissions set on /tmp/app/tmp/tests
Permissions set on /tmp/app/tmp
Permissions set on /tmp/app/logs
Updated Security.salt value in config/app.php
Do you want to remove the existing VCS (.git, .svn..) history? [Y,n]? n
www-data @ dev [ /tmp ]
-> cd app/
www-data @ dev [ /tmp/app ] (master *%=)
-> bin/cake migrations create Initial

Welcome to CakePHP v3.0.0-RC2 Console
---------------------------------------------------------------
App : src
Path: /tmp/app/src/
---------------------------------------------------------------
using migration path /tmp/app/config/Migrations



  [InvalidArgumentException]             
  The "template" option does not exist.  



create [-p|--plugin="..."] [-c|--connection="..."] [-s|--source="..."] name


www-data @ dev [ /tmp/app ] (master *%=)
-> bin/cake bake migration Initial

Welcome to CakePHP v3.0.0-RC2 Console
---------------------------------------------------------------
App : src
Path: /tmp/app/src/
---------------------------------------------------------------

Baking migration class for Connection default

Creating file /tmp/app/config/Migrations/20150209090114_initial.php
Wrote `/tmp/app/config/Migrations/20150209090114_initial.php`
www-data @ dev [ /tmp/app ] (master *%=)

@AD7six AD7six added bug and removed question labels Feb 9, 2015
@segy
Copy link

segy commented Feb 9, 2015

thanks. bin/cake bake migration works. can you please explain, if the bake or migrations console should be used to create migrations?

@AD7six
Copy link
Member

AD7six commented Feb 9, 2015

They do different things, so at the moment, you'd use bake for the first one, and then bin/cake migrations create thereafter - probably. Depends on your workflow though.

@brabeji
Copy link

brabeji commented Feb 9, 2015

Hello, the problem seems to be following:

configure() in /Command/Create.php is not calling parent::configure() so changes in underlying phinx library are not taken into account, namely addition of "template" option which is the problem in this case.

IMO parent::configure() should be called and conflicting addOption() calls removed since corresponding options are set by phinx. This seems to fix immediate problem.

Please advise if I should create PR for this.

@CauanCabral
Copy link

Migrations plugin will follow the CakePHP standard (theme) or Phinx's (template) for that option? Maybe both?

The Phinx related change are here (I think): cakephp/phinx@40adf07

But only today I found that issue.

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

No branches or pull requests

6 participants