J3 Issue ?
avatar olleharstedt
olleharstedt
27 Apr 2018

Steps to reproduce the issue

Use JFile::upload in a way that causes an error.

Expected result

Being able to check for errors after use.

Actual result

Errors are only logged in log file, no exceptions or error return value.

System information (as much as possible)

N/A

Additional comments

I propose a static class variable called $upload_error, which is set to relevant error message (or object) if upload returns false.

Better would probably be throwing an exception, or returning a result array like [boolean $result, string $errorMessage], but that would break compatibility.

Link to method: https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/filesystem/file.php#L521

avatar olleharstedt olleharstedt - open - 27 Apr 2018
avatar joomla-cms-bot joomla-cms-bot - change - 27 Apr 2018
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 27 Apr 2018
avatar olleharstedt olleharstedt - change - 27 Apr 2018
Title
JFile::upload does not return any status message
JFile::upload does not return any status message on error
avatar olleharstedt olleharstedt - edited - 27 Apr 2018
avatar olleharstedt olleharstedt - change - 27 Apr 2018
The description was changed
avatar olleharstedt olleharstedt - edited - 27 Apr 2018
avatar olleharstedt olleharstedt - change - 27 Apr 2018
The description was changed
avatar olleharstedt olleharstedt - edited - 27 Apr 2018
avatar olleharstedt olleharstedt - change - 27 Apr 2018
The description was changed
avatar olleharstedt olleharstedt - edited - 27 Apr 2018
avatar olleharstedt olleharstedt - change - 27 Apr 2018
The description was changed
avatar olleharstedt olleharstedt - edited - 27 Apr 2018
avatar franz-wohlkoenig franz-wohlkoenig - change - 27 Apr 2018
Category Feature Request Libraries
avatar brianteeman brianteeman - change - 29 Apr 2018
Labels Added: J3 Issue
avatar brianteeman brianteeman - labeled - 29 Apr 2018
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 8 May 2018

Can someone please answer on this issue as its open since 10+ Days having Staus "New"?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/20246.

avatar franz-wohlkoenig franz-wohlkoenig - change - 11 May 2018
Status New Information Required
avatar PhilETaylor
PhilETaylor - comment - 15 May 2018

The code is doing exactly as it is designed to. It is designed to return a bool only.

What this issue really is, is a new feature request, to allow the upload error to be captured and reported someway instead of just returning false.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 16 May 2018

Thanks @PhilETaylor for Answer.

So this Issue stay open as Feature Request.

avatar franz-wohlkoenig franz-wohlkoenig - change - 16 May 2018
Status Information Required Discussion
avatar olleharstedt
olleharstedt - comment - 16 May 2018

@PhilETaylor Haha, yes, I know it does that. That's the problem!! I can do a PR if you want to.

avatar Quy
Quy - comment - 16 May 2018

@olleharstedt Please submit a PR so it has a chance to be included in the core.

avatar olleharstedt
olleharstedt - comment - 17 May 2018

Added PR here: #20438

avatar franz-wohlkoenig franz-wohlkoenig - change - 17 May 2018
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2018-05-17 11:32:03
Closed_By franz-wohlkoenig
avatar joomla-cms-bot joomla-cms-bot - change - 17 May 2018
Closed_By franz-wohlkoenig joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 17 May 2018
avatar joomla-cms-bot
joomla-cms-bot - comment - 17 May 2018
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 17 May 2018

closed as having Pull Request #20438

Add a Comment

Login with GitHub to post a comment