Skip to content
This repository has been archived by the owner on Sep 25, 2024. It is now read-only.

Testing/content collection #125

Draft
wants to merge 5 commits into
base: reference
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -706,8 +706,7 @@ protected function buildContentTab(FieldItemListInterface $items, $delta, array
$content_types_options = $this->indexHelper->getNodeTypes();
$allowed_content_types = $settings['content']['internal']['contentTypes']['allowed_values'];
if (!empty($allowed_content_types)) {
$content_types_options = array_intersect_key($content_types_options,
array_flip($allowed_content_types));
$content_types_options = array_intersect_key($allowed_content_types, $content_types_options);
}
$element['tabs']['content']['contentTypes'] = [
'#type' => 'checkboxes',
Expand Down
18 changes: 18 additions & 0 deletions modules/tide_content_collection/tide_content_collection.install
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,21 @@ function _assign_content_collection_perm_site_admin() {
$role->save();
}
}

/**
* Add event and publication to content collection.
*/
function tide_content_collection_update_10000() {
$config_factory = \Drupal::configFactory();
$config = $config_factory->getEditable('core.entity_form_display.paragraph.content_collection_enhanced.default');
$allowed_content_types = [
'landing_page' => 'Landing Page',
'publication' => 'Publication',
'news' => 'News',
'event' => 'Events',
];
if ($config) {
$config->set('content.field_content_collection_config.settings.content.internal.contentTypes.allowed_values', $allowed_content_types);
$config->save();
}
}
Loading