RTC bug PR-5.4-dev Pending

User tests: Successful: Unsuccessful:

avatar richard67
richard67
5 Aug 2025

Pull Request for Issue #45839 .

Summary of Changes

This pull request adds missing names quotes to the column alias "newPublished" of the subquery used in the "recursiveUpdatePublishedColumn" in the "Joomla\CMS\Table\Nested" table class and corrects casing for the later use of that column alias so that the query works without any error on any database environment, regardless of case-sensitivity of column names.

Testing Instructions

On MySQL or MariaDB it might need a special environment to be able to reproduce the issue, e.g. a database server where the "information_schema" database uses a case-sensitive collation.

You could do that by changing the collation of the "information_schema" database and convert all its tables to the same collation as it has now but without the "_ci" at the end so that it is case-insensitive.

But you should make a backup so you can later restore the original state as it is not recommended to change the character set and collation of the "information_schema" database.

Then you can try to reproduce the issue.

On PostgreSQL there was no error because the 2 mistakes fixed by this PR compensate each other:

  • PostgreSQL converts all names to lowercase if they are not quoted, what was the case here with the missing names quotes at the first place.
  • But when checking for names, PostgreSQL is still case-sensitive.
  • Because of the 2nd mistake (lowercase spelling of the quoted name a few lines below) it works.
  • If this PR would fix only one of the 2 mistakes, it would fail on PostgreSQL.

So on PostgreSQL you can only check if everything works as before.

Actual result BEFORE applying this Pull Request

See issue #45839 .

Expected result AFTER applying this Pull Request

No such error.

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 richard67 richard67 - open - 5 Aug 2025
avatar richard67 richard67 - change - 5 Aug 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 5 Aug 2025
Category Libraries
avatar richard67 richard67 - change - 5 Aug 2025
Title
[5.3] Fix column alias missing names quoting and wrong casing in libraries/src/Table/Nested.php
[5.3] Fix missing names quotes and wrong casing of column alias in libraries/src/Table/Nested.php
avatar richard67 richard67 - edited - 5 Aug 2025
avatar richard67 richard67 - change - 5 Aug 2025
The description was changed
avatar richard67 richard67 - edited - 5 Aug 2025
avatar richard67 richard67 - change - 5 Aug 2025
The description was changed
avatar richard67 richard67 - edited - 5 Aug 2025
avatar richard67 richard67 - change - 5 Aug 2025
The description was changed
avatar richard67 richard67 - edited - 5 Aug 2025
avatar richard67 richard67 - change - 5 Aug 2025
The description was changed
avatar richard67 richard67 - edited - 5 Aug 2025
avatar richard67 richard67 - change - 5 Aug 2025
The description was changed
avatar richard67 richard67 - edited - 5 Aug 2025
avatar richard67 richard67 - change - 5 Aug 2025
The description was changed
avatar richard67 richard67 - edited - 5 Aug 2025
avatar richard67 richard67 - change - 5 Aug 2025
The description was changed
avatar richard67 richard67 - edited - 5 Aug 2025
avatar richard67 richard67 - change - 5 Aug 2025
The description was changed
avatar richard67 richard67 - edited - 5 Aug 2025
avatar toivo
toivo - comment - 6 Aug 2025

I have not managed to duplicate the error even after creating a database from the command line with case-sensitive collation:
CREATE DATABASE joomla53 CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs;
When Joomla 5.3.3-dev is installed, the database connection_collation is automatically set to be case-insensitive:

Database Collation	utf8mb4_0900_as_cs
Database Connection Collation	utf8mb4_0900_ai_ci

I am guessing the server variable collation_connection should somehow be set in the command line session before creating the database, just to make the operations involving column aliases case-sensitive.

avatar richard67
richard67 - comment - 6 Aug 2025

@toivo i meant the collation of the „information_schema“ database, not of the database used by Joomla.

avatar richard67
richard67 - comment - 6 Aug 2025

P.S.: The connection collation has absolutely nothing to do with it.

avatar HLeithner
HLeithner - comment - 15 Oct 2025

This pull request has been automatically rebased to 5.4-dev.

avatar richard67 richard67 - change - 19 Oct 2025
Title
[5.3] Fix missing names quotes and wrong casing of column alias in libraries/src/Table/Nested.php
[5.4] Fix missing names quotes and wrong casing of column alias in libraries/src/Table/Nested.php
avatar richard67 richard67 - edited - 19 Oct 2025
avatar richard67 richard67 - change - 19 Oct 2025
Labels Added: bug PR-5.4-dev
avatar richard67
richard67 - comment - 2 Nov 2025

I've meanwhile found some information in MySQL documentation which could be helpful to identify an environment where the issue could be reproduced, or at least explain why it cannot be reproduced for most people:

I have tzo check that deeper to develop a scenario for testing this PR.

@catwired As you had the original issue: Could you report back which OS your database server is running on, and could you check and report back the value of the "lower_case_table_names" system variable? The latter can be obtained e.g. in phpMyAdmin with the SQL statement SELECT @@GLOBAL.lower_case_table_names;;

avatar muhme muhme - test_item - 30 Jan 2026 - Tested successfully
avatar muhme
muhme - comment - 30 Jan 2026

I have tested this item ✅ successfully on e87582d

Tested with JBT

  • I have tried a few experiments with MariaDB/MySQL, but it is hard to have case sensitive information_schema.
    Therefore tested with PostgreSQL scripts/database 54 pgsql and hack line 1511 to the correct "c2.newPublished"
  • Seen ERROR: column c2.newPublished does not exist LINE 2: SET "published" = "c2"."newPublished" in creating a new category
  • Reverted hack, Applied PR with Patch Tester
  • It is now possible to create a category, but this is no surprise as the CI System Tests creates categories already
  • As the CI System Tests are already testing MariaDB, MySQL and PostgreSQL there are no more human tests needed from my point of view

This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45848.
avatar muhme
muhme - comment - 30 Jan 2026

@alikon As this PR is hard/not possible to test, could you please make a code review?

avatar alikon alikon - test_item - 31 Jan 2026 - Tested successfully
avatar alikon
alikon - comment - 31 Jan 2026

I have tested this item ✅ successfully on e87582d


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

avatar alikon alikon - change - 31 Jan 2026
Status Pending Ready to Commit
avatar alikon
alikon - comment - 31 Jan 2026

RTC


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

avatar muhme muhme - change - 3 Feb 2026
Labels Added: RTC
avatar muhme muhme - change - 3 Feb 2026
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2026-02-03 15:48:44
Closed_By muhme
avatar muhme muhme - close - 3 Feb 2026
avatar muhme muhme - merge - 3 Feb 2026
avatar muhme
muhme - comment - 3 Feb 2026

Thank you @richard67 for your contribution. Thank you @alikon for testing and review.

Add a Comment

Login with GitHub to post a comment