Skip to content

Commit

Permalink
BUG fieldNameError() references invalid $this->form
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
christopherdarling authored Mar 31, 2021
1 parent 66fa597 commit f1e5c72
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Forms/FieldList.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,11 @@ public function dataFieldNames()
*/
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 = '';
Expand Down

0 comments on commit f1e5c72

Please sign in to comment.