? ? Pending

User tests: Successful: Unsuccessful:

avatar richard67
richard67
6 Oct 2020

Pull Request for Issue #30929 .

Summary of Changes

This pull request (PR) adds the necessary SQL statements to delete the duplicate record for plg_sampledata_multilang in the extension table to the update SQL scripts.

I order to not add again a new update SQL script, I've decided to modify the existing script 4.0.0-2020-09-27.sql, which hasn't been released yet and so can be modified, as we don't support updates between nightlies.

If a new Beta or whatever else release of J4 will be made before this PR will be merged, I'll have to move the new statement to a new update SQL script then.

In addition, this PR deletes the update SQL script 4.0.0-2018-06-11.sql which causes the duplicate record. In fact the other one 4.0.0-2019-03-31.sql which was added later with commit fc0d2ea#diff-97d026690fd483a67b57a74953ef4a50 caused the problem, but because no other SQL script in between those references the record for that plugin, it doesn't matter which of the duplicate insert statements is deleted, and so I've chosen the first one because 1. it saves us a complete update SQL script, and 2. the deleted one had the wrong "enabled" status.

Testing Instructions

Test 1: Reproduce the issue by updating a 3.10 to 4.0 Beta 4

  1. Update a clean installation (i.e. no 3rd party extensions) of current 3.10-dev or latest 3.10 nightly or 3.10-alpha2 to 4.0 Beta 4, using the following custom URL for Live Update or the following update package for Upload & Update:
  1. After successful update, go to the "System - Manage - Plugins" and check if there are plugins with name "Sample Data - Multilingual".
    Result: There are two plugins with that name, one of them is disabled.
  2. Go to "System - Manage - Extensions" and search for "Sample Data - Multilingual".
    Result: There are two plugins with that name, one of them is disabled.

Test 2: Verify that this PR fixes the issue when updating a 4.0 Beta 4 which has the issue

This test has to be executed after the previous test "Test 1".

  1. Update the installation used in the previous test "Test 1" to current 4.0-dev plus the fix from this PR applied, using the following custom URL for Live Update or the following update package for Upload & Update:
  1. After successful update, go to the "System - Manage - Plugins" and check if there are plugins with name "Sample Data - Multilingual".

Result: There is only one plugin with name "Sample Data - Multilingual", which is enabled. The first one of the two duplicate plugins has been deleted.

Test 3: Verify that this PR fixes the issue when updating from 3.10-dev

Repeat test "Test 1", i.e. start again from 3.10, but this time use the update package of latest 4.0 nightly plus the fix of this PR included. The custom update URL and the download package are the same as used in the previous test "Test 2".

Result: There is only one plugin with name "Sample Data - Multilingual", which is enabled.

Actual result BEFORE applying this Pull Request

After an update from 3.10 to 4, there are two plugins with name "Sample Data - Multilingual". They are equal, except one of them is disabled.

Expected result AFTER applying this Pull Request

After an update from 3.10 to 4, there is only one plugin with name "Sample Data - Multilingual", which is enabled.

After update from a 4 Beta 4 which had the issue to a future 4 version which contains the fix from this PR, one of the duplicate plugins "Sample Data - Multilingual" will be deleted.

Documentation Changes Required

None.

avatar richard67 richard67 - open - 6 Oct 2020
avatar richard67 richard67 - change - 6 Oct 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 6 Oct 2020
Category SQL Administration com_admin Postgresql
avatar richard67 richard67 - change - 6 Oct 2020
Title
[4.0] Fix duplicate "Sample Data - Multingual" plugin in database on 4.0 sites which have been updated from 3.10
[4.0] Fix duplicate "Sample Data - Multilingual" plugin in database on 4.0 sites which have been updated from 3.10
avatar richard67 richard67 - edited - 6 Oct 2020
avatar richard67 richard67 - change - 6 Oct 2020
The description was changed
avatar richard67 richard67 - edited - 6 Oct 2020
avatar richard67 richard67 - change - 6 Oct 2020
The description was changed
avatar richard67 richard67 - edited - 6 Oct 2020
avatar richard67 richard67 - change - 6 Oct 2020
The description was changed
avatar richard67 richard67 - edited - 6 Oct 2020
avatar richard67 richard67 - change - 6 Oct 2020
The description was changed
avatar richard67 richard67 - edited - 6 Oct 2020
avatar richard67 richard67 - change - 8 Oct 2020
Labels Added: ?
avatar richard67 richard67 - change - 8 Oct 2020
The description was changed
avatar richard67 richard67 - edited - 8 Oct 2020
avatar richard67 richard67 - change - 8 Oct 2020
The description was changed
avatar richard67 richard67 - edited - 8 Oct 2020
avatar richard67 richard67 - change - 8 Oct 2020
The description was changed
avatar richard67 richard67 - edited - 8 Oct 2020
avatar richard67 richard67 - change - 11 Oct 2020
The description was changed
avatar richard67 richard67 - edited - 11 Oct 2020
avatar richard67 richard67 - change - 11 Oct 2020
The description was changed
avatar richard67 richard67 - edited - 11 Oct 2020
avatar richard67 richard67 - change - 11 Oct 2020
The description was changed
avatar richard67 richard67 - edited - 11 Oct 2020
avatar richard67 richard67 - change - 11 Oct 2020
The description was changed
avatar richard67 richard67 - edited - 11 Oct 2020
avatar richard67 richard67 - change - 11 Oct 2020
The description was changed
avatar richard67 richard67 - edited - 11 Oct 2020
avatar richard67 richard67 - change - 11 Oct 2020
The description was changed
avatar richard67 richard67 - edited - 11 Oct 2020
avatar richard67 richard67 - change - 11 Oct 2020
The description was changed
avatar richard67 richard67 - edited - 11 Oct 2020
avatar richard67 richard67 - change - 11 Oct 2020
The description was changed
avatar richard67 richard67 - edited - 11 Oct 2020
avatar richard67
richard67 - comment - 11 Oct 2020

I've just fixed a few things in the testing instructions. Now it's really ready for testing.

avatar richard67
richard67 - comment - 11 Oct 2020

@brianteeman Would be great if you could find some time to give this PR a test. Thanks in advance.

avatar infograf768 infograf768 - test_item - 11 Oct 2020 - Tested successfully
avatar infograf768
infograf768 - comment - 11 Oct 2020

I have tested this item successfully on 7da4b2a


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

avatar richard67
richard67 - comment - 16 Oct 2020

@brianteeman I'm a bit disappointed that you don't test PR's for issues opened by you. Or is it just when I am the PR author?

avatar alikon alikon - test_item - 16 Oct 2020 - Tested successfully
avatar alikon
alikon - comment - 16 Oct 2020

I have tested this item successfully on 7da4b2a


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

avatar alikon alikon - change - 16 Oct 2020
Status Pending Ready to Commit
avatar alikon
alikon - comment - 16 Oct 2020

RTC


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

avatar wilsonge wilsonge - change - 16 Oct 2020
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-10-16 22:55:31
Closed_By wilsonge
Labels Added: ?
avatar wilsonge wilsonge - close - 16 Oct 2020
avatar wilsonge wilsonge - merge - 16 Oct 2020
avatar wilsonge
wilsonge - comment - 16 Oct 2020

Thanks!

avatar richard67
richard67 - comment - 17 Oct 2020

Thanks for testing and merging.

avatar richard67
richard67 - comment - 20 Oct 2020

I've just noticed that this PR causes an SQL error when updating e.g. 4.0 Beta 4 to latest nightly on MySQL, and very likely also on MariaDB.

The reason is that MySQL can't handle a subquery on the same table in an UPDATE or DELETE statement.

Will check if that's a problem with PostgreSQL, too, and then make a PR to fix it.

No idea why that hasn't shown up when testing.

Other database types, e.g. MS SQL server and Oracle, can handle that, just by the way.

Update: Not a problem on PostgreSQL.

avatar richard67
richard67 - comment - 20 Oct 2020

PR to fix my mistake with MySQL will be #31171 . I just need a bit time to test all scenarios and provide complete testing instructions. For PostgreSQL this PR here seems to be fine.

Add a Comment

Login with GitHub to post a comment