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.
Please use this new patch instead of the old one. I fixed the warnings as well.
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)
I met the same issue. I attached the patch with the fix.
sandzel → created an issue.