Skip to content
Snippets Groups Projects
Unverified Commit 091bff84 authored by Matt Glaman's avatar Matt Glaman Committed by GitHub
Browse files

Issue #3345913 by sandzel, Ok4p1: Error when adding media in Drupal 10 with...

Issue #3345913 by sandzel, Ok4p1: Error when adding media in Drupal 10 with Symfony 6 - Non-scalar values in InputBag

DIT-1161
parent 3ffbdacf
Branches 1.0.x
Tags 1.0.1
No related merge requests found
......@@ -363,12 +363,12 @@ final class AssetLibraryBuilder extends MediaLibraryUiBuilder {
}
$query = $this->request->query;
if (!$query->get('complete_allowed_list')) {
if (!$query->all('complete_allowed_list')) {
$query->set('complete_allowed_list', $state->get('media_library_allowed_types'));
}
/** @var string[] $allowed_type_ids */
$allowed_type_ids = $query->get('complete_allowed_list');
$allowed_type_ids = $query->all('complete_allowed_list');
/** @var array<string, array<string, \Drupal\media\MediaTypeInterface>> $grouped_allowed_types */
$grouped_allowed_types = [];
/** @var array<string, \Drupal\media\MediaTypeInterface> $source_allowed_types */
......@@ -415,7 +415,7 @@ final class AssetLibraryBuilder extends MediaLibraryUiBuilder {
$state->set('media_library_selected_type', array_values($allowed_type_ids)[0]);
}
$state->set('media_library_allowed_types', $allowed_type_ids);
$state->set('complete_allowed_list', $query->get('complete_allowed_list'));
$state->set('complete_allowed_list', $query->all('complete_allowed_list'));
$state->set('source', $source_value);
// Resetting the hash with new allowed types.
$state->set('hash', $state->getHash());
......
......@@ -122,7 +122,7 @@ final class MediaLibrarySelectForm extends MediaEntityMediaLibrarySelectForm {
$form['#submit'][] = [$this, 'processInputValues'];
$source = $this->view->getRequest()->query->get('source');
if (!$source) {
$allowed_type = array_values($this->view->getRequest()->query->get('media_library_allowed_types'))[0];
$allowed_type = array_values($this->view->getRequest()->query->all('media_library_allowed_types'))[0];
$source = $this->entityTypeManager->getStorage('media_type')->load($allowed_type)->getSource()->getPluginDefinition()['provider'];
}
if ($query === 'media_library.opener.editor' && $source === 'acquia_dam') {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment