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