? Failure

User tests: Successful: Unsuccessful:

avatar nikosdion
nikosdion
3 Sep 2014

Executive summary

When you try installing an extension package file with Manage Extensions but your PHP upload temporary directory (upload_tmp_dir) is not set in pph.ini or the package size is larger than the maximum upload size (max_upload_size) you get a generic error which doesn't let you understand why the upload failed. This PR adds descriptive error messages using the same language strings we are already using in the Warnings page.

Backwards compatibility

No backwards compatibility issues are introduced.

Translation impact

No translation strings are added, removed or modified.

Testing instructions

Test 1: Make sure that your server's php.ini has a max_upload_size of 1M. Try installing an extension bigger than that, e.g. Admin Tools Core, K2, Community Builder etc. You get a generic upload error. Apply the PR and retry. You now get an error telling you that the upload failed and that your maximum upload limit is too small.

Test 2 (the problem may not appear on all servers): Make sure that your server's php.ini doesn't have an upload_tmp_dir set. Try installing any extension. You get a generic upload error. Apply the PR and retry. You now get an error telling you that the upload failed and the PHP temporary directory is not set.

avatar nikosdion nikosdion - open - 3 Sep 2014
avatar jissues-bot jissues-bot - change - 3 Sep 2014
Labels Added: ?
avatar infograf768
infograf768 - comment - 3 Sep 2014

@nikosdion
Please add a line before the returns.
Also, as you are using existing lang strings, I suggest, to cope with all languages, to replace the space between the 2 strings by a

<br />
avatar nikosdion
nikosdion - comment - 3 Sep 2014

Regarding returns: I am following the same codestyle as the rest of the code in this method. It would be extremely ridiculous to have line breaks before returns when the rest of the code in this method doesn't. The idea behind code style is enforcing uniformity, not breaking it.

Regarding the break, here you go.

avatar beat
beat - comment - 3 Sep 2014

:+1: This is a really useful error-message bug-fix! Thank you @nikosdion :+1::100:

avatar purplebeanie
purplebeanie - comment - 3 Sep 2014

@test, @nikosdion Tested great for me following test instructions. This is great! I'm amazed how low the upload size is on some servers!

I must have one of the servers that test 2 may not appear on.

avatar infograf768
infograf768 - comment - 3 Sep 2014

@test OK here

avatar infograf768 infograf768 - change - 3 Sep 2014
Labels Added: ?
avatar infograf768 infograf768 - change - 3 Sep 2014
Labels Added: ?
avatar Bakual
Bakual - comment - 3 Sep 2014

Regarding returns: I am following the same codestyle as the rest of the code in this method. It would be extremely ridiculous to have line breaks before returns when the rest of the code in this method doesn't. The idea behind code style is enforcing uniformity, not breaking it.

Imho JM is right that our codestyle requires an empty line before a return statement, however Travis seems to be fine.
I completely agree with you that codestyle is about enforcing uniformity. The thing is that we only require it for new submissions, existing code isn't tested. So their is a period which can be annoying long when there is part of it folling the codestyle and other parts dont.
There are some community members which do codestyle PRs from time to time. So eventually it will be fixed.

That being said, as long as Travis is fine with codestyle, Jenkins hopefully is fine as well. If not, I can fix it after merging myself.

avatar nikosdion
nikosdion - comment - 3 Sep 2014

I fully agree, Thomas. Do you want me to go through the entire file and
add the missing line breaks everywhere?

avatar Bakual
Bakual - comment - 3 Sep 2014

I fully agree, Thomas. Do you want me to go through the entire file and
add the missing line breaks everywhere?

Personally I prefer codestyle changes in a separate PR. It's easier to review and less likely to produce conflicts. But I also don't mind if you do it, it's not a big file in this case and shouldn't generate problems :smile:

avatar nikosdion
nikosdion - comment - 3 Sep 2014

OK, better put code style changes in a new PR once this one is merged.

avatar zero-24 zero-24 - change - 3 Sep 2014
Status New Ready to Commit
avatar dbhurley dbhurley - change - 4 Sep 2014
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2014-09-04 19:11:27
avatar dbhurley dbhurley - close - 4 Sep 2014

Add a Comment

Login with GitHub to post a comment