Skip to content

Commit

Permalink
Fixed SitesCommand#getSiteCreateOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Sara McCutcheon committed Sep 29, 2016
1 parent 32f714c commit 2357706
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 25 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ All notable changes to this project starting with the 0.6.0 release will be docu
### Removed
- `Environment::info()` has been removed. Please use `Environment::serialize()` instead. (#1251)

### Fixed
- Fixed `SiteCommand::getSiteCreateOptions()` to prevent the failure of the creation of sites. (#1278)

## [0.13.2] - 2016-09-26
### Fixed
- Fixed apply upstream updates. (#1233)
Expand Down
46 changes: 21 additions & 25 deletions php/Terminus/Commands/SitesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -486,44 +486,40 @@ function ($site) {
return $filtered_sites;
}

/**
=======
>>>>>>> Fixed sites list memberships so that information is correctly rendered when a user is both an organizational and a team member.
* A helper function for getting/prompting for the site create options.
*
* @param array $assoc_args Arguments from command
* @return array
*/
/**
* A helper function for getting/prompting for the site create options.
*
* @param array $assoc_args Arguments from command
* @return array
*/
private function getSiteCreateOptions($assoc_args)
{
$options = [];
$options['label'] = $this->input()->string(
[
'args' => $assoc_args,
'key' => 'label',
'message' => 'Human-readable label for the site',
'required' => true,
]
);
$suggested_name = $this->sanitizeName($options['label']);

$options = [
'label' => $this->input()->string(
[
'args' => $assoc_args,
'key' => 'label',
'message' => 'Human-readable label for the site',
'required' => true,
]
),
];
if (array_key_exists('name', $assoc_args)) {
// Deprecated but kept for backwards compatibility
$options['site_name'] = $assoc_args['name'];
} elseif (array_key_exists('site', $assoc_args)) {
$options['site_name'] = $assoc_args['site'];
} elseif (!is_null(Config::get('site'))) {
$options['site_name'] = Config::get('site');
} elseif (!empty($site = Config::get('site'))) {
$options['site_name'] = $site;
} else {
$message = 'Machine name of the site; used as part of the default URL';
$message .= " (if left blank will be $suggested_name)";

$suggested_name = $this->sanitizeName($options['label']);
$options['site_name'] = $this->input()->string(
[
'args' => $assoc_args,
'key' => 'site',
'default' => $suggested_name,
'message' => $message,
'message' => 'The machine name of the site, used as part of the default URL '
. "(if left blank, it will be $suggested_name)";
'required' => true,
]
);
Expand Down

0 comments on commit 2357706

Please sign in to comment.