\Civi::dispatcher()->dispatch('civi.afform.validate', $event);
$errors = $event->getErrors();
if ($errors) {
+ \Civi::log('afform')->error('Afform Validation errors: ' . print_r($errors, TRUE));
throw new \CRM_Core_Exception(ts('Validation Error', ['plural' => '%1 Validation Errors', 'count' => count($errors)]), 0, ['validation' => $errors]);
}
$isRequired = $attributes['defn']['required'] ?? $fullDefn['required'] ?? FALSE;
if ($isRequired) {
- $label = $attributes['defn']['label'] ?? $fullDefn['label'];
+ $label = $attributes['defn']['label'] ?? $fullDefn['label'] ?? $fieldName;
return E::ts('%1 is a required field.', [1 => $label]);
}
return NULL;