Skip to content

Make sure Joomla always points to the latest release and don't fill up the #__updates table#25923

Merged
HLeithner merged 2 commits intojoomla:stagingfrom
zero-24:updateDeleteBeforeUpdate
Aug 19, 2019
Merged

Make sure Joomla always points to the latest release and don't fill up the #__updates table#25923
HLeithner merged 2 commits intojoomla:stagingfrom
zero-24:updateDeleteBeforeUpdate

Conversation

@zero-24
Copy link
Contributor

@zero-24 zero-24 commented Aug 18, 2019

Pull Request for Issue #25920

Summary of Changes

As explained here #25920 we never delete the #__updates table and only add new entries. In some cases this lead to long list of duplicates, especial for language updates with different versions etc. Example:
image

For this reason I propose to make sure, before we checking for new updates on a specific update site, that we remove all updates associated to that update site from the #__updates table. This way we make sure only the latest version is added there and no duplicates should be in the database any more.

Testing Instructions

First Test

Seccond Test

  • Install 3.9.11
  • don't apply this patch
  • install an outdated language pack like this on: https://github.com/joomlagerman/joomla/releases/download/3.9.9v1/de-DE_joomla_lang_full_3.9.9v1.zip
  • check for updates (Extensions -> Mange ->Update)
  • Check the #__updates table
  • notice there is only one entry for the German DE Update.
  • got to #__update_sites table
  • set the last checked timestamp for the language update server to 0 (this way we force the updater to check again)
  • got to the #__updates table and set the version of the found update for the pkg_de-DE to 3.9.10.1 this way we fake that there is a old cached version in the database already.
  • check for updates from the extension manager
  • check the #__updates table again
  • notice there are now two entries for the latest update
  • notice also that Joomla still points to 3.9.10 as latest version.
Third Test

Do the steps of the second test again but now with this patch applied. Please note that there are no duplicate entries in the database anymore and Joomla always points to the latest version.

Expected result

Updates still work than expected

Actual result

Updates work but under some conditions duplicate entries in the #__updates database happend, that never get deleted by Joomla unless you hit the Clear Cache button that in the end just runs a truncate on the table.

Documentation Changes Required

None

@richard67
Copy link
Member

I have tested this item ✅ successfully on d999520

Hints for other testers:

You can test also on current staging if you have a cloned GitHub repo, as long as you always properly reset it after each test, i.e. no need to install 3.9.11.

The step "check for updates" in the first tests might require to use the "Clear cache" button in order to find the update.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25923.

@zero-24
Copy link
Contributor Author

zero-24 commented Aug 18, 2019

Thanks for your test @richard67 and useful infos for the other testers 👍

@richard67
Copy link
Member

Unfortunately we currently have a lack of testers, maybe due to holiday time. So if you have a bit boredom, feel free to test other PR's 😄

@ChristineWk
Copy link

I have tested this item ✅ successfully on d999520

Belongs to First Test only :-)

There was already J 3.9.11. Confirm that: "The step "check for updates" in the first tests might require to use the "Clear cache" button in order to find the update".was needed!


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25923.

@wilsonge wilsonge removed their request for review August 18, 2019 23:22
@ghost ghost removed the PR-staging label Aug 19, 2019
@ghost
Copy link

ghost commented Aug 19, 2019

Status "Ready To Commit".

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Aug 19, 2019
@ghost ghost added the PR-staging label Aug 19, 2019
@HLeithner HLeithner merged commit 07e40c7 into joomla:staging Aug 19, 2019
@HLeithner
Copy link
Member

Thanks for keeping the update tables clean.

@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Aug 19, 2019
@HLeithner HLeithner added this to the Joomla! 3.9.12 milestone Aug 19, 2019
@zero-24 zero-24 deleted the updateDeleteBeforeUpdate branch August 20, 2019 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants