- Issue created by @davidhernandez
- Assigned to mglaman
- πΊπΈUnited States mglaman WI, USA
It looks to be due to
\Drupal\media_library\MediaLibraryUiBuilder::buildMediaTypeMenu
If there is is one media type there is no menu.
// Add the menu for each type if we have more than 1 media type enabled for // the field. $allowed_type_ids = $state->getAllowedTypeIds(); if (count($allowed_type_ids) <= 1) { return []; }
Otherwise
$build['menu']['link']['#links']
would be an array. This method does not seem to be supporting this. I actually think it may have been a silent failure on PHP 7.4 and started throwing notices on PHP 8.0@davidhernandez can provide the PHP version and number of media types configured for the field or WYSIWYG? I want to try and reproduce versus just my hunches.
- @mglaman opened merge request.
- Status changed to Needs review
almost 2 years ago 4:10pm 6 February 2023 - πΊπΈUnited States mglaman WI, USA
MR with the fix. I want to get test coverage for this. We manually tested media library instances configured with one instance and didn't get these warnings, and tests should have caught them as well.
- πΊπΈUnited States mglaman WI, USA
Unfortunately DrupalCI is failing due to a dev dependency requiring composer-patches, relying on internal CI to verify tests.
- πΊπΈUnited States mglaman WI, USA
Thanks, @davidhernandez! I am too. I think the problem is that any test which asserted the media library installed the module's own config. This new test does not and asserts the media type links. That's why it didn't occur. I guess the runtime QA environment didn't for unknown reasons (I'll check that later.)
- Issue was unassigned.
- πΊπΈUnited States mglaman WI, USA
Okay, this passed on the internal CI, now. Sourcing some reviews.
-
mglaman β
authored 69ffb039 on 1.0.x
Issue #3338385 by mglaman: PHP errors caused by media library popup (#...
-
mglaman β
authored 69ffb039 on 1.0.x
- Status changed to Fixed
almost 2 years ago 8:28pm 6 February 2023 Automatically closed - issue fixed for 2 weeks with no activity.