Show more helpful error message if destination is not specified in a file field

This commit is contained in:
Flavio Copes
2016-10-10 13:07:34 +02:00
parent ef063f0e7d
commit fd426b4d49
2 changed files with 10 additions and 0 deletions

View File

@@ -1652,6 +1652,15 @@ class AdminController
$upload = $this->normalizeFiles($_FILES['data'], $settings->name);
if (!isset($settings->destination)) {
$this->admin->json_response = [
'status' => 'error',
'message' => $this->admin->translate('PLUGIN_ADMIN.DESTINATION_NOT_SPECIFIED', null, true)
];
return false;
}
// Do not use self@ outside of pages
if ($this->view != 'pages' && in_array($settings->destination, ['@self', 'self@'])) {
$this->admin->json_response = [