Skip to content
Snippets Groups Projects

3023322 - Contextual Links Style Update

7 unresolved threads
2 files
+ 37
5
Compare changes
  • Side-by-side
  • Inline
Files
2
  • 2030a5bb
    Issue #3248454 by daffie, Spokje, longwave, larowlan, alexpott: [Symfony6] The... · 2030a5bb
    catch authored
    Issue #3248454 by daffie, Spokje, longwave, larowlan, alexpott: [Symfony6] The Drupal\Tests\media_library\Kernel\MediaLibraryStateTest fails for Symfony 5.4
    
    (cherry picked from commit b8e771ec)
@@ -101,10 +101,10 @@ public static function fromRequest(Request $request) {
@@ -101,10 +101,10 @@ public static function fromRequest(Request $request) {
// all validation runs.
// all validation runs.
$state = static::create(
$state = static::create(
$query->get('media_library_opener_id'),
$query->get('media_library_opener_id'),
$query->get('media_library_allowed_types', []),
$query->all('media_library_allowed_types'),
$query->get('media_library_selected_type'),
$query->get('media_library_selected_type'),
$query->get('media_library_remaining'),
$query->get('media_library_remaining'),
$query->get('media_library_opener_parameters', [])
$query->all('media_library_opener_parameters')
);
);
// The request parameters need to contain a valid hash to prevent a
// The request parameters need to contain a valid hash to prevent a
@@ -224,7 +224,7 @@ public function getOpenerId() {
@@ -224,7 +224,7 @@ public function getOpenerId() {
* The media type IDs.
* The media type IDs.
*/
*/
public function getAllowedTypeIds() {
public function getAllowedTypeIds() {
return $this->get('media_library_allowed_types');
return $this->all('media_library_allowed_types');
}
}
/**
/**
@@ -268,7 +268,32 @@ public function getAvailableSlots() {
@@ -268,7 +268,32 @@ public function getAvailableSlots() {
* An associative array of all opener-specific parameter values.
* An associative array of all opener-specific parameter values.
*/
*/
public function getOpenerParameters() {
public function getOpenerParameters() {
return $this->get('media_library_opener_parameters', []);
return $this->all('media_library_opener_parameters');
 
}
 
 
/**
 
* Returns the parameters.
 
*
 
* @param string|null $key
 
* The name of the parameter to return or null to get them all.
 
*
 
* @return array
 
* An array of parameters.
 
*
 
* @todo Remove this when Symfony 4 is no longer supported.
 
* See https://www.drupal.org/node/3162981
 
*/
 
public function all(string $key = NULL): array {
 
if ($key === NULL) {
 
return $this->parameters;
 
}
 
 
$value = $this->parameters[$key] ?? [];
 
if (!is_array($value)) {
 
throw new \UnexpectedValueException(sprintf('Unexpected value for parameter "%s": expecting "array", got "%s".', $key, get_debug_type($value)));
 
}
 
 
return $value;
}
}
/**
/**
Loading