Problem/Motivation

If there are several status and/or error messages shown on the same page, they are often not in any reasonable order. The order messages are thrown is sometimes not the order the processes logically take place. This is especially true, when other modules plug in via a hook and throw additional messages.

This usability problem is especially severe when there are both status and error messages: First the status messages are bundled to a list, then the bundle of error messages follows separately. While this looks pretty and clean, it would often make a lot more sense to have the messages in a logical ordering.

A good example is the admin/build/modules page. Just take a look at the enclosed picture and you see what I mean. This is really confusing!

Think this is a usability bug to be fixed. I'm waiting for some input, before supplying a patch.

Steps to reproduce

Proposed resolution

Options from Usability Meeting, #23.

A. Either mark as won't fix

or

B. Group the message by priority, show them in the order error, warning, status (same as on the site status report). See #5

-- Original proposal --
To fix this I propose:

  • To add a weight key to drupal_set_message(), so messages can be logically ordered.
  • To only bundle status messages with the same weight to a list, to avoid a logical connection being suggested that doesn't exist. Messages with different weights should be displayed one by one.
  • Not to keep status, warning, and error messages together, but to line them up intermixed.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Pancho’s picture

FileSize
23.3 KB

Forgot the picture...

The expected order would have been:

  • STATUS: The configuration options have been saved.
  • STATUS: Database tables for the Copyright module have been successfully installed. (inserted by a module's _install hook)
  • ERROR: Inserting standard licenses failed (inserted by a module's _install hook)
  • WARNING: No information is available about [...] can take a long time, so please be patient. (inserted by update_status module)

The first message could be given a weight of -10 (or even -100) to make sure it is always the first message.
The last message could be given a weight of 10 (or even 100) to make sure it is shown after more contextual messages.

Pancho’s picture

Version: 6.x-dev » 7.x-dev

Moving this to D7 queue

Sutharsan’s picture

Component: base system » usability

Moving all usability issues to Drupal - component usability.

gzfelix’s picture

Component: usability » base system

If adding a $weight, does it add another layer of complexity to drupal_set_message?
For usability, a message related to a specific widget on the page should actually be displayed alongside a widget on the page, such as beside a text field or a select list. However, the current drupal_set_message is not able to do so. If implementing $weight, the order of messages is going to depend on an arbitrary number, which is a bad solution.

Current drupal_set_message stores messages in a queue, so messages are shown first-come-first-serve. Unless we plan to get the call stack to maintain a certain order of the messages, I don't think the issue is going to be resolved.

yoroy’s picture

Version: 7.x-dev » 8.x-dev
Issue tags: +Usability

From a ux point of view, I'd expect messages to be sorted on cardinality: errors first, then warnings, then status.
Currently not the case:

webstandards’s picture

Issue summary: View changes
Issue tags: +Accessibility

Tagging this accessibility.
We got dinged on WCAG Accessibility testing for "the list of errors are wrongly not in the same order as the order of the fields". In testing we found users disoriented by the seemingly random sequence of the errors in relation of the sequence of the form (which describes the general Usability problem) however for people with Cognitive disabilities this adds an additional unnecessary level of confusion and disorientation. Relevant sections of WCAG 2.0 include 1.3.2 "Meaningful Sequence" and 3.3.1 "Error Identification".

mgifford’s picture

Version: 8.0.x-dev » 8.1.x-dev
Related issues: +#1493324: Inline form errors for accessibility and UX

Just adding a related issue. Form errors are going to get a lot better soon I think.

It should make it much easier for people to identify what to fix.

WCAG requirements 1.3.2 & 3.3.1 are both WCAG 2.0 A level requirements, but usually issues around cognitive disabilities are AAA.

I can see some advantages to being able to weight the errors, but not sure how often this is likely to come up.

I do like @yoroy point of ordering by cardinality.

mgifford’s picture

Status: Active » Postponed
mgifford’s picture

Status: Postponed » Active

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

yoroy’s picture

Issue tags: +ux-hierarchy

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

pameeela’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: +Bug Smash Initiative, +Needs issue summary update

drupal_set_message() is deprecated so at the very least this needs an issue summary update.

But do we think this is still worth pursuing? Lack of replies suggests there isn't much interest, and I don't think it's a bug but rather a feature request or a task.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

benjifisher’s picture

We discussed this issue at #3220445: Drupal Usability Meeting 2021-06-25.

The original suggestion of providing an optional weight parameter does not seem like it would solve the problem. The code that creates the message does not know what other messages are being generated, so it is not the right place to make that decision.

We agree with #20: there seems to be a lack of interest in this issue. We recommend either closing the issue (won't fix) or rewriting it to follow the suggestion in #5. That is, keep the messages grouped by priority, but show them in the order error, warning, status (same as on the site status report).

quietone’s picture

Issue summary: View changes
Issue tags: -Needs issue summary update

Updated the IS with the options.

It is now time to decide on option A or B in the proposed resolution. What do you think?

pameeela’s picture

I vote won't fix, at least as the issue is currently framed. I have had this in mind since I found the issue last year and have concluded it isn't the case that we should *always* show an error first.

Example: on a site that has pending security updates, an error message appears on *every page*. In this scenario, currently a success message appears before the error, which in my opinion is correct. The success message is new information and it's gone on subsequent page loads. There might be several of these persistent errors on a site and if you showed the success message after these, it could be buried and even difficult to spot.

I can't actually think of a way to produce both an error and a success message *from the same action* as shown in the original IS. I propose that if there are situations where this is possible, and it still is the case that errors come last, we should identify them individually and see if there is logical improvement.

pameeela’s picture

Also thanks @benjifisher and the UX folks for taking the time to consider this!

larowlan’s picture

Messages go through the theme layer too, so sites can already opt to do this if they want

So I vote for won't fix too

I also feel this is a feature request rather than a bug

benjifisher’s picture

Messages go through the theme layer too

If you think that #5 is a good idea (display errors first) then this issue could be moved to the theme system (or the individual core themes).

larowlan’s picture

Sorry, I was pointing out that if a site felt particularly strongly about the order messages should show in, then it can implement custom ordering in the theme, i.e. there are ways to customise this already and therefore another vote for option A

pameeela’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

OK I'm going to go ahead and close. I don't think it's viable as a feature request in broad form given the example I provided. Plus @larowlan pointed out that it can be controlled in the theme anyway so folks can opt to go there if they want.

If there are scenarios that can produce the same output as in the OP, let's create a new ticket to address them.

AaronMcHale’s picture

Just to add to what's been said, during the UX Call I brought up the idea that a site could decide to completely change how status messages are handled, they might decide to take the "notification toasts" approach, where messages appear as a floating element in the corner, and use Ajax to fetch them on a recurring basis, thereby meaning the order would then be first-come-first-serve.

So absolutely agree that this is a won't fix and with what has been said.