Skip to content

Commit fe65097

Browse files
authored
Add error message when view doesn't exist. Fix translation strings (#3911)
1 parent f7cf0fd commit fe65097

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/Command/Config/ExportViewCommand.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,15 @@ protected function execute(InputInterface $input, OutputInterface $output)
153153
$viewTypeName = $viewTypeDefinition->getConfigPrefix() . '.' . $viewId;
154154

155155
$viewNameConfig = $this->getConfiguration($viewTypeName);
156+
if (empty($viewNameConfig)) {
157+
$this->getIo()->error(
158+
sprintf(
159+
$this->trans('commands.config.export.view.messages.wrong-view'),
160+
$viewId
161+
)
162+
);
163+
return 0;
164+
}
156165

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

@@ -168,6 +177,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
168177
}
169178
}
170179

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

0 commit comments

Comments
 (0)