diff --git a/UPGRADE-2.1.md b/UPGRADE-2.1.md index aa57ba7ef8..02ae5ea3a3 100644 --- a/UPGRADE-2.1.md +++ b/UPGRADE-2.1.md @@ -536,25 +536,43 @@ * In the choice field type's template, the `_form_is_choice_selected` method used to identify a selected choice has been replaced with the `selectedchoice` - filter. + filter. Similarly, the `_form_is_choice_group` method used to check if a + choice is grouped has been removed and can be checked with the `iterable` + test. Before: ``` {% for choice, label in choices %} - + {% if _form_is_choice_group(label) %} + + {% for nestedChoice, nestedLabel in label %} + ... options tags ... + {% endfor %} + + {% else %} + + {% endif %} {% endfor %} ``` After: ``` - {% for choice, label in choices %} - + {% for label, choice in choices %} + {% if choice is iterable %} + + {% for nestedChoice, nestedLabel in choice %} + ... options tags ... + {% endfor %} + + {% else %} + + {% endif %} {% endfor %} ```