This Pull Request (PR) adds a check if the selected file is too big to be uploaded with respect to the PHP limits to the "Upload & Install Package" tab of the Extensions Installer.
Testing Instructions
Please wait with testing and reviews. I have to fix drag and drop. Fixed. Ready for reviews and tests.
Run npm run build:js (or npm install if you prefer this).
Clear browser cache to get rid of old cached JS.
Go to administrator/index.php?option=com_installer&view=install and there to tab "Upload Package File".
Drag to the drag and drop area 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 valid extension package. Result: See screenshot in section "Expected result" below. A browser alert is shown telling that the file can't be uploaded because it's too big. The upload is not started.
Select a file which is too big, using the "Or browse for file" button. Result: Same as in previous step. A browser alert is shown telling that the file can't be uploaded because it's too big.
Drag to the drag and drop area a file which is not too big compared to the maximum upload size shown below the file selection. Result: Uploading of not too big package file using drag and drop still works as well as without this PR.
Finally select another package file which is not too big, using the "Or browse for file" button, and verify that uploading still works. Result: Uploading of not too big package file using the "Or browse for file" button still works as well as without this PR.
If post_max_size is big enough but upload_max_size is violated:
If upload_max_size is big enough but post_max_size is violated:
Nothing happens, and PHP error log shows: PHP Warning: POST Content-Length of 22972015 bytes exceeds the limit of 16777216 bytes in Unknown on line 0, referer: ... (with byte figures suitable to your test).
Documentation Changes Required
Nothing special for this PR. The help screens for J4 backend have to be udpated anyway.
We should wait with RTC until the other PR #27570 has RTC, too, or maybe even until that other one is merged, because this PR here depends on that other one.
Please wait with testing and reviews. I have to fix drag and drop.Fixed. Ready for reviews and tests.