Skip to content

Commit

Permalink
Merge branch '3.x' into missing-object
Browse files Browse the repository at this point in the history
  • Loading branch information
namespacebrian committed Sep 20, 2023
2 parents 7857a37 + be0691c commit 74852be
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/3x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ jobs:
env:
TERMINUS_TOKEN: ${{ secrets.TERMINUS_TOKEN }}
TERMINUS_SITE: ${{ secrets.TERMINUS_SITE }}
TERMINUS_SITE_WP: ${{ secrets.TERMINUS_SITE_WP }}
TERMINUS_SITE_WP_NETWORK: ${{ secrets.TERMINUS_SITE_WP_NETWORK }}
TERMINUS_ORG: ${{ secrets.TERMINUS_ORG }}
TERMINUS_BASE_DIR: ${{ secrets.TERMINUS_BASE_DIR }}
TERMINUS_PLUGINS_DIR: ${{ secrets.TERMINUS_PLUGINS_DIR }}
Expand Down
3 changes: 3 additions & 0 deletions src/Commands/StructuredListTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ private function addDatetimeRenderer(AbstractStructuredList $list, array $date_a
$list->addRendererFunction(
function ($key, $cell_data) use ($config, $date_attributes) {
if (!is_numeric($key) && in_array($key, $date_attributes)) {
if (empty($cell_data)) {
return '-';
}
return $config->formatDatetime($cell_data);
}
return $cell_data;
Expand Down
13 changes: 9 additions & 4 deletions src/Models/Environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,15 @@ public function cloneDatabase(Environment $from_env, array $options = [])
if (isset($options['updatedb'])) {
$options['updatedb'] = (int)$options['updatedb'];
}
$params = array_merge(
['from_environment' => $from_env->getName(),],
$options
);
$params = [
'from_environment' => $from_env->getName(),
'updatedb' => $options['updatedb'] ?? 0,
'clear_cache' => $options['clear_cache'] ?? false,
];
if (!empty($options['from_url']) && !empty($options['to_url'])) {
$params['wp_replace_siteurl']['from_url'] = $options['from_url'];
$params['wp_replace_siteurl']['to_url'] = $options['to_url'];
}
return $this->getWorkflows()->create(
'clone_database',
compact('params')
Expand Down
1 change: 1 addition & 0 deletions src/Terminus.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ private function addBuiltInCommandsAndHooks()
{
// List of all hooks and commands. Update via 'composer update-class-lists'
$this->commands = [
'Consolidation\\Filter\\Hooks\\FilterHooks',
'Pantheon\\Terminus\\Hooks\\Authorizer',
'Pantheon\\Terminus\\Hooks\\RoleValidator',
'Pantheon\\Terminus\\Hooks\\SiteEnvLookup',
Expand Down

0 comments on commit 74852be

Please sign in to comment.