Problem/Motivation

Inline Form Errors needs a documentation update in hook_help.

Proposed resolution

The part about 'experimental' needs to be removed.

See: https://www.drupal.org/node/632280#help

Furthermore we need to update the documentation page on Drupal.org about the module with:

  • A brief explanation (remove the non-existent behaviors)
  • Known limitations (like HTML5 validation)
  • How to disable IFE for a complete form
  • How to hide inline error messages for certain elements

Remaining tasks

  • Create a patch to change the help text.
  • Update module info file
  • Match the online documentation to the new text.
  • Add the extra information to the online documentation
    • Point out which parts of WCAG this module helps with.
    • Known limitations (like HTML5 validation)
    • How to disable IFE for a complete form
    • How to hide inline error messages for certain elements

User interface changes

None

API changes

None

Data model changes

None

CommentFileSizeAuthor
#48 interdiff-2888189-45-48.txt1.41 KBandrewmacpherson
#48 2888189-ife-help-48.patch2.81 KBandrewmacpherson
#45 interdiff-38-45.txt1.52 KBifrik
#45 2888189-ife-help-45.patch2.8 KBifrik
#38 interdiff-2863318-19-24.txt638 bytesmartin107
#38 space-2888189-38.patch2.8 KBmartin107
#34 interdiff-2888189-32-34.txt1.55 KBifrik
#34 2888189-34-ife_help.patch2.79 KBifrik
#33 2888189-32.patch2.8 KBdmsmidt
#33 interdiff-2888189-29-32.txt1.41 KBdmsmidt
#29 2888189-29.patch2.82 KBandrewmacpherson
#29 interdiff-2888189-28-29.txt1.43 KBandrewmacpherson
#29 interdiff-2888189-24-27.txt1.44 KBandrewmacpherson
#28 2888189-28.patch2.81 KBshashikant_chauhan
#28 interdiff-2888189-27-28.txt1.43 KBshashikant_chauhan
#27 2888189-27.ife_help.patch2.81 KBpk188
#24 interdiff-2888189-22-24.txt621 bytesifrik
#24 2888189-24.ife_help.patch2.81 KBifrik
#22 2888189-22-ife_help.patch2.81 KBifrik
#22 interdiff-288189-19-22.txt2.24 KBifrik
#19 interdiff-2888189-11-19.patch493 bytesandrewmacpherson
#19 2888189-19-ife_help.patch1.96 KBandrewmacpherson
#14 Screen Shot 2017-07-02 at 10.37.37.png104.45 KBJohn Cook
#14 Screen Shot 2017-07-02 at 10.36.18.png95.35 KBJohn Cook
#11 2888189-11-ife_help.patch1.34 KBoadaeh
#4 2888189-04-ife_help.patch1.36 KBoadaeh
#2 2888189-02-ife_help.patch1.33 KBdmsmidt
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dmsmidt created an issue. See original summary.

dmsmidt’s picture

Status: Active » Needs review
FileSize
1.33 KB

Initial hook_help update.

mgifford’s picture

This looks fine to me:

The Inline Form Errors module makes form errors more accessible and user friendly. It places the error messages next to the form elements themselves and adds a summary of all errors. For more information, see the <a href=":inline_form_error">online documentation for the Inline Form Errors module</a>.

Thanks @dmsmidt!

oadaeh’s picture

I applied the patch to the latest 8.4.x (no surprise there, considering how new it is), and I was also able to apply it to the latest 8.3.x. In both cases, the text displayed as expected.

However, while I think the wording is essentially fine as is, I think it can be improved slightly by changing it to be like this:

The Inline Form Errors module makes form errors more accessible and user friendly by placing the error messages next to the form elements themselves and displaying a summary of all errors at the top of the page. For more information, see the online documentation for the Inline Form Errors module.

It puts the "how" and the "what" in the same sentence with a connecting word, rather than having them in separate sentences. (I think it flows better when reading it that way.)
I also added a tad more clarification on a couple of points in the included text.

For your convenience, I've attached a patch that includes those changes.

dmsmidt’s picture

Status: Needs review » Needs work

Thanks for being so precise @oadeah. I thought about putting 'at the top of the page' in there as well. But we can't be sure about where people display their Drupal messages, so I left that one out.
What do you guys think?

Also it would be great if anybody could update the DO help page with the points mentioned in the IS.

oadaeh’s picture

What about something more like "...summary of all errors, usually displayed at the top of the page."?

oadaeh’s picture

I read through the other hot issues for this module, and I don't think I can be much help with them, so I can see what I can come up with for the d.o documentation, but I will need to spend some time familiarizing myself with the module and it's code, so I actually know what it does.
Also, I think the last two points are still a work in progress, so I might wait until they are done before writing much about them.

mgifford’s picture

Not sure that the 'at the top of the page' is necessary.

Yes, presently d.o just has "Documentation for the experimental Drupal 8 Inline Form Errors module." here:
https://www.drupal.org/docs/8/core/modules/inline-form-errors

So should this be identical to the text in core, or longer?

dmsmidt’s picture

@oadaeh, reviewing the patches in other issues would also be a huge help.

The documentation on d.o. can be separated in two chapters maybe: for end users / for developers. For users we can give some screenshots and maybe write something about that the summary is usually at the top of the page. Then we can skip that in the modules hook_help.

mgifford’s picture

Ok, this is just a place holder:
https://www.drupal.org/docs/8/core/modules/inline-form-errors

Really this content should all go in:
https://www.drupal.org/docs/8/core/modules/inline-form-errors/inline-for...

I've created a "What is IFE - for users?" & "IFE for Developers". Just added one screenshot as a placeholder. The text needs more work, but it is an improvement.

oadaeh’s picture

Status: Needs work » Needs review
FileSize
1.34 KB

Okay, I removed the at the top part. Here's the updated patch for scrutiny.

oadaeh’s picture

I also removed that text from the documentation page.

mgifford’s picture

Thanks!

John Cook’s picture

I've tested oadaeh's patch from comment #11.

Before:

After:

The text has reference to the module being experimental has been removed as requested by the first part of the description. The online documentation also matches this text.

I would say that the patch is fine and can be committed.

But the second part of the summary, about adding more information, has not been done yet. For that reason I'm setting the issue back to needs work.

I've updated the summary showing what is still to do.

John Cook’s picture

Issue summary: View changes
John Cook’s picture

Status: Needs review » Needs work
lplp’s picture

Assigned: Unassigned » lplp
andrewmacpherson’s picture

For the documentation pages, we could point out which parts of WCAG this helps with. That might help people who are tasked with evaluating Drupal.

Most specifically, it is Drupal 8's implementation of WCAG 2.0 technique G139: Creating a mechanism that allows users to jump to errors.

Overall, it helps with WCAG 2.0 Guideline 3.3 - Input Assistance, and to some extent Success Criterion 2.4.1 - Bypass Blocks.

Who benefits from Inline Form Errors?

  • People who use screen magnifiers can find details of an error next to the input field which it applies to.
  • Likewise users with small screens (such as mobile phones) can see the field and error message on screen together, without needing to scroll up and down.
  • People who only use a keyboard can reach fields with errors with less effort.
  • Screen reader users can find the error message near the relevant field.

release managers: some of this might help in the D8.4.0 release notes too?

andrewmacpherson’s picture

Issue summary: View changes
Status: Needs work » Needs review
FileSize
1.96 KB
493 bytes

The description in the IFE info file is misleading in a couple of ways.

type: module
name: Inline Form Errors
description: 'Adds WCAG 2.0 accessibility compliance for web form errors, 
  1. WCAG 2.0 doesn't mention the word "compliance" anywhere - the word it uses is "conformance" (I know... the difference is lost on me).
  2. The current description kind of implies that if you enable this module, then your website WILL be conformant with WCAG 2.0. That's too bold a claim IMO. All the module can do is help you achieve WCAG conformance, not guarantee it. Designers and themers could still make poor choices with regards to colour, or when customizing the message block, etc..
    In any case, our IFE approach is only one of the suggested ways to implement G139: Creating a mechanism that allows users to jump to errors, which in turn is considered an "additional advisory technique" for WCAG Guideline 3.3. It's not going to be the best approach for all situations, so we have #2856950: Add a possibility to disable inline form errors for a complete form to help developers who need to take a different approach.

</pedantic>

I'd suggest:
description: 'Places error messages adjacent to form inputs, for improved usability and acessibility.'

Updated the patch with new info file.

lplp’s picture

Issue summary: View changes

Updated the documentation, Added known limitations (considering HTML 5), Who benefits from Inline Form Errors?, How to disable IFE for a complete form and How to hide inline error messages for certain elements.

ifrik’s picture

Status: Needs review » Needs work

Some nit-picking:
"user-friendly" needs a hyphen.

Strictly speaking the module doesn't make the errors more accessible - it makes identifying the form errors more accessible and provides the different messages for different fields.

Maybe "The Inline Form Errors module makes it easier for users to identify at which form elements errors needs to be resolved by providing a summary of all errors and by placing the individual error messages next to the form elements themselves."

I would also suggest a sentences under "Uses"

Displaying error messages inline
If a user does not fill in a form correctly (for example by not filling out a required field), then a warning message with links to each individual form element is displayed at the top of the form. The individual error messages are displayed next to each form element.

Displaying error messages in browsers with HTML5 form validation
In browsers that support HTML5 form validation, users will first see the error messages generated by their browser. In this case, the inline form error messages are only displayed after the HTML5 validation errors have been resolved. 
ifrik’s picture

Status: Needs work » Needs review
Issue tags: +Documentation
FileSize
2.24 KB
2.81 KB

I've made a patch.

BarisW’s picture

Status: Needs review » Needs work
+++ b/core/modules/inline_form_errors/inline_form_errors.info.yml
@@ -1,6 +1,6 @@
+description: 'Places error messages adjacent to form inputs, for improved usability and acessibility.'

acessibility > accessibility

ifrik’s picture

Status: Needs work » Needs review
FileSize
2.81 KB
621 bytes

I fixed the typo in the description.

BarisW’s picture

Status: Needs review » Reviewed & tested by the community
dmsmidt’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Novice

I'm very pleased to see this progress.
The documentation on DO is very nice now, thanks all!

Some last remarks:

  1. +++ b/core/modules/inline_form_errors/inline_form_errors.module
    @@ -15,7 +15,13 @@ function inline_form_errors_help($route_name, RouteMatchInterface $route_match)
    +      $output .= '<p>' . t('The Inline Form Errors module makes it easier for users to identify at which error needs to be resolved by providing a summary of all errors and by placing the individual error messages next to the form elements themselves. For more information, see the <a href=":inline_form_error">online documentation for the Inline Form Errors module</a>.', [':inline_form_error' => 'https://www.drupal.org/docs/8/core/modules/inline-form-errors']) . '</p>';
    

    Remove 'at'.
    Maybe say: 'which error(s)' instead of 'which error'.

    I'm also missing the words 'usability' and 'accessibility', like we use them in the module.info description.

  2. +++ b/core/modules/inline_form_errors/inline_form_errors.module
    @@ -15,7 +15,13 @@ function inline_form_errors_help($route_name, RouteMatchInterface $route_match)
    +      $output .= '<dd>' . t('If a user does not fill in a form element correctly (for example by not filling out a required field), then a warning message with links to each individual form element is displayed at the top of the form. The individual error messages are displayed next to each form element.') . '</dd>';
    

    The example is about one error, the summary about multiple. Let's get those two in line.

    'If a user does not fill in a form elements correctly (for example by not filling out a required fields), then a warning message with links to each individual form element is displayed at the top of the form. The individual error messages are displayed next to each form element.'

pk188’s picture

Status: Needs work » Needs review
FileSize
2.81 KB

Fixed 1 of #26.
Didn't understand 2 of #26.

shashikant_chauhan’s picture

Added patch for point 2 of #26.

andrewmacpherson’s picture

Thanks pk188 and shashikant_chauhan.

Patch #27 didn't provide an interdiff, but I can confirm it addressed #26 part 1:

Remove 'at'.
Maybe say: 'which error(s)' instead of 'which error'.

Patch #28 did exactly what was asked in #26 part 2, but the grammar isn't quite right. It should say:

(for example by not filling out a required fields)

New patch attached.

pk188’s picture

Any updates on this issue?

volkswagenchick’s picture

Thanks for all the work on this module!

Patch #29 looks good, but I have a couple of nitpicks.

  1. +++ b/core/modules/inline_form_errors/inline_form_errors.module
    @@ -15,7 +15,13 @@ function inline_form_errors_help($route_name, RouteMatchInterface $route_match)
    +      $output .= '<p>' . t('The Inline Form Errors module makes it easier for users to identify which error(s) needs to be resolved by providing a summary of all errors and by placing the individual error messages next to the form elements themselves. For more information, see the <a href=":inline_form_error">online documentation for the Inline Form Errors module</a>.', [':inline_form_error' => 'https://www.drupal.org/docs/8/core/modules/inline-form-errors']) . '</p>';
    

    Should the word "see" be replaced with "visit" to accommodate users with vision issues?

  2. +++ b/core/modules/inline_form_errors/inline_form_errors.module
    @@ -15,7 +15,13 @@ function inline_form_errors_help($route_name, RouteMatchInterface $route_match)
    +      $output .= '<dd>' . t('In browsers that support HTML5 form validation, users will first see the error messages generated by their browser. In this case, the inline form error messages are only displayed after the HTML5 validation errors have been resolved.') . '</dd>';
    

    Should the word "see" be replaced with "visit" to accommodate users with vision issues?

andrewmacpherson’s picture

Re: #31

Should the word "see" be replaced with "visit" to accommodate users with vision issues?

No. Generally it's OK to use everyday language like this; many style guides (etc) from disability organisations recommend it. For more info, see:

dmsmidt’s picture

Assigned: lplp » Unassigned
FileSize
1.41 KB
2.8 KB

Thanks @andrew for clarifying that.

I've a final nit fixed in this patch, if agreed upon I think we can RTBC this again.

ifrik’s picture

The bracketed "error(s)" made the text less readable because it would require the verb in two different forms as well, so therefore it should be avoided in help texts like this where the goal is to give the user a fast understanding of what the module does. "One or more errors" would be the better way, if we really want to bring across that's it can be either, but in this case and context simply saying "errors" is a sufficiently clear option.

And while I was on it: I use the original patch name again because as long as we are building on somebody else's work, it is simply bad form to rename the patches - even if that's what your software might automatically do...

dmsmidt’s picture

Status: Needs review » Reviewed & tested by the community

@ifrik, thanks I was struggling with that sentence as well. It seems enough people have looked at this now after is was initially RTBC-ed.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 34: 2888189-34-ife_help.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

xjm’s picture

Fail was https://www.drupal.org/pift-ci-job/721893 (edit: #2891911: Random fail in Drupal\Tests\locale\Functional\LocaleTranslationUiTest::testStringTranslation).

However, there is a coding standards issue also shown there:

core/modules/inline_form_errors/inline_form_errors.module
line 19	Concat operator must be surrounded by a single space
martin107’s picture

Status: Needs work » Needs review
FileSize
2.8 KB
638 bytes

coding standard issue resolved.

xjm’s picture

I don't think the interdiff is right, but the patch itself seems to be. :)

xjm’s picture

Status: Needs review » Reviewed & tested by the community

Since this was just a coding standards fix and https://www.drupal.org/pift-ci-job/721917 shows it is indeed resolved, this can be back at RTBC.

xjm’s picture

Status: Reviewed & tested by the community » Needs work

Okay, and now my committer review:

+++ b/core/modules/inline_form_errors/inline_form_errors.module
@@ -15,7 +15,13 @@ function inline_form_errors_help($route_name, RouteMatchInterface $route_match)
+      $output .= '<dd>' . t('If a user wrongly fills in form elements (for example by forgetting required fields), then a warning message with links to each individual form element is displayed at the top of the form. The individual error messages are displayed next to each form element.') . '</dd>';

I think this sentence needs work for two reasons:

  • "Wrongly" is a bit emotionally loaded. "Incorrectly" or "Invalidly" might be better choices.
  • It makes it sound like it means "If a user mistakenly entered something in a form field they should have left blank" (especially confusing with the parenthetical following) instead of "If a user entered something that's invalid or incorrect".

So, maybe it would be better to say something like:

If a user makes invalid entries in form elements...

Please feel free to improve that suggestion. :) Edit: I guess "entries" also implies that they filled out the fields, which is also confusing with the parenthetical. :) So please do improve on my suggestion.

The rest of the text looks good to me.

Thanks all!

xjm’s picture

"Fills out form elements in an invalid way" maybe?

xjm’s picture

Aside: I learned something new from #32; thanks @andrewmacpherson for those references!

ifrik’s picture

Good point - users should not be blamed, but also "invalid" is a rather technical wording.

So how about this?
"If not all form elements are filled in correctly (for expample if a required field is left blank), then a warning message with links to each individual form element is displayed at the top of the form. The individual error messages are displayed next to each form element."

ifrik’s picture

Status: Needs work » Needs review
FileSize
2.8 KB
1.52 KB

Changed the wording as proposed. I've also changed the patch name back to avoid confusion.

martin107, thanks for fixing the coding standard. In general, it is better to keep the original patch name because then it obvious that the next patch is a based on the previous one, and not something different or starting from scratch.

xjm’s picture

Thanks @ifrik. I like #44; removing "forgetting" is also a good improvement.

The sentence is getting a bit grammatically complicated though. Maybe:

When a form is not filled in correctly (for example, if a required field is left blank), a warning message with a link to each form element is displayed at the top of the form. The individual error messages are displayed next to each form element.

xjm’s picture

Or:

When a form is not filled in correctly (for example, if a required field is left blank), a warning message is displayed at the top of the form. This message links to the affected form elements, and individual error messages are displayed next to each form element.

andrewmacpherson’s picture

I like #47 too, so here's an updated patch.

dmsmidt’s picture

Status: Needs review » Reviewed & tested by the community

I'm no native speaker so I wont be judging grammar, I assume @andrew took care of that when accepting #48.
#48 implements #47 correctly, the wording is not too technical anymore and not emotionally loaded.
All issues seem to be resolved.

  • xjm committed 985736c on 8.4.x
    Issue #2888189 by ifrik, andrewmacpherson, dmsmidt, oadaeh, martin107,...
xjm’s picture

Status: Reviewed & tested by the community » Fixed

Alright, this looks good! Thanks @andrewmacpherson, @dmsmidt, and @ifrik.

Thanks @shashikant_chauhan for submitting a patch earlier. In this case I did not grant issue credit for #28 because the change was very small and made the sentence grammatically incorrect. Next time, for a better chance of receiving issue credit, I suggest carefully reading the patch you're updating and seeing what other changes might be needed for the update you make. You can help more by reading the whole issue carefully and participating in the overall discussion. I suggest the same for @pk188 as well.

I applied the patch and read the help page as a whole on an installed site. I also read over the updated documentation at https://www.drupal.org/docs/8/core/modules/inline-form-errors/inline-for... -- it's really nicely done! Great work, everyone. I also credited people who helped with the handbook page.

We're getting really close to the feature being stable. Yay!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.