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
InvalidArgumentExceptionis 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!