The error message of a required field with multiple values does not include the field name.

if ($element['#required'] && $value == '_none')  {
  form_error($element, t('!name field is required.', array('!name' => $element['#title'])));
  return;
}

The field module empties $element['#title'] in the function field_multiple_value_form, so there is no title for the message.

Comments

tucho’s picture

I have made a patch to replace the title with the label of the instance, when this occurs.

tucho’s picture

Status: Active » Needs review

Changed to needs review

arled’s picture

This patch needs re-rolling

arled’s picture

Re-rolling this patch against version: version = "7.x-1.6+42-dev"

stborchert’s picture

Status: Needs review » Fixed

Thanks for your contribution.
I've committed a slightly modified version of your patch to latest dev.

  • stBorchert committed 427282a on 7.x-1.x authored by tucho
    Issue #2320093 by tucho, arled: SHS for required field with mutiple...

Status: Fixed » Closed (fixed)

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