Skip to content

Commit

Permalink
[SRM-813] Fixes a layout issue for publications
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-gao committed May 29, 2023
1 parent fe4ad5b commit 101180a
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,24 +187,21 @@ third_party_settings:
region: content
weight: -61
group_publication_metadata:
label: 'Publication metadata'
format_type: html_element
format_settings:
open: true
collapsible: false
element: div
show_label: false
label_element: h3
label_element_classes: ''
required_fields: true
attributes: ''
classes: 'seven-details js-form-wrapper form-wrapper seven-details__wrapper details-wrapper'
children:
- field_license_type
- field_publication_date
- field_publication_authors
label: ''
region: content
parent_name: ''
weight: -80
format_type: fieldset
format_settings:
classes: ''
show_empty_fields: true
id: ''
description: ''
required_fields: true
id: node.publication.default
targetEntityType: node
bundle: publication
Expand Down
31 changes: 31 additions & 0 deletions tide_publication.install
Original file line number Diff line number Diff line change
Expand Up @@ -1025,3 +1025,34 @@ function tide_publication_update_8014() {
}
}
}

/**
* Update Publication metadata group to use fieldset.
*/
function tide_publication_update_8015() {
/** @var \Drupal\Core\Entity\Display\EntityFormDisplayInterface $form_display */
$form_display = EntityFormDisplay::load('node.publication.default');
$field_group = $form_display->getThirdPartySettings('field_group');
$group_settings = [
'label' => '',
'format_type' => 'fieldset',
'format_settings' => [
'show_empty_fields' => FALSE,
'id' => '',
'description' => '',
'required_fields' => TRUE,
'classes' => '',
],
'children' => [
'field_license_type',
'field_publication_date',
'field_publication_authors',
],
'region' => 'content',
'weight' => -80,
];
if (isset($field_group['group_publication_metadata'])) {
$form_display->setThirdPartySetting('field_group', 'group_publication_metadata', $group_settings);
$form_display->save();
}
}

0 comments on commit 101180a

Please sign in to comment.