-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[5.3] Fix core update information retrieval after changing the update channel or stability options #44954
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Fixed, thanks @brianteeman |
why is this a plugin and not part of the component.? And if it is to be a plugin then it needs to be added to the list of core extensions |
Because the action, that is relevant for the purge of the updates, does not happen in com_joomlaupdate but in com_config; and com_config triggers plugin events.
Good catch, done! |
For testing: do I need to be on the latest version (5.2.4) or i.e. on 5.2.3? |
The provided test instruction don't rely on the actual retrieval of update information but on the execution of "proof statement". So, for these instructions the version does not matter. |
I have tested this item ✅ successfully on 257002e This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44954. |
I tested on localhost with MariaDB This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44954. |
I have tested this item 🔴 unsuccessfully on 257002e
Observed Behavior:
Expected Behavior (Not Achieved):
|
@komalm have you installed and activated the new plugin before performing the test? applying the patch alone will not be sufficient. |
administrator/components/com_admin/sql/updates/mysql/5.3.0-2025-02-22.sql
Outdated
Show resolved
Hide resolved
administrator/components/com_admin/sql/updates/postgresql/5.3.0-2025-02-22.sql
Outdated
Show resolved
Hide resolved
Co-authored-by: Richard Fath <[email protected]>
@SniperSister The testing instructions tell to toggle the minimum stability. But they don't tell to check that the purge is also triggered by changing the update channel without and with the PR, i.e. that this still works with the PR. I think the instructions should also cover that case. |
@SniperSister There is something wrong when changing the update channel with this PR applied. I've done a real test with the version number patched to 5.3.0-alpha4. When I use the custom URL of this PR with minimum stability = stable, then the update to this PR is found. That's right because the PR builds are tagged as stable in the custom update XML. Then I switch back to the default channel where nothing should be found. But it still shows the update from the custom URL, and the URL of the update site in database is still the custom URL. Hint: To patch the version to alpha4 I've edited files |
I have tested this item 🔴 unsuccessfully on 4eb1439 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44954. |
Or maybe the plugin is listening to the wrong event? When I add some error log for debugging, it shows that the purge is triggered, but the values of |
@richard67 stupid question: plugin was installed and enabled during the test? |
Sure. I have updated a 5.3-dev installation to the custom update URL of this PR to see if your update SQL works. Then I have checked that the plugin is installed and enabled. Then I have patched the version to 5.3.0-alpha4 like I described in the comment before my test result. Then I have tested. Instead of a die, I did use error_log for producing debug output to my error log at the place where you said the die should be added. I've still had the custom URL of the PR entered, minimum stability was stable, and I only changed the update channel from "Custom URL" to "Default" and vice versa and saved after each change. My debug log has shown that the purge always gets triggered one time, but the values of |
@SniperSister This is the debug code which I've used in the
The 2 variables are determined from the params gotten with the statement at the top of the method in line :
Maybe this still gets the old values from before save? |
@richard67 I was able to reproduce your finding and have update the PR and the test instructions accordingly @webgras a re-test would be much appreciated! |
administrator/components/com_joomlaupdate/src/Model/UpdateModel.php
Outdated
Show resolved
Hide resolved
administrator/components/com_joomlaupdate/src/Model/UpdateModel.php
Outdated
Show resolved
Hide resolved
…l.php Co-authored-by: Richard Fath <[email protected]>
I have tested this item ✅ successfully on 9498976 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44954. |
I have tested this item ✅ successfully on 9498976 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44954. |
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44954. |
joomla/joomla-cms#41496 - (upmerge с 5.2х) joomla/joomla-cms#42530 + joomla/joomla-cms#43994 - (upmerge с 5.2х) joomla/joomla-cms#44009 - (upmerge с 5.2х) joomla/joomla-cms#44010 - (upmerge с 5.2х) joomla/joomla-cms#44161 + joomla/joomla-cms#44187 - (upmerge с 5.2х) joomla/joomla-cms#44207 - (upmerge с 5.2х) joomla/joomla-cms#44271 + joomla/joomla-cms#44273 + joomla/joomla-cms#44288 - (только для en-GB) joomla/joomla-cms#44348 - (upmerge с 5.2х) joomla/joomla-cms#44366 + joomla/joomla-cms#44367 - (upmerge с 5.2х) joomla/joomla-cms#44434 - (upmerge с 5.2х) joomla/joomla-cms#44448 - (upmerge с 5.2х) joomla/joomla-cms#44462 + joomla/joomla-cms#44487 - (upmerge с 5.2х) joomla/joomla-cms#44587 + joomla/joomla-cms#44600 + joomla/joomla-cms#44604 + joomla/joomla-cms#44621 - (upmerge с 5.2х) joomla/joomla-cms#44623 + joomla/joomla-cms#44632 + joomla/joomla-cms#44640 - (позже был REVERT joomla/joomla-cms#44845) joomla/joomla-cms#44714 - (upmerge с 5.2х) joomla/joomla-cms#44756 + joomla/joomla-cms#44768 - (upmerge с 5.2х) joomla/joomla-cms#44792 - (только для en-GB) joomla/joomla-cms#44813 + joomla/joomla-cms#44822 - (upmerge с 5.2х) joomla/joomla-cms#44839 + joomla/joomla-cms#44871 + joomla/joomla-cms#44954 + joomla/joomla-cms#45034 - (upmerge с 5.2х) joomla/joomla-cms#45058 - (только для en-GB) joomla/joomla-cms#45064 + joomla/joomla-cms#45078 - (только для en-GB) joomla/joomla-cms#45130 - (upmerge с 5.2х) joomla/joomla-cms#45240 - (upmerge с 5.2х) joomla/joomla-cms#45246 - (только для др. пакетов)
Summary of Changes
In the pre-TUF era, each and every update channel and event some of the stability options in the config of com_joomlaupdate had it's own update XML. After switching that the XML, the existing update information in the database had to be purged before new information could be fetched. That was done by calling the "applyUpdateSite" method in the DisplayController of com_joomlaupdate because that controller task would be shown after the config has been changed.
That approach has two flaws:
This PR now adds a new plugin that listens for config save events of com_joomlaupdate, applies the new config and always purges the now outdated information. That fixes both issues.
Testing Instructions
EXTRA_VERSION
constant in libraries/src/Version.php to "alpha-4" - that's necessary for the test because otherwise the default update channel will not show any updateshttps://artifacts.joomla.org/drone/joomla/joomla-cms/5.3-dev/44954/downloads/82486/pr_list.xml
as custom urlActual result BEFORE applying this Pull Request
Update information is not fetched correctly, showing available updates for the "previous" channel
Expected result AFTER applying this Pull Request
Correct information is shown
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