Skip to content

Commit 12f8e52

Browse files
committed
Resolve select field options from the Select field type class
1 parent 2277839 commit 12f8e52

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

view/adminhtml/templates/form/field_type/select.phtml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,10 @@ use Loki\Components\Util\Block\TemplateRenderer;
1717
/** @var Escaper $escaper */
1818

1919
$field = $block->getField();
20-
$options = $field->getOptions();
2120
$emptyOption = $field->getEmptyOption();
2221
$fieldType = $field->getFieldType();
22+
$options = $fieldType->getOptions();
2323
$fieldAttributes = $field->getFieldAttributes();
24-
25-
if (false === $options instanceof OptionSourceInterface) {
26-
echo '$options is not a proper instance: '.gettype($options);
27-
return;
28-
}
2924
?>
3025
<select
3126
aria-label="<?= $escaper->escapeHtml($field->getLabel()) ?>"
@@ -54,7 +49,7 @@ if (false === $options instanceof OptionSourceInterface) {
5449
) ?>
5550
<?php endif; ?>
5651

57-
<?php foreach ($options->toOptionArray() as $option) : ?>
52+
<?php foreach ($options as $option) : ?>
5853
<?php $option['level'] = 0; ?>
5954
<?= /* @noEscape */ $templateRenderer->html(
6055
$block,

0 commit comments

Comments
 (0)