- Issue created by @larowlan
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Simple fix, with thorough tests. The test-only CI job fails. π
Another case of https://en.m.wikipedia.org/wiki/Robustness_principle π€
In ManagedFile we do this for the current fids value of the element:
$element['fids'] = [
'#type' => 'hidden',
'#value' => $fids,
];
But $fids
is an array.
This only works because of a quirk in twig rendering because of
Drupal\Core\Template\AttributeArray::__toString
This limits the ability to perform programmatic submissions of forms with managed file elements because FormStateInterface::getValues()
returns an array for the value, but \Drupal\file\Element\ManagedFile::valueCallback
expects the value to be a string imploded with ' '
Relax \Drupal\file\Element\ManagedFile::valueCallback
to only run explode
if the value is a string.
Active
11.0 π₯
file.module
Simple fix, with thorough tests. The test-only CI job fails. π
Another case of https://en.m.wikipedia.org/wiki/Robustness_principle π€