?
avatar richard67
richard67
1 Jul 2020

Pull Request for Issue # .

Summary of Changes

This Pull Request (PR) adds a missing return statement to the upload function in file administrator/components/com_joomlaupdate/controllers/update.php.

Testing Instructions

Code review should be enough, but if you want to make a real test ...

  1. Because it is not easy to cause one of the exceptions in function upload of the Joomla Update model, add a line as follows to throw an exception just at the beginning of the function, e.g. here https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_joomlaupdate/models/default.php#L941
    throw new RuntimeException('THIS IS A TEST', 500);

  2. On a clean current staging or recent 3.9 nightly build or a 3.9.19, login to backend and go to "Components -> Joomla Update".

  3. Select any file for upload.
    Result: See section "Actual result BEFORE applying this Pull Request" below.

  4. Apply the patch of this PR.

  5. Repeat steps 2 and 3.
    Result: See section "Expected result AFTER applying this Pull Request" below.

Actual result BEFORE applying this Pull Request

First a 403 "Access forbidden" error is shown.
snap_1

After that when navigating or using the "Back to Control Panel" button, the alert with the exception message is shown.
snap_2

Expected result AFTER applying this Pull Request

The alert with the exception message is shown on the Joomla Update Component page. There is no 403 "Access forbidden" error.
snap_3

Documentation Changes Required

None.

Additional information

When doing the test with one of the language strings COM_INSTALLER_MSG_... used in one of the exceptions thrown in that function, you will see that these language strings are not trantlated. This is a separate issue not within the scope of this PR. I will later check if there is already an issue or not.

What remains to be clarified is: Shall we make com_joomlaupdate load the strings from com_installer, or shouldn't we better duplicate the necessary strings into the com_joomlaupdate language file and change their name so we have COM_JOOMLAUPDATE_MSG_...? @infograf768 What do you think?

avatar richard67 richard67 - open - 1 Jul 2020
avatar richard67
richard67 - comment - 1 Jul 2020

For some reason I don't see this PR in the issue tracker :-( solved.

avatar richard67
richard67 - comment - 1 Jul 2020

Hmm, now the test buttons are missing in the issue tracker.

avatar richard67 richard67 - change - 1 Jul 2020
Category Administration com_joomlaupdate
avatar richard67 richard67 - change - 1 Jul 2020
Status New Pending
Labels Added: ?
avatar richard67
richard67 - comment - 1 Jul 2020

Closing this one and making a new, identical one ... hopefully I'll be more lucky with the issue tracker. Don't have the time now to open an issue for the tracker.

avatar richard67 richard67 - close - 1 Jul 2020
avatar richard67 richard67 - change - 1 Jul 2020
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2020-07-01 17:30:09
Closed_By richard67

Add a Comment

Login with GitHub to post a comment