RTC bug PR-5.1-dev Pending

User tests: Successful: Unsuccessful:

avatar brianteeman
brianteeman
18 Apr 2024

On updated versions of Joomla there is no value set for the colorscheme and the only way to enable the colorscheme switch is to op4en the atum template style and then save it.

This PR is (hopefully) sql that will run on the next patch release that will add a default value for the colorScheme so that the switch is always available. Note that if a user has already set a value then nothing is changed.

I dont have a current postgres server so am relying on others to test that carefuly.

Pull Request for Issue #43307 (part).

Testing Instructions

Update an existing joomla site with the prebuilt package available here https://artifacts.joomla.org/drone/joomla/joomla-cms/5.1-dev/43310/downloads/75557/

Expected result AFTER applying this Pull Request

If the switcher was NOT available in the User dropdwn menu then it is now
If the switcher was already available in the User dropdwn menu thenthere is no change

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar brianteeman brianteeman - open - 18 Apr 2024
avatar brianteeman brianteeman - change - 18 Apr 2024
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 18 Apr 2024
Category SQL Administration com_admin Postgresql
avatar brianteeman brianteeman - change - 18 Apr 2024
Labels Added: PR-5.1-dev
avatar dautrich dautrich - test_item - 19 Apr 2024 - Tested unsuccessfully
avatar dautrich
dautrich - comment - 19 Apr 2024

I have tested this item ? unsuccessfully on 769ff95


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43310.
avatar dautrich
dautrich - comment - 19 Apr 2024

How I tested:

  • Installed a J5.0.3 on XAMPP (Apache 2.4.58,PHP 8.2.12, MariaDB 10.4.32).
  • Updated to J5.1.0.
  • Checked User Menu for Dark Mode switch: Not visible.
  • Applied the patch manually by patching the respective value ("colorScheme":"os",) into the database (#__template_styles, record "atum", params).
  • Checked User Menu for Dark Mode switch: Not visible.
  • Navigated to System Dashboard. Database was checked automatically.
  • Checked User Menu for Dark Mode switch: Visible and working
  • Removed the respective value from the database.
  • Checked User Menu for Dark Mode switch: Not visible.
  • Installed Patchtester.
  • Applied patch #43310.
  • Checked User Menu for Dark Mode switch: Not visible.
  • Navigated to System Dashboard. Database was checked automatically.
  • There was one problem for Joomla CMS.
  • Checked and clicked "Update Structure". "All database table structures are up to date."
  • Checked User Menu for Dark Mode switch: Not visible.
  • Checked database #__template_styles, record "atum", params): value "colorScheme":"os" not present.

When using the Patchtester to test this PR, I didn't get the Dark Mode switch in the User Menu. Only when I patched the database manually with phpMyAdmin, I got the switch.

avatar brianteeman
brianteeman - comment - 19 Apr 2024

i doubt this can be tested with patchtester and it definitely cannot be tested using datatbase structure fix as this is not a structure change

avatar brianteeman
brianteeman - comment - 19 Apr 2024

. Only when I patched the database manually with phpMyAdmin, I got the switch.

Do you mean you edited the field OR you ran the sql query

avatar dautrich
dautrich - comment - 19 Apr 2024

I directly edited the field in the database with phpMyAdmin.

avatar brianteeman
brianteeman - comment - 19 Apr 2024

I directly edited the field in the database with phpMyAdmin.

can you also test by using the sql directly in the phpmyadmin query window. Remembering to update the query with your own db prefix

avatar brianteeman
brianteeman - comment - 19 Apr 2024

can you also follow the test instructions

Update an existing joomla site with the prebuilt package available here

image

avatar dautrich
dautrich - comment - 19 Apr 2024

First test: I updated the database by directly applying the SQL to it. After that, I navigated to the System Dashboard to have the database checked automatically. Back to the Home Dashboard and checked the User Menu: The menu item for Dark mode is visible and working.

avatar dautrich
dautrich - comment - 19 Apr 2024

Removed the value from the database again. System Dashboard - Home Dashboard - Check: The menu item is gone again.

avatar brianteeman
brianteeman - comment - 19 Apr 2024

The database check is of NO use to you - it only checks database STRUCTURE. It does nothing for database CONTENT.

Please just follow the test instructions

avatar dautrich
dautrich - comment - 19 Apr 2024

With the prebuilt package, the menu item is visible.

avatar dautrich dautrich - test_item - 19 Apr 2024 - Tested successfully
avatar dautrich
dautrich - comment - 19 Apr 2024

I have tested this item ✅ successfully on 769ff95


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

avatar heelc29 heelc29 - test_item - 19 Apr 2024 - Tested unsuccessfully
avatar heelc29
heelc29 - comment - 19 Apr 2024

I have tested this item ? unsuccessfully on 769ff95

postgresql update fails:

2024-04-19T13:50:45+00:00	INFO XXX	update	The current database version (schema) is 5.1.0-2024-03-28.
2024-04-19T13:50:45+00:00	INFO XXX	update	Ran query from file 5.1.1-2024-04-18. Query text: UPDATE "#__template_styles" SET "params" = jsonb_set("params", '{colorScheme}', .
2024-04-19T13:50:45+00:00	INFO XXX	update	JInstaller: :Install: Error SQL 42601, 7, ERROR:  syntax error at or near "$1"
LINE 4: AND NOT ("params" -> 'colorScheme' $1 'os');
                                           ^
2024-04-19T13:50:45+00:00	INFO XXX	update	End of SQL updates - INCOMPLETE.

image
image


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43310.
avatar richard67 richard67 - change - 20 Apr 2024
The description was changed
avatar richard67 richard67 - edited - 20 Apr 2024
avatar richard67
richard67 - comment - 20 Apr 2024

@heelc29 @brianteeman I will review the update SQL script for PostgreSQL as soon as I can find the time, either today or tomorrow. Stay tuned.

avatar brianteeman
brianteeman - comment - 20 Apr 2024

... sorry I dont have the time today

avatar richard67
richard67 - comment - 20 Apr 2024

... sorry I dont have the time today

@brianteeman No problem. I will prepare code review suggestions so you can apply them with a click tomorrow.

avatar richard67
richard67 - comment - 20 Apr 2024

Review done. The update SQL script for MySQL is fine. For the PostgreSQL script I have made 2 change suggestions and not only one for better explanation.

avatar richard67
richard67 - comment - 20 Apr 2024

I allow myself to commit my suggestions as Brian is not available today.

avatar richard67 richard67 - alter_testresult - 20 Apr 2024 - dautrich: Tested successfully
avatar richard67
richard67 - comment - 20 Apr 2024

I've restored @dautrich 's test result in the issue tracker as the test was made with MySQL (or MariaDB), and the changes after that test only changed the update SQL script for PostgreSQL.

@heelc29 Could you test again with PostgreSQL? Now it should work. Thanks in advance, and thanks for testing with PostgreSQL in general. That's much appreciated.

avatar richard67 richard67 - change - 20 Apr 2024
The description was changed
avatar richard67 richard67 - edited - 20 Apr 2024
avatar richard67 richard67 - alter_testresult - 20 Apr 2024 - @dautrich: Tested successfully
avatar richard67 richard67 - change - 20 Apr 2024
The description was changed
avatar richard67 richard67 - edited - 20 Apr 2024
avatar heelc29 heelc29 - test_item - 20 Apr 2024 - Tested successfully
avatar heelc29
heelc29 - comment - 20 Apr 2024

I have tested this item ✅ successfully on 1ea19d6


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

avatar richard67 richard67 - test_item - 20 Apr 2024 - Tested successfully
avatar richard67
richard67 - comment - 20 Apr 2024

I have tested this item ✅ successfully on 1ea19d6

I've verified with both MySQL and PostgreSQL that the SQL from the corresponding update SQL script successfully adds the value if it is missing and does not do anything if the value is already there.


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

avatar richard67 richard67 - change - 20 Apr 2024
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 20 Apr 2024

RTC


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

avatar brianteeman
brianteeman - comment - 20 Apr 2024

Thanks @richard67 !!!

avatar wilsonge wilsonge - change - 23 Apr 2024
Labels Added: RTC bug
avatar wilsonge wilsonge - change - 23 Apr 2024
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2024-04-23 13:14:27
Closed_By wilsonge
avatar wilsonge wilsonge - close - 23 Apr 2024
avatar wilsonge wilsonge - merge - 23 Apr 2024
avatar wilsonge
wilsonge - comment - 23 Apr 2024

Thanks!

avatar brianteeman
brianteeman - comment - 23 Apr 2024

Thanks @wilsonge

Add a Comment

Login with GitHub to post a comment