[4.4] Add information about reasons to Joomla Update when an update was found which doesn't fulfil PHP or DB requirements#42489
Conversation
administrator/components/com_joomlaupdate/src/View/Joomlaupdate/HtmlView.php
Show resolved
Hide resolved
administrator/components/com_joomlaupdate/tmpl/joomlaupdate/noupdate.php
Outdated
Show resolved
Hide resolved
Co-authored-by: Quy <quy@nomonkeybiz.com>
Co-authored-by: Brian Teeman <brian@teeman.net>
Co-authored-by: Brian Teeman <brian@teeman.net>
|
No, my mistake when testing. Modified the wrong DB driver file for faking db version. |
|
@nasirkhan @josephsimony as you were reporting the issue which should be fixed with this pull request (PR) here, or commented in it: Could you test this PR? You know, every non-trivial PR needs 2 successful human tests before it is accepted, so if you want that fix in the upcoming 4.4.2 and 5.0.2 releases, you can help with testing. You can download a full installation package or an update package of 4.4.2-dev + this PR here: https://artifacts.joomla.org/drone/joomla/joomla-cms/4.4-dev/42489/downloads/72341/ . Just make a new installation of that, or update an existing 4.x to that. Do that on a testing environment, preferably on the one with which you had the issue, e.g. in a subdomain or a sub-folder. If that environment would fulfil the PHP and database version requirements for updating to 5.0.1, you can find instructions on how to fake the current versions in the description of this pull request. Then test that if some requirement is not fulfilled so that the "No update" view is shown like described in the issue, a sentence in the text on that screen is telling that, together with the actual and the required version, and if all requirements would not be fulfilled the "normal" update view is shown with the available update and the pre-update checker and so on. If all that works as described, it is a successful test for this PR here. |
|
Awesome work! Very insightfull to see what you changed to make this work. Was just a little bit out of my league still. 😅 |
|
Tried two different existing J4 sites and updated them to the package listed in this PR. But both sites won't show a J5 update when i set the update channel to Joomla Next. |
|
@TLWebdesign i've used custom url with https://update.joomla.org/core/nightlies/next_major_list.xml |
|
Can't mark a successful test but i did test succesfully on local install that does not meet requirements and on a live website i tested it still works when it does meet requirements. |
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/42489. |
|
Is it not possible to make this without the html |
Yes it is, but I am busy with paid job. Maybe you can make a follow-up PR for that after this one got merged? |
|
@brianteeman Would it be ok to remove the |
|
Thanks a lot - good improvement for the update process! |
|
@MacJoom Thanks for merging. I'd like to know your opinion on something which Brian had mentioned. The new language strings as well as the existing ones contain |
|
@richard67 not tested it but that proposed change looks perfect. |
|
We have a lot of language strings including |
|
Ok, follow-up PR see #42550 . I think it can be tested by review. |
|
@brianteeman Could you at least test or just review my PR #42550 ? |


Pull Request for Issue #42228 .
Summary of Changes
This pull request (PR) extends the "Update" object of the updater library to provide additional information about failed checks for PHP and database server requirements and extends the Joomla Update Component's "noupdate" view to show details when there was no suitable update found but one which failed one of these checks.
The change is made in the most b/c way so it uses a new property of the "Update" object and not any existing one, and in case if a suitable update was found there is no change in behaviour.
The language string "COM_JOOMLAUPDATE_NODOWNLOAD_EMPTYSTATE_REASON" for such cases, which was added with PR #42103 , is not modified regarding its meaning or its sprintf parameters. This PR only removes the last part "Please contact your web host to update your server." from it, which will be appended after the new details information again with a new string, and it changes the link to the technical requirements to the page the currently linked site refers to. The latter I was reluctant to do because the currently linked site that linking to another site is just a temporary thing, but the discussion in the referred issue and on social media has shown that people would prefer the link to go directly to the site where currently the requirements can be found. So worst case is that with an outdated translation the removed part of the sting will still be there and the link will be the old one.
Testing Instructions
You can find a full installation package and an update package of 4.4.2-dev + this PR here: https://artifacts.joomla.org/drone/joomla/joomla-cms/4.4-dev/42489/downloads/72341/ .
If you have a Joomla 4 site which does not meet the PHP or database requirements to update to Joomla 5 you can use that for testing.
If not, you can fake the database or the PHP version or both as described below.
Then make sure that an update is found where the requirements are not met and go to the Joomla Update component.
In addition, check that the Joomla Update Components still works as usual when there is an update found where all requirements are fulfilled.
How to fake a too low PHP version
Edit file "libraries/src/Updater/Update.php" and search for this line in the "_endElement" method:
In the unmodified file on the 4.4-dev branch it is line 348, in the modified file from this PR it is line 360.
Change the
PHP_VERSIONto e.g.'7.4.0'.In the modified file from this PR you should also do the same change a few lines later in line 367 so you get the faked PHP version also reported in the new details information.
How to fake a too low database version
Depending on which database driver you use, "MySQLi", "MySQL (PDO)" or "PostgreSQL", modify the "getVersion" method of the particular driver to return a version string with a too small version, e.g.
'5.7.0-0ubuntu0.22.04.1'for a MySQL,'10.2.0-0ubuntu0.22.04.1'for a MariaDB or'11.0-0ubuntu0.22.04.1'for PostgreSQL database.Actual result BEFORE applying this Pull Request
See issue #42228 : There are no details on which of the requirements is not met, and the link to the technical requirements goes to a site which refers to another site.
Expected result AFTER applying this Pull Request
When the PHP version requirement is not met, an additional sentence shows that, telling the current and the required version.
When the database version requirement is not met, an additional sentence shows that, telling the database type and the current and required versions.
Link to documentations
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed