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
Comment | File | Size | Author |
---|---|---|---|
#25 | Screen Shot 2021-06-26 at 10.19.21 AM.png | 34.45 KB | pameeela |
#1 | unordered messages.png | 23.3 KB | Pancho |
Comments
Comment #1
PanchoForgot the picture...
The expected order would have been:
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.
Comment #2
PanchoMoving this to D7 queue
Comment #3
Sutharsan CreditAttribution: Sutharsan commentedMoving all usability issues to Drupal - component usability.
Comment #4
gzfelix CreditAttribution: gzfelix commentedIf 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.
Comment #5
yoroy CreditAttribution: yoroy commentedFrom a ux point of view, I'd expect messages to be sorted on cardinality: errors first, then warnings, then status.
Currently not the case:
Comment #6
webstandards CreditAttribution: webstandards commentedTagging 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".
Comment #7
mgiffordJust 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.
Comment #8
mgiffordComment #9
mgiffordComment #11
yoroy CreditAttribution: yoroy commentedComment #20
pameeela CreditAttribution: pameeela commenteddrupal_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.
Comment #23
benjifisherWe 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).
Comment #24
quietone CreditAttribution: quietone as a volunteer commentedUpdated the IS with the options.
It is now time to decide on option A or B in the proposed resolution. What do you think?
Comment #25
pameeela CreditAttribution: pameeela commentedI 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.
Comment #26
pameeela CreditAttribution: pameeela commentedAlso thanks @benjifisher and the UX folks for taking the time to consider this!
Comment #27
larowlanMessages 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
Comment #28
benjifisherIf 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).
Comment #29
larowlanSorry, 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
Comment #30
pameeela CreditAttribution: pameeela commentedOK 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.
Comment #31
AaronMcHaleJust 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.