? ? Pending

User tests: Successful: Unsuccessful:

avatar richard67
richard67
5 Sep 2021

Pull Request for Issue # .

Summary of Changes

With pull request (PR) #35164 , an update SQL script "4.0.0-2021-08-17.sql" has been added (and later been fixed with PR #35176 ) to insert a record into the extensions table for a new com_search package "pkg_search" and create database records for an update site for that package to migrate com_search from a core extension to a core supported extension when updating to J4.

Unfortunately these database records are also added when updating from a 4.0 RC 6 or previous 4.0 RC or Beta version where com_search was not installed (or has been removed after updating from 3.10 to that version).

The result is a package "pkg_search" which can not be uninstalled because the manifest XML file of that package is not there.

This PR here fixes this by adding a new update SQL script which deleted the update site and extension records for that package if no other com_search extension is installed.

This fixes the issue without touching an installation where com_search is really installed.

Normally I would have also changed the update SQL script "4.0.0-2021-08-17.sql" not to insert these records if no other com_search extension is there, but since changing old update SQL scripts is always a subject of discussion I did not do that. So now we have the silly situation that these records are first installed in any case and then later removed again during the update if obsolete.

Testing Instructions

This PR needs to be tested with all kinds of databases which are supported in Joomla 4, i.e. MySQL or MariaDB and PostgreSQL.

Testers please report back which kind of database server and which version you have used.

If you have more than one available, test with all.

The tests should be performed with "Debug System" switched on and "Error Reporting" set to "Maximum" in Global Configuration to make sure to see any SQL errors.

Thanks in advance.

Test 1: Update a 4.0 RC 6 or earlier 4.0 version which has no com_search to 4.0.0 or later to reproduce the issue

  1. Have a 4.0 RC 6 or previous 4.0 RC or Beta version which does not have com_search installed.

  2. Update to 4.0.2 or to the latest 4.0 nightly build.

  3. Check if there is an update site with name "Search Update Site" and location "https://raw.githubusercontent.com/joomla-extensions/search/main/manifest.xml".
    Result: There is such a update site.
    j4-test-pr-xxxxx_with-com-search-update-site

  4. In the extensions manager, check if there is a package "pkg_search".
    Result: There is such a package.
    j4-test-pr-xxxxx_packages-after-update-to-4 0 2

  5. Try to uninstall that package.
    Result: It fails because no manifest file found, see section "Actual result BEFORE applying this Pull Request" below.

Test 2: Update the result of Test 1 to the patched package for this PR to test the fix

  1. Update the result from the previous Test 1 to the patched package or custom update URL created by drone for this PR.

  2. In the extensions manager, check if there is a package "pkg_search".
    Result: There is no such a package.
    j4-test-pr-xxxxx_packages-after-update-to-pr

  3. Check if there is an update site with name "Search Update Site" and location "https://raw.githubusercontent.com/joomla-extensions/search/main/manifest.xml".
    Result: There is no such a update site.
    j4-test-pr-xxxxx_no-com-search-update-site

  4. Rebuild update sites and check if there are errors.
    Result: No errors related to com_search.

  5. Check again step 3.
    Result: There is still no such a update site.

Test 3: Update a 3.10.x or 4.0.x which has com_search to the patched package for this PR to test that it sill works

  1. Have a current 3.10.x or 4.0.x which has com_search installed.

  2. Update to the patched package or custom update URL created by drone for this PR.

  3. Check if there is an update site with name "Search Update Site" and location "https://raw.githubusercontent.com/joomla-extensions/search/main/manifest.xml".
    Result: There is such a update site.

  4. In the extensions manager, check if there is a package "pkg_search".
    Result: There is such a package.

  5. Uninstall that package.
    Result: The package and com_search and all plugins and modules belonging to com_search are uninstalled, and the update site is removed.

Actual result BEFORE applying this Pull Request

After an update from a 4.0 RC 6 or previous 4.0 RC or 4.0 Beta version where com_search was not installed because it was a new installation or where it has been removed after updating from 3.10 to that version, a package "pkg_search" has been added in the database.

When trying to uninstall that obsolete package, you get an error that the manifest file is missing:

j4-test-pr-xxxxx_uninstall-package-2

Expected result AFTER applying this Pull Request

When updating an installation where com_search is present, a package "pgk_search" and an update site for that are created in database.

When updating an installation where com_search is not present, no such stuff is created.

When updating a 4.0.0 or later where a package "pgk_search" and an update site for that have been created in database but com_search is not present, these obsolete database records are removed when updating to a future 4.0.x version which contains the changes from this PR.

Documentation Changes Required

None.

avatar richard67 richard67 - open - 5 Sep 2021
avatar richard67 richard67 - change - 5 Sep 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 5 Sep 2021
Category SQL Administration com_admin Postgresql
avatar richard67 richard67 - change - 5 Sep 2021
The description was changed
avatar richard67 richard67 - edited - 5 Sep 2021
avatar richard67 richard67 - change - 5 Sep 2021
The description was changed
avatar richard67 richard67 - edited - 5 Sep 2021
avatar richard67 richard67 - change - 5 Sep 2021
The description was changed
avatar richard67 richard67 - edited - 5 Sep 2021
avatar richard67 richard67 - change - 5 Sep 2021
The description was changed
avatar richard67 richard67 - edited - 5 Sep 2021
avatar richard67 richard67 - change - 5 Sep 2021
The description was changed
avatar richard67 richard67 - edited - 5 Sep 2021
avatar richard67 richard67 - change - 5 Sep 2021
The description was changed
avatar richard67 richard67 - edited - 5 Sep 2021
avatar richard67 richard67 - change - 5 Sep 2021
The description was changed
avatar richard67 richard67 - edited - 5 Sep 2021
avatar richard67 richard67 - change - 5 Sep 2021
The description was changed
avatar richard67 richard67 - edited - 5 Sep 2021
avatar richard67 richard67 - change - 5 Sep 2021
The description was changed
avatar richard67 richard67 - edited - 5 Sep 2021
avatar richard67 richard67 - change - 5 Sep 2021
The description was changed
avatar richard67 richard67 - edited - 5 Sep 2021
avatar richard67 richard67 - change - 5 Sep 2021
The description was changed
avatar richard67 richard67 - edited - 5 Sep 2021
avatar chmst chmst - test_item - 5 Sep 2021 - Tested successfully
avatar chmst
chmst - comment - 5 Sep 2021

I have tested this item successfully on dfc469d

Tested on MariaDB


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

avatar richard67 richard67 - change - 6 Sep 2021
Labels Added: ?
avatar ChristineWk
ChristineWk - comment - 6 Sep 2021

Hope, I made everything correct :-)

Confirm Actual Result 4.0.0
Installed Prebuilt Package with this xml: https://ci.joomla.org/artifacts/joomla/joomla-cms/4.0-dev/35483/downloads/47337/pr_list.xml
Updated to 4.0.3-dev.
With Patch > Extensions: Manage searched for: "search" > Result: Some Smart-Search.
Under > Update > Extensions: System shows me Update Info for "Search Package".
After Checking above > No Update available.
Message under Update Extensions was then removed.
So, it seems OK, Thanks for checking my steps.

Database Check: 4.0.3-2021-09-04
MySQLi
5.7.33
PHP 7.4.21


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35483.
avatar chmst chmst - test_item - 6 Sep 2021 - Tested successfully
avatar chmst
chmst - comment - 6 Sep 2021

I have tested this item successfully on 6d74e61

Code inspected. There are no changes since my first test.
To be sure I performed the SQL statement on a J4 database (MariaDB) without errors.


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

avatar zero-24 zero-24 - test_item - 6 Sep 2021 - Tested successfully
avatar zero-24
zero-24 - comment - 6 Sep 2021

I have tested this item successfully on 6d74e61

Works good to me too.

I have tested an update from 3.10 to 4.0 (with and without the patch) as well as an older dev version of 4.0 to this patch. ?


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

avatar zero-24 zero-24 - change - 6 Sep 2021
Status Pending Ready to Commit
avatar zero-24
zero-24 - comment - 6 Sep 2021

Merging now thanks for the tests and the PR ?

avatar zero-24 zero-24 - change - 6 Sep 2021
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2021-09-06 18:43:00
Closed_By zero-24
Labels Added: ?
avatar zero-24 zero-24 - close - 6 Sep 2021
avatar zero-24 zero-24 - merge - 6 Sep 2021
avatar richard67
richard67 - comment - 6 Sep 2021

Thanks for testing.

Add a Comment

Login with GitHub to post a comment