Problem/Motivation
Media entity used to provide custom validation API to be used by type plugins. In #2529178: Convert media type validation code to a constraint we converted this feature to core's Constraint API. All media type providers need to follow that change.
Proposed resolution
Media entity slideshow should follow this change too. Media entity Twitter already did that in #2578927: [Chase media_entity] Convert validation to Constraints API and can be used as a reference.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | interdiff-2578945-7.txt | 6.97 KB | sanja_m |
| #7 | 2578945-7.patch | 7.44 KB | sanja_m |
Comments
Comment #2
sanja_m commentedWorking on this.
Comment #3
sanja_m commentedAdded ItemsCount constraint.
Comment #4
slashrsm commentedWe don't need to override constructor.
It would be nicer to have unit test for this.
Comment #5
sanja_m commented#4-1. and 2. fixed.
Comment #6
slashrsm commentedPHPUnit tests are usually located in module_root/tests/src and namespaced \Drupal\Tests\module_name\...
I think that we don't need data provider since there will always be just two options.
Leave an empty line at the beginning and end of the class definition.
Let's make argument optional and default it to NULL. This way it won't be needed to do empty string check any more.
Comment #7
sanja_m commented#6 - 1, 2, 3 and 4 fixed.
Comment #8
slashrsm commentedCommitted. Thank you!