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.
Problem
Feed entity validation misses the logic from FeedForm::validate(). This is critical as the validation logic will be missed from RESTful validation. (see #1696648: [META] Untie content entity validation from form validation)
Proposed resolution
Convert the logic to entity validation and leverage entity validation in form validation.
Remaining tasks
Implement proposed resolution.
User interface changes
-
API changes
-
Comment | File | Size | Author |
---|---|---|---|
#14 | feeds-constraints-2403817.14.patch | 11.64 KB | larowlan |
#14 | interdiff.txt | 2 KB | larowlan |
#12 | feeds-constraints-2403817.2.patch | 9.64 KB | larowlan |
#12 | interdiff.txt | 10.63 KB | larowlan |
#2 | feeds-constraints-2403817.1.patch | 9.9 KB | larowlan |
Comments
Comment #1
larowlantaking
Comment #2
larowlanComment #3
larowlanComment #4
dawehnerWhy do we need both?
Comment #5
BerdirAny chance we can find a way to write a generic unique field constraint? I know that for example BlockContent needs that too.
And there's nothing in FeedStorage::getFeedDuplicates() that is feed specific, it's just an entity query?
Comment #6
larowlanCause it no-worky. See #2197029: Allow to inject dependencies into validation constraints
Sure but should we do that as a non-critical follow up?
Comment #7
ParisLiakos CreditAttribution: ParisLiakos commentedyes. relevant: #2228733: Remove getFeedDuplicates - its unused and untested
Comment #8
larowlanShould we postpone this on #2197029: Allow to inject dependencies into validation constraints to address comment #4?
Comment #9
larowlanComment #10
fagoThere is already a UserUniqueValidator - it should be easy to make this unique-constraint entity type acgnostic. If some usages needs customized messages, those could be specified when defining the constraint. (What would bloat our field definitions though, when we do that often).
Comment #11
larowlanShould be able to guide any newcomers through this in today's office hours
Comment #12
larowlanFixes #4 #5 and #10 I think this is pretty close
Comment #13
dawehnerGreat extraction of existing logic.
Now we have worked on moving code around, but nothing actually ensures that the critical is fixed: Validation is executed on an API / REST level,
the test still just deals with forms.
We still can't inject things? Too bad.
Comment #14
larowlanadded a test
rtbc'd the injections issue
getting close now
Comment #15
dawehnerCool, thank you!
Comment #16
alexpottThis issue addresses a critical bug and is allowed per https://www.drupal.org/core/beta-changes. Committed 2a55451 and pushed to 8.0.x. Thanks!
Comment #19
almaudoh CreditAttribution: almaudoh commentedFiled a follow-up here #2483869: Make Unique Field constraints generic