Open alexdryden opened 1 year ago
When uploading a media item with a file extension that isn't allowed, a JSON parse error message is displayed instead of the the custom error text:
This is because the error message is not passed with the self keyword here: https://github.com/anvc/scalar/blob/a9165f1fc34d0834b911c11757b92fc47b9d15bf/system/application/libraries/File_Upload.php#L61 It should be throw new Exception(self::FILE_NAME_NOT_ALLOWED);. I can submit a pr for this along with the other error message related issue.
self
Exception(self::FILE_NAME_NOT_ALLOWED);
A pull request here, too, would be excellent, thanks @alexdryden !
When uploading a media item with a file extension that isn't allowed, a JSON parse error message is displayed instead of the the custom error text:
This is because the error message is not passed with the
self
keyword here: https://github.com/anvc/scalar/blob/a9165f1fc34d0834b911c11757b92fc47b9d15bf/system/application/libraries/File_Upload.php#L61 It should be throw newException(self::FILE_NAME_NOT_ALLOWED);
. I can submit a pr for this along with the other error message related issue.