Skip to content

[5.x] Throw for mismatched name and alias arrays in quoteName() - #411

Open
Hackwar wants to merge 2 commits into
joomla-framework:5.x-devfrom
Hackwar:5.x-quotename-mismatch-throws
Open

Hackwar wants to merge 2 commits into
joomla-framework:5.x-devfrom
Hackwar:5.x-quotename-mismatch-throws

Conversation

@Hackwar

@Hackwar Hackwar commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary of Changes

DatabaseDriver::quoteName($name, $as) with an array of names and an alias array of a different length returned [], so queries silently selected nothing or broke far from the cause. 4.x deprecates this (#394); 5.0 now throws an InvalidArgumentException, the same exception 4.x already throws for an array of names with a string alias.

Testing Instructions

testQuoteNameWithMismatchedAliases in Tests/AbstractDatabaseDriverTestCase.php expects the exception (vendor/bin/phpunit -c phpunit.sqlite.xml.dist --filter Mismatched).

When 4.x-dev is merged into 5.x-dev after the 4.x PR: the 4.x PR adds a test with the same name that expects the deprecation; keep this (5.x) version, and keep the 4.x test for the string alias.

Documentation Changes Required

Entry "quoteName() rejects mismatched aliases" in docs/v4-to-v5-update.md.

Depends on #394 (deprecation in 4.x) and #410 (creates docs/v4-to-v5-update.md; this branch is based on it).

🤖 Generated with Claude Code

Hackwar and others added 2 commits November 12, 2026 23:48
Several 5.0 changes need an entry in the update guide; adding the empty
guide first keeps their pull requests from conflicting over its creation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
quoteName() with arrays of different length returned an empty array, which
4.x deprecated. It now throws an InvalidArgumentException, as it already did
in 4.x for an array of names with a string alias.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant