joomla-cms
joomla-cms copied to clipboard
[5.1] Error handling on extension update
Pull Request for Issue #43319 .
Summary of Changes
Catch errors from the extension being updated and abort update with a sensible message.
Testing Instructions
(a) Installed this Plugin. plg_updatetest1.zip
(b) Enable the plugin.
(c) Go to Joomla updater and check for updates.
(d) Then select the plugin installed above PLG_HIKASHOPSHIPPING_BFEXTRAFEATURES and update it.
Actual result BEFORE applying this Pull Request
Expected result AFTER applying this Pull Request
Link to documentations
Please select:
-
[ ] Documentation link for docs.joomla.org:
-
[x] No documentation changes for docs.joomla.org needed
-
[ ] Pull Request link for manual.joomla.org:
-
[x] No documentation changes for manual.joomla.org needed
Cannot be tested
Try this test plugin - screenshots before applying the pull request changes. plg_updatetest2.zip
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Test does not work on Unix system! - must be filename case, investigating.
I am using windows
Sorted, no change to the above needed, can go ahead with testing. Appologizes for inconvenience, update server issue, not looked at that for a long time!
With Debug Disabled
With Debug Enabled
PLEASE check your work before submitting it
Changed.
Sorry, copied the changed code across and forgot the use statement. Failed to check the files changed count - thought I had copied the language text across.
You also forgot to check the language string you used and the string you created.
Retested as: https://github.com/joomla/joomla-cms/pull/43321#issuecomment-2067737115
With changes made the message is now:
I am all in favour of meaningfull error messages but they also have to be helpful. In this example the advice is not helpful at all as it means nothing at all to the user. This is a message that is only useful to the original extension developer and is not something that an end user shoudl ever see. Extension developers dont release updates without testing they work do they
Regardless of who is to blame for the error what I propose is better and more useful than what Joomla currently displays.
This is actually not a plugin bug - the plugin is used by and depends on a 3rd party extension, it is that dependency which causes the problem when the update is attempted with the plugin enabled. Could modify such plugins to protect against such errors but I see that as unnecessary code in the plugin when Joomla can handle it more gracefully.
I suppose could add another line to the error message: "Please contact the extension developer."
Could enhance further by adding contact information from current XML?
The question is. Does the new message help the end user more than the original message. For me the answer is no
The end user is an admin who hopefully knows the extensions installed on their site.
The current error is missleading as it implies it is a bug in the Joomla installer ... which led to me being asked a question which started me on this.
I think that this helps "Please contact the extension developer of the Plugin ... ". Then I know that it is not a bug in Joomla or in my confirguration and don't waste time with debugging.
@chmst the problem is that according to @BrainforgeUK the problem is not with the developer of this plugin but with the developer of a completely different extension upon which it depends - so which extension developer am I going to contact? For me that is not the problem. The problem is that the extension that is being installed is not checking for the presence of the extension it is dependent upon. ergo nothing sensible can be changed in core to fix an extension developers errors
@brianteeman - thanks, agreed.
there is only so much that Joomla can do. Extension developers need to take responsibility for their own code being installed correctly.
should this PR get test or not?
I do't see why not. Improves on what is there already but as indicated in previous comments it is not perfect. There can never be a perfect solution.
I do't see why not.
I don't see positive comments. Don't wanna waste my time.
I have tested this item :red_circle: unsuccessfully on bb1c6aa4acc1d4944f815b6f0950579616ac4582
Hi BrainForgeUK, I have really tried to test this during PBF 2024, and I am sorry, but neither pig_updatetest1.zip nor png_updatetest2.zip yield the results that you show/want... perhaps because we are testing it now against Joomla 5.2.0-beta2-dev but couldn't get it to work out ;(
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43321.
I should specify that I considered this a fail since it did NOT include the path line and just showed the first 2 lines:
Error updating: PLG_BF_MANUAL Class "hikashopShippingPlugin" not found
I have tested this item :white_check_mark: successfully on bb1c6aa4acc1d4944f815b6f0950579616ac4582
Tested successfully. Seems like a no brainer to me to improve this.
I've tested on J5.1.3 and then there was no path visible (3rd line in the alert) but on 5.2.0-beta2-dev it was fine.
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43321.
I have tested this item :white_check_mark: successfully on bb1c6aa4acc1d4944f815b6f0950579616ac4582
Works as described.
Thank you for this PR! The new error message has more details, so it helps the website admins understand the issue better when they get such an error.
btw: I've tested this PR successfully on 5.2-dev:
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43321.
On Joomla 5.1.3 i'm not seeing the path. I tested it both on a localhost and on a live test server.
See attached screenshot:
@TLWebdesign as this PR is for 5.1 and not 5.2 then you should be marking this as an unsuccessful test
I have tested this item :red_circle: unsuccessfully on bb1c6aa4acc1d4944f815b6f0950579616ac4582
On 5.1.3 i'm not getting the path to the file to show.
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43321.
This pull request has been automatically rebased to 5.2-dev.
I have tested this item :white_check_mark: successfully on bb1c6aa4acc1d4944f815b6f0950579616ac4582
Tested Succesfully on 5.2
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43321.
RTC
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43321.