If upload file fails, you want to know why so that you can show an error message to the user and also react accordingly in the code. Right now, the type of the error is just recorded in the log.
Return integer instead of boolean. OR throw an exception.
To increase backward compatibility, 1 can be success, failure can be 0, -1, -2, etc.
https://github.com/joomla/joomla-cms/blob/staging/libraries/src/Filesystem/File.php#L531
I will create a PR when an accepted solution is agreed upon (result code vs exception).
Labels |
Added:
?
|
Labels |
Added:
J3 Issue
|
Yes, this is still an issue in 4: https://github.com/joomla/joomla-cms/blob/4.0-dev/libraries/src/Filesystem/File.php#L449
So you already got your answer from Michael #20438 (comment)
please create a pull request against the framework and throw a exception if it doesn't succeed.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-05-13 14:46:16 |
Closed_By | ⇒ | HLeithner |
My fault it's not in the framework its in the CMS.
changing this would be a b/c break even if it shouldn't be too bad, did you checked if this is still a valid issue in j4?