Skip to content

Commit

Permalink
FIX Avoid infinite recursive loop with attributes in schemadata
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Nov 15, 2024
1 parent 656598a commit d6bc04c
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 15 deletions.
13 changes: 0 additions & 13 deletions src/StringTagField.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,19 +197,6 @@ protected function formatOptions($fieldValue)
return $formattedValue;
}

/**
* When not used in a React form factory context, this adds the schema data to SilverStripe template
* rendered attributes lists
*
* @return array
*/
public function getAttributes()
{
$attributes = parent::getAttributes();
$attributes['data-schema'] = json_encode($this->getSchemaData());
return $attributes;
}

/**
* @return string
*/
Expand Down
1 change: 0 additions & 1 deletion src/TagField.php
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,6 @@ public function getAttributes()
[
'name' => $name,
'style' => 'width: 100%',
'data-schema' => json_encode($this->getSchemaData()),
]
);
}
Expand Down
2 changes: 1 addition & 1 deletion templates/SilverStripe/TagField/TagField.ss
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<div $AttributesHTML></div>
<div $AttributesHTML data-schema="$SchemaData.JSON"></div>

0 comments on commit d6bc04c

Please sign in to comment.