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.

Comments

danchadwick’s picture

Issue summary: View changes

In 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.

danchadwick’s picture

I'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.

liam morland’s picture

That makes sense to me. Would you like me to write a patch?

danchadwick’s picture

@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.

danchadwick’s picture

Version: 7.x-4.x-dev » 8.x-4.x-dev
Priority: Normal » Minor
Status: Active » Fixed
StatusFileSize
new1.36 KB

I 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.

  • Commit f551d42 on 7.x-4.x by DanChadwick:
    Issue #1958014 by Liam Morland, Dan Chadwick: Fixed some error messages...
  • Commit c74e13b on 8.x-4.x by DanChadwick:
    Issue #1958014 by Liam Morland, Dan Chadwick: Fixed some error messages...

Status: Fixed » Closed (fixed)

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