It seems that when a user hits the submission_limit for a webform block they will not get a "You may not submit another entry at this time." message either in the block body or in global $messages. Is this the expected behavior? Is there any way to enable or configure this?

Currently, when a user hits the webform submission limit, they see an empty webform block. Or webform node title & body, with no form (depending on the block settings). It would be nice for the user to see some kind of message.

Comments

MattDanger’s picture

Issue summary: View changes
Sylense’s picture

I wondered the same thing. My simple solution was just to use jQuery to check to see if the form existed. If not, then it displays a message.

DanChadwick’s picture

Version: 7.x-3.20 » 7.x-4.x-dev
Category: Support request » Bug report

This seems to be intentional behavior. There is an explicit test in the theme function for messages that inhibits error messages unless the webform is being displayed as a page. I presume this is to prevent cluttering up the messages on a busy page that has many blocks.

@quicksketch -- what is the desired behavior for when a webform block has an error? Should we perhaps move all these error messages to be within the block itself, rather than displayed through drupal_set_message()?

Changing this to a bug report because this doesn't seem right.

DanChadwick’s picture

Status: Active » Closed (works as designed)

This is the intended behavior. If the form itself fails "prevalidation" -- i.e. it should not be shown, then the block is not displayed and there is no message. If the form passes prevalidation but fails validation (e.g. a required component is not filled out), then the message is shown.

I believe the idea is to not clutter up the message display with a bunch of messages about a form that the user can't even see.

I'm closing this but if you feel there is a compelling reason why some other behavior is better, feel free to re-open.

mtoscano’s picture

Status: Closed (works as designed) » Active

I re-open this issue, instead of creating a new one because it is exactly the same scenario I am facing and I think the expected behaviour should be to display a message on the webform block if the total number of submission has been reached, otherwise people will still see the block title and description, but not the form and is not clear why.
How can this behaviour be incorporated? How can we otherwise accomplish it (for example via jQuery)?
Tx

anand.toshniwal93’s picture

Assigned: Unassigned » anand.toshniwal93
anand.toshniwal93’s picture

Assigned: anand.toshniwal93 » Unassigned
jay-dee-ess’s picture

Related: previous submission messages also do not appear if set to do so.

DanChadwick’s picture

Status: Active » Closed (works as designed)

The current behavior is the "desired" behavior, which might not meet your use case. When the form cannot be submitted, the block is not shown at all to avoid "teasing" the user with something they can't submit. As an example, you might have several (or many) webform blocks on a page. It might not even be clear to which block the message would apply.

I suggest you make a small webform add-on module to address this use case. You could also create a new issue with a feature, but at this point, I'm not sure webform has sufficient maintainers to add new features.

Therefore reverting to the status from 2 years ago