- Issue created by @Ok4p1
- π²π©Moldova sandzel Chisinau
I met the same issue. I attached the patch with the fix.
- π²π©Moldova sandzel Chisinau
The patch #2 is fixing the issue but it generates 2 more warnings which I will try to fix them
Warning: Undefined array key "#links" in Drupal\acquia_dam\AssetLibraryBuilder->addSourceMenu() (line 510 of /var/www/docroot/modules/contrib/acquia_dam/src/AssetLibraryBuilder.php)
and
Warning: foreach() argument must be of type array|object, null given in Drupal\acquia_dam\AssetLibraryBuilder->addSourceMenu() (line 510 of /var/www/docroot/modules/contrib/acquia_dam/src/AssetLibraryBuilder.php)
- π²π©Moldova sandzel Chisinau
Please use this new patch instead of the old one. I fixed the warnings as well.
- π²π©Moldova sandzel Chisinau
If I have chosen a media field to be able to add Media Types such as Image and DAM Image, my expectation is that when I open the Media Library, the 'Select media source' field should allow me to switch between the 'DAM' and 'Media Types' Media Sources and vice versa. However, this is no longer happening since the modifications in https://www.drupal.org/project/acquia_dam/issues/3338385 π PHP errors caused by media library popup Fixed .
The patch I added fixes this issue. The idea is to display the 'Select Media Source' field and omit displaying the menu with the Media types when not needed.
- Assigned to mglaman
- Status changed to Needs review
almost 2 years ago 2:22pm 7 April 2023 - @mglaman opened merge request.
The last submitted patch, 4: acquia_dam-3347862-3.patch, failed testing. View results β
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.- Status changed to Needs work
almost 2 years ago 2:45pm 7 April 2023 - πΊπΈUnited States mglaman WI, USA
I see, because each tab has one (DAM Image, Drupal Image) and
$state->get('media_library_content') === '1'
is triggered, which\Drupal\media_library\MediaLibraryUiBuilder::buildUi
then just returnsif ($state->get('media_library_content') === '1') { return $this->buildLibraryContent($state); }
- πΊπΈUnited States mglaman WI, USA
Actually, it wasn't due to
media_library_content
. Thanks for calling out that earlier issue.This important part was missed:
// If there is only one source for the media types, no need to render the // source selector. if (count($grouped_allowed_types) === 1) { return parent::buildUi($state); }
I shouldn't have checked for an empty menu. We know the selector needs to be added if this is called, as earlier the builder determines if there are multiple media type sources.
- Issue was unassigned.
- Status changed to Needs review
almost 2 years ago 3:31pm 7 April 2023 - πΊπΈUnited States mglaman WI, USA
This should do it. Fixed the tests β if I had called
buildUi
instead ofaddSourceMenu
this would have been caught. Thanks @sandzel, again. -
mglaman β
authored 58dfa490 on 1.0.x
Issue #3347862 by sandzel: Missing select media source option DIT-1183...
-
mglaman β
authored 58dfa490 on 1.0.x
- Status changed to Fixed
over 1 year ago 4:04pm 24 April 2023 Automatically closed - issue fixed for 2 weeks with no activity.