DB-IP URL is automatically updated in the options #16713
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
Added a method called by the updater task that updates the DB-IP URL if needed to the latest downloaded one instead of the one set in the options when Matomo was initially installed. This removes much of the confusion at seeing a seemingly outdated URL being used on the GeoIP2 plugin page.
Would love to contribute a test as well but need to make sure I add the right test in the right place - I think a system test would be the right one for this method as I'd need to make sure an option was changed?
Tested the changes by manually setting the
geoip2.loc_db_url
option tohttps://download.db-ip.com/free/dbip-city-lite-2020-05.mmdb.gz
in the database, then running the updater task with./console core:run-scheduled-tasks "Piwik\Plugins\GeoIp2\GeoIP2AutoUpdater.update"
Result - option set to
https://download.db-ip.com/free/dbip-city-lite-2020-11.mmdb.gz
and the plugin page now displays the latest URL in the "Download URL" field.Fixes #16618.
Review