Merge pull request #9905 from christopherdarling/patch-20

BUG fieldNameError() references invalid $this->form
This commit is contained in:
Guy Sartorelli 2022-07-07 20:29:38 +12:00 committed by GitHub
commit 3e85c4dc5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -155,11 +155,11 @@ class FieldList extends ArrayList
*/ */
protected function fieldNameError(FormField $field, $functionName) protected function fieldNameError(FormField $field, $functionName)
{ {
if ($this->form) { if ($field->getForm()) {
$errorSuffix = sprintf( $errorSuffix = sprintf(
" in your '%s' form called '%s'", " in your '%s' form called '%s'",
get_class($this->form), get_class($field->getForm()),
$this->form->getName() $field->getForm()->getName()
); );
} else { } else {
$errorSuffix = ''; $errorSuffix = '';