? ? ? Pending

User tests: Successful: Unsuccessful:

avatar richard67
richard67
2 Jul 2020

Pull Request for Issue #27494 .

Summary of Changes

This Pull Request (PR) is a back port of PR #27570 from 4.0-dev.

It adds following to the Upload & Update tab of the Joomla Update Component:

  • Display of the selected upload file's size.
  • Check if the selected file is too big to be uploaded with respect to the PHP limits.

If the selected upload file is too big, a warning alert is shown. If the user tries to upload that file anway, the upload is rejected with an appropriate browser alert message.

The size of the selected file is always shown in MB because the PHP limits and so the maximum file size will with a 99.9 % likelyhood also be in MB.

For the Upload & Install Package tab of the Extension Installer I've created PR #30190 for backporting PR #27665 from 4.0-dev.

Testing Instructions

  1. Go to administrator/index.php?option=com_joomlaupdate and there to tab "Upload & Update".

  2. Try to upload a file which is bigger than the maximum size shown below the file select button.
    Hint: This does not necessarily need to be a Joomla Update paclage. Take any file with a sufficient size.
    Result: See section "Actual result BEFORE applying this Pull Request" below.

  3. Apply patch of this PR.

  4. Go to administrator/index.php?option=com_joomlaupdate and there to tab "Upload & Update".

  5. Check the Joomla package file fields.
    Result: See section "Expected result" screenshot 1. No information related to the selected file's size is shown if no file is selected.

  6. Select a file which is not too big compared to the maximum upload size shown below the file selection.
    Hint: This can be any file, it doesn't necessarily have to be a Joomla Update package.
    Result: See section "Expected result" screenshot 2. The size of the selected file is shown below the maximum upload size.

  7. Select a file which is too big compared to the maximum upload size shown below the file selection.
    Hint: This can be any file, it doesn't necessarily have to be a Joomla Update package.
    Result: See section "Expected result" screenshot 3. The size of the selected file is shown below the maximum upload size, and below that a warning alert is shown telling that the selected file is too big.

  8. Try to upload the file anway by selecting the Upload & Install button.
    Result: See section "Expected result" screenshot 4. A browser alert is shown telling that the file can't be uploaded because it's too big. The upload is not started.

  9. Toggle the file selection a few times between too big and not too big file, and also between different files of each type.
    Result: The warning disappears when the selection is changed from too big to not too big, and it appears again when vice versa. The file size is updated with each change of the file.

  10. Finally select a valid Joomla Update package which is not too big and verify that uploading still works.
    Result: Uploading of not too big file still works as well as without this PR.

Actual result BEFORE applying this Pull Request

The result depends on the values of the PHP limit post_max_size and upload_max_filesize.

  • If post_max_size is big enough but upload_max_filesize is violated, you get an error alert with the untranslated language string constants COM_INSTALLER_MSG_INSTALL_WARNINSTALLUPLOADERROR and COM_INSTALLER_MSG_WARNINGS_SMALLUPLOADSIZE.
    The not translated languages strings will be solved with PR #29899 .

  • If upload_max_filesize is big enough but post_max_size is violated, you get stuck in the update process, i.e. nothing happens, no progress.

Expected result AFTER applying this Pull Request

  • No file selected:
    expected-result_no-file-selected

  • File size ok:
    expected-result_file-size-ok

  • File too big:
    expected-result_file-size-too-big

  • Broswer alert when trying to upload too big file:
    expected-result_browser-alert

Documentation Changes Required

None.

avatar richard67 richard67 - change - 2 Jul 2020
Status New Pending
avatar richard67 richard67 - open - 2 Jul 2020
avatar joomla-cms-bot joomla-cms-bot - change - 2 Jul 2020
Category Administration com_joomlaupdate Language & Strings
avatar richard67 richard67 - change - 2 Jul 2020
The description was changed
avatar richard67 richard67 - edited - 2 Jul 2020
avatar richard67 richard67 - change - 2 Jul 2020
The description was changed
avatar richard67 richard67 - edited - 2 Jul 2020
avatar richard67 richard67 - change - 2 Jul 2020
The description was changed
avatar richard67 richard67 - edited - 2 Jul 2020
avatar richard67 richard67 - change - 2 Jul 2020
The description was changed
avatar richard67 richard67 - edited - 2 Jul 2020
avatar richard67 richard67 - change - 2 Jul 2020
The description was changed
avatar richard67 richard67 - edited - 2 Jul 2020
avatar richard67 richard67 - change - 18 Jul 2020
Labels Added: ? ?
avatar richard67 richard67 - change - 18 Jul 2020
The description was changed
avatar richard67 richard67 - edited - 18 Jul 2020
avatar richard67 richard67 - change - 18 Jul 2020
The description was changed
avatar richard67 richard67 - edited - 18 Jul 2020
avatar Quy Quy - test_item - 24 Jul 2020 - Tested successfully
avatar Quy Quy - test_item - 24 Jul 2020 - Tested successfully
avatar Quy
Quy - comment - 24 Jul 2020

I have tested this item successfully on f9a655c


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

avatar richard67 richard67 - change - 25 Jul 2020
The description was changed
avatar richard67 richard67 - edited - 25 Jul 2020
avatar jwaisner jwaisner - test_item - 25 Jul 2020 - Tested successfully
avatar jwaisner
jwaisner - comment - 25 Jul 2020

I have tested this item successfully on f9a655c


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

avatar jwaisner jwaisner - change - 25 Jul 2020
Status Pending Ready to Commit
avatar jwaisner
jwaisner - comment - 25 Jul 2020

RTC


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

avatar richard67
richard67 - comment - 25 Jul 2020

@Quy @jwaisner Thanks a lot for testing. There is another, similar PR for the extensions installer: #30190 . It doesn't show the size of the selected file like this one here does, because in the extension installer's Upload & Install the upload starts immediately after having selected or dropped a file, but the alert if the file is too big is the same as here. So if you could test the other one, too, would be really great. Thanks in advance.

avatar HLeithner HLeithner - change - 17 Aug 2020
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-08-17 08:54:50
Closed_By HLeithner
Labels Added: ?
avatar HLeithner HLeithner - close - 17 Aug 2020
avatar HLeithner HLeithner - merge - 17 Aug 2020
avatar HLeithner
HLeithner - comment - 17 Aug 2020

Thanks

avatar richard67
richard67 - comment - 17 Aug 2020

Thanks.

Add a Comment

Login with GitHub to post a comment