diff --git a/src/Forms/GroupedDropdownField.php b/src/Forms/GroupedDropdownField.php index 2dfd1e974..feb758361 100644 --- a/src/Forms/GroupedDropdownField.php +++ b/src/Forms/GroupedDropdownField.php @@ -2,6 +2,7 @@ namespace SilverStripe\Forms; +use SilverStripe\ORM\ArrayLib; use SilverStripe\ORM\ArrayList; use SilverStripe\View\ArrayData; @@ -104,4 +105,14 @@ class GroupedDropdownField extends DropdownField ); return $values; } + + /** + * @return SingleLookupField + */ + public function performReadonlyTransformation() + { + $field = parent::performReadonlyTransformation(); + $field->setSource(ArrayLib::flatten($this->getSource())); + return $field; + } } diff --git a/src/View/Shortcodes/EmbedShortcodeProvider.php b/src/View/Shortcodes/EmbedShortcodeProvider.php index ba7fabc4f..f19529337 100644 --- a/src/View/Shortcodes/EmbedShortcodeProvider.php +++ b/src/View/Shortcodes/EmbedShortcodeProvider.php @@ -160,6 +160,17 @@ class EmbedShortcodeProvider implements ShortcodeHandler $arguments['style'] = 'width: ' . intval($arguments['width']) . 'px;'; } + // override iframe dimension attributes provided by webservice with ones specified in shortcode arguments + foreach (['width', 'height'] as $attr) { + if (!($value = $arguments[$attr] ?? false)) { + continue; + } + foreach (['"', "'"] as $quote) { + $rx = "/( +

A nice video

EOS ,