Fix nested option support for non-filterable single selection form fields
authorMatthias Schmidt <gravatronics@live.com>
Fri, 27 Jul 2018 07:33:45 +0000 (09:33 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Fri, 27 Jul 2018 07:33:45 +0000 (09:33 +0200)
See #2509

wcfsetup/install/files/acp/templates/__singleSelectionFormField.tpl

index e994be8a68fffab611a8d131abd25609306b94d2..adcd0540dbcf5387bbd16f97a3843a529410a4c7 100644 (file)
@@ -26,7 +26,9 @@
        </ul>
 {else}
        <select id="{@$field->getPrefixedId()}" name="{@$field->getPrefixedId()}">
-               {htmlOptions options=$field->getOptions() selected=$field->getValue() disableEncoding=true}
+               {foreach from=$field->getNestedOptions() item=__fieldNestedOption}
+                       <option name="{@$field->getPrefixedId()}" value="{$__fieldNestedOption[value]}"{if $field->getValue() === $__fieldNestedOption[value]} selected{/if}>{@'&nbsp;'|str_repeat:$__fieldNestedOption[depth] * 4}{@$__fieldNestedOption[label]}</option>
+               {/foreach}
        </select>
 {/if}