This is a followup to #2953662: Only use count() on countables.

Warning: count(): Parameter must be an array or an object that implements Countable in _webform_edit_email() (line 64 of webform/components/email.inc).

This occurs when editing an email component where the value is "[current-user:mail]". The assumption that form_get_errors() will return an array (countable) is a reasonable one because of the documentation, but incorrect. See #2733299: Documentation and behavior mismatch in form_get_errors.

This patch fixes the ternary condition.

Comments

jacob.embree created an issue. See original summary.

liam morland’s picture

Status: Needs review » Fixed

Thanks!

Status: Fixed » Closed (fixed)

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

caschbre’s picture

StatusFileSize
new593 bytes

Just in case someone needs a patch that applies to 7.x-3.x...