J3 Issue ?
avatar olleharstedt
olleharstedt
13 May 2019

Is your feature request related to a problem? Please describe.

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.

Describe the solution you'd like

Return integer instead of boolean. OR throw an exception.

To increase backward compatibility, 1 can be success, failure can be 0, -1, -2, etc.

Additional context

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).

avatar olleharstedt olleharstedt - open - 13 May 2019
avatar joomla-cms-bot joomla-cms-bot - change - 13 May 2019
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 13 May 2019
avatar olleharstedt olleharstedt - change - 13 May 2019
The description was changed
avatar olleharstedt olleharstedt - edited - 13 May 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 13 May 2019
Labels Added: J3 Issue
avatar franz-wohlkoenig franz-wohlkoenig - labeled - 13 May 2019
avatar HLeithner
HLeithner - comment - 13 May 2019

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?

avatar olleharstedt
olleharstedt - comment - 13 May 2019
avatar olleharstedt
olleharstedt - comment - 13 May 2019

Also see discussion here: #20438

avatar olleharstedt olleharstedt - change - 13 May 2019
The description was changed
avatar olleharstedt olleharstedt - edited - 13 May 2019
avatar HLeithner
HLeithner - comment - 13 May 2019

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.

avatar HLeithner HLeithner - change - 13 May 2019
Status New Closed
Closed_Date 0000-00-00 00:00:00 2019-05-13 14:46:16
Closed_By HLeithner
avatar HLeithner HLeithner - close - 13 May 2019
avatar HLeithner
HLeithner - comment - 14 May 2019

My fault it's not in the framework its in the CMS.

avatar olleharstedt
olleharstedt - comment - 14 May 2019

Done: #24894

Add a Comment

Login with GitHub to post a comment