Skip to content

Commit

Permalink
Add error message when view doesn't exist. Fix translation strings (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
LOBsTerr committed Apr 10, 2019
1 parent f7cf0fd commit fe65097
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Command/Config/ExportViewCommand.php
Expand Up @@ -153,6 +153,15 @@ protected function execute(InputInterface $input, OutputInterface $output)
$viewTypeName = $viewTypeDefinition->getConfigPrefix() . '.' . $viewId;

$viewNameConfig = $this->getConfiguration($viewTypeName);
if (empty($viewNameConfig)) {
$this->getIo()->error(
sprintf(
$this->trans('commands.config.export.view.messages.wrong-view'),
$viewId
)
);
return 0;
}

$this->configExport[$viewTypeName] = ['data' => $viewNameConfig, 'optional' => $optionalConfig];

Expand All @@ -168,6 +177,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
}
}

$this->exportConfigToModule($module, $this->trans('commands.views.export.messages.view-exported'));
$this->exportConfigToModule($module, $this->trans('commands.config.export.view.messages.view-exported'));
}
}

0 comments on commit fe65097

Please sign in to comment.