Skip to content

Commit

Permalink
[CIVIC-1529] Fixed submit button arrow htmlentity.
Browse files Browse the repository at this point in the history
  • Loading branch information
govindmaloo committed Feb 5, 2024
1 parent 7cd22b4 commit 397c11f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,21 @@
* CivicTheme implementation to display a 'submit' form element.
*
* Variables:
* - value: [string] value.
* - attributes: [string] Additional attributes.
* - modifier_class: [string] Additional classes.
*/
#}

{% if 'secondary' in modifier_class %}
{% set type = 'secondary' %}
{% set type = 'secondary' %}
{% else %}
{% set type = 'primary' %}
{% set type = 'primary' %}
{% endif %}
{% set children %}
{% include "@atoms/button/button.twig" with {
{% include "@atoms/button/button.twig" with {
type: type,
text: attributes.value,
text: value,
modifier_class: modifier_class,
attributes: attributes,
kind: 'submit',
Expand Down
7 changes: 7 additions & 0 deletions web/themes/contrib/civictheme/includes/form.inc
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ function civictheme_preprocess_input(array &$variables): void {
if (isset($variables['attributes']['#civictheme_theme'])) {
unset($variables['attributes']['#civictheme_theme']);
}

// Fix htmlentity in submit button text.
$element = $variables['element'];

if (isset($element['#type']) && $element['#type'] == 'submit' && !empty($variables['attributes']['value'])) {
$variables['value'] = $variables['attributes']['value'];
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,25 @@
* CivicTheme implementation to display a 'submit' form element.
*
* Variables:
* - value: [string] value.
* - attributes: [string] Additional attributes.
* - modifier_class: [string] Additional classes.
*/
#}

{% if 'secondary' in modifier_class %}
{% set type = 'secondary' %}
{% set type = 'secondary' %}
{% else %}
{% set type = 'primary' %}
{% set type = 'primary' %}
{% endif %}
{% set children %}
{% include "@atoms/button/button.twig" with {
{% include "@atoms/button/button.twig" with {
type: type,
text: attributes.value,
text: value,
modifier_class: modifier_class,
attributes: attributes,
kind: 'submit'
kind: 'submit',
theme: theme
} only %}
{% endset %}
{% include "@molecules/form-element/form-element.twig" with {
Expand Down

0 comments on commit 397c11f

Please sign in to comment.