|
540 | 540 | {% block ea_form_column_open_row %} |
541 | 541 | {% set field = form.vars.ea_vars.field %} |
542 | 542 | {% set field_icon = field.getCustomOption('icon') %} |
543 | | - {% set column_has_title = field_icon != null or field.label != false or field.label != null or field.label != '' or field.help != null %} |
| 543 | + {# don't use "field.label|default()" here; it'll trigger deprecation messages: Method TranslatableMessage::__toString() is deprecated #} |
| 544 | + {% set has_label = field.label is not same as(false) and field.label is not null and field.label is not same as('') %} |
| 545 | + {% set has_help = field.help is not same as(false) and field.help is not null and field.help is not same as('') %} |
| 546 | + {% set column_has_title = field_icon != null or has_label or has_help %} |
544 | 547 |
|
545 | 548 | <div class="form-column {{ not column_has_title ? 'form-column-no-header' }} {{ field.cssClass }}"> |
546 | 549 | {% if column_has_title %} |
547 | 550 | <div class="form-column-title"> |
548 | 551 | <div class="form-column-title-content"> |
549 | 552 | {% if field_icon %}<twig:ea:Icon name="{{ field_icon }}" class="form-column-icon" />{% endif %} |
550 | | - {% if field.label %}{{ field.label|default('')|trans(domain: ea().i18n.translationDomain)|raw }}{% endif %} |
| 553 | + {% if has_label %}{{ field.label|trans(domain: ea().i18n.translationDomain)|raw }}{% endif %} |
551 | 554 | </div> |
552 | 555 |
|
553 | | - {% if field.help %} |
| 556 | + {% if has_help %} |
554 | 557 | <div class="form-column-help">{{ field.help|trans(domain: ea().i18n.translationDomain)|raw }}</div> |
555 | 558 | {% endif %} |
556 | 559 | </div> |
|
574 | 577 | {% endblock ea_form_fieldset_open_ealabel %} |
575 | 578 |
|
576 | 579 | {% block ea_form_fieldset_open_label %} |
577 | | - <div class="form-fieldset-header {{ ea_is_collapsible ? 'collapsible' }} {{ ea_help is not empty ? 'with-help' }}"> |
| 580 | + {# don't use 'ea_help is not empty' here; it'll trigger deprecation messages: Method TranslatableMessage::__toString() is deprecated #} |
| 581 | + {% set has_help = ea_help is not same as(false) and ea_help is not null and ea_help is not same as('') %} |
| 582 | + |
| 583 | + <div class="form-fieldset-header {{ ea_is_collapsible ? 'collapsible' }} {{ has_help ? 'with-help' }}"> |
578 | 584 | <div class="form-fieldset-title"> |
579 | 585 | {% if ea_is_collapsible %} |
580 | 586 | <a href="#content-{{ form.vars.name }}" data-bs-toggle="collapse" |
|
588 | 594 | </span> |
589 | 595 | {% endif %} |
590 | 596 |
|
591 | | - {% if ea_help %} |
| 597 | + {% if has_help %} |
592 | 598 | <div class="form-fieldset-help">{{ ea_help|trans|raw }}</div> |
593 | 599 | {% endif %} |
594 | 600 | </div> |
595 | 601 | </div> |
596 | 602 | {% endblock ea_form_fieldset_open_label %} |
597 | 603 |
|
598 | 604 | {% block ea_form_fieldset_open_row %} |
599 | | - {% set fieldset_has_header = form.vars.label or ea_icon or ea_help %} |
| 605 | + {# don't use 'ea_help is not empty' here; it'll trigger deprecation messages: Method TranslatableMessage::__toString() is deprecated #} |
| 606 | + {% set has_help = ea_help is not same as(false) and ea_help is not null and ea_help is not same as('') %} |
| 607 | + {# don't use 'form.vars.label is not empty' here; it'll trigger deprecation messages: Method TranslatableMessage::__toString() is deprecated #} |
| 608 | + {% set has_label = form.vars.label is not same as(false) and form.vars.label is not null and form.vars.label is not same as('') %} |
| 609 | + {% set fieldset_has_header = has_label or ea_icon or has_help %} |
600 | 610 |
|
601 | 611 | <div class="form-fieldset {{ not fieldset_has_header ? 'form-fieldset-no-header' }} {{ ea_css_class }}"> |
602 | 612 | <fieldset> |
|
684 | 694 | <input type="checkbox" class="filter-checkbox" {% if field.vars.name in applied_filters %}checked{% endif %}> |
685 | 695 | <a data-bs-toggle="collapse" href="#filter-content-{{ loop.index }}" aria-expanded="{{ field.vars.name in applied_filters ? 'true' : 'false' }}" aria-controls="filter-content-{{ loop.index }}" |
686 | 696 | {% for name, value in field.vars.label_attr|default([]) %}{{ name }}="{{ value|e('html') }}" {% endfor %}> |
687 | | - {{ field.vars.label|default(field.vars.name|humanize)|trans(domain: ea().i18n.translationDomain) }} |
| 697 | + {# don't use 'field.vars.label is not empty' here; it'll trigger deprecation messages: Method TranslatableMessage::__toString() is deprecated #} |
| 698 | + {% set has_filter_label = field.vars.label is not same as(false) and field.vars.label is not null and field.vars.label is not same as('') %} |
| 699 | + {% set filter_label = has_filter_label ? field.vars.label : field.vars.name|humanize %} |
| 700 | + {{ filter_label|trans(domain: ea().i18n.translationDomain) }} |
688 | 701 | </a> |
689 | 702 | </div> |
690 | 703 | <div id="filter-content-{{ loop.index }}" class="filter-content collapse {% if field.vars.name in applied_filters %}show{% endif %}" aria-labelledby="filter-heading-{{ loop.index }}"> |
|
732 | 745 | {% endif %} |
733 | 746 | <div class="custom-file"> |
734 | 747 | {{ form_widget(form.file, {attr: form.file.vars.attr|merge({placeholder: placeholder, title: title, 'data-files-label': filesLabel, class: 'd-none'})}) }} |
735 | | - {{ form_label(form.file, placeholder, {label_attr: {class: 'custom-file-label'}}) }} |
| 748 | + {# don't pass 'placeholder' as the 2nd argument of form_label(); Twig calls testEmpty() on it internally, which triggers the TranslatableMessage::__toString() deprecation #} |
| 749 | + {{ form_label(form.file, null, {label: placeholder, label_attr: {class: 'custom-file-label'}}) }} |
736 | 750 | </div> |
737 | 751 | <div class="input-group-text"> |
738 | 752 | {%- if currentFiles -%} |
|
0 commit comments