Closed (outdated)
Project:
Drupal core
Version:
9.5.x-dev
Component:
typed data system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
24 Nov 2013 at 10:05 UTC
Updated:
25 Aug 2023 at 17:01 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
mariancalinro commentedComment #2
stefan.r commentedPostponed upon discussion with fago as the EntityChanged constraint validator will be reworked (or might disappear).
Comment #3
berdirWhy that? it already has been reworked, from NodeChanged to EntityChanged?
Comment #4
stefan.r commentedSee also #2145103: Provide non-configurable field types for entity created, changed and timestamp fields
Comment #5
jibranComment #6
mgiffordThis still a concern?
Comment #7
stefan.r commentedComment #8
stefan.r commentedComment #10
stefan.r commentedFix for the failing node validation test as the property path is now
changed.0instead ofchanged.0.valuedue to the constraint inChangedItemrunning on the field level.Comment #13
berdirNice work.
Should have a leading backlash: \Drupal\...
We no longer use getInfo(). Add @group Validation to the annotation instead.
I think we should just add changed to the EntityTest entity type and use that. We have a large amount of entity types for specific tests already.
Comment #14
stefan.r commentedComment #18
stefan.r commentedFix attached for the other tests that were failing upon entity_test having a "changed" field.
As I looked at the failing REST update test, where the EntityChanged validation constraint was making it fail as the PATCH request was passing along a "changed time" situated in the past, I was wondering if there is any case where we want the end user to be able to forcibly/manually update the "changed" field to a date in the past? I guess we don't want the EntityChanged validator to run there in such case?
Comment #19
stefan.r commentedComment #23
stefan.r commentedre-roll
Comment #25
pfrenssenEntityChangedConstraintValidatorTest is missing from the reroll, this is the main part of the patch.
Comment #26
stefan.r commentedComment #27
stefan.r commentedComment #28
fagoThis will need to adapt once #2429037: Allow adding entity level constraints lands. It also introduces a separate test entity type which implements the EntityChangedInterface. Thus, we should be able to use it for testing here as well and so do away with the need for some other test changes as EntityTest remains unchanged?
Comment #31
stefan.r commentedLooks like #2429037: Allow adding entity level constraints is almost in, let me do a re-roll in the mean time...
Comment #32
stefan.r commentedreroll
Comment #34
stefan.r commentedSeems we were sending an invalid changed time over REST without triggering a validation error before... So maybe the whole constraint currently isn't working?
This patch unsets the changed field in REST requests.
Comment #35
stefan.r commentedComment #36
yesct commentedOne of those is not hidden... so I think the test request should have gone.. but it did not.
#2420915-14: patches on issues not being sent to testbot for testing
re-uploading it so it goes to the bot.
Comment #38
stefan.r commentedComment #39
stefan.r commentedThanks. Here's a patch that should be green, for completeness. Just waiting to hear from @fago whether this issue ought to be closed as a duplicate of #2429037: Allow adding entity level constraints, as there's big overlap between both :)
Comment #40
fagoAs posted there, I think it still makes sense to add a dedicated test case. However, it will need a re-roll once #2429037 lands. As the other one is critical, let's postpone this on it.
Comment #41
yesct commented#2429037: Allow adding entity level constraints went in. unpostponing so the work can start on the reroll.
@stefan.r also, the beta evaluation needs some changes which I think you will see since we worked on the beta evaluation in the other issue.
Comment #42
stefan.r commentedReroll, this runs the validator on the entity instead of on the field.
It also removes the field-level validation, the fix to the validator itself as well as the added changed field to entity_test entity type (as we now have 'entity_test_constraints'). So all that is left is the test anymore :)
Comment #43
stefan.r commentedComment #44
stefan.r commentedAfter this patch we only need #2142995: PrimitiveTypeConstraintValidator does not validate some values correctly anymore to have complete test coverage for #2012776: [META] Improve validation constraint test coverage.
In #2142995: PrimitiveTypeConstraintValidator does not validate some values correctly I could use some help on why this last test fails as I am not sure on why some of the primitive type constraints are validated the way they are.
Comment #58
smustgrave commentedNeeds to be updated for 10.1
See some deprecated calls in the patch.
Comment #59
smustgrave commentedThis still a concern?
Comment #61
smustgrave commentedSince there hasn't been movement or a follow up in 8 years going to close for now.
If still valid task please reopen.