Repository navigation
Fixed reading relation field definitions without constraints - #918
Merged
Merged
Conversation
Covered reading Relation and RelationList field definitions from storage XML with full, empty and missing <constraints> elements. The "without constraints" cases currently fail with a call on null, as the dead DOMNodeList truthiness guard never returns early. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The guard meant to skip a missing <constraints> element tested the DOMNodeList returned by getElementsByTagName(), which is always truthy. A missing element therefore led to a call on null. The guard now checks the element itself and, in RelationListConverter, no longer returns early, so the selection limit validator is still read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
vidarl
approved these changes
Oct 28, 2026
alongosz
requested review from
Steveb-p,
ViniTou,
barw4,
bnowak,
ciastektk,
konradoboza,
mikadamczyk,
tbialcz and
wiewiurdp
October 28, 2026 16:43
mikadamczyk
approved these changes
Oct 28, 2026
bnowak
approved these changes
Oct 29, 2026
konradoboza
approved these changes
Oct 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Related PRs:
Description:
PHPStan 2.3.3 started reporting
booleanNot.alwaysFalseinRelationConverterandRelationListConverter, which turnsUnit tests & SQLite integration testsred on PHP 8.3 and 8.4 for every PR against4.6(e.g. #699, run 40712372766).PHPStan is right though: the guard meant to skip a missing
<constraints>element checked theDOMNodeListreturned bygetElementsByTagName(), which is always truthy. So for storage XML without<constraints>,->item(0)returnednullandtoFieldDefinition()crashed with a call on null. Its write counterpart always emits<constraints>, so it'd affect only data written some other way, e.g. legacy content or hand-made migrations.<constraints>element inRelationConverterandRelationListConverterFor QA:
No QA required.
Documentation:
No documentation required.
🤖 Generated with Claude Code