Fixed Non-filled required custom fields do not report the custom field title

Xon

Well-known member
Affected version
2.1.9
In XF\CustomField\Set::set; the isValid reports the failed custom field. But if the field is required and doesn't trip the validation check, then a generic "Please enter a value for all required fields." is reported without actually reporting the required field(s).

PHP:
$valid = $field->isValid($value, $error, $existingValue);
if (!$valid)
{
   if (!$ignoreInvalid)
   {
      $this->entity->error("{$field->title}: $error", "custom_field_$fieldId");
   }
   return false;
}

if ($field->isRequired($editMode) && ($value === '' || $value === []))
{
   if (!$ignoreInvalid)
   {
      $this->entity->error(\XF::phraseDeferred('please_enter_value_for_all_required_fields'), "custom_field_$fieldId");
   }
   return false;
}

The field title is there, just a horrible error message.
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.1.10).

Change log:
Display field name in required custom field error message
There may be a delay before changes are rolled out to the XenForo Community.
 
Top Bottom