Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Problem/Motivation
When calling MediaLibraryState::fromRequest()
on a request without any media library URL query argument, the following type error occurs:
Argument 2 passed to Drupal\media_library\MediaLibraryState::create() must be of the type array, null given
We overlooked this in #3038241: Implement a tamper-proof hash for the media library state.
Proposed resolution
Ensure that MediaLibraryState::fromRequest()
always passes valid arguments into MediaLibraryState::create()
Remaining tasks
Test coverage.Fix.- RTBC.
User interface changes
None.
API changes
None.
Data model changes
None.
Release notes snippet
N/A
Comment | File | Size | Author |
---|---|---|---|
#3 | 3057370-3.patch | 1.75 KB | Wim Leers |
#3 | interdiff.txt | 774 bytes | Wim Leers |
#2 | 3057370-2-test_only_FAIL.patch | 1.01 KB | Wim Leers |
Comments
Comment #2
Wim LeersComment #3
Wim LeersComment #4
seanBNice find. I guess you shouldn't do that, but fixing the type error and throwing a nice
InvalidArgumentException
is a lot better.I think this is RTBC as soon as the tests are green.
Comment #6
seanBLooks good to me!
Comment #7
alexpottCommitted and pushed d2792e13d7 to 8.8.x and 9fbc804e47 to 8.7.x. Thanks!