Skip to content

5.x: Fix TypeError in FixtureHelper::getForeignReferences()#19098

Merged
dereuromark merged 1 commit into5.xfrom
fix-fixture-helper-type-error
Nov 27, 2025
Merged

5.x: Fix TypeError in FixtureHelper::getForeignReferences()#19098
dereuromark merged 1 commit into5.xfrom
fix-fixture-helper-type-error

Conversation

@dereuromark
Copy link
Copy Markdown
Member

@dereuromark dereuromark commented Nov 27, 2025

Summary

Details

PHP's array_keys() returns integers for numeric string keys. When a constraint name is a numeric string like "1", it gets converted to integer 1 in the internal array. Calling array_keys() (via constraints()) then returns 1 instead of "1", which causes a TypeError when passed to getConstraint(string $name).

PHP's array_keys() returns integers for numeric string keys, causing
a TypeError when passed to TableSchema::getConstraint() which expects
a string. Cast constraint names to string to fix this issue.

This bug was introduced in 4.3.0 (daacfce) and affects tables with
constraint names that are numeric strings.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@dereuromark dereuromark added this to the 5.2.10 milestone Nov 27, 2025
@dereuromark dereuromark marked this pull request as ready for review November 27, 2025 18:48
@dereuromark dereuromark merged commit 07e72de into 5.x Nov 27, 2025
14 of 15 checks passed
@dereuromark dereuromark deleted the fix-fixture-helper-type-error branch November 27, 2025 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant