Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This is a subissue of #2012776: [META] Improve validation constraint test coverage
This is a test for the Constraint Validation: BundleConstraintValidator
Comment | File | Size | Author |
---|---|---|---|
#15 | interdiff-2142989-15.txt | 721 bytes | damiankloip |
#15 | 2142989-15.patch | 4.08 KB | damiankloip |
#11 | d8_bundleconstraint_test.interdiff.txt | 1.46 KB | fago |
#11 | d8_bundleconstraint_test.patch | 4.07 KB | fago |
#6 | d8_bundleconstraint_test.interdiff.txt | 1.8 KB | fago |
Comments
Comment #1
mariancalinro CreditAttribution: mariancalinro commentedComment #2
stefan.r CreditAttribution: stefan.r commentedComment #4
fagoGood work!
This shows why we should have these tests :-) This would need a re-roll to move the test to the Entity component tests once #2137301: Move entity constraints under the Entity component is in.
Comment #5
webchick#2137301: Move entity constraints under the Entity component was just committed so this will need a re-roll.
Comment #6
fagore-rolled and updated the test to work with HEAD.
Comment #7
fago6: d8_bundleconstraint_test.patch queued for re-testing.
Comment #8
yched CreditAttribution: yched commentedMinor stuff, otherwise RTBC.
Language seems weird ?
var is misnamed ?
Comment #9
Berdir6: d8_bundleconstraint_test.patch queued for re-testing.
Comment #11
fagoRe-rolled to account for the typed data manager rename and addressed #8.
Comment #12
yched CreditAttribution: yched commentedSame remark as #2142991-10: Test for ComplexDataConstraintValidator about $this->typedData, but otherwise RTBC.
Comment #13
webchickCommitted and pushed to 8.x. Thanks!
Comment #14
catchThis broke HEAD, not sure if it is consistent or random:
Rolled back for now.
Comment #15
damiankloip CreditAttribution: damiankloip commentedHere is patch rerolled with fix. We had the fix but couldn't beat catch to the revert :)
Comment #16
fagoLooks like things changed a bit since when the patch got re-rolled :-/
Comment #17
BerdirLooks like the following change broke it:
Which is quite interesting, because this does apparently not cause any php warnings or notices at all:
It just says bool(false).
Anyway, the fix is correct and should have been there from the beginning.
Comment #18
yched CreditAttribution: yched commentedGot bitten by this too in #2144919-95: Allow widgets and formatters for base fields to be configured in Field UI
It's a case where $target_type_info is NULL, because the test doesn't enable the module that defines the entity type.
Before #2005716: Promote EntityType to a domain object, the old code did :
is_subclass_of($target_type_info['class'], 'ContentEntityInterface')
i.e is_subclass_of(NULL['class'], 'ContentEntityInterface')
i.e is_subclass_of(NULL, 'ContentEntityInterface')
i.e FALSE
The new code does :
$target_type_info->isSubclassOf('ContentEntityInterface')
i.e NULL->isSubclassOf('ContentEntityInterface')
i.e fatal error
Comment #19
webchickOk, let's try this again. :)
Committed and pushed to 8.x. Thanks!