Skip to content

Commit

Permalink
Update ElementContentExtension.php
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz-sauer-13 committed Jul 13, 2023
1 parent 97f4a04 commit a0c26dc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Extensions/ElementContentExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,13 @@ public function updateCMSFields(FieldList $fields): FieldList
/*As long as no Layout is selected, all Fields will be removed*/
$fields->removeByName($field);
if (!$fields->dataFieldByName($field)) {
$fields->removeByName($field);
$field = str_replace('ID', '', $field);
$fields->removeByName($field);
}
} else {
if (!$this->getConfigVariable('Layouts', $this->owner->ElementStyle)['FieldsVisible'][$field]) {
$fields->removeByName($field);
$field = str_replace('ID', '', $field);
$fields->removeByName($field);
}
Expand Down

0 comments on commit a0c26dc

Please sign in to comment.