? ? Pending

User tests: Successful: Unsuccessful:

avatar richard67
richard67
28 Oct 2021

Pull Request for Issue #35427 .

Summary of Changes

This pull request (PR) fixes an SQL error which happens when you have made some template overrides and now a 3rd party extension or core update makes changes on the overridden files so the override checker finds that change, and then you have another update which again changes the same files but no others files and you haven't made any new overrides in the mean time so all the detected override changes just need to be updated in database and no new one has to be inserted in addition.

Thanks to @stAn47 who suggested the fix.

In addition, this PR adds a ParameterType::INTEGER parameter to the 2nd bind call. This could be tested by code review, or test this PR with MySQLi and MySQL (PDO) and PostgreSQL (PDO). The 2 ID columns of the same table are bound with ParameterType::INTEGER here https://github.com/joomla/joomla-cms/blob/4.0-dev/plugins/installer/override/override.php#L303-L304 , and the status is given as integer, too.

Testing Instructions

  1. Have a clean, current 4.0-dev or latest 4.0 nightly or 4.0.4 installation which does not have com_weblinks installed.

  2. Switch error reporting to maximum in global configuration.

  3. Download the Weblinks 4.0.0 RC1 package from here https://github.com/joomla-extensions/weblinks/releases/download/4.0.0-rc1/pkg-weblinks-4.0.0-rc1.zip and install that package.

  4. Create a template override for the "category" folder of com_weblinks.
    01-create-override

  5. Modify the "default_items.php" file of your override.
    02-modify-file

  6. Download the special Weblinks 4.0.0 RC2 package which I have created for testing this PR from here https://test5.richard-fath.de/pkg-weblinks-4.0.0-rc2_test.zip and update to that package by uploading and installing it with the extensions installer.
    03-upload-update-1

  7. Now check for extension updates and update to the (regular, i.e. unmodified) Weblinks 4.0.0 package.
    04-online-update-2
    If you can't use the online update you can download the package from here https://github.com/joomla-extensions/weblinks/releases/download/4.0.0/pkg-weblinks-4.0.0.zip and update to that package in the same way as in the previous step.

Result: See section "Actual result BEFORE applying this Pull Request" below.

  1. Uninstall the weblinks package and the weblinks editor button.
    05a-uninstall-weblinks-package
    Hint: You might see some yellow warning messages about errors e.g. with table not existing, but you can safely ignore that.

  2. Delete all override files and folders so there is no "com_weblinks" folder anymore in the template's "html" folder..

  3. Make sure that no override changes are shown anymore. If necessary, delete all records in table #__template_overrides in database.
    05b-no-overide-changes

  4. Apply the patch from this PR.

  5. Repeat steps 3 to 7.

Result: No SQL error, see section "Expected result AFTER applying this Pull Request" below.

  1. Verify that a changed override is shown.
    06-override-changed

  2. Verify that your override file still contains your change from step 5.
    07-override-check-1

  3. Verify that the comparison also shows the change in the original file from RC1 to the final package.
    07-override-check-2

Actual result BEFORE applying this Pull Request

05-sql-error

Expected result AFTER applying this Pull Request

No SQL error. Override checker works as it should.

Documentation Changes Required

None.

avatar richard67 richard67 - open - 28 Oct 2021
avatar richard67 richard67 - change - 28 Oct 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 28 Oct 2021
Category Front End Plugins
avatar richard67 richard67 - change - 28 Oct 2021
The description was changed
avatar richard67 richard67 - edited - 28 Oct 2021
avatar richard67 richard67 - change - 28 Oct 2021
The description was changed
avatar richard67 richard67 - edited - 28 Oct 2021
avatar richard67 richard67 - change - 28 Oct 2021
The description was changed
avatar richard67 richard67 - edited - 28 Oct 2021
avatar RickR2H RickR2H - test_item - 28 Oct 2021 - Tested successfully
avatar RickR2H
RickR2H - comment - 28 Oct 2021

I have tested this item successfully on fe98aec

Patch works! I bet writing the testing instructions was more work then fixing the bug! Great work!


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

avatar alikon alikon - test_item - 29 Oct 2021 - Tested successfully
avatar alikon
alikon - comment - 29 Oct 2021

I have tested this item successfully on fe98aec


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

avatar alikon alikon - change - 29 Oct 2021
Status Pending Ready to Commit
avatar alikon
alikon - comment - 29 Oct 2021

RTC


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

avatar bembelimen bembelimen - change - 2 Nov 2021
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2021-11-02 15:47:38
Closed_By bembelimen
Labels Added: ? ?
avatar bembelimen bembelimen - close - 2 Nov 2021
avatar bembelimen bembelimen - merge - 2 Nov 2021
avatar bembelimen
bembelimen - comment - 2 Nov 2021

Thx

avatar richard67
richard67 - comment - 2 Nov 2021

Thanks all

avatar stAn47
stAn47 - comment - 3 Nov 2021

Thank you y'all, and thanks Richard for describing how to reproduce this as this must had been a few hours to get it done.

Add a Comment

Login with GitHub to post a comment