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

terminus site create: Call to undefined method Products_Command::getById(). Also, permission to install product is not granted. #49

Closed
bwood opened this issue Jan 13, 2015 · 5 comments

Comments

@bwood
Copy link
Contributor

bwood commented Jan 13, 2015

In reference to issue #45. I saw this PR #45 so I tested and hit a new error:

First, my terminus version:

[bwood@mbp ~]$ terminus cli version
Terminus 0.3.1-beta

(I pulled the latest code from [email protected]:pantheon-systems/cli.git master at about 15:00PDT)

[bwood@mbp ~]$ terminus sites create --product=87774fa4-b570-4300-a693-1c98b61457cd --name=t20create-ucb-ob7 --org=94a63981-a120-4f67-ae63-11547dee8be1 --label=t20create-ucb
PHP Fatal error:  Call to undefined method Products_Command::getById() in phar:///Users/bwood/code/drupal/bwood/cli/builds/terminus/php/commands/sites.php on line 78
PHP Stack trace:
PHP   1. {main}() /Users/bwood/code/drupal/bwood/cli/builds/terminus:0
PHP   2. include() /Users/bwood/code/drupal/bwood/cli/builds/terminus:4
PHP   3. include() phar:///Users/bwood/code/drupal/bwood/cli/builds/terminus/php/boot-phar.php:5
PHP   4. Terminus\Runner->run() phar:///Users/bwood/code/drupal/bwood/cli/builds/terminus/php/terminus.php:29
PHP   5. Terminus\Runner->_run_command() phar:///Users/bwood/code/drupal/bwood/cli/builds/terminus/php/Terminus/Runner.php:155
PHP   6. Terminus\Runner->run_command() phar:///Users/bwood/code/drupal/bwood/cli/builds/terminus/php/Terminus/Runner.php:75
PHP   7. Terminus\Dispatcher\Subcommand->invoke() phar:///Users/bwood/code/drupal/bwood/cli/builds/terminus/php/Terminus/Runner.php:68
PHP   8. call_user_func() phar:///Users/bwood/code/drupal/bwood/cli/builds/terminus/php/Terminus/Dispatcher/Subcommand.php:220
PHP   9. Terminus\Dispatcher\CommandFactory::Terminus\Dispatcher\{closure}() phar:///Users/bwood/code/drupal/bwood/cli/builds/terminus/php/Terminus/Dispatcher/Subcommand.php:220
PHP  10. call_user_func() phar:///Users/bwood/code/drupal/bwood/cli/builds/terminus/php/Terminus/Dispatcher/CommandFactory.php:35
PHP  11. Sites_Command->create() phar:///Users/bwood/code/drupal/bwood/cli/builds/terminus/php/Terminus/Dispatcher/CommandFactory.php:35

I corrected this error with the following:

diff --git a/php/commands/sites.php b/php/commands/sites.php
index ae8bd63..72eff3d 100755
--- a/php/commands/sites.php
+++ b/php/commands/sites.php
@@ -75,10 +75,10 @@ class Sites_Command extends Terminus_Command {
     }
     require_once __DIR__.'/products.php';
     if (isset($assoc_args['product'])) {
-      $product = Products_Command::getById($assoc_args['product']);
+      $product = Products::getById($assoc_args['product']);
     } else {
       $product = Terminus::menu( Products_Command::selectList() );
-      $product = Products_Command::getByIndex($product);
+      $product = Products::getByIndex($product);
     }
     Terminus::line( sprintf( "Creating new %s installation ... ", $product['longname'] ) );
     $data['product'] = $product['id'];

Now terminus sites create works, however it does not address the problem with product/organization permissions that I've described in Pantheon issue 30469:

[bwood@mbp ~]$ terminus sites create --product=87774fa4-b570-4300-a693-1c98b61457cd --name=t20create-ucb-ob7 --org=94a63981-a120-4f67-ae63-11547dee8be1 --label=t20create-ucb
Creating new Open Berkeley 7 installation ...
Error: "Error: Product cannot be used outside                                               organizational context.\n"
@mikevanwinkle
Copy link
Contributor

@bwood you'll see the travis indicator that the build is broken atm ... will alert once it's fixed.

@mikevanwinkle
Copy link
Contributor

Thanks for testing though

@mikevanwinkle
Copy link
Contributor

This should be fix despite the unit tests still failing. please pull down the latest and give it a try. Cheers,

@mikevanwinkle
Copy link
Contributor

@bwood I believe the issue with ""Error: Product cannot be used outside organization level" is an api issue and is being addressed at that level.

@bwood
Copy link
Contributor Author

bwood commented Jan 14, 2015

Thanks Mike. The Call to undefined method Products_Command::getById() is fixed:

[bwood@mbp cli]$ terminus sites create --product=21e1fada-199c-492b-97bd-0b36b53a9da0 --name=t20create-ucb-ob7 --org=430c1947-354f-459a-8755-f38293aef105 --label=t20-ob7-ucbtest
Creating new Drupal 7 installation ...
Working ..............
Success: Pow! You created a new site!

@bwood I believe the issue with ""Error: Product cannot be used outside organization level" is an api issue and is being addressed at that level.

Makes sense. In my conversation with Timani yesterday, he referred to this work, and I mistakenly thought the permissions fix might be included. I'll close this.

@bwood bwood closed this as completed Jan 14, 2015
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

2 participants