theme_webform_view_messages() generates a bunch of messages, such as "Submissions for this form are closed". Most of these are status (green), but I think that more of these should be errors (red). If the user cannot complete the form, it should be error, such as form closed, lacking permission, or maximum entries received. It should be green for messages that the user can complete it if they login.
If you agree, I will write a patch.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | webform-messages_as_errors-1958014-5.patch | 1.36 KB | danchadwick |
Comments
Comment #1
danchadwick commentedIn some situations, this might be normal operation, such as viewing a webform node that is currently closed.
I would suggest that these be warning -- sort of a middle ground.
Comment #2
danchadwick commentedI'm proposing the following changes.
Webform is closed or when no roles are allowed to submit it:
Submissions for this form are closed.
status -> warning
Not logged in and need to be:
You must login [or register] to view this form.
status -> warning
Doesn't have the proper role:
You do not have permission to view this form
error -> (no change)
User limits:
You have submitted this form the maximum number of times
You have already submitted this form
You may not submit another entry at this time
error -> (no change)
Webform limits:
This form has received the maximum number of entries
You may not submit another entry at this time
status-> error
Submitted before:
[You have already submitted this form] View your previous submissions
status -> (no change)
An issue is that the last message is appended to the end of one of the above ones, all of which would be warnings or errors. Maybe it should instead add another status message, rather than appending.
Comment #3
liam morlandThat makes sense to me. Would you like me to write a patch?
Comment #4
danchadwick commented@Liam - Thanks but, I'll tend to it, unless quicksketch has other thoughts.
I also think these should be $repeat == FALSE. I'm pretty sure I've gotten the "View your previous submissions" both on its own and at the end of a message at the same time.
Comment #5
danchadwick commentedI did not like how the extra message looked as separate, so I left the extra message as part of the existing message, event if the main message is a warning or error.
Committed to 7.x-4.x and 8.x.
My apologies to Liam. I had forgotten that you had commit access. I didn't mean to usurp this issue from you.