From f1e5c72e43375e6137b984c90a96f7cf331591ff Mon Sep 17 00:00:00 2001 From: Christopher Darling Date: Wed, 31 Mar 2021 14:55:50 +0100 Subject: [PATCH] BUG fieldNameError() references invalid $this->form FieldList references `$this->form` which doesn't exist from what I can see. I presume this should have been `$field->getForm()`. However, please note that I came across this when looking for something unrelated and haven't tested this PR. --- src/Forms/FieldList.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Forms/FieldList.php b/src/Forms/FieldList.php index 5ec25798a..695c6ca5c 100644 --- a/src/Forms/FieldList.php +++ b/src/Forms/FieldList.php @@ -155,11 +155,11 @@ class FieldList extends ArrayList */ protected function fieldNameError(FormField $field, $functionName) { - if ($this->form) { + if ($field->getForm()) { $errorSuffix = sprintf( " in your '%s' form called '%s'", - get_class($this->form), - $this->form->getName() + get_class($field->getForm()), + $field->getForm()->getName() ); } else { $errorSuffix = '';