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.
This commit is contained in:
Christopher Darling 2021-03-31 14:55:50 +01:00 committed by GitHub
parent 66fa597b3b
commit f1e5c72e43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -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 = '';