Needs review
Project:
Media Entity Flickr
Version:
8.x-4.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Apr 2019 at 11:52 UTC
Updated:
10 Apr 2019 at 00:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
fenstratAttached patch should fix validation.
Added a Functional test to cover this. It'd be better as a Kernel or even Unit to better test the validator, however as Functional this easily test the config in config/install.
Not uploading a test only patch as there no other tests in the module, so I don't think the tests will actually run anyway (without the fixes it fails locally).
Comment #3
sam152 commentedI can't see a way that the other code paths in the validator are actually triggered:
if (is_string($value)) {...
elseif ($value instanceof FieldItemInterface) {It's attached in
getSourceFieldConstraintson the media type plugin, which is then only assigned to the FieldItemList class:Perhaps worth removing the other two types of data? Otherwise, patch looks great.