Skip to content

Commit

Permalink
No need to instantiate the element here
Browse files Browse the repository at this point in the history
Additional fix for #16254
  • Loading branch information
brandonkelly committed Dec 2, 2024
1 parent d4ae5d8 commit eff6671
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/models/FieldLayout.php
Original file line number Diff line number Diff line change
Expand Up @@ -794,12 +794,10 @@ public function getCardBodyFields(?ElementInterface $element): array
public function getCardBodyAttributes(): array
{
$cardViewValues = $this->getCardView();
/** @var ElementInterface $elementType */
$elementType = new ($this->type);

// filter only the selected attributes
$attributes = array_filter(
$elementType::cardAttributes(),
$this->type::cardAttributes(),
fn($cardAttribute, $key) => in_array($key, $cardViewValues),
ARRAY_FILTER_USE_BOTH
);
Expand Down

0 comments on commit eff6671

Please sign in to comment.