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.
Current validation occurs in the FieldWidget object, but it should be in a Constraint level, so REST request are validated too (POST, PATCH).
Comment | File | Size | Author |
---|---|---|---|
#9 | video_embed_field-add_constraint-2844338-9.patch | 7.39 KB | Sam152 |
#7 | video_embed_field-add_constraint-2844338-7.patch | 7.36 KB | Sam152 |
#7 | interdiff.txt | 2.77 KB | Sam152 |
#6 | video_embed_field-add_constraint-2844338-6.patch | 6.06 KB | ruloweb |
#6 | diff-2-6.txt | 3.55 KB | ruloweb |
Comments
Comment #2
ruloweb CreditAttribution: ruloweb at Media.Monks commentedThis patch requires to clear the cache, so Drupal detects the new Constraint Plugin.
Comment #3
Sam152 CreditAttribution: Sam152 at PreviousNext commentedThis is a great issue! Thanks for working on this. This will likely fail a test and should have a test of its own.
Can we explain what the constraint does here?
Missing description of the param.
Should hint the interface.
should be short array syntax to match the rest of the module.
I don't think the URL belongs in the error. Should be the same as the other error message.
Comment #4
ruloweb CreditAttribution: ruloweb at Media.Monks commentedThanks @Sam152 for the quick response :)
1) "Validation constraint for video embed fields which checks for existing providers."
2) "ProviderManager service."
3) Do you mean ProviderManagerInterface ?
4) Won't be necessary if the URL is not in the error message.
5) "Could not find a video provider to handle the given URL"
As soon as I get your thoughts I will create a new patch.
I also found an issue with the video_embed_wysiwyg module, I should replace:
Comment #5
Sam152 CreditAttribution: Sam152 at PreviousNext commentedGood on all counts.
Comment #6
ruloweb CreditAttribution: ruloweb at Media.Monks commentedNew version which applies @Sam152 recommendations.
Still missing the test. will be uploaded this days :).
Let's test bot this.
Comment #7
Sam152 CreditAttribution: Sam152 at PreviousNext commentedWith test and minor style changes.
Comment #9
Sam152 CreditAttribution: Sam152 at PreviousNext commentedMissing group annotation on test.
Comment #11
Sam152 CreditAttribution: Sam152 at PreviousNext commented