Closed (fixed)
Project:
Drupal core
Version:
8.7.x-dev
Component:
media system
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
21 Aug 2019 at 07:59 UTC
Updated:
25 Sep 2019 at 00:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
cilefen commentedComment #3
phenaproximaI think we can easily test this with a kernel test:
Tagging for tests and marking as "needs work". Once we have that, we can easily land this. Very nice find!
Comment #4
oknateHere's test coverage. I also moved the sorting into getHash(), as I think that's more appropriate.
We don't really need to be massaging the values in ::create() and and it was redundant in the following code, since it was being passed to create() just after.
3)
ksort($allowed_media_type_ids)fails when they are passed without keys, such as ['image', 'file'], so changed that up a bit:Comment #5
oknateOops, I left some test code in there while trying to figure out #4.3. Removing it.
Comment #8
oknateRetriggering test of #5, It looks like a random failure.
Comment #9
phenaproximaLooking excellent! Can't wait to RTBC this bugfix. I'm nominating it for backport to 8.7.x because it is a non-disruptive bug fix, in an experimental module, no less.
Nit: There is an extra space before "Sort".
Good call on using
array_values()! 👍This is a little more verbose than it needs to be. We can combine $state and $state3, and $state2 and $state4, and still get the same amount of test coverage.
Comment #10
oknate1. Removed extra space.
3. After discussing this with @phenaproxima on Slack, I broke it up into two methods, one to test allowed media types and one to test open parameters. He agreed with me that keeping the two separate sets of tests is OK, as it tests the allowed view modes and the opener params in isolation.
Comment #12
phenaproximaLooks good to me. RTBC when Christmas-ey.
Comment #13
alexpottCommitted 5a2c58c and pushed to 8.8.x. Thanks!
Comment #17
phenaproximaThanks!
Comment #18
josephdpurcell commentedLinking to other tickets to increase the likelihood someone finds this issue.