Problem/Motivation

A recently committed change #1493324: Inline form errors for accessibility and UX moves error messages to the fields. Those errors are not returned by drupal_get_messages() which google_analytics.module uses to send tracked errors to google analytics. Unless there is some way to extract those errors from the links in the error message, we can't know about these errors when forming our message to send to google analytics.

Proposed resolution

Either convince people to include those field errors to be returned by drupal_get_messages or find another solution to get the errors attached to fields.

Remaining tasks

Send errors attached to fields to google analytics again, provide patch, commit it.

User interface changes

None / More detailed information about errors

API changes

None

Data model changes

None

Comments

crasx’s picture

The patch that broke this was added to fix a huge accessibility issue and afaik there is no way to disable this functionality.

My recommendation would be to add ga events for form error messages instead of drupal event messages (or in addition to it). This could be targeted in places like the login form, or all forms. Either way drupal's messages won't be of much use for tracking form errors now and you shouldn't push people to use drupal_set_message instead of the form system because that patch is a huge win for people with disabilities.

alexpott’s picture

Also what about html5 fields not ever hitting the back end and therefore not possibly ending up in drupal_get_messages() - or anywhere else.

hass’s picture

Is there any way to run a JS callBack function for HTML5 elements that don't validate and provide the browser error text to JS? It looks like the new system has only "errors" and no longer info and warnings.

LKS90’s picture

Status: Active » Closed (duplicate)

Closing as duplicate, the other issue has a patch with some code from hass that works: https://www.drupal.org/node/2506827#comment-10049712

hass’s picture

It does not have a solution for html5 form errors and no solution for warnings and info messages.