From 134aba99d656e956969d07cc1fd66ac31b32837b Mon Sep 17 00:00:00 2001 From: xjm <xjm@65776.no-reply.drupal.org> Date: Sat, 4 Jul 2015 14:20:54 +0100 Subject: [PATCH] Issue #2501903 by pguillard, Manjit.Singh: inline form errors classnames to follow namestandard --- core/modules/system/css/system.theme.css | 2 +- core/modules/system/src/Tests/Form/FormTest.php | 2 +- core/modules/system/src/Tests/Form/ValidationTest.php | 2 +- core/modules/system/templates/form-element.html.twig | 4 ++-- core/themes/bartik/css/components/form.css | 2 +- .../themes/classy/templates/form/datetime-wrapper.html.twig | 2 +- core/themes/classy/templates/form/fieldset.html.twig | 2 +- core/themes/classy/templates/form/form-element.html.twig | 4 ++-- core/themes/seven/css/components/form.css | 6 +++--- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/core/modules/system/css/system.theme.css b/core/modules/system/css/system.theme.css index fa7a75bce57c..179628f84ab5 100644 --- a/core/modules/system/css/system.theme.css +++ b/core/modules/system/css/system.theme.css @@ -114,7 +114,7 @@ abbr.ajax-changed { } /* Inline error messages. */ -.form-error-message:before { +.form-item--error-message:before { content: ''; display: inline-block; height: 14px; diff --git a/core/modules/system/src/Tests/Form/FormTest.php b/core/modules/system/src/Tests/Form/FormTest.php index c5e7fe76a3bc..e556b2059991 100644 --- a/core/modules/system/src/Tests/Form/FormTest.php +++ b/core/modules/system/src/Tests/Form/FormTest.php @@ -188,7 +188,7 @@ function testRequiredCheckboxesRadio() { } // Check the page for error messages. - $errors = $this->xpath('//div[contains(@class, "form-error-message")]//strong'); + $errors = $this->xpath('//div[contains(@class, "form-item--error-message")]//strong'); foreach ($errors as $error) { $expected_key = array_search($error[0], $expected); // If the error message is not one of the expected messages, fail. diff --git a/core/modules/system/src/Tests/Form/ValidationTest.php b/core/modules/system/src/Tests/Form/ValidationTest.php index 7fd60e7f8891..31db834ccbf1 100644 --- a/core/modules/system/src/Tests/Form/ValidationTest.php +++ b/core/modules/system/src/Tests/Form/ValidationTest.php @@ -276,7 +276,7 @@ function testCustomRequiredError() { * - key: The key used for the form element. */ protected function assertErrorMessages($messages) { - $element = $this->xpath('//div[@class = "form-error-message"]/strong'); + $element = $this->xpath('//div[@class = "form-item--error-message"]/strong'); $this->assertIdentical(count($messages), count($element)); $error_links = []; diff --git a/core/modules/system/templates/form-element.html.twig b/core/modules/system/templates/form-element.html.twig index b1ca6e9ef9b1..9292fd7e3d3c 100644 --- a/core/modules/system/templates/form-element.html.twig +++ b/core/modules/system/templates/form-element.html.twig @@ -53,7 +53,7 @@ 'form-item-' ~ name|clean_class, title_display not in ['after', 'before'] ? 'form-no-label', disabled == 'disabled' ? 'form-disabled', - errors ? 'form-error', + errors ? 'form-item--error', ] %} {% @@ -82,7 +82,7 @@ {{ label }} {% endif %} {% if errors %} - <div class="form-error-message"> + <div class="form-item--error-message"> {{ errors }} </div> {% endif %} diff --git a/core/themes/bartik/css/components/form.css b/core/themes/bartik/css/components/form.css index 4574da0cadc9..36e82560e456 100644 --- a/core/themes/bartik/css/components/form.css +++ b/core/themes/bartik/css/components/form.css @@ -276,6 +276,6 @@ input.form-submit:focus { } /* Form error message styles. */ -.form-error-message { +.form-item--error-message { color: #ea2800; } diff --git a/core/themes/classy/templates/form/datetime-wrapper.html.twig b/core/themes/classy/templates/form/datetime-wrapper.html.twig index 56da17309d6d..fa04a65c75e2 100644 --- a/core/themes/classy/templates/form/datetime-wrapper.html.twig +++ b/core/themes/classy/templates/form/datetime-wrapper.html.twig @@ -24,7 +24,7 @@ {% endif %} {{ content }} {% if errors %} - <div class="form-error-message"> + <div class="form-item--error-message"> <strong>{{ errors }}</strong> </div> {% endif %} diff --git a/core/themes/classy/templates/form/fieldset.html.twig b/core/themes/classy/templates/form/fieldset.html.twig index 67b8451bae79..5e0d795381e6 100644 --- a/core/themes/classy/templates/form/fieldset.html.twig +++ b/core/themes/classy/templates/form/fieldset.html.twig @@ -40,7 +40,7 @@ </legend> <div class="fieldset-wrapper"> {% if errors %} - <div class="form-error-message"> + <div class="form-item--error-message"> <strong>{{ errors }}</strong> </div> {% endif %} diff --git a/core/themes/classy/templates/form/form-element.html.twig b/core/themes/classy/templates/form/form-element.html.twig index f0d4d5601225..65028fa3be56 100644 --- a/core/themes/classy/templates/form/form-element.html.twig +++ b/core/themes/classy/templates/form/form-element.html.twig @@ -52,7 +52,7 @@ 'form-item-' ~ name|clean_class, title_display not in ['after', 'before'] ? 'form-no-label', disabled == 'disabled' ? 'form-disabled', - errors ? 'form-error', + errors ? 'form-item--error', ] %} {% @@ -81,7 +81,7 @@ {{ label }} {% endif %} {% if errors %} - <div class="form-error-message"> + <div class="form-item--error-message"> <strong>{{ errors }}</strong> </div> {% endif %} diff --git a/core/themes/seven/css/components/form.css b/core/themes/seven/css/components/form.css index 07232de4f763..3a717aec876f 100644 --- a/core/themes/seven/css/components/form.css +++ b/core/themes/seven/css/components/form.css @@ -96,14 +96,14 @@ label[for] { width: 7px; height: 7px; } -.form-error-message { +.form-item--error-message { margin-top: 0.15em; color: #ea2800; } -.fieldset-wrapper > .form-error-message { +.fieldset-wrapper > .form-item--error-message { margin-top: 0; } -.text-format-wrapper .form-error-message { +.text-format-wrapper .form-item--error-message { border: solid #ccc; border-width: 0 1px; margin: 0; -- GitLab