From 530c8ca936fa6c78e62acd11b07e8d9ff9ccd34a Mon Sep 17 00:00:00 2001 From: Martin Leblanc Date: Wed, 5 Oct 2022 16:00:10 -0400 Subject: [PATCH 001/180] ISTWCMS-5862: removed the teaser logic and only load the date through the card header for news node --- src/Service/UwNodeContent.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/Service/UwNodeContent.php b/src/Service/UwNodeContent.php index 383d485..d7abe39 100644 --- a/src/Service/UwNodeContent.php +++ b/src/Service/UwNodeContent.php @@ -401,13 +401,7 @@ class UwNodeContent { // Setup the header content. if ($node_flags['get_header']) { - if ($view_mode == 'teaser') { - $content_data['header']['date'] = $this->addToContentData('date', 'field_uw_news_date'); - } - else { - $content_data['header']['date'] = $this->addToContentData('date', 'field_uw_news_date'); - $content_data['header']['author'] = $this->addToContentData('author', 'field_author'); - } + $content_data['header']['date'] = $this->addToContentData('date', 'field_uw_news_date'); } // Get the media. -- GitLab From f753d52f77946ca73a677581d0b97703b640e730 Mon Sep 17 00:00:00 2001 From: Igor Biki Date: Thu, 6 Oct 2022 18:31:20 -0400 Subject: [PATCH 002/180] ISTWCMS-5680: Adding webform pre save fix for ohana branch. --- .../UwWebformEventSubscriber.php | 53 +++++++++++++++++++ uw_cfg_common.services.yml | 4 ++ 2 files changed, 57 insertions(+) create mode 100644 src/EventSubscriber/UwWebformEventSubscriber.php diff --git a/src/EventSubscriber/UwWebformEventSubscriber.php b/src/EventSubscriber/UwWebformEventSubscriber.php new file mode 100644 index 0000000..d248672 --- /dev/null +++ b/src/EventSubscriber/UwWebformEventSubscriber.php @@ -0,0 +1,53 @@ + 'preSave', + ]; + } + + /** + * Entity pre save dispatched event. + * + * @param \Drupal\core_event_dispatcher\Event\Entity\EntityPresaveEvent $event + * Event object. + */ + public function preSave(EntityPresaveEvent $event): void { + $entity = $event->getEntity(); + + if ($entity->bundle() === 'webform') { + /** @var \Drupal\webform\Entity\Webform $entity */ + $access_rules = $entity->getAccessRules(); + + // Update webform submission access roles to be anonymous and + // authenticated. This will be done on EVERY webform save. + // Fixes migration issue with webforms. Once migration is updated and + // fixed, this code is no longer needed and can be removed. + $access_rules['create']['roles'] = [ + 'anonymous', + 'authenticated', + ]; + + $entity->setAccessRules($access_rules); + + // Setting default access denied handler. + $entity->setSetting('form_access_denied', WebformInterface::ACCESS_DENIED_PAGE); + } + } + +} diff --git a/uw_cfg_common.services.yml b/uw_cfg_common.services.yml index 28b61b8..f3b1041 100644 --- a/uw_cfg_common.services.yml +++ b/uw_cfg_common.services.yml @@ -45,3 +45,7 @@ services: uw_cfg_common.missing_blocks: class: Drupal\uw_cfg_common\Service\UWMissingBlocks arguments: ['@entity_type.manager', '@keyvalue.expirable', '@layout_builder.tempstore_repository'] + uw_cfg_common.webform.event_subscriber: + class: '\Drupal\uw_cfg_common\EventSubscriber\UwWebformEventSubscriber' + tags: + - { name: 'event_subscriber' } -- GitLab From 492e126fa128450a3d60b0203f8390fb446b44a0 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Thu, 6 Oct 2022 10:47:24 -0400 Subject: [PATCH 003/180] ISTWCMS-5865: adding workflows config to install hook so that features is happy --- uw_cfg_common.install | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/uw_cfg_common.install b/uw_cfg_common.install index 7ce88d6..bca7ef7 100644 --- a/uw_cfg_common.install +++ b/uw_cfg_common.install @@ -19,6 +19,16 @@ use Symfony\Component\Yaml\Yaml; */ function uw_cfg_common_install() { + // ISTWCMS-5865: this the attempt to fix features for our build. + // Moving the actual installing of workflows to here, so that + // we can include workflows as a dependency in our modules and + // that it will allow new site installs. + $name = 'workflows.workflow.uw_workflow'; + $path = \Drupal::service('extension.list.module')->getPath('uw_cfg_common') . '/config/custom/'; + $source = new FileStorage($path); + $active_storage = \Drupal::service('config.storage'); + $active_storage->write($name, $source->read($name)); + // Get the role ids for UW roles. $uw_rids = UwRoles::getUwRoleIds(); -- GitLab From 2fa90fbd2a3a83a11591735bd67969ad19b29237 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Thu, 6 Oct 2022 11:44:25 -0400 Subject: [PATCH 004/180] ISTWCMS-5865: adding workflows yml file --- .../custom/workflows.workflow.uw_workflow.yml | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 config/custom/workflows.workflow.uw_workflow.yml diff --git a/config/custom/workflows.workflow.uw_workflow.yml b/config/custom/workflows.workflow.uw_workflow.yml new file mode 100644 index 0000000..bde9c4e --- /dev/null +++ b/config/custom/workflows.workflow.uw_workflow.yml @@ -0,0 +1,106 @@ +langcode: en +status: true +dependencies: + config: + - node.type.uw_ct_blog + - node.type.uw_ct_catalog_item + - node.type.uw_ct_contact + - node.type.uw_ct_event + - node.type.uw_ct_expand_collapse_group + - node.type.uw_ct_news_item + - node.type.uw_ct_opportunity + - node.type.uw_ct_profile + - node.type.uw_ct_service + - node.type.uw_ct_sidebar + - node.type.uw_ct_site_footer + - node.type.uw_ct_web_page + module: + - content_moderation +id: uw_workflow +label: 'UW workflow' +type: content_moderation +type_settings: + states: + draft: + label: Draft + weight: -10 + published: false + default_revision: false + published: + label: Published + weight: -10 + published: true + default_revision: true + uw_wf_archived: + label: Archived + weight: -10 + published: false + default_revision: true + uw_wf_needs_review: + label: 'Needs Review' + weight: -10 + published: false + default_revision: false + uw_wf_unpublished: + label: Unpublished + weight: 0 + published: false + default_revision: true + transitions: + archived: + label: Archive + from: + - draft + - published + - uw_wf_archived + - uw_wf_needs_review + to: uw_wf_archived + weight: 3 + draft: + label: 'Create draft' + from: + - draft + - published + - uw_wf_archived + - uw_wf_needs_review + to: draft + weight: 0 + needs_review: + label: 'Submit for review' + from: + - draft + - published + - uw_wf_archived + - uw_wf_needs_review + to: uw_wf_needs_review + weight: 1 + published: + label: Publish + from: + - draft + - published + - uw_wf_archived + - uw_wf_needs_review + to: published + weight: 2 + unpublish: + label: Unpublish + from: + - uw_wf_unpublished + to: draft + weight: 4 + entity_types: + node: + - uw_ct_blog + - uw_ct_catalog_item + - uw_ct_contact + - uw_ct_event + - uw_ct_expand_collapse_group + - uw_ct_news_item + - uw_ct_opportunity + - uw_ct_profile + - uw_ct_service + - uw_ct_sidebar + - uw_ct_site_footer + - uw_ct_web_page + default_moderation_state: draft -- GitLab From ad1bb76d3a1fbb9869b6a20f33779b243a568048 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Wed, 12 Oct 2022 10:31:31 -0400 Subject: [PATCH 005/180] ISTWCMS-5865: more changes to make features happy --- .../layout_builder_styles.style.uw_lbs_carousel_1_item.yml | 1 - .../layout_builder_styles.style.uw_lbs_carousel_2_items.yml | 1 - .../layout_builder_styles.style.uw_lbs_carousel_3_items.yml | 1 - .../layout_builder_styles.style.uw_lbs_carousel_4_items.yml | 1 - .../layout_builder_styles.style.uw_lbs_contained_width.yml | 1 - ...layout_builder_styles.style.uw_lbs_contained_width_narrow.yml | 1 - .../layout_builder_styles.style.uw_lbs_contained_width_wide.yml | 1 - config/install/layout_builder_styles.style.uw_lbs_full_width.yml | 1 - 8 files changed, 8 deletions(-) diff --git a/config/install/layout_builder_styles.style.uw_lbs_carousel_1_item.yml b/config/install/layout_builder_styles.style.uw_lbs_carousel_1_item.yml index 3d18660..81b005f 100644 --- a/config/install/layout_builder_styles.style.uw_lbs_carousel_1_item.yml +++ b/config/install/layout_builder_styles.style.uw_lbs_carousel_1_item.yml @@ -5,7 +5,6 @@ id: uw_lbs_carousel_1_item label: 'Carousel - 1 item' classes: uw-carousel--one-item type: component -group: default weight: -10 block_restrictions: - 'inline_block:uw_cbl_facts_and_figures' diff --git a/config/install/layout_builder_styles.style.uw_lbs_carousel_2_items.yml b/config/install/layout_builder_styles.style.uw_lbs_carousel_2_items.yml index 21076bf..a438e8b 100644 --- a/config/install/layout_builder_styles.style.uw_lbs_carousel_2_items.yml +++ b/config/install/layout_builder_styles.style.uw_lbs_carousel_2_items.yml @@ -5,7 +5,6 @@ id: uw_lbs_carousel_2_items label: 'Carousel - 2 items' classes: uw-carousel--two-items type: component -group: default weight: -9 block_restrictions: - 'inline_block:uw_cbl_facts_and_figures' diff --git a/config/install/layout_builder_styles.style.uw_lbs_carousel_3_items.yml b/config/install/layout_builder_styles.style.uw_lbs_carousel_3_items.yml index a4e3440..973fc63 100644 --- a/config/install/layout_builder_styles.style.uw_lbs_carousel_3_items.yml +++ b/config/install/layout_builder_styles.style.uw_lbs_carousel_3_items.yml @@ -5,7 +5,6 @@ id: uw_lbs_carousel_3_items label: 'Carousel - 3 items' classes: uw-carousel--three-items type: component -group: default weight: -8 block_restrictions: - 'inline_block:uw_cbl_facts_and_figures' diff --git a/config/install/layout_builder_styles.style.uw_lbs_carousel_4_items.yml b/config/install/layout_builder_styles.style.uw_lbs_carousel_4_items.yml index 3576c28..985bf7d 100644 --- a/config/install/layout_builder_styles.style.uw_lbs_carousel_4_items.yml +++ b/config/install/layout_builder_styles.style.uw_lbs_carousel_4_items.yml @@ -5,7 +5,6 @@ id: uw_lbs_carousel_4_items label: 'Carousel - 4 items' classes: uw-carousel--four-items type: component -group: default weight: -7 block_restrictions: - 'inline_block:uw_cbl_facts_and_figures' diff --git a/config/install/layout_builder_styles.style.uw_lbs_contained_width.yml b/config/install/layout_builder_styles.style.uw_lbs_contained_width.yml index d68c387..916c632 100644 --- a/config/install/layout_builder_styles.style.uw_lbs_contained_width.yml +++ b/config/install/layout_builder_styles.style.uw_lbs_contained_width.yml @@ -5,7 +5,6 @@ id: uw_lbs_contained_width label: 'Extra-wide contained width' classes: uw-contained-width type: section -group: default weight: -4 block_restrictions: - 'inline_block:uw_cbl_call_to_action' diff --git a/config/install/layout_builder_styles.style.uw_lbs_contained_width_narrow.yml b/config/install/layout_builder_styles.style.uw_lbs_contained_width_narrow.yml index c120b5b..68c56dc 100644 --- a/config/install/layout_builder_styles.style.uw_lbs_contained_width_narrow.yml +++ b/config/install/layout_builder_styles.style.uw_lbs_contained_width_narrow.yml @@ -5,7 +5,6 @@ id: uw_lbs_contained_width_narrow label: 'Narrow contained width' classes: "uw-contained-width\r\nuw-contained-width--narrow" type: section -group: default weight: -6 block_restrictions: { } layout_restrictions: { } diff --git a/config/install/layout_builder_styles.style.uw_lbs_contained_width_wide.yml b/config/install/layout_builder_styles.style.uw_lbs_contained_width_wide.yml index 7f62da9..7303b56 100644 --- a/config/install/layout_builder_styles.style.uw_lbs_contained_width_wide.yml +++ b/config/install/layout_builder_styles.style.uw_lbs_contained_width_wide.yml @@ -5,7 +5,6 @@ id: uw_lbs_contained_width_wide label: 'Wide contained width' classes: "uw-contained-width\r\nuw-contained-width--wide" type: section -group: default weight: -5 block_restrictions: { } layout_restrictions: { } diff --git a/config/install/layout_builder_styles.style.uw_lbs_full_width.yml b/config/install/layout_builder_styles.style.uw_lbs_full_width.yml index 461e8dd..43689e4 100644 --- a/config/install/layout_builder_styles.style.uw_lbs_full_width.yml +++ b/config/install/layout_builder_styles.style.uw_lbs_full_width.yml @@ -5,7 +5,6 @@ id: uw_lbs_full_width label: 'Full width' classes: uw-full-width type: section -group: default weight: -3 block_restrictions: - 'inline_block:uw_cbl_call_to_action' -- GitLab From 1b342104421539660e2209a82bbce856ab629813 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Wed, 12 Oct 2022 14:26:56 -0400 Subject: [PATCH 006/180] ISTWCMS-5865: still trying to make features happy --- .../layout_builder_styles.style.uw_lbs_carousel_1_item.yml | 1 + .../layout_builder_styles.style.uw_lbs_carousel_2_items.yml | 1 + .../layout_builder_styles.style.uw_lbs_carousel_3_items.yml | 1 + .../layout_builder_styles.style.uw_lbs_carousel_4_items.yml | 1 + .../layout_builder_styles.style.uw_lbs_contained_width.yml | 1 + ...layout_builder_styles.style.uw_lbs_contained_width_narrow.yml | 1 + .../layout_builder_styles.style.uw_lbs_contained_width_wide.yml | 1 + config/install/layout_builder_styles.style.uw_lbs_full_width.yml | 1 + 8 files changed, 8 insertions(+) diff --git a/config/install/layout_builder_styles.style.uw_lbs_carousel_1_item.yml b/config/install/layout_builder_styles.style.uw_lbs_carousel_1_item.yml index 81b005f..ace0bf2 100644 --- a/config/install/layout_builder_styles.style.uw_lbs_carousel_1_item.yml +++ b/config/install/layout_builder_styles.style.uw_lbs_carousel_1_item.yml @@ -5,6 +5,7 @@ id: uw_lbs_carousel_1_item label: 'Carousel - 1 item' classes: uw-carousel--one-item type: component +group: null weight: -10 block_restrictions: - 'inline_block:uw_cbl_facts_and_figures' diff --git a/config/install/layout_builder_styles.style.uw_lbs_carousel_2_items.yml b/config/install/layout_builder_styles.style.uw_lbs_carousel_2_items.yml index a438e8b..87d18f3 100644 --- a/config/install/layout_builder_styles.style.uw_lbs_carousel_2_items.yml +++ b/config/install/layout_builder_styles.style.uw_lbs_carousel_2_items.yml @@ -5,6 +5,7 @@ id: uw_lbs_carousel_2_items label: 'Carousel - 2 items' classes: uw-carousel--two-items type: component +group: null weight: -9 block_restrictions: - 'inline_block:uw_cbl_facts_and_figures' diff --git a/config/install/layout_builder_styles.style.uw_lbs_carousel_3_items.yml b/config/install/layout_builder_styles.style.uw_lbs_carousel_3_items.yml index 973fc63..3f04717 100644 --- a/config/install/layout_builder_styles.style.uw_lbs_carousel_3_items.yml +++ b/config/install/layout_builder_styles.style.uw_lbs_carousel_3_items.yml @@ -5,6 +5,7 @@ id: uw_lbs_carousel_3_items label: 'Carousel - 3 items' classes: uw-carousel--three-items type: component +group: null weight: -8 block_restrictions: - 'inline_block:uw_cbl_facts_and_figures' diff --git a/config/install/layout_builder_styles.style.uw_lbs_carousel_4_items.yml b/config/install/layout_builder_styles.style.uw_lbs_carousel_4_items.yml index 985bf7d..550699c 100644 --- a/config/install/layout_builder_styles.style.uw_lbs_carousel_4_items.yml +++ b/config/install/layout_builder_styles.style.uw_lbs_carousel_4_items.yml @@ -5,6 +5,7 @@ id: uw_lbs_carousel_4_items label: 'Carousel - 4 items' classes: uw-carousel--four-items type: component +group: null weight: -7 block_restrictions: - 'inline_block:uw_cbl_facts_and_figures' diff --git a/config/install/layout_builder_styles.style.uw_lbs_contained_width.yml b/config/install/layout_builder_styles.style.uw_lbs_contained_width.yml index 916c632..9612387 100644 --- a/config/install/layout_builder_styles.style.uw_lbs_contained_width.yml +++ b/config/install/layout_builder_styles.style.uw_lbs_contained_width.yml @@ -5,6 +5,7 @@ id: uw_lbs_contained_width label: 'Extra-wide contained width' classes: uw-contained-width type: section +group: null weight: -4 block_restrictions: - 'inline_block:uw_cbl_call_to_action' diff --git a/config/install/layout_builder_styles.style.uw_lbs_contained_width_narrow.yml b/config/install/layout_builder_styles.style.uw_lbs_contained_width_narrow.yml index 68c56dc..62063e3 100644 --- a/config/install/layout_builder_styles.style.uw_lbs_contained_width_narrow.yml +++ b/config/install/layout_builder_styles.style.uw_lbs_contained_width_narrow.yml @@ -5,6 +5,7 @@ id: uw_lbs_contained_width_narrow label: 'Narrow contained width' classes: "uw-contained-width\r\nuw-contained-width--narrow" type: section +group: null weight: -6 block_restrictions: { } layout_restrictions: { } diff --git a/config/install/layout_builder_styles.style.uw_lbs_contained_width_wide.yml b/config/install/layout_builder_styles.style.uw_lbs_contained_width_wide.yml index 7303b56..c286b01 100644 --- a/config/install/layout_builder_styles.style.uw_lbs_contained_width_wide.yml +++ b/config/install/layout_builder_styles.style.uw_lbs_contained_width_wide.yml @@ -5,6 +5,7 @@ id: uw_lbs_contained_width_wide label: 'Wide contained width' classes: "uw-contained-width\r\nuw-contained-width--wide" type: section +group: null weight: -5 block_restrictions: { } layout_restrictions: { } diff --git a/config/install/layout_builder_styles.style.uw_lbs_full_width.yml b/config/install/layout_builder_styles.style.uw_lbs_full_width.yml index 43689e4..4aab26a 100644 --- a/config/install/layout_builder_styles.style.uw_lbs_full_width.yml +++ b/config/install/layout_builder_styles.style.uw_lbs_full_width.yml @@ -5,6 +5,7 @@ id: uw_lbs_full_width label: 'Full width' classes: uw-full-width type: section +group: null weight: -3 block_restrictions: - 'inline_block:uw_cbl_call_to_action' -- GitLab From 028a415f0a24449ec7017e0afa08971c15b0371a Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Thu, 13 Oct 2022 15:16:07 -0400 Subject: [PATCH 007/180] ISTWCMS-5865: adding project to workflows --- config/custom/workflows.workflow.uw_workflow.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/custom/workflows.workflow.uw_workflow.yml b/config/custom/workflows.workflow.uw_workflow.yml index bde9c4e..9351d03 100644 --- a/config/custom/workflows.workflow.uw_workflow.yml +++ b/config/custom/workflows.workflow.uw_workflow.yml @@ -10,6 +10,7 @@ dependencies: - node.type.uw_ct_news_item - node.type.uw_ct_opportunity - node.type.uw_ct_profile + - node.type.uw_ct_project - node.type.uw_ct_service - node.type.uw_ct_sidebar - node.type.uw_ct_site_footer @@ -99,6 +100,7 @@ type_settings: - uw_ct_news_item - uw_ct_opportunity - uw_ct_profile + - uw_ct_project - uw_ct_service - uw_ct_sidebar - uw_ct_site_footer -- GitLab From 9573cc3a2ac4537a444cd935de0e7ad4a7ee866b Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Thu, 13 Oct 2022 15:28:06 -0400 Subject: [PATCH 008/180] ISTWCMS-5865: adding update hook to make features happy --- uw_cfg_common.install | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/uw_cfg_common.install b/uw_cfg_common.install index bca7ef7..415955e 100644 --- a/uw_cfg_common.install +++ b/uw_cfg_common.install @@ -447,3 +447,14 @@ function uw_cfg_common_update_9104(&$sandbox) { $service->removeMissingBlocksFromUnsaved(); $service->removeMissingBlocksFromSaved(); } + +/** + * Feature revert for workflows. + */ +function uw_cfg_common_update_9105(&$sandbox) { + $name = 'workflows.workflow.uw_workflow'; + $path = \Drupal::service('extension.list.module')->getPath('uw_cfg_common') . '/config/custom/'; + $source = new FileStorage($path); + $active_storage = \Drupal::service('config.storage'); + $active_storage->write($name, $source->read($name)); +} -- GitLab From d41a21fd98c42a9504acdef29634c7e84d56b8b9 Mon Sep 17 00:00:00 2001 From: Igor Biki Date: Fri, 14 Oct 2022 10:39:42 -0400 Subject: [PATCH 009/180] ISTWCMS-5544: Refactoring of code. --- .../UwDeleteFormEventSubscriber.php | 86 +++---------------- 1 file changed, 12 insertions(+), 74 deletions(-) diff --git a/src/EventSubscriber/UwDeleteFormEventSubscriber.php b/src/EventSubscriber/UwDeleteFormEventSubscriber.php index 286c119..4d5fa9b 100644 --- a/src/EventSubscriber/UwDeleteFormEventSubscriber.php +++ b/src/EventSubscriber/UwDeleteFormEventSubscriber.php @@ -50,80 +50,18 @@ class UwDeleteFormEventSubscriber implements EventSubscriberInterface { public function alterForm(FormAlterEvent $event): void { $form = &$event->getForm(); - // Define all names in an array. - $names = [ - 'ct_names' => [ - 'uw_ct_blog', - 'uw_ct_contact', - 'uw_ct_catalog_item', - 'uw_ct_event', - 'uw_ct_expand_collapse_group', - 'uw_ct_news_item', - 'uw_ct_opportunity', - 'uw_ct_profile', - 'uw_ct_project', - 'uw_ct_service', - 'uw_ct_sidebar', - 'uw_ct_site_footer', - 'uw_ct_web_page', - ], - 'vocab_names' => [ - 'uw_vocab_blog_tags', - 'uw_vocab_contact_group', - 'uw_vocab_audience', - 'uw_vocab_catalog_categories', - 'uw_vocab_catalogs', - 'uw_tax_event_tags', - 'uw_tax_event_type', - 'uw_vocab_news_tags', - 'uw_vocab_profile_type', - 'uw_vocab_project_roles', - 'uw_vocab_project_topics', - 'uw_vocab_service_categories', - ], - 'media_names' => [ - 'uw_mt_file', - 'uw_mt_icon', - 'uw_mt_image', - 'uw_mt_local_video', - 'uw_mt_remote_video', - 'uw_mt_vimeo_banner_video', - ], - ]; - - // Loop all names in array. - foreach ($names as $key => $type_names) { - foreach ($type_names as $name) { - $custom_waring_message = $this->t('CAUTION. This will permanently delete this piece of content; this action cannot be undone. If anything references this content, it may cause visual or structural issues on that page. Make sure you have removed or updated all references before deleting.'); - - // Use custom warning message for deleting nodes, terms and medias. - // The user has 'delete any' and 'delete own' permissions. - if ($key == 'ct_names') { - if (($form['#form_id'] == 'node_' . $name . '_delete_form') && - ($this->currentUser->hasPermission('delete any ' . $name . ' content') || - $this->currentUser->hasPermission('delete own ' . $name . ' content'))) { - $form['description']['#markup'] = $custom_waring_message; - break; - } - } - // The user has 'delete terms' permission. - if ($key == 'vocab_names') { - if (($form['#form_id'] == 'taxonomy_term_' . $name . '_delete_form') && - $this->currentUser->hasPermission('delete terms in ' . $name)) { - $form['description']['#markup'] = $custom_waring_message; - break; - } - } - // The user has 'delete any' permission. - if ($key == 'media_names') { - if (($form['#form_id'] == 'media_' . $name . '_delete_form') && - ($this->currentUser->hasPermission('delete any media') || $this->currentUser->hasPermission('delete any ' . $name . ' media') || - $this->currentUser->hasPermission('delete own ' . $name . ' media'))) { - $form['description']['#markup'] = $custom_waring_message; - break; - } - } - } + // Change the deletion warning on any of the following forms. + // - any node, taxonomy term, or media deletion page. + // - the node delete multiple page. + // - the media delete multiple page. + if ( + preg_match('/^(?:node|taxonomy_term|media)_.+_delete_form$/', $form['#form_id']) + || + $form['#form_id'] == 'node_delete_multiple_confirm_form' + || + $form['#form_id'] == 'media_delete_multiple_confirm_form' + ) { + $form['description']['#markup'] = $this->t('CAUTION. This will permanently delete this piece of content; this action cannot be undone. If anything references this content, it may cause visual or structural issues on that page. Make sure you have removed or updated all references before deleting.'); } } -- GitLab From cff3e2d06b9f034185fa3e15a9ff3adf5bb1f202 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Tue, 18 Oct 2022 09:14:43 -0400 Subject: [PATCH 010/180] ISTWCMS-5880: fixing layout builder styles --- .../layout_builder_styles.style.uw_lbs_contained_width.yml | 5 ++--- ...ut_builder_styles.style.uw_lbs_contained_width_narrow.yml | 4 ++-- ...yout_builder_styles.style.uw_lbs_contained_width_wide.yml | 4 ++-- .../layout_builder_styles.style.uw_lbs_full_width.yml | 5 ++--- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/config/install/layout_builder_styles.style.uw_lbs_contained_width.yml b/config/install/layout_builder_styles.style.uw_lbs_contained_width.yml index 9612387..0eb0779 100644 --- a/config/install/layout_builder_styles.style.uw_lbs_contained_width.yml +++ b/config/install/layout_builder_styles.style.uw_lbs_contained_width.yml @@ -5,13 +5,12 @@ id: uw_lbs_contained_width label: 'Extra-wide contained width' classes: uw-contained-width type: section -group: null -weight: -4 +group: default block_restrictions: - 'inline_block:uw_cbl_call_to_action' - 'inline_block:uw_cbl_copy_text' - - 'inline_block:uw_cbl_facebook' - 'inline_block:uw_cbl_facts_and_figures' - 'inline_block:uw_cbl_image' - 'inline_block:uw_cbl_remote_video' layout_restrictions: { } +weight: -4 diff --git a/config/install/layout_builder_styles.style.uw_lbs_contained_width_narrow.yml b/config/install/layout_builder_styles.style.uw_lbs_contained_width_narrow.yml index 62063e3..b0cd3fe 100644 --- a/config/install/layout_builder_styles.style.uw_lbs_contained_width_narrow.yml +++ b/config/install/layout_builder_styles.style.uw_lbs_contained_width_narrow.yml @@ -5,7 +5,7 @@ id: uw_lbs_contained_width_narrow label: 'Narrow contained width' classes: "uw-contained-width\r\nuw-contained-width--narrow" type: section -group: null -weight: -6 +group: default block_restrictions: { } layout_restrictions: { } +weight: -6 diff --git a/config/install/layout_builder_styles.style.uw_lbs_contained_width_wide.yml b/config/install/layout_builder_styles.style.uw_lbs_contained_width_wide.yml index c286b01..d18394f 100644 --- a/config/install/layout_builder_styles.style.uw_lbs_contained_width_wide.yml +++ b/config/install/layout_builder_styles.style.uw_lbs_contained_width_wide.yml @@ -5,7 +5,7 @@ id: uw_lbs_contained_width_wide label: 'Wide contained width' classes: "uw-contained-width\r\nuw-contained-width--wide" type: section -group: null -weight: -5 +group: default block_restrictions: { } layout_restrictions: { } +weight: -5 diff --git a/config/install/layout_builder_styles.style.uw_lbs_full_width.yml b/config/install/layout_builder_styles.style.uw_lbs_full_width.yml index 4aab26a..f0da2d6 100644 --- a/config/install/layout_builder_styles.style.uw_lbs_full_width.yml +++ b/config/install/layout_builder_styles.style.uw_lbs_full_width.yml @@ -5,13 +5,12 @@ id: uw_lbs_full_width label: 'Full width' classes: uw-full-width type: section -group: null -weight: -3 +group: default block_restrictions: - 'inline_block:uw_cbl_call_to_action' - 'inline_block:uw_cbl_copy_text' - - 'inline_block:uw_cbl_facebook' - 'inline_block:uw_cbl_facts_and_figures' - 'inline_block:uw_cbl_image' - 'inline_block:uw_cbl_remote_video' layout_restrictions: { } +weight: -3 -- GitLab From f6464467603870eb6214439bf24bff6aed82bd01 Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Thu, 6 Oct 2022 14:14:15 -0400 Subject: [PATCH 011/180] ISTWCMS-5863 Authenticated webforms should properly enforce individual user access --- uw_cfg_common.module | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/uw_cfg_common.module b/uw_cfg_common.module index dcf4989..ed72eb9 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -1022,6 +1022,25 @@ function uw_cfg_common_webform_access(WebformInterface $webform, string $operati return AccessResult::forbidden(); } break; + + case 'user': + // Must be authenticated for group auth. + if (!$account->isAuthenticated()) { + return AccessResult::forbidden(); + } + + // Get all users when selecting 'Users specified below' under + // admin/structure/webform/manage/WEBFORM_ID/access. + $create_user_ids = $webform->getAccessRules()['create']['users']; + + // Get current logged in user id. + $current_user_id = \Drupal::currentUser()->id(); + + // If the logged user is in not a specified user, get access denied. + if (!in_array($current_user_id, $create_user_ids)) { + return AccessResult::forbidden(); + } + break; } return AccessResult::neutral(); -- GitLab From 5570e1d6afb39257142c422384ccae783ff6fde2 Mon Sep 17 00:00:00 2001 From: Igor Biki Date: Wed, 19 Oct 2022 10:03:30 -0400 Subject: [PATCH 012/180] ISTWCMS-5863: Using provided user account instead of current user. Comment update. --- uw_cfg_common.module | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/uw_cfg_common.module b/uw_cfg_common.module index ed72eb9..6058514 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -1033,11 +1033,8 @@ function uw_cfg_common_webform_access(WebformInterface $webform, string $operati // admin/structure/webform/manage/WEBFORM_ID/access. $create_user_ids = $webform->getAccessRules()['create']['users']; - // Get current logged in user id. - $current_user_id = \Drupal::currentUser()->id(); - - // If the logged user is in not a specified user, get access denied. - if (!in_array($current_user_id, $create_user_ids)) { + // If the logged in user is not a specified user, get access denied. + if (!in_array($account->id(), $create_user_ids)) { return AccessResult::forbidden(); } break; -- GitLab From bacf2ae4e41ea71df8e6f9f275c3949a7af8d04c Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Thu, 13 Oct 2022 10:58:46 -0400 Subject: [PATCH 013/180] ISTWCMS-5869 Add missing delete paragraph content permissions in order to fix content editors unable to remove paragraphs from a block --- src/UwRoles/user.role.uw_role_content_editor.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/UwRoles/user.role.uw_role_content_editor.yml b/src/UwRoles/user.role.uw_role_content_editor.yml index a75dbd8..7878edd 100644 --- a/src/UwRoles/user.role.uw_role_content_editor.yml +++ b/src/UwRoles/user.role.uw_role_content_editor.yml @@ -87,6 +87,19 @@ permissions: - 'create paragraph content uw_para_timeline' - 'create paragraph content uw_para_vimeo_video_banner' - 'create url aliases' + - 'delete paragraph content uw_para_call_to_action' + - 'delete paragraph content uw_para_call_to_action_text' + - 'delete paragraph content uw_para_ec_item' + - 'delete paragraph content uw_para_fact_figure' + - 'delete paragraph content uw_para_fact_point' + - 'delete paragraph content uw_para_fact_text' + - 'delete paragraph content uw_para_facts_and_figures' + - 'delete paragraph content uw_para_ff' + - 'delete paragraph content uw_para_image_banner' + - 'delete paragraph content uw_para_local_video_banner' + - 'delete paragraph content uw_para_project_members' + - 'delete paragraph content uw_para_timeline' + - 'delete paragraph content uw_para_vimeo_video_banner' - 'enter uw_ct_blog revision log entry' - 'enter uw_ct_catalog_item revision log entry' - 'enter uw_ct_contact revision log entry' -- GitLab From bc560bf07d7cd9cb8946e21f11e2511a65fcc1df Mon Sep 17 00:00:00 2001 From: Kevin Paxman Date: Thu, 27 Oct 2022 11:38:00 -0400 Subject: [PATCH 014/180] ISTWCMS-5902: make dates Y-m-d instead of Y-d-m --- src/Controller/UwDownloadCsvController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Controller/UwDownloadCsvController.php b/src/Controller/UwDownloadCsvController.php index b5cba5e..714801a 100644 --- a/src/Controller/UwDownloadCsvController.php +++ b/src/Controller/UwDownloadCsvController.php @@ -138,8 +138,8 @@ class UwDownloadCsvController extends ControllerBase { 'type' => $node->type->entity->label(), 'path' => $this->pathAlias->getAliasByPath('/node/' . $node->id()), 'published' => $node->status->value == 1 ? 'yes' : 'no', - 'created' => date('Y-d-m G:i', $node->getCreatedTime()), - 'updated' => date('Y-d-m G:i', $node->getChangedTime()), + 'created' => date('Y-m-d G:i', $node->getCreatedTime()), + 'updated' => date('Y-m-d G:i', $node->getChangedTime()), ]; // Store the node info for use later in the CSV. -- GitLab From 89375c97a315ed90cc5ea1559480f7de4825af2d Mon Sep 17 00:00:00 2001 From: Anuprita Kulkarni Date: Wed, 19 Oct 2022 16:25:20 -0400 Subject: [PATCH 015/180] ISTWCMS-5866 Prevent URL aliases being created for reserved paths --- uw_cfg_common.module | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/uw_cfg_common.module b/uw_cfg_common.module index 6058514..c911d56 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -851,7 +851,14 @@ function uw_cfg_common_form_alter(array &$form, FormStateInterface $form_state, } // Ensure that we are on a UW content type node. - if (preg_match('/node_uw.*add_form/', $form_id) || preg_match('/node_uw.*edit_form/', $form_id)) { + if ( + preg_match('/node_uw.*add_form/', $form_id) || + preg_match('/node_uw.*edit_form/', $form_id) || + preg_match('/node_uw.*_form/', $form_id) + ) { + + // Add custom validation for alias. + $form['#validate'][] = '_uw_cfg_common_alias_validate'; // Ensure that the node has metatag information. if (isset($form['field_uw_meta_tags'])) { @@ -931,6 +938,40 @@ function uw_cfg_common_form_alter(array &$form, FormStateInterface $form_state, } } +/** + * Validates submission values for alias on nodes. + */ +function _uw_cfg_common_alias_validate(array &$form, FormStateInterface $form_state): void { + + // List of urls which should not be repeat in alias. + $urls = [ + 'blog', + 'events', + 'news', + 'projects', + 'profiles', + 'contacts', + 'service', + 'opportunities', + 'user', + 'users', + ]; + + $values = $form_state->getValues(); + $alias = $values['path'][0]['alias']; + $alias = str_replace('/', '', $alias); + + // Check if the alias exists if yes, sets error. + if ( + in_array($alias, $urls) || + $alias == '/' || + preg_match('/^\/?admin\/.*/', $values['path'][0]['alias']) + ) { + // Set an error message if alias exists. + $form_state->setError($form['path']['widget'][0], t('@url cannot be an alias', ['@url' => $alias])); + } +} + /** * Implements hook_field_widget_WIDGET_TYPE_form_alter(). */ -- GitLab From f1a5685d4cd78acb68e7759ae443e3985c395c69 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Thu, 20 Oct 2022 11:41:00 -0400 Subject: [PATCH 016/180] ISTWCMS-5866: adding comments, fixing inline form error placement and logic for admin urls while validating url aliases --- uw_cfg_common.module | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/uw_cfg_common.module b/uw_cfg_common.module index c911d56..8e5bb14 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -957,18 +957,35 @@ function _uw_cfg_common_alias_validate(array &$form, FormStateInterface $form_st 'users', ]; + // Get the values from the form state. $values = $form_state->getValues(); + + // Get the alias from the form state values. $alias = $values['path'][0]['alias']; + + // We want to remove all the slashes from the alias to + // ensure that we are getting exact matches for the + // predefined alias from above. Some users will add + // slashes before and after the alias, so just + // easier to check without slashes. $alias = str_replace('/', '', $alias); // Check if the alias exists if yes, sets error. + // We are checking three cases, the first is if + // the alias is in the predefined list. The second + // is if the alias is directly /, we have to check here + // because we removed all the slashes with the alias + // variable. The last is to check if the alias has + // any form of strictly admin, so /admin/, /admin, admin/, + // and admin/something are not allowed. if ( in_array($alias, $urls) || - $alias == '/' || - preg_match('/^\/?admin\/.*/', $values['path'][0]['alias']) + $values['path'][0]['alias'] == '/' || + preg_match('/^\/?admin\/?.*/', $values['path'][0]['alias']) ) { + // Set an error message if alias exists. - $form_state->setError($form['path']['widget'][0], t('@url cannot be an alias', ['@url' => $alias])); + $form_state->setError($form['path']['widget'][0]['alias'], t('@url cannot be an alias', ['@url' => $alias])); } } -- GitLab From 2e51494f00db7b4bbb29cc96517789384d082212 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Thu, 20 Oct 2022 11:42:11 -0400 Subject: [PATCH 017/180] ISTWCMS-5886: fixing error message when validating urls --- uw_cfg_common.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uw_cfg_common.module b/uw_cfg_common.module index 8e5bb14..0308d96 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -985,7 +985,7 @@ function _uw_cfg_common_alias_validate(array &$form, FormStateInterface $form_st ) { // Set an error message if alias exists. - $form_state->setError($form['path']['widget'][0]['alias'], t('@url cannot be an alias', ['@url' => $alias])); + $form_state->setError($form['path']['widget'][0]['alias'], t('@url cannot be an alias.', ['@url' => $alias])); } } -- GitLab From bc1b00f229e5f84680c6ba0aa541f456c5632a40 Mon Sep 17 00:00:00 2001 From: Kevin Paxman Date: Thu, 20 Oct 2022 17:37:51 -0400 Subject: [PATCH 018/180] ISTWCMS-5866: simplify/robustify the check we are on a content type --- uw_cfg_common.module | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/uw_cfg_common.module b/uw_cfg_common.module index 0308d96..58b2ee4 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -851,11 +851,7 @@ function uw_cfg_common_form_alter(array &$form, FormStateInterface $form_state, } // Ensure that we are on a UW content type node. - if ( - preg_match('/node_uw.*add_form/', $form_id) || - preg_match('/node_uw.*edit_form/', $form_id) || - preg_match('/node_uw.*_form/', $form_id) - ) { + if (preg_match('/node_uw_ct_.*_form/', $form_id)) { // Add custom validation for alias. $form['#validate'][] = '_uw_cfg_common_alias_validate'; -- GitLab From bc1f9273da86e86359fd3052f78afd2ddf5dbc96 Mon Sep 17 00:00:00 2001 From: Kevin Paxman Date: Thu, 20 Oct 2022 17:48:33 -0400 Subject: [PATCH 019/180] ISTWCMS-5866: only strip surrounding slashes so aliases like bl/og can work --- uw_cfg_common.module | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/uw_cfg_common.module b/uw_cfg_common.module index 58b2ee4..cebb0e0 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -939,7 +939,7 @@ function uw_cfg_common_form_alter(array &$form, FormStateInterface $form_state, */ function _uw_cfg_common_alias_validate(array &$form, FormStateInterface $form_state): void { - // List of urls which should not be repeat in alias. + // List of urls which should not be an alias. $urls = [ 'blog', 'events', @@ -959,12 +959,12 @@ function _uw_cfg_common_alias_validate(array &$form, FormStateInterface $form_st // Get the alias from the form state values. $alias = $values['path'][0]['alias']; - // We want to remove all the slashes from the alias to + // Trim any surrounding slashes from the alias to // ensure that we are getting exact matches for the // predefined alias from above. Some users will add // slashes before and after the alias, so just // easier to check without slashes. - $alias = str_replace('/', '', $alias); + $alias = trim($alias, '/'); // Check if the alias exists if yes, sets error. // We are checking three cases, the first is if -- GitLab From cd4831aaef652d978e3471c317ea2ecc161566bf Mon Sep 17 00:00:00 2001 From: Kevin Paxman Date: Thu, 20 Oct 2022 17:53:19 -0400 Subject: [PATCH 020/180] ISTWCMS-5866: improve error message text and show originally entered path --- uw_cfg_common.module | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/uw_cfg_common.module b/uw_cfg_common.module index cebb0e0..89182d2 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -958,6 +958,7 @@ function _uw_cfg_common_alias_validate(array &$form, FormStateInterface $form_st // Get the alias from the form state values. $alias = $values['path'][0]['alias']; + $orig_alias = $alias; // Trim any surrounding slashes from the alias to // ensure that we are getting exact matches for the @@ -981,7 +982,7 @@ function _uw_cfg_common_alias_validate(array &$form, FormStateInterface $form_st ) { // Set an error message if alias exists. - $form_state->setError($form['path']['widget'][0]['alias'], t('@url cannot be an alias.', ['@url' => $alias])); + $form_state->setError($form['path']['widget'][0]['alias'], t('The alias "@url" is a reserved path that cannot be used.', ['@url' => $orig_alias])); } } -- GitLab From 997ad1e1e22a8a221ed145e5931a208c3d31305e Mon Sep 17 00:00:00 2001 From: Kevin Paxman Date: Thu, 20 Oct 2022 18:14:06 -0400 Subject: [PATCH 021/180] ISTWCMS-5866: don't allow any string of only slashes, and fix the admin check so paths like admin-meeting are still allowed. --- uw_cfg_common.module | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/uw_cfg_common.module b/uw_cfg_common.module index 89182d2..ab13e4d 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -962,23 +962,24 @@ function _uw_cfg_common_alias_validate(array &$form, FormStateInterface $form_st // Trim any surrounding slashes from the alias to // ensure that we are getting exact matches for the - // predefined alias from above. Some users will add + // predefined alias from above. Some users will add // slashes before and after the alias, so just // easier to check without slashes. $alias = trim($alias, '/'); // Check if the alias exists if yes, sets error. // We are checking three cases, the first is if - // the alias is in the predefined list. The second - // is if the alias is directly /, we have to check here - // because we removed all the slashes with the alias - // variable. The last is to check if the alias has - // any form of strictly admin, so /admin/, /admin, admin/, - // and admin/something are not allowed. + // the alias is in the predefined list. The second + // is if the alias is just /, or just a series of slashes, + // we have to check here because we removed all the + // slashes with the alias variable. The last is to check + // if the alias has any form of strictly admin, so /admin/, + // admin, admin/, and admin/something are not allowed, + // but something like admin-meeting would be. if ( in_array($alias, $urls) || - $values['path'][0]['alias'] == '/' || - preg_match('/^\/?admin\/?.*/', $values['path'][0]['alias']) + preg_match('/^\/+$/', $orig_alias) || + preg_match('/^admin(?:\/.*)?$/', $alias) ) { // Set an error message if alias exists. -- GitLab From fb410f22ab46f2f7e1f8f13e7b252a052789b191 Mon Sep 17 00:00:00 2001 From: Kevin Paxman Date: Thu, 20 Oct 2022 18:15:19 -0400 Subject: [PATCH 022/180] ISTWCMS-5866: disallow profile (singular) since that is used by OFIS --- uw_cfg_common.module | 1 + 1 file changed, 1 insertion(+) diff --git a/uw_cfg_common.module b/uw_cfg_common.module index ab13e4d..8575a20 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -945,6 +945,7 @@ function _uw_cfg_common_alias_validate(array &$form, FormStateInterface $form_st 'events', 'news', 'projects', + 'profile', 'profiles', 'contacts', 'service', -- GitLab From 5d1ebfdd563d9aaeea8b56c8db0aa6f11a5bebf0 Mon Sep 17 00:00:00 2001 From: Kevin Paxman Date: Fri, 21 Oct 2022 15:37:23 -0400 Subject: [PATCH 023/180] ISTWMCS-5866: only do alias stuff if an alias exists (tests were failing) --- uw_cfg_common.module | 93 ++++++++++++++++++++++---------------------- 1 file changed, 47 insertions(+), 46 deletions(-) diff --git a/uw_cfg_common.module b/uw_cfg_common.module index 8575a20..0bae4d3 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -851,7 +851,7 @@ function uw_cfg_common_form_alter(array &$form, FormStateInterface $form_state, } // Ensure that we are on a UW content type node. - if (preg_match('/node_uw_ct_.*_form/', $form_id)) { + if (preg_match('/^node_uw_ct_.*_form$/', $form_id)) { // Add custom validation for alias. $form['#validate'][] = '_uw_cfg_common_alias_validate'; @@ -938,53 +938,54 @@ function uw_cfg_common_form_alter(array &$form, FormStateInterface $form_state, * Validates submission values for alias on nodes. */ function _uw_cfg_common_alias_validate(array &$form, FormStateInterface $form_state): void { + if (isset($values['path'][0]['alias'])) { + // List of urls which should not be an alias. + $urls = [ + 'blog', + 'events', + 'news', + 'projects', + 'profile', + 'profiles', + 'contacts', + 'service', + 'opportunities', + 'user', + 'users', + ]; - // List of urls which should not be an alias. - $urls = [ - 'blog', - 'events', - 'news', - 'projects', - 'profile', - 'profiles', - 'contacts', - 'service', - 'opportunities', - 'user', - 'users', - ]; - - // Get the values from the form state. - $values = $form_state->getValues(); - - // Get the alias from the form state values. - $alias = $values['path'][0]['alias']; - $orig_alias = $alias; - - // Trim any surrounding slashes from the alias to - // ensure that we are getting exact matches for the - // predefined alias from above. Some users will add - // slashes before and after the alias, so just - // easier to check without slashes. - $alias = trim($alias, '/'); - - // Check if the alias exists if yes, sets error. - // We are checking three cases, the first is if - // the alias is in the predefined list. The second - // is if the alias is just /, or just a series of slashes, - // we have to check here because we removed all the - // slashes with the alias variable. The last is to check - // if the alias has any form of strictly admin, so /admin/, - // admin, admin/, and admin/something are not allowed, - // but something like admin-meeting would be. - if ( - in_array($alias, $urls) || - preg_match('/^\/+$/', $orig_alias) || - preg_match('/^admin(?:\/.*)?$/', $alias) - ) { + // Get the values from the form state. + $values = $form_state->getValues(); + + // Get the alias from the form state values. + $alias = $values['path'][0]['alias']; + $orig_alias = $alias; + + // Trim any surrounding slashes from the alias to + // ensure that we are getting exact matches for the + // predefined alias from above. Some users will add + // slashes before and after the alias, so just + // easier to check without slashes. + $alias = trim($alias, '/'); + + // Check if the alias exists if yes, sets error. + // We are checking three cases, the first is if + // the alias is in the predefined list. The second + // is if the alias is just /, or just a series of slashes, + // we have to check here because we removed all the + // slashes with the alias variable. The last is to check + // if the alias has any form of strictly admin, so /admin/, + // admin, admin/, and admin/something are not allowed, + // but something like admin-meeting would be. + if ( + in_array($alias, $urls) || + preg_match('/^\/+$/', $orig_alias) || + preg_match('/^admin(?:\/.*)?$/', $alias) + ) { - // Set an error message if alias exists. - $form_state->setError($form['path']['widget'][0]['alias'], t('The alias "@url" is a reserved path that cannot be used.', ['@url' => $orig_alias])); + // Set an error message if alias exists. + $form_state->setError($form['path']['widget'][0]['alias'], t('The alias "@url" is a reserved path that cannot be used.', ['@url' => $orig_alias])); + } } } -- GitLab From 71f6ef22d705fbfa4312c1f1b8104169b242efb4 Mon Sep 17 00:00:00 2001 From: Shreya Pawar Date: Thu, 27 Oct 2022 15:08:47 -0400 Subject: [PATCH 024/180] ISTWCMS-5866: Gets values before checks values. --- uw_cfg_common.module | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/uw_cfg_common.module b/uw_cfg_common.module index 0bae4d3..e1e447c 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -938,6 +938,10 @@ function uw_cfg_common_form_alter(array &$form, FormStateInterface $form_state, * Validates submission values for alias on nodes. */ function _uw_cfg_common_alias_validate(array &$form, FormStateInterface $form_state): void { + + // Get the values from the form state. + $values = $form_state->getValues(); + if (isset($values['path'][0]['alias'])) { // List of urls which should not be an alias. $urls = [ @@ -954,9 +958,6 @@ function _uw_cfg_common_alias_validate(array &$form, FormStateInterface $form_st 'users', ]; - // Get the values from the form state. - $values = $form_state->getValues(); - // Get the alias from the form state values. $alias = $values['path'][0]['alias']; $orig_alias = $alias; -- GitLab From c79b669264d5c094bf24ee441bc46c7a057e9ccd Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Thu, 3 Nov 2022 10:39:23 -0400 Subject: [PATCH 025/180] ISTWCMS-5885 Remove ability to set CSS classes, CSS styles and custom attributes (YAML) for webform elements --- uw_cfg_common.module | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/uw_cfg_common.module b/uw_cfg_common.module index e1e447c..b63253a 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -192,6 +192,15 @@ function uw_cfg_common_form_webform_admin_config_submissions_form_alter(array &$ $form['views_settings']['#access'] = FALSE; } +/** + * Implements hook_form_FORM_ID_alter(). + * + * Remove wrapper attributes in admin/structure/webform/manage/{webform_id}. + */ +function uw_cfg_common_form_webform_ui_element_form_alter(array &$form, FormStateInterface $form_state, string $form_id): void { + $form['properties']['wrapper_attributes']['#access'] = FALSE; +} + /** * Implements hook_form_FORM_ID_alter(). * -- GitLab From 32f575e11fa86dea977f29a0036c97fc414a5e68 Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Tue, 25 Oct 2022 13:38:51 -0400 Subject: [PATCH 026/180] ISTWCMS-4667 Enable cancel button for forms of the Taxonomy term entity type and set to admin/structure/taxonomy/manage/vocabmachinename/overview --- config/install/cancel_button.settings.yml | 375 ++++++++++++++++++++++ uw_cfg_common.info.yml | 1 + 2 files changed, 376 insertions(+) create mode 100644 config/install/cancel_button.settings.yml diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml new file mode 100644 index 0000000..3bb7a40 --- /dev/null +++ b/config/install/cancel_button.settings.yml @@ -0,0 +1,375 @@ +entity_type_cancel_destination: + default: + path: / + enabled: true + comment: + path: / + enabled: false + block: + path: /admin/structure/block + enabled: true + block_content_type: + path: /admin/structure/block/block-content/types + enabled: true + comment_type: + path: /admin/structure/comment + enabled: true + contact_form: + path: /admin/structure/contact + enabled: true + editor: + path: / + enabled: false + field_storage_config: + path: / + enabled: false + field_config: + path: / + enabled: true + file: + path: / + enabled: false + filter_format: + path: /admin/config/content/formats + enabled: true + image_style: + path: /admin/config/media/image-styles + enabled: true + node_type: + path: /admin/structure/types + enabled: true + node: + path: / + enabled: true + shortcut_set: + path: / + enabled: false + shortcut: + path: / + enabled: false + action: + path: / + enabled: false + menu: + path: / + enabled: false + taxonomy_term: + path: / + enabled: true + taxonomy_vocabulary: + path: /admin/structure/taxonomy + enabled: true + tour: + path: / + enabled: false + user_role: + path: /admin/people/roles + enabled: true + user: + path: / + enabled: true + menu_link_content: + path: / + enabled: false + view: + path: / + enabled: false + base_field_override: + path: / + enabled: false + date_format: + path: / + enabled: false + entity_view_mode: + path: /admin/structure/display-modes/view + enabled: true + entity_form_display: + path: / + enabled: false + entity_view_display: + path: / + enabled: false + entity_form_mode: + path: /admin/structure/display-modes/form + enabled: true + aggregator_feed: + path: / + enabled: true + aggregator_item: + path: / + enabled: true + block_content_uw_cbl_banner_images: + path: / + block_content_uw_cbl_blockquote: + path: / + block_content_uw_cbl_call_to_action: + path: / + block_content_uw_cbl_codepen: + path: / + block_content_uw_cbl_copy_text: + path: / + block_content_uw_cbl_facts_and_figures: + path: / + block_content_uw_cbl_google_maps: + path: / + block_content_uw_cbl_image: + path: / + block_content_uw_cbl_image_gallery: + path: / + block_content_uw_cbl_instagram: + path: / + block_content_uw_cbl_mailchimp: + path: / + block_content_uw_cbl_mailman: + path: / + block_content_uw_cbl_powerbi: + path: / + block_content_uw_cbl_related_links: + path: / + block_content_uw_cbl_remote_video: + path: / + block_content_uw_cbl_services_list: + path: / + block_content_uw_cbl_social_intents: + path: / + block_content_uw_cbl_tableau: + path: / + block_content_uw_cbl_timeline: + path: / + block_content: + enabled: true + captcha_point: + path: / + enabled: true + contact_message_personal: + path: / + contact_message: + enabled: true + content_moderation_state: + path: / + enabled: true + crop_type: + path: / + enabled: true + crop_uw_crop_media_large: + path: / + crop_uw_crop_media_medium: + path: / + crop_uw_crop_media_small: + path: / + crop_uw_crop_media_x_large: + path: / + crop_uw_crop_media_x_small: + path: / + crop_uw_crop_portrait: + path: / + crop: + enabled: true + dashboard: + path: / + enabled: true + entity_browser: + path: / + enabled: true + features_bundle: + path: / + enabled: true + field_validation_rule_set: + path: / + enabled: true + fillpdf_form: + path: / + enabled: true + fillpdf_file_context: + path: / + enabled: true + fillpdf_form_field: + path: / + enabled: true + imageapi_optimize_pipeline: + path: / + enabled: true + language_content_settings: + path: / + enabled: true + configurable_language: + path: / + enabled: true + layout_builder_browser_block: + path: / + enabled: true + layout_builder_browser_blockcat: + path: / + enabled: true + layout_builder_style: + path: / + enabled: true + layout_builder_style_group: + path: / + enabled: true + linkit_profile: + path: / + enabled: true + media_uw_mt_file: + path: / + media_uw_mt_icon: + path: / + media_uw_mt_image: + path: / + media_uw_mt_local_video: + path: / + media_uw_mt_remote_video: + path: / + media_uw_mt_vimeo_banner_video: + path: / + media: + enabled: true + media_type: + path: / + enabled: true + metatag_defaults: + path: / + enabled: true + node_uw_ct_blog: + path: / + node_uw_ct_catalog_item: + path: / + node_uw_ct_contact: + path: / + node_uw_ct_event: + path: / + node_uw_ct_expand_collapse_group: + path: / + node_uw_ct_news_item: + path: / + node_uw_ct_opportunity: + path: / + node_uw_ct_profile: + path: / + node_uw_ct_project: + path: / + node_uw_ct_service: + path: / + node_uw_ct_sidebar: + path: / + node_uw_ct_site_footer: + path: / + node_uw_ct_web_page: + path: / + path_alias: + path: / + enabled: true + rdf_mapping: + path: / + enabled: true + redirect: + path: / + enabled: true + responsive_image_style: + path: / + enabled: true + rest_resource_config: + path: / + enabled: true + shortcut_default: + path: / + simple_sitemap: + path: / + enabled: true + simple_sitemap_type: + path: / + enabled: true + smart_date_format: + path: / + enabled: true + smart_date_rule: + path: / + enabled: true + smart_date_override: + path: / + enabled: true + taxonomy_term_uw_tax_event_tags: + path: /admin/structure/taxonomy/manage/uw_tax_event_tags/overview + taxonomy_term_uw_tax_event_type: + path: /admin/structure/taxonomy/manage/uw_tax_event_type/overview + taxonomy_term_uw_vocab_audience: + path: /admin/structure/taxonomy/manage/uw_vocab_audience/overview + taxonomy_term_uw_vocab_blog_tags: + path: /admin/structure/taxonomy/manage/uw_vocab_blog_tags/overview + taxonomy_term_uw_vocab_catalogs: + path: /admin/structure/taxonomy/manage/uw_vocab_catalogs/overview + taxonomy_term_uw_vocab_catalog_categories: + path: / + taxonomy_term_uw_vocab_contact_group: + path: /admin/structure/taxonomy/manage/uw_vocab_contact_group/overview + taxonomy_term_uw_vocab_faculties_and_schools: + path: /admin/structure/taxonomy/manage/uw_vocab_faculties_and_schools/overview + taxonomy_term_uw_vocab_news_tags: + path: /admin/structure/taxonomy/manage/uw_vocab_news_tags/overview + taxonomy_term_uw_vocab_opportunity_employment: + path: /admin/structure/taxonomy/manage/uw_vocab_opportunity_employment/overview + taxonomy_term_uw_vocab_opportunity_payrate: + path: /admin/structure/taxonomy/manage/uw_vocab_opportunity_payrate/overview + taxonomy_term_uw_vocab_opportunity_type: + path: /admin/structure/taxonomy/manage/uw_vocab_opportunity_type/overview + taxonomy_term_uw_vocab_profile_type: + path: /admin/structure/taxonomy/manage/uw_vocab_profile_type/overview + taxonomy_term_uw_vocab_project_role: + path: /admin/structure/taxonomy/manage/uw_vocab_project_role/overview + taxonomy_term_uw_vocab_project_status: + path: /admin/structure/taxonomy/manage/uw_vocab_project_status/overview + taxonomy_term_uw_vocab_project_topic: + path: /admin/structure/taxonomy/manage/uw_vocab_project_topic/overview + taxonomy_term_uw_vocab_service_categories: + path: /admin/structure/taxonomy/manage/uw_vocab_service_categories/overview + userprotect_rule: + path: / + enabled: true + webform_submission: + path: / + enabled: true + webform_options: + path: / + enabled: true + webform: + path: / + enabled: true + access_scheme: + path: / + enabled: true + section_association: + path: / + enabled: true + workflow: + path: / + enabled: true + pathauto_pattern: + path: / + enabled: true + password_policy: + path: / + enabled: true + cookie_category: + path: / + enabled: true + paragraphs_type: + path: / + enabled: true + paragraph_uw_para_call_to_action: + path: / + paragraph_uw_para_fact_figure: + path: / + paragraph_uw_para_ff: + path: / + paragraph_uw_para_image_banner: + path: / + paragraph_uw_para_local_video_banner: + path: / + paragraph_uw_para_project_members: + path: / + paragraph_uw_para_timeline: + path: / + paragraph_uw_para_vimeo_video_banner: + path: / + paragraph: + enabled: true diff --git a/uw_cfg_common.info.yml b/uw_cfg_common.info.yml index 434c806..f79c137 100644 --- a/uw_cfg_common.info.yml +++ b/uw_cfg_common.info.yml @@ -5,6 +5,7 @@ type: module core_version_requirement: '^8.9 || ^9' dependencies: - 'allowed_formats:allowed_formats' + - 'cancel_button:cancel_button' - 'composer_deploy:composer_deploy' - 'drupal:anchor_link' - 'drupal:better_exposed_filters' -- GitLab From a7d8045b7e8726ae0383810dceba1096d5c9a3fa Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Tue, 25 Oct 2022 14:34:53 -0400 Subject: [PATCH 027/180] ISTWCMS-4667 Enable cancel button for forms of the Content entity type and set to dashboard/my_dashboard --- config/install/cancel_button.settings.yml | 26 +++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index 3bb7a40..04bfcf3 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -231,31 +231,31 @@ entity_type_cancel_destination: path: / enabled: true node_uw_ct_blog: - path: / + path: /dashboard/my_dashboard node_uw_ct_catalog_item: - path: / + path: /dashboard/my_dashboard node_uw_ct_contact: - path: / + path: /dashboard/my_dashboard node_uw_ct_event: - path: / + path: /dashboard/my_dashboard node_uw_ct_expand_collapse_group: - path: / + path: /dashboard/my_dashboard node_uw_ct_news_item: - path: / + path: /dashboard/my_dashboard node_uw_ct_opportunity: - path: / + path: /dashboard/my_dashboard node_uw_ct_profile: - path: / + path: /dashboard/my_dashboard node_uw_ct_project: - path: / + path: /dashboard/my_dashboard node_uw_ct_service: - path: / + path: /dashboard/my_dashboard node_uw_ct_sidebar: - path: / + path: /dashboard/my_dashboard node_uw_ct_site_footer: - path: / + path: /dashboard/my_dashboard node_uw_ct_web_page: - path: / + path: /dashboard/my_dashboard path_alias: path: / enabled: true -- GitLab From 6a282dabec93abd65182be4b5f45033032986d4c Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Tue, 25 Oct 2022 14:47:16 -0400 Subject: [PATCH 028/180] ISTWCMS-4667 Enable cancel button for forms of the Captcha Point entity type and set to admin/config/people/captcha/captcha-points --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index 04bfcf3..3a1c7e7 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -139,7 +139,7 @@ entity_type_cancel_destination: block_content: enabled: true captcha_point: - path: / + path: /admin/config/people/captcha/captcha-points enabled: true contact_message_personal: path: / -- GitLab From a6cea169961d95be3721a2d765a54a8c147f5008 Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Tue, 25 Oct 2022 15:04:12 -0400 Subject: [PATCH 029/180] ISTWCMS-4667 Enable cancel button for forms of the Workflow entity type and set to admin/config/workflow/workflows/manage/uw_workflow --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index 3a1c7e7..60c45c0 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -341,7 +341,7 @@ entity_type_cancel_destination: path: / enabled: true workflow: - path: / + path: /admin/config/workflow/workflows/manage/uw_workflow enabled: true pathauto_pattern: path: / -- GitLab From 755b1851a7f264c3671a712bbc552c848a02707c Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Tue, 25 Oct 2022 15:14:25 -0400 Subject: [PATCH 030/180] ISTWCMS-4667 Enable cancel button for forms of the Media type entity type and set to admin/structure/media --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index 60c45c0..81615d9 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -225,7 +225,7 @@ entity_type_cancel_destination: media: enabled: true media_type: - path: / + path: /admin/structure/media enabled: true metatag_defaults: path: / -- GitLab From ae3113776fbf237c443aba4de77fe860e2975d04 Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Tue, 25 Oct 2022 15:47:22 -0400 Subject: [PATCH 031/180] ISTWCMS-4667 Enable cancel button for forms of the Webform options entity type and set to admin/structure/webform/options/manage --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index 81615d9..268bec6 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -329,7 +329,7 @@ entity_type_cancel_destination: path: / enabled: true webform_options: - path: / + path: /admin/structure/webform/options/manage enabled: true webform: path: / -- GitLab From 6586e02ed44509a837aea533451783babc365725 Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Wed, 26 Oct 2022 09:54:18 -0400 Subject: [PATCH 032/180] ISTWCMS-4667 Enable cancel button for forms of the Aggregator feed entity type and set to admin/config/services/aggregator --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index 268bec6..a9d6b5d 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -93,7 +93,7 @@ entity_type_cancel_destination: path: /admin/structure/display-modes/form enabled: true aggregator_feed: - path: / + path: /admin/config/services/aggregator enabled: true aggregator_item: path: / -- GitLab From 60df71d5cd3cc07e06d2dbb2c3e37ffc54f354af Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Wed, 26 Oct 2022 11:32:02 -0400 Subject: [PATCH 033/180] ISTWCMS-4667 Enable cancel button for forms of the Crop type entity type and set to admin/config/media/crop --- config/install/cancel_button.settings.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index a9d6b5d..098fa75 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -149,7 +149,7 @@ entity_type_cancel_destination: path: / enabled: true crop_type: - path: / + path: /admin/config/media/crop enabled: true crop_uw_crop_media_large: path: / @@ -373,3 +373,5 @@ entity_type_cancel_destination: path: / paragraph: enabled: true + contact_message_aa: + path: / -- GitLab From 25e6c07c97d0ef0b1c61a9c7d7e2e471ad322e91 Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Wed, 26 Oct 2022 11:44:39 -0400 Subject: [PATCH 034/180] ISTWCMS-4667 Enable cancel button for forms of the Dashboard entity type and set to admin/structure/dashboards --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index 098fa75..5c2e390 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -166,7 +166,7 @@ entity_type_cancel_destination: crop: enabled: true dashboard: - path: / + path: /admin/structure/dashboards enabled: true entity_browser: path: / -- GitLab From 4ce4adfe52b48ed45aa1169b357b0431dfd7165d Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Wed, 26 Oct 2022 13:18:04 -0400 Subject: [PATCH 035/180] ISTWCMS-4667 Enable cancel button for forms of the Entity browser entity type and set to admin/config/content/entity_browser --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index 5c2e390..b04b841 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -169,7 +169,7 @@ entity_type_cancel_destination: path: /admin/structure/dashboards enabled: true entity_browser: - path: / + path: /admin/config/content/entity_browser enabled: true features_bundle: path: / -- GitLab From e1ea77bf5da151196e252a96c83d53491f6d3426 Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Wed, 26 Oct 2022 15:22:12 -0400 Subject: [PATCH 036/180] ISTWCMS-4667 Enable cancel button for forms of the FillPDF form entity type and set to admin/structure/fillpdf --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index b04b841..da615ca 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -178,7 +178,7 @@ entity_type_cancel_destination: path: / enabled: true fillpdf_form: - path: / + path: /admin/structure/fillpdf enabled: true fillpdf_file_context: path: / -- GitLab From 5de518ab5c82660b4425b8fc08b8feb990a192a1 Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Wed, 26 Oct 2022 15:54:35 -0400 Subject: [PATCH 037/180] ISTWCMS-4667 Enable cancel button for forms of the Language entity type and set to admin/config/regional/language --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index da615ca..5bd9e54 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -193,7 +193,7 @@ entity_type_cancel_destination: path: / enabled: true configurable_language: - path: / + path: /admin/config/regional/language enabled: true layout_builder_browser_block: path: / -- GitLab From 5b9185e94e39ce43f2bb8dec8075c67c624eaa5b Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Wed, 26 Oct 2022 15:59:29 -0400 Subject: [PATCH 038/180] ISTWCMS-4667 Enable cancel button for forms of the Layout builder browser block entity type and set to admin/config/content/layout-builder-browser --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index 5bd9e54..3295149 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -196,7 +196,7 @@ entity_type_cancel_destination: path: /admin/config/regional/language enabled: true layout_builder_browser_block: - path: / + path: /admin/config/content/layout-builder-browser enabled: true layout_builder_browser_blockcat: path: / -- GitLab From a488553ef083b33b060700ac25690961709fa17f Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Wed, 26 Oct 2022 16:02:19 -0400 Subject: [PATCH 039/180] ISTWCMS-4667 Enable cancel button for forms of the Layout builder browser block category entity type and set to admin/config/content/layout-builder-browser/categories --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index 3295149..532cc63 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -199,7 +199,7 @@ entity_type_cancel_destination: path: /admin/config/content/layout-builder-browser enabled: true layout_builder_browser_blockcat: - path: / + path: /admin/config/content/layout-builder-browser/categories enabled: true layout_builder_style: path: / -- GitLab From b4bc7022a72cc89903ac98299201ac999531947b Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Thu, 27 Oct 2022 11:54:16 -0400 Subject: [PATCH 040/180] ISTWCMS-4667 Enable cancel button for forms of the Layout builder style entity type and set to admin/config/content/layout_builder_style --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index 532cc63..ae4f63f 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -202,7 +202,7 @@ entity_type_cancel_destination: path: /admin/config/content/layout-builder-browser/categories enabled: true layout_builder_style: - path: / + path: /admin/config/content/layout_builder_style enabled: true layout_builder_style_group: path: / -- GitLab From 05e01020e4618b8af847afd9f9905bf5763fcf45 Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Mon, 31 Oct 2022 08:59:36 -0400 Subject: [PATCH 041/180] ISTWCMS-4667 Enable cancel button for forms of the Layout builder style group entity type and set to admin/config/content/layout_builder_style/group --- config/install/cancel_button.settings.yml | 90 +++++++++++------------ 1 file changed, 44 insertions(+), 46 deletions(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index ae4f63f..4e7a766 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -55,7 +55,7 @@ entity_type_cancel_destination: enabled: false taxonomy_term: path: / - enabled: true + enabled: false taxonomy_vocabulary: path: /admin/structure/taxonomy enabled: true @@ -93,7 +93,7 @@ entity_type_cancel_destination: path: /admin/structure/display-modes/form enabled: true aggregator_feed: - path: /admin/config/services/aggregator + path: / enabled: true aggregator_item: path: / @@ -139,7 +139,7 @@ entity_type_cancel_destination: block_content: enabled: true captcha_point: - path: /admin/config/people/captcha/captcha-points + path: / enabled: true contact_message_personal: path: / @@ -149,7 +149,7 @@ entity_type_cancel_destination: path: / enabled: true crop_type: - path: /admin/config/media/crop + path: / enabled: true crop_uw_crop_media_large: path: / @@ -166,10 +166,10 @@ entity_type_cancel_destination: crop: enabled: true dashboard: - path: /admin/structure/dashboards + path: / enabled: true entity_browser: - path: /admin/config/content/entity_browser + path: / enabled: true features_bundle: path: / @@ -178,7 +178,7 @@ entity_type_cancel_destination: path: / enabled: true fillpdf_form: - path: /admin/structure/fillpdf + path: / enabled: true fillpdf_file_context: path: / @@ -193,19 +193,19 @@ entity_type_cancel_destination: path: / enabled: true configurable_language: - path: /admin/config/regional/language + path: / enabled: true layout_builder_browser_block: - path: /admin/config/content/layout-builder-browser + path: / enabled: true layout_builder_browser_blockcat: - path: /admin/config/content/layout-builder-browser/categories + path: / enabled: true layout_builder_style: - path: /admin/config/content/layout_builder_style + path: / enabled: true layout_builder_style_group: - path: / + path: /admin/config/content/layout_builder_style/group enabled: true linkit_profile: path: / @@ -225,37 +225,37 @@ entity_type_cancel_destination: media: enabled: true media_type: - path: /admin/structure/media + path: / enabled: true metatag_defaults: path: / enabled: true node_uw_ct_blog: - path: /dashboard/my_dashboard + path: / node_uw_ct_catalog_item: - path: /dashboard/my_dashboard + path: / node_uw_ct_contact: - path: /dashboard/my_dashboard + path: / node_uw_ct_event: - path: /dashboard/my_dashboard + path: / node_uw_ct_expand_collapse_group: - path: /dashboard/my_dashboard + path: / node_uw_ct_news_item: - path: /dashboard/my_dashboard + path: / node_uw_ct_opportunity: - path: /dashboard/my_dashboard + path: / node_uw_ct_profile: - path: /dashboard/my_dashboard + path: / node_uw_ct_project: - path: /dashboard/my_dashboard + path: / node_uw_ct_service: - path: /dashboard/my_dashboard + path: / node_uw_ct_sidebar: - path: /dashboard/my_dashboard + path: / node_uw_ct_site_footer: - path: /dashboard/my_dashboard + path: / node_uw_ct_web_page: - path: /dashboard/my_dashboard + path: / path_alias: path: / enabled: true @@ -289,39 +289,39 @@ entity_type_cancel_destination: path: / enabled: true taxonomy_term_uw_tax_event_tags: - path: /admin/structure/taxonomy/manage/uw_tax_event_tags/overview + path: / taxonomy_term_uw_tax_event_type: - path: /admin/structure/taxonomy/manage/uw_tax_event_type/overview + path: / taxonomy_term_uw_vocab_audience: - path: /admin/structure/taxonomy/manage/uw_vocab_audience/overview + path: / taxonomy_term_uw_vocab_blog_tags: - path: /admin/structure/taxonomy/manage/uw_vocab_blog_tags/overview + path: / taxonomy_term_uw_vocab_catalogs: - path: /admin/structure/taxonomy/manage/uw_vocab_catalogs/overview + path: / taxonomy_term_uw_vocab_catalog_categories: path: / taxonomy_term_uw_vocab_contact_group: - path: /admin/structure/taxonomy/manage/uw_vocab_contact_group/overview + path: / taxonomy_term_uw_vocab_faculties_and_schools: - path: /admin/structure/taxonomy/manage/uw_vocab_faculties_and_schools/overview + path: / taxonomy_term_uw_vocab_news_tags: - path: /admin/structure/taxonomy/manage/uw_vocab_news_tags/overview + path: / taxonomy_term_uw_vocab_opportunity_employment: - path: /admin/structure/taxonomy/manage/uw_vocab_opportunity_employment/overview + path: / taxonomy_term_uw_vocab_opportunity_payrate: - path: /admin/structure/taxonomy/manage/uw_vocab_opportunity_payrate/overview + path: / taxonomy_term_uw_vocab_opportunity_type: - path: /admin/structure/taxonomy/manage/uw_vocab_opportunity_type/overview + path: / taxonomy_term_uw_vocab_profile_type: - path: /admin/structure/taxonomy/manage/uw_vocab_profile_type/overview + path: / taxonomy_term_uw_vocab_project_role: - path: /admin/structure/taxonomy/manage/uw_vocab_project_role/overview + path: / taxonomy_term_uw_vocab_project_status: - path: /admin/structure/taxonomy/manage/uw_vocab_project_status/overview + path: / taxonomy_term_uw_vocab_project_topic: - path: /admin/structure/taxonomy/manage/uw_vocab_project_topic/overview + path: / taxonomy_term_uw_vocab_service_categories: - path: /admin/structure/taxonomy/manage/uw_vocab_service_categories/overview + path: / userprotect_rule: path: / enabled: true @@ -329,7 +329,7 @@ entity_type_cancel_destination: path: / enabled: true webform_options: - path: /admin/structure/webform/options/manage + path: / enabled: true webform: path: / @@ -341,7 +341,7 @@ entity_type_cancel_destination: path: / enabled: true workflow: - path: /admin/config/workflow/workflows/manage/uw_workflow + path: / enabled: true pathauto_pattern: path: / @@ -373,5 +373,3 @@ entity_type_cancel_destination: path: / paragraph: enabled: true - contact_message_aa: - path: / -- GitLab From 874fd57e8ac4d57d2dad717b16bc7f1e05a39e48 Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Mon, 31 Oct 2022 09:03:14 -0400 Subject: [PATCH 042/180] ISTWCMS-4667 Enable cancel button for forms of the Linkit profile entity type and set to admin/config/content/linkit --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index 4e7a766..774652b 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -208,7 +208,7 @@ entity_type_cancel_destination: path: /admin/config/content/layout_builder_style/group enabled: true linkit_profile: - path: / + path: /admin/config/content/linkit enabled: true media_uw_mt_file: path: / -- GitLab From 2326e20bac1eb3f113bed0bedc8a46bc4e2e297f Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Mon, 31 Oct 2022 09:13:29 -0400 Subject: [PATCH 043/180] ISTWCMS-4667 Enable cancel button for forms of the Media type entity type and set to admin/structure/media --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index 774652b..0448615 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -225,7 +225,7 @@ entity_type_cancel_destination: media: enabled: true media_type: - path: / + path: /admin/structure/media enabled: true metatag_defaults: path: / -- GitLab From f6f0c552522846a9ccafad1ae0bf1ee1f42527e5 Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Mon, 31 Oct 2022 09:25:29 -0400 Subject: [PATCH 044/180] ISTWCMS-4667 Enable cancel button for forms of the Metatag defaults entity type and set to admin/config/search/metatag --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index 0448615..a33bc43 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -228,7 +228,7 @@ entity_type_cancel_destination: path: /admin/structure/media enabled: true metatag_defaults: - path: / + path: /admin/config/search/metatag enabled: true node_uw_ct_blog: path: / -- GitLab From 4ddb6d20b8576c081f0a17eddb6df76ed4d5a611 Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Mon, 31 Oct 2022 09:52:21 -0400 Subject: [PATCH 045/180] ISTWCMS-4667 Enable cancel button for forms of the URL alias entity typ and admin/config/search/path. --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index a33bc43..abebc64 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -257,7 +257,7 @@ entity_type_cancel_destination: node_uw_ct_web_page: path: / path_alias: - path: / + path: /admin/config/search/path enabled: true rdf_mapping: path: / -- GitLab From 3345bea1a63f482162e328650e31f25585050f60 Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Mon, 31 Oct 2022 10:02:28 -0400 Subject: [PATCH 046/180] ISTWCMS-4667 Disable cancel button for forms of the RDF mapping entity type --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index abebc64..09671ae 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -261,7 +261,7 @@ entity_type_cancel_destination: enabled: true rdf_mapping: path: / - enabled: true + enabled: false redirect: path: / enabled: true -- GitLab From 7a604485cba08b8520d6f71456f059737e2f4264 Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Mon, 31 Oct 2022 10:27:54 -0400 Subject: [PATCH 047/180] ISTWCMS-4667 Enable cancel button for forms of the Redirect entity type and admin/config/search/redirect --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index 09671ae..4b28c9f 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -263,7 +263,7 @@ entity_type_cancel_destination: path: / enabled: false redirect: - path: / + path: /admin/config/search/redirect enabled: true responsive_image_style: path: / -- GitLab From 9689b8be8ce13669662e838548db9e6495c378f3 Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Mon, 31 Oct 2022 10:31:25 -0400 Subject: [PATCH 048/180] ISTWCMS-4667 Enable cancel button for forms of the Responsive image style entity type and set to admin/config/media/responsive-image-style --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index 4b28c9f..fc4408f 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -266,7 +266,7 @@ entity_type_cancel_destination: path: /admin/config/search/redirect enabled: true responsive_image_style: - path: / + path: /admin/config/media/responsive-image-style enabled: true rest_resource_config: path: / -- GitLab From eb3a97ea21fce5bed68c8bd1dc4fb469e1d848a7 Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Mon, 31 Oct 2022 10:37:21 -0400 Subject: [PATCH 049/180] ISTWCMS-4667 Disable cancel button for forms of the REST resource configuration entity type --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index fc4408f..43bfa84 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -270,7 +270,7 @@ entity_type_cancel_destination: enabled: true rest_resource_config: path: / - enabled: true + enabled: false shortcut_default: path: / simple_sitemap: -- GitLab From b2fe9a18c65aa088665f9e3f4c4413a75600efaa Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Mon, 31 Oct 2022 10:44:44 -0400 Subject: [PATCH 050/180] ISTWCMS-4667 Enable cancel button for forms of the Simple XML sitemap type entity type and set to admin/config/search/simplesitemap/types --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index 43bfa84..2a4dd2b 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -277,7 +277,7 @@ entity_type_cancel_destination: path: / enabled: true simple_sitemap_type: - path: / + path: /admin/config/search/simplesitemap/types enabled: true smart_date_format: path: / -- GitLab From 7a2fdcd2840383d7edc8c101070c092f8d35290e Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Mon, 31 Oct 2022 11:08:57 -0400 Subject: [PATCH 051/180] ISTWCMS-4667 Enable cancel button for forms of the Sitemap entity type and set to admin/config/search/simplesitemap --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index 2a4dd2b..951537d 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -274,7 +274,7 @@ entity_type_cancel_destination: shortcut_default: path: / simple_sitemap: - path: / + path: /admin/config/search/simplesitemap enabled: true simple_sitemap_type: path: /admin/config/search/simplesitemap/types -- GitLab From b3c49366c7d689baf94aba9aa6f178e7c941e971 Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Mon, 31 Oct 2022 11:22:40 -0400 Subject: [PATCH 052/180] ISTWCMS-4667 Enable cancel button for forms of the Smart date format entity type and set to admin/config/regional/smart-date --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index 951537d..89b092e 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -280,7 +280,7 @@ entity_type_cancel_destination: path: /admin/config/search/simplesitemap/types enabled: true smart_date_format: - path: / + path: /admin/config/regional/smart-date enabled: true smart_date_rule: path: / -- GitLab From 264101f5d332e55389f9d9261d99374f360a8cc8 Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Mon, 31 Oct 2022 11:28:30 -0400 Subject: [PATCH 053/180] ISTWCMS-4667 Disable cancel button for forms of the Smart date recurring rule entity type --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index 89b092e..ba02541 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -284,7 +284,7 @@ entity_type_cancel_destination: enabled: true smart_date_rule: path: / - enabled: true + enabled: false smart_date_override: path: / enabled: true -- GitLab From 8f731b23d548da87ebe3c65ca4f0ab11cc9faf73 Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Mon, 31 Oct 2022 11:33:02 -0400 Subject: [PATCH 054/180] ISTWCMS-4667 Disable cancel button for forms of the Smart Date override entity type --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index ba02541..2bcaa9b 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -287,7 +287,7 @@ entity_type_cancel_destination: enabled: false smart_date_override: path: / - enabled: true + enabled: false taxonomy_term_uw_tax_event_tags: path: / taxonomy_term_uw_tax_event_type: -- GitLab From 0430af739a7c88068c3aeaff03a49a471058004e Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Mon, 31 Oct 2022 11:49:25 -0400 Subject: [PATCH 055/180] ISTWCMS-4667 Enable cancel button for forms of the User entity type and set to admin/people/create --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index 2bcaa9b..e0e79b1 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -66,7 +66,7 @@ entity_type_cancel_destination: path: /admin/people/roles enabled: true user: - path: / + path: /admin/people/create enabled: true menu_link_content: path: / -- GitLab From 4cbd6c194ff37c2b0724a1df400e1c7c08ffd32e Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Mon, 31 Oct 2022 13:17:41 -0400 Subject: [PATCH 056/180] ISTWCMS-4667 Enable cancel button for forms of the Protection rule entity type and set to admin/config/people/userprotect/add/user --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index e0e79b1..81ee380 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -323,7 +323,7 @@ entity_type_cancel_destination: taxonomy_term_uw_vocab_service_categories: path: / userprotect_rule: - path: / + path: /admin/config/people/userprotect/add/user enabled: true webform_submission: path: / -- GitLab From 97f5014cfb1fae92b59b8d6b7875c5d4f4f48ec2 Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Mon, 31 Oct 2022 13:41:07 -0400 Subject: [PATCH 057/180] ISTWCMS-4667 Enable cancel button for forms of the Webform options entity type and set to admin/structure/webform/options/manage --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index 81ee380..0bc4fe4 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -329,7 +329,7 @@ entity_type_cancel_destination: path: / enabled: true webform_options: - path: / + path: /admin/structure/webform/options/manage enabled: true webform: path: / -- GitLab From 4a3b4401c4e54cee55e2db22e2cdd52d591cd8b0 Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Mon, 31 Oct 2022 13:53:20 -0400 Subject: [PATCH 058/180] ISTWCMS-4667 Enable cancel button for forms of the Access scheme entity type and set to admin/config/workflow/workbench_access --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index 0bc4fe4..0fd6169 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -335,7 +335,7 @@ entity_type_cancel_destination: path: / enabled: true access_scheme: - path: / + path: /admin/config/workflow/workbench_access enabled: true section_association: path: / -- GitLab From 0935ddc8e99e8bfa078c4357d2d37f3746026fae Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Mon, 31 Oct 2022 13:59:11 -0400 Subject: [PATCH 059/180] ISTWCMS-4667 Disable cancel button for forms of the Section association entity type --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index 0fd6169..0bc5e43 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -339,7 +339,7 @@ entity_type_cancel_destination: enabled: true section_association: path: / - enabled: true + enabled: false workflow: path: / enabled: true -- GitLab From e0dbe7a957a12f84e4438585d090158a02b37193 Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Mon, 31 Oct 2022 14:01:50 -0400 Subject: [PATCH 060/180] ISTWCMS-4667 Enable cancel button for forms of the Workflow entity type and set to admin/config/workflow/workflows --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index 0bc5e43..7dc9e01 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -341,7 +341,7 @@ entity_type_cancel_destination: path: / enabled: false workflow: - path: / + path: /admin/config/workflow/workflows enabled: true pathauto_pattern: path: / -- GitLab From 8ee245c066dfa0d40c0369212eab52479faf777b Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Mon, 31 Oct 2022 14:05:02 -0400 Subject: [PATCH 061/180] ISTWCMS-4667 Enable cancel button for forms of the Pathauto pattern entity type and set to admin/config/search/path/patterns --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index 7dc9e01..9c406ed 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -344,7 +344,7 @@ entity_type_cancel_destination: path: /admin/config/workflow/workflows enabled: true pathauto_pattern: - path: / + path: /admin/config/search/path/patterns enabled: true password_policy: path: / -- GitLab From ef71a9558387b315d1594df25074812388e5b701 Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Mon, 31 Oct 2022 14:08:57 -0400 Subject: [PATCH 062/180] ISTWCMS-4667 Enable cancel button for forms of the Password Policy entity type and set to admin/config/security/password-policy --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index 9c406ed..eb735cd 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -347,7 +347,7 @@ entity_type_cancel_destination: path: /admin/config/search/path/patterns enabled: true password_policy: - path: / + path: /admin/config/security/password-policy enabled: true cookie_category: path: / -- GitLab From 4954a2ee5b36a67d14b318d1101774f9b0acd17a Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Mon, 31 Oct 2022 14:22:47 -0400 Subject: [PATCH 063/180] ISTWCMS-4667 Enable cancel button for forms of the Cookie category entity type and set to admin/config/system/eu-cookie-compliance/categories --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index eb735cd..7ada418 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -350,7 +350,7 @@ entity_type_cancel_destination: path: /admin/config/security/password-policy enabled: true cookie_category: - path: / + path: /admin/config/system/eu-cookie-compliance/categories enabled: true paragraphs_type: path: / -- GitLab From 2dccd89104bc2e3882b88244de59e86f08d8f6b6 Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Mon, 31 Oct 2022 15:17:06 -0400 Subject: [PATCH 064/180] ISTWCMS-4667 Enable cancel button for forms of the Date format entity type and set to admin/config/regional/date-time --- config/install/cancel_button.settings.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index 7ada418..c7202b1 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -78,8 +78,8 @@ entity_type_cancel_destination: path: / enabled: false date_format: - path: / - enabled: false + path: /admin/config/regional/date-time + enabled: true entity_view_mode: path: /admin/structure/display-modes/view enabled: true -- GitLab From 6cef22abc2792e5d8685eeded703ac63dc069a44 Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Mon, 31 Oct 2022 15:19:27 -0400 Subject: [PATCH 065/180] ISTWCMS-4667 Enable cancel button for forms of the Paragraphs type entity type and set to admin/structure/paragraphs_type --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index c7202b1..9ec3b63 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -353,7 +353,7 @@ entity_type_cancel_destination: path: /admin/config/system/eu-cookie-compliance/categories enabled: true paragraphs_type: - path: / + path: /admin/structure/paragraphs_type enabled: true paragraph_uw_para_call_to_action: path: / -- GitLab From fc659f41bbfe7474b33aa415758f2bcf87ac5b82 Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Mon, 31 Oct 2022 15:22:04 -0400 Subject: [PATCH 066/180] ISTWCMS-4667 Enable cancel button for forms of the Aggregator feed entity type and set to admin/config/services/aggregator --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index 9ec3b63..089529f 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -93,7 +93,7 @@ entity_type_cancel_destination: path: /admin/structure/display-modes/form enabled: true aggregator_feed: - path: / + path: /admin/config/services/aggregator enabled: true aggregator_item: path: / -- GitLab From cb0778a89f8505559595010d0338480285cc7fe8 Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Mon, 31 Oct 2022 15:26:21 -0400 Subject: [PATCH 067/180] ISTWCMS-4667 Disable cancel button for forms of the Aggregator feed item entity type --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index 089529f..60b66cd 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -97,7 +97,7 @@ entity_type_cancel_destination: enabled: true aggregator_item: path: / - enabled: true + enabled: false block_content_uw_cbl_banner_images: path: / block_content_uw_cbl_blockquote: -- GitLab From 2caa4d1cdea7129c945c8831251df0c2089708f6 Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Mon, 31 Oct 2022 15:34:56 -0400 Subject: [PATCH 068/180] ISTWCMS-4667 Enable cancel button for forms of the Captcha Point entity type and set to admin/config/people/captcha/captcha-points --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index 60b66cd..0696a87 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -139,7 +139,7 @@ entity_type_cancel_destination: block_content: enabled: true captcha_point: - path: / + path: /admin/config/people/captcha/captcha-points enabled: true contact_message_personal: path: / -- GitLab From f2fee2cbb65b7aca06ff80f4ab669d2598d524b2 Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Mon, 31 Oct 2022 15:41:02 -0400 Subject: [PATCH 069/180] ISTWCMS-4667 Disable cancel button for forms of the Contact message entity type --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index 0696a87..dc70297 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -144,7 +144,7 @@ entity_type_cancel_destination: contact_message_personal: path: / contact_message: - enabled: true + enabled: false content_moderation_state: path: / enabled: true -- GitLab From e0f217c97dcd105779198837c2dad6d14bb04ccc Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Mon, 31 Oct 2022 15:50:19 -0400 Subject: [PATCH 070/180] ISTWCMS-4667 Disable cancel button for forms of the Content moderation state entity type --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index dc70297..c0c97d7 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -147,7 +147,7 @@ entity_type_cancel_destination: enabled: false content_moderation_state: path: / - enabled: true + enabled: false crop_type: path: / enabled: true -- GitLab From 26f2908a17afc03913628c041d83dc7eb297b99a Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Mon, 31 Oct 2022 15:53:29 -0400 Subject: [PATCH 071/180] ISTWCMS-4667 Enable cancel button for forms of the Crop type entity type and set to admin/config/media/crop --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index c0c97d7..c239b57 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -149,7 +149,7 @@ entity_type_cancel_destination: path: / enabled: false crop_type: - path: / + path: /admin/config/media/crop enabled: true crop_uw_crop_media_large: path: / -- GitLab From 2171683fc5bca97c471ab1215685de5abbcf7608 Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Mon, 31 Oct 2022 15:57:35 -0400 Subject: [PATCH 072/180] ISTWCMS-4667 Enable cancel button for forms of the Dashboard entity type and set to admin/structure/dashboards --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index c239b57..1ee11a1 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -166,7 +166,7 @@ entity_type_cancel_destination: crop: enabled: true dashboard: - path: / + path: /admin/structure/dashboards enabled: true entity_browser: path: / -- GitLab From 4a48e96eabfd4f4356746fc76e9d64044fbeb7f4 Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Tue, 1 Nov 2022 09:49:34 -0400 Subject: [PATCH 073/180] ISTWCMS-4667 Enable cancel button for forms of the Entity browser entity type and set to admin/config/content/entity_browser --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index 1ee11a1..27ce5b2 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -169,7 +169,7 @@ entity_type_cancel_destination: path: /admin/structure/dashboards enabled: true entity_browser: - path: / + path: /admin/config/content/entity_browser enabled: true features_bundle: path: / -- GitLab From 657d324e9b929500db233f9865c9407a75174932 Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Tue, 1 Nov 2022 11:09:56 -0400 Subject: [PATCH 074/180] ISTWCMS-4667 Disable cancel button for forms of the Field validation rule set entity type --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index 27ce5b2..c362436 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -173,7 +173,7 @@ entity_type_cancel_destination: enabled: true features_bundle: path: / - enabled: true + enabled: false field_validation_rule_set: path: / enabled: true -- GitLab From f89930a5dcf1016cb379de569a5c96ef97bd8d04 Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Tue, 1 Nov 2022 11:19:55 -0400 Subject: [PATCH 075/180] ISTWCMS-4667 Enable cancel button for forms of the FillPDF form entity type and set to admin/structure/fillpdf --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index c362436..175a878 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -178,7 +178,7 @@ entity_type_cancel_destination: path: / enabled: true fillpdf_form: - path: / + path: /admin/structure/fillpdf enabled: true fillpdf_file_context: path: / -- GitLab From cfa598c3911b6d62530c33d8e6504200d42d731e Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Tue, 1 Nov 2022 11:22:47 -0400 Subject: [PATCH 076/180] ISTWCMS-4667 Disable cancel button for forms of the FillPDF file context entity type --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index 175a878..2447ad9 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -182,7 +182,7 @@ entity_type_cancel_destination: enabled: true fillpdf_file_context: path: / - enabled: true + enabled: false fillpdf_form_field: path: / enabled: true -- GitLab From 69f45445712b8b99da7b95f3e46977d64e4a49d4 Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Tue, 1 Nov 2022 11:28:06 -0400 Subject: [PATCH 077/180] ISTWCMS-4667 Enable cancel button for forms of the Image Optimize Pipeline entity type and set to admin/config/media/imageapi-optimize-pipelines --- config/install/cancel_button.settings.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index 2447ad9..ab6badb 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -185,9 +185,9 @@ entity_type_cancel_destination: enabled: false fillpdf_form_field: path: / - enabled: true + enabled: false imageapi_optimize_pipeline: - path: / + path: /admin/config/media/imageapi-optimize-pipelines enabled: true language_content_settings: path: / -- GitLab From 7aca6ef1271e3a0c63811681d8a68d8a47dcbd93 Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Tue, 1 Nov 2022 11:31:26 -0400 Subject: [PATCH 078/180] ISTWCMS-4667 Disable cancel button for forms of the Content Language Settings entity type --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index ab6badb..1fff411 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -191,7 +191,7 @@ entity_type_cancel_destination: enabled: true language_content_settings: path: / - enabled: true + enabled: false configurable_language: path: / enabled: true -- GitLab From 45c965fb5cfd636d4e8201ed5f72170359d4ee91 Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Tue, 1 Nov 2022 11:34:27 -0400 Subject: [PATCH 079/180] ISTWCMS-4667 Enable cancel button for forms of the Language entity type and set to admin/config/regional/language --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index 1fff411..52cdf55 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -193,7 +193,7 @@ entity_type_cancel_destination: path: / enabled: false configurable_language: - path: / + path: /admin/config/regional/language enabled: true layout_builder_browser_block: path: / -- GitLab From 67ab664e027e6a24cde224a58c8c28c125e96f2a Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Tue, 1 Nov 2022 11:38:27 -0400 Subject: [PATCH 080/180] ISTWCMS-4667 Enable cancel button for forms of the Layout builder browser block category entity type and set to admin/config/content/layout-builder-browser/categories --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index 52cdf55..235d331 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -199,7 +199,7 @@ entity_type_cancel_destination: path: / enabled: true layout_builder_browser_blockcat: - path: / + path: /admin/config/content/layout-builder-browser/categories enabled: true layout_builder_style: path: / -- GitLab From 1c115e9ef5bffea890b62dc036ec065bff8d18fc Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Tue, 1 Nov 2022 11:44:28 -0400 Subject: [PATCH 081/180] ISTWCMS-4667 Enable cancel button for forms of the Layout builder style entity type and set to admin/config/content/layout_builder_style --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index 235d331..5493a60 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -202,7 +202,7 @@ entity_type_cancel_destination: path: /admin/config/content/layout-builder-browser/categories enabled: true layout_builder_style: - path: / + path: /admin/config/content/layout_builder_style enabled: true layout_builder_style_group: path: /admin/config/content/layout_builder_style/group -- GitLab From ff036f0a633a818f0642b0a5c31ba9642340c97b Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Tue, 1 Nov 2022 13:26:04 -0400 Subject: [PATCH 082/180] ISTWCMS-4667 Enable cancel button for forms of the Taxonomy term entity type --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index 5493a60..8303920 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -55,7 +55,7 @@ entity_type_cancel_destination: enabled: false taxonomy_term: path: / - enabled: false + enabled: true taxonomy_vocabulary: path: /admin/structure/taxonomy enabled: true -- GitLab From 9aabe3774e12a905c7949b5d52444dd93aed80f8 Mon Sep 17 00:00:00 2001 From: Kevin Paxman Date: Tue, 8 Nov 2022 14:03:36 -0500 Subject: [PATCH 083/180] ISTWCMS-4667: disable cancel on webform submissions because it would always lead to the home page regardless of where the form was embedded --- config/install/cancel_button.settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/cancel_button.settings.yml b/config/install/cancel_button.settings.yml index 8303920..ed75fe2 100644 --- a/config/install/cancel_button.settings.yml +++ b/config/install/cancel_button.settings.yml @@ -327,7 +327,7 @@ entity_type_cancel_destination: enabled: true webform_submission: path: / - enabled: true + enabled: false webform_options: path: /admin/structure/webform/options/manage enabled: true -- GitLab From da83e42fd9607e81c3a27c3e289b173532a43cea Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Tue, 18 Oct 2022 14:11:31 -0400 Subject: [PATCH 084/180] ISTWCMS-5879 Add default style to four existing components --- .../layout_builder_styles.style.uw_lbs_carousel_1_item.yml | 2 +- .../layout_builder_styles.style.uw_lbs_carousel_2_items.yml | 2 +- .../layout_builder_styles.style.uw_lbs_carousel_3_items.yml | 2 +- .../layout_builder_styles.style.uw_lbs_carousel_4_items.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/install/layout_builder_styles.style.uw_lbs_carousel_1_item.yml b/config/install/layout_builder_styles.style.uw_lbs_carousel_1_item.yml index ace0bf2..3d18660 100644 --- a/config/install/layout_builder_styles.style.uw_lbs_carousel_1_item.yml +++ b/config/install/layout_builder_styles.style.uw_lbs_carousel_1_item.yml @@ -5,7 +5,7 @@ id: uw_lbs_carousel_1_item label: 'Carousel - 1 item' classes: uw-carousel--one-item type: component -group: null +group: default weight: -10 block_restrictions: - 'inline_block:uw_cbl_facts_and_figures' diff --git a/config/install/layout_builder_styles.style.uw_lbs_carousel_2_items.yml b/config/install/layout_builder_styles.style.uw_lbs_carousel_2_items.yml index 87d18f3..21076bf 100644 --- a/config/install/layout_builder_styles.style.uw_lbs_carousel_2_items.yml +++ b/config/install/layout_builder_styles.style.uw_lbs_carousel_2_items.yml @@ -5,7 +5,7 @@ id: uw_lbs_carousel_2_items label: 'Carousel - 2 items' classes: uw-carousel--two-items type: component -group: null +group: default weight: -9 block_restrictions: - 'inline_block:uw_cbl_facts_and_figures' diff --git a/config/install/layout_builder_styles.style.uw_lbs_carousel_3_items.yml b/config/install/layout_builder_styles.style.uw_lbs_carousel_3_items.yml index 3f04717..a4e3440 100644 --- a/config/install/layout_builder_styles.style.uw_lbs_carousel_3_items.yml +++ b/config/install/layout_builder_styles.style.uw_lbs_carousel_3_items.yml @@ -5,7 +5,7 @@ id: uw_lbs_carousel_3_items label: 'Carousel - 3 items' classes: uw-carousel--three-items type: component -group: null +group: default weight: -8 block_restrictions: - 'inline_block:uw_cbl_facts_and_figures' diff --git a/config/install/layout_builder_styles.style.uw_lbs_carousel_4_items.yml b/config/install/layout_builder_styles.style.uw_lbs_carousel_4_items.yml index 550699c..5d9396e 100644 --- a/config/install/layout_builder_styles.style.uw_lbs_carousel_4_items.yml +++ b/config/install/layout_builder_styles.style.uw_lbs_carousel_4_items.yml @@ -5,7 +5,7 @@ id: uw_lbs_carousel_4_items label: 'Carousel - 4 items' classes: uw-carousel--four-items type: component -group: null +group: default weight: -7 block_restrictions: - 'inline_block:uw_cbl_facts_and_figures' -- GitLab From 5abe846e2c4f38c6cc88aca9fdd233a94b11eef0 Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Wed, 9 Nov 2022 10:00:31 -0500 Subject: [PATCH 085/180] ISTWCMS-5939 Click Save configuration button under admin/config/search/metatag/settings (it is not due to 8.x-1.22) --- config/install/metatag.settings.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/config/install/metatag.settings.yml b/config/install/metatag.settings.yml index f13c69e..1fe2185 100644 --- a/config/install/metatag.settings.yml +++ b/config/install/metatag.settings.yml @@ -53,11 +53,24 @@ entity_type_groups: advanced: advanced open_graph: open_graph twitter_cards: twitter_cards - schema_web_page: schema_web_page schema_service: schema_service + schema_web_page: schema_web_page uw_ct_web_page: basic: basic advanced: advanced open_graph: open_graph twitter_cards: twitter_cards schema_web_page: schema_web_page +tag_trim_method: beforeValue +tag_trim_maxlength: + metatag_maxlength_description: null + metatag_maxlength_abstract: null + metatag_maxlength_title: null + metatag_maxlength_og_description: null + metatag_maxlength_og_site_name: null + metatag_maxlength_og_title: null + metatag_maxlength_twitter_cards_title: null + metatag_maxlength_twitter_cards_label1: null + metatag_maxlength_twitter_cards_description: null + metatag_maxlength_twitter_cards_label2: null +tag_scroll_max_height: '' -- GitLab From 38c839c85f9cb88f1af308203c396617a4f0aad2 Mon Sep 17 00:00:00 2001 From: Kevin Paxman Date: Fri, 11 Nov 2022 09:42:07 -0500 Subject: [PATCH 086/180] ISTWCMS-5943: update how-to link --- uw_cfg_common.links.menu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uw_cfg_common.links.menu.yml b/uw_cfg_common.links.menu.yml index 867e803..b205bda 100644 --- a/uw_cfg_common.links.menu.yml +++ b/uw_cfg_common.links.menu.yml @@ -433,7 +433,7 @@ uw_site_management.submit_request: uw_site_management.wcms_how_to_documents: title: 'WCMS how-to documents' menu_name: uw-menu-site-management - url: https://uwaterloo.ca/web-resources/wcms-users/training-and-support/wcms-how-documents + url: https://uwaterloo.ca/web-resources/wcms-3-users/wcms-3-training-and-support/wcms-3-how-documents weight: 0 uw_site_management.manage_all_Media: title: 'Manage all media' -- GitLab From 4ae1f52c62317fa46d43d432c29395a22fbcca84 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Thu, 10 Nov 2022 10:01:36 -0500 Subject: [PATCH 087/180] ISTWCMS-5900: adding layout builder browser for contact blocks --- ...der_browser_block.uw_lbb_contact_list_automatic.yml | 10 ++++++++++ ...uilder_browser_block.uw_lbb_contact_list_manual.yml | 10 ++++++++++ ...out_builder_browser_block.uw_lbb_contact_teaser.yml | 10 ++++++++++ 3 files changed, 30 insertions(+) create mode 100644 config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_contact_list_automatic.yml create mode 100644 config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_contact_list_manual.yml create mode 100644 config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_contact_teaser.yml diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_contact_list_automatic.yml b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_contact_list_automatic.yml new file mode 100644 index 0000000..8b6f0f3 --- /dev/null +++ b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_contact_list_automatic.yml @@ -0,0 +1,10 @@ +langcode: en +status: true +dependencies: { } +id: uw_lbb_contact_list_automatic +block_id: uw_cbl_contacts_automatic +category: uw_bc_listings +label: 'Contact list (automatic)' +image_path: images/layout_builder_browser/contactlist.svg +image_path_base: 'theme:uw_fdsu_theme_resp' +image_alt: 'Contact list automatic' diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_contact_list_manual.yml b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_contact_list_manual.yml new file mode 100644 index 0000000..e6d52fe --- /dev/null +++ b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_contact_list_manual.yml @@ -0,0 +1,10 @@ +langcode: en +status: true +dependencies: { } +id: uw_lbb_contact_list_manual +block_id: uw_cbl_contacts_manual +category: uw_bc_listings +label: 'Contact list (manual)' +image_path: images/layout_builder_browser/contactlist-manual.svg +image_path_base: 'theme:uw_fdsu_theme_resp' +image_alt: 'Contact list manual' diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_contact_teaser.yml b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_contact_teaser.yml new file mode 100644 index 0000000..e8a30a5 --- /dev/null +++ b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_contact_teaser.yml @@ -0,0 +1,10 @@ +langcode: en +status: true +dependencies: { } +id: uw_lbb_contact_teaser +block_id: uw_cbl_contact_teaser +category: uw_bc_teasers +label: 'Contact teaser' +image_path: images/layout_builder_browser/contactteaser.svg +image_path_base: 'theme:uw_fdsu_theme_resp' +image_alt: Contact -- GitLab From 87ede4d5d91c1687ce5fd438cee72651df47d08c Mon Sep 17 00:00:00 2001 From: Kevin Paxman Date: Mon, 21 Nov 2022 12:01:34 -0500 Subject: [PATCH 088/180] ISTWCMS-5900: fix overridden feature by saving weight config --- ...ayout_builder_browser_block.uw_lbb_contact_list_automatic.yml | 1 + ...r.layout_builder_browser_block.uw_lbb_contact_list_manual.yml | 1 + ...rowser.layout_builder_browser_block.uw_lbb_contact_teaser.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_contact_list_automatic.yml b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_contact_list_automatic.yml index 8b6f0f3..0d53a14 100644 --- a/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_contact_list_automatic.yml +++ b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_contact_list_automatic.yml @@ -8,3 +8,4 @@ label: 'Contact list (automatic)' image_path: images/layout_builder_browser/contactlist.svg image_path_base: 'theme:uw_fdsu_theme_resp' image_alt: 'Contact list automatic' +weight: 0 diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_contact_list_manual.yml b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_contact_list_manual.yml index e6d52fe..12ebf06 100644 --- a/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_contact_list_manual.yml +++ b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_contact_list_manual.yml @@ -8,3 +8,4 @@ label: 'Contact list (manual)' image_path: images/layout_builder_browser/contactlist-manual.svg image_path_base: 'theme:uw_fdsu_theme_resp' image_alt: 'Contact list manual' +weight: 0 diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_contact_teaser.yml b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_contact_teaser.yml index e8a30a5..2dccb7e 100644 --- a/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_contact_teaser.yml +++ b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_contact_teaser.yml @@ -8,3 +8,4 @@ label: 'Contact teaser' image_path: images/layout_builder_browser/contactteaser.svg image_path_base: 'theme:uw_fdsu_theme_resp' image_alt: Contact +weight: 0 -- GitLab From a667712475e63fff29d2d0d948f3a2c53e6c77d1 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Wed, 12 Oct 2022 15:58:30 -0400 Subject: [PATCH 089/180] ISTWCMS-5880: adding states for banners above page title --- uw_cfg_common.module | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/uw_cfg_common.module b/uw_cfg_common.module index b63253a..805ff86 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -897,6 +897,16 @@ function uw_cfg_common_form_alter(array &$form, FormStateInterface $form_state, ], ], ]; + + $form['field_uw_node_banner']['#states'] = [ + 'visible' => [ + [ + 'select[name="field_uw_type_of_media"]' => [ + ['value' => 'banner'], + ], + ], + ], + ]; } // If we are on the media upload form, we want to restrict -- GitLab From e5811d0bd2cd385316dff5d5ce5d101f1f5a4340 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Wed, 12 Oct 2022 16:35:13 -0400 Subject: [PATCH 090/180] ISTWCMS-5880: adding banner states --- uw_cfg_common.module | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/uw_cfg_common.module b/uw_cfg_common.module index 805ff86..94e1c4e 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -888,6 +888,8 @@ function uw_cfg_common_form_alter(array &$form, FormStateInterface $form_state, // on a node add/edit page, so add the states for the // actual media types in the hero section. if (isset($form['field_uw_type_of_media'])) { + + // Set the states for the hero image. $form['field_uw_hero_image']['#states'] = [ 'visible' => [ [ @@ -898,7 +900,8 @@ function uw_cfg_common_form_alter(array &$form, FormStateInterface $form_state, ], ]; - $form['field_uw_node_banner']['#states'] = [ + // Set the states for the banner. + $form['field_uw_banner']['#states'] = [ 'visible' => [ [ 'select[name="field_uw_type_of_media"]' => [ -- GitLab From 87bdbd502bbf8bde5ded0f7450c76f47e704480b Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Wed, 12 Oct 2022 16:35:37 -0400 Subject: [PATCH 091/180] ISTWCMS-5880: adding banner field --- .../field.storage.node.field_uw_banner.yml | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 config/install/field.storage.node.field_uw_banner.yml diff --git a/config/install/field.storage.node.field_uw_banner.yml b/config/install/field.storage.node.field_uw_banner.yml new file mode 100644 index 0000000..38e4c28 --- /dev/null +++ b/config/install/field.storage.node.field_uw_banner.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + module: + - entity_reference_revisions + - node + - paragraphs +id: node.field_uw_banner +field_name: field_uw_banner +entity_type: node +type: entity_reference_revisions +settings: + target_type: paragraph +module: entity_reference_revisions +locked: false +cardinality: -1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false -- GitLab From ae7aa9409fb347cfd26baa0c8a567b6b013d1410 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Fri, 14 Oct 2022 08:44:11 -0400 Subject: [PATCH 092/180] ISTWCMS-5880: adding web page to media --- src/Service/UWService.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Service/UWService.php b/src/Service/UWService.php index 7e6a4bb..a6c9018 100644 --- a/src/Service/UWService.php +++ b/src/Service/UWService.php @@ -210,6 +210,7 @@ class UWService implements UWServiceInterface { 'uw_ct_project', 'uw_ct_catalog_item', 'uw_ct_service', + 'uw_ct_web_page', ]; break; @@ -232,6 +233,7 @@ class UWService implements UWServiceInterface { 'uw_ct_blog', 'uw_ct_event', 'uw_ct_news_item', + 'uw_ct_web_page', ]; break; } -- GitLab From ad30a13692dcbd67bc636f390136f97b6690636c Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Fri, 14 Oct 2022 09:05:08 -0400 Subject: [PATCH 093/180] ISTWCMS-5880: adding states for group of banner settings --- uw_cfg_common.module | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/uw_cfg_common.module b/uw_cfg_common.module index 94e1c4e..0cd525a 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -910,6 +910,17 @@ function uw_cfg_common_form_alter(array &$form, FormStateInterface $form_state, ], ], ]; + + // Set the states for the banner. + $form['group_banner_settings']['#states'] = [ + 'visible' => [ + [ + 'select[name="field_uw_type_of_media"]' => [ + ['value' => 'banner'], + ], + ], + ], + ]; } // If we are on the media upload form, we want to restrict -- GitLab From 35edb731e91665eeeb6a630d6d7478abc84a8e63 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Fri, 14 Oct 2022 09:18:49 -0400 Subject: [PATCH 094/180] ISTWCMS-5880: adding field storage for banner settings --- .../field.storage.node.field_uw_autoplay.yml | 17 ++++++++++ ...ield.storage.node.field_uw_slide_speed.yml | 20 ++++++++++++ ...orage.node.field_uw_text_overlay_style.yml | 32 +++++++++++++++++++ ...storage.node.field_uw_transition_speed.yml | 19 +++++++++++ 4 files changed, 88 insertions(+) create mode 100644 config/install/field.storage.node.field_uw_autoplay.yml create mode 100644 config/install/field.storage.node.field_uw_slide_speed.yml create mode 100644 config/install/field.storage.node.field_uw_text_overlay_style.yml create mode 100644 config/install/field.storage.node.field_uw_transition_speed.yml diff --git a/config/install/field.storage.node.field_uw_autoplay.yml b/config/install/field.storage.node.field_uw_autoplay.yml new file mode 100644 index 0000000..15dd121 --- /dev/null +++ b/config/install/field.storage.node.field_uw_autoplay.yml @@ -0,0 +1,17 @@ +langcode: en +status: true +dependencies: + module: + - node +id: node.field_uw_autoplay +field_name: field_uw_autoplay +entity_type: node +type: boolean +settings: { } +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/install/field.storage.node.field_uw_slide_speed.yml b/config/install/field.storage.node.field_uw_slide_speed.yml new file mode 100644 index 0000000..40e4c89 --- /dev/null +++ b/config/install/field.storage.node.field_uw_slide_speed.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + module: + - node +id: node.field_uw_slide_speed +field_name: field_uw_slide_speed +entity_type: node +type: integer +settings: + unsigned: false + size: normal +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false + diff --git a/config/install/field.storage.node.field_uw_text_overlay_style.yml b/config/install/field.storage.node.field_uw_text_overlay_style.yml new file mode 100644 index 0000000..6f45549 --- /dev/null +++ b/config/install/field.storage.node.field_uw_text_overlay_style.yml @@ -0,0 +1,32 @@ +langcode: en +status: true +dependencies: + module: + - node + - options +id: node.field_uw_text_overlay_style +field_name: field_uw_text_overlay_style +entity_type: node +type: list_string +settings: + allowed_values: + - + value: full-width + label: 'Full banner width, bottom, theme colour background ("FDSU" style)' + - + value: inset + label: 'Inset from banner, bottom, black background ("home page" style)' + - + value: split + label: 'Split top and bottom, black and white backgrounds ("single page" style)' + - + value: full-overlay + label: 'Full black overlay, centered text ("conference" style)' + allowed_values_function: '' +module: options +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/install/field.storage.node.field_uw_transition_speed.yml b/config/install/field.storage.node.field_uw_transition_speed.yml new file mode 100644 index 0000000..d14af62 --- /dev/null +++ b/config/install/field.storage.node.field_uw_transition_speed.yml @@ -0,0 +1,19 @@ +langcode: en +status: true +dependencies: + module: + - node +id: node.field_uw_transition_speed +field_name: field_uw_transition_speed +entity_type: node +type: integer +settings: + unsigned: false + size: normal +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false -- GitLab From 5693ff9a6507d09db820ead8b6c3081a647982c8 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Fri, 14 Oct 2022 09:31:55 -0400 Subject: [PATCH 095/180] ISTWCMS-5880: coding standards --- config/install/field.storage.node.field_uw_slide_speed.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/config/install/field.storage.node.field_uw_slide_speed.yml b/config/install/field.storage.node.field_uw_slide_speed.yml index 40e4c89..ecc45be 100644 --- a/config/install/field.storage.node.field_uw_slide_speed.yml +++ b/config/install/field.storage.node.field_uw_slide_speed.yml @@ -17,4 +17,3 @@ translatable: true indexes: { } persist_with_no_fields: false custom_storage: false - -- GitLab From da3898baa00adbe6848de7e1ac23e2b6e526d553 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Fri, 14 Oct 2022 09:35:25 -0400 Subject: [PATCH 096/180] ISTWCMS-5880: adding labels to banner settings fields --- config/install/field.storage.node.field_uw_autoplay.yml | 1 + config/install/field.storage.node.field_uw_slide_speed.yml | 1 + .../install/field.storage.node.field_uw_text_overlay_style.yml | 1 + config/install/field.storage.node.field_uw_transition_speed.yml | 1 + 4 files changed, 4 insertions(+) diff --git a/config/install/field.storage.node.field_uw_autoplay.yml b/config/install/field.storage.node.field_uw_autoplay.yml index 15dd121..8a21148 100644 --- a/config/install/field.storage.node.field_uw_autoplay.yml +++ b/config/install/field.storage.node.field_uw_autoplay.yml @@ -6,6 +6,7 @@ dependencies: id: node.field_uw_autoplay field_name: field_uw_autoplay entity_type: node +label: 'Autoplay' type: boolean settings: { } module: core diff --git a/config/install/field.storage.node.field_uw_slide_speed.yml b/config/install/field.storage.node.field_uw_slide_speed.yml index ecc45be..a62c20a 100644 --- a/config/install/field.storage.node.field_uw_slide_speed.yml +++ b/config/install/field.storage.node.field_uw_slide_speed.yml @@ -6,6 +6,7 @@ dependencies: id: node.field_uw_slide_speed field_name: field_uw_slide_speed entity_type: node +label: 'Slide speed' type: integer settings: unsigned: false diff --git a/config/install/field.storage.node.field_uw_text_overlay_style.yml b/config/install/field.storage.node.field_uw_text_overlay_style.yml index 6f45549..2ac2458 100644 --- a/config/install/field.storage.node.field_uw_text_overlay_style.yml +++ b/config/install/field.storage.node.field_uw_text_overlay_style.yml @@ -7,6 +7,7 @@ dependencies: id: node.field_uw_text_overlay_style field_name: field_uw_text_overlay_style entity_type: node +label: 'Text overlay style' type: list_string settings: allowed_values: diff --git a/config/install/field.storage.node.field_uw_transition_speed.yml b/config/install/field.storage.node.field_uw_transition_speed.yml index d14af62..a229375 100644 --- a/config/install/field.storage.node.field_uw_transition_speed.yml +++ b/config/install/field.storage.node.field_uw_transition_speed.yml @@ -6,6 +6,7 @@ dependencies: id: node.field_uw_transition_speed field_name: field_uw_transition_speed entity_type: node +label: 'Transition speed' type: integer settings: unsigned: false -- GitLab From 1f347fc7c2e9d96bb4b2fd9271e1524b9aa3de94 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Fri, 14 Oct 2022 09:39:58 -0400 Subject: [PATCH 097/180] ISTWCMS-5880: guess features doesn't like labels for field storage --- config/install/field.storage.node.field_uw_autoplay.yml | 1 - config/install/field.storage.node.field_uw_slide_speed.yml | 1 - .../install/field.storage.node.field_uw_text_overlay_style.yml | 1 - config/install/field.storage.node.field_uw_transition_speed.yml | 1 - 4 files changed, 4 deletions(-) diff --git a/config/install/field.storage.node.field_uw_autoplay.yml b/config/install/field.storage.node.field_uw_autoplay.yml index 8a21148..15dd121 100644 --- a/config/install/field.storage.node.field_uw_autoplay.yml +++ b/config/install/field.storage.node.field_uw_autoplay.yml @@ -6,7 +6,6 @@ dependencies: id: node.field_uw_autoplay field_name: field_uw_autoplay entity_type: node -label: 'Autoplay' type: boolean settings: { } module: core diff --git a/config/install/field.storage.node.field_uw_slide_speed.yml b/config/install/field.storage.node.field_uw_slide_speed.yml index a62c20a..ecc45be 100644 --- a/config/install/field.storage.node.field_uw_slide_speed.yml +++ b/config/install/field.storage.node.field_uw_slide_speed.yml @@ -6,7 +6,6 @@ dependencies: id: node.field_uw_slide_speed field_name: field_uw_slide_speed entity_type: node -label: 'Slide speed' type: integer settings: unsigned: false diff --git a/config/install/field.storage.node.field_uw_text_overlay_style.yml b/config/install/field.storage.node.field_uw_text_overlay_style.yml index 2ac2458..6f45549 100644 --- a/config/install/field.storage.node.field_uw_text_overlay_style.yml +++ b/config/install/field.storage.node.field_uw_text_overlay_style.yml @@ -7,7 +7,6 @@ dependencies: id: node.field_uw_text_overlay_style field_name: field_uw_text_overlay_style entity_type: node -label: 'Text overlay style' type: list_string settings: allowed_values: diff --git a/config/install/field.storage.node.field_uw_transition_speed.yml b/config/install/field.storage.node.field_uw_transition_speed.yml index a229375..d14af62 100644 --- a/config/install/field.storage.node.field_uw_transition_speed.yml +++ b/config/install/field.storage.node.field_uw_transition_speed.yml @@ -6,7 +6,6 @@ dependencies: id: node.field_uw_transition_speed field_name: field_uw_transition_speed entity_type: node -label: 'Transition speed' type: integer settings: unsigned: false -- GitLab From f6d9ad4754924de1661d995249417f64fa4bc155 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Fri, 14 Oct 2022 09:47:01 -0400 Subject: [PATCH 098/180] ISTWCMS-5880: adding allowed values function for type of media field --- ...ld.storage.node.field_uw_type_of_media.yml | 7 ++--- uw_cfg_common.module | 28 +++++++++++++++++++ 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/config/install/field.storage.node.field_uw_type_of_media.yml b/config/install/field.storage.node.field_uw_type_of_media.yml index 3671c93..196be0a 100644 --- a/config/install/field.storage.node.field_uw_type_of_media.yml +++ b/config/install/field.storage.node.field_uw_type_of_media.yml @@ -9,11 +9,8 @@ field_name: field_uw_type_of_media entity_type: node type: list_string settings: - allowed_values: - - - value: image - label: Image - allowed_values_function: '' + allowed_values: { } + allowed_values_function: '_uw_cfg_common_allowed_media_types' module: options locked: false cardinality: 1 diff --git a/uw_cfg_common.module b/uw_cfg_common.module index 0cd525a..0772ca8 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -7,6 +7,7 @@ use Drupal\Component\Utility\Html; use Drupal\Core\Access\AccessResult; +use Drupal\Core\Entity\ContentEntityInterface; use Drupal\Core\Entity\Display\EntityViewDisplayInterface; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Form\FormStateInterface; @@ -14,6 +15,7 @@ use Drupal\Core\Link; use Drupal\Core\Render\Element; use Drupal\Core\Session\AccountInterface; use Drupal\Core\Url; +use Drupal\field\Entity\FieldStorageConfig; use Drupal\fillpdf\Controller\HandlePdfController; use Drupal\fillpdf\Form\FillPdfFormForm; use Drupal\media_library\MediaLibraryState; @@ -1432,3 +1434,29 @@ function uw_cfg_common_preprocess_html(&$variables): void { $variables['page']['#attached']['html_head'][] = [$noindex, 'noindex']; } } + +/** + * Set dynamic allowed values for the type of media field. + * + * @param \Drupal\field\Entity\FieldStorageConfig $definition + * The field definition. + * @param \Drupal\Core\Entity\ContentEntityInterface|null $entity + * The entity being created if applicable. + * @param bool $cacheable + * Boolean indicating if the results are cacheable. + * + * @return array + * An array of possible key and value options. + * + * @see options_allowed_values() + */ +function _uw_cfg_common_allowed_media_types( + FieldStorageConfig $definition, + ContentEntityInterface $entity = NULL, $cacheable +) { + + return [ + 'banner' => 'Banner images', + 'image' => 'Image', + ]; +} -- GitLab From c9bf8b5fe4b5f8538ef2f83a880182b7ec595e6d Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Fri, 14 Oct 2022 10:00:26 -0400 Subject: [PATCH 099/180] ISTWCMS-5880: coding standards --- uw_cfg_common.module | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/uw_cfg_common.module b/uw_cfg_common.module index 0772ca8..4843c0f 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -886,11 +886,25 @@ function uw_cfg_common_form_alter(array &$form, FormStateInterface $form_state, } } + $node = \Drupal::routeMatch()->getParameter('node'); + // If there is a type of media field, it means that we are // on a node add/edit page, so add the states for the // actual media types in the hero section. if (isset($form['field_uw_type_of_media'])) { + $node_type = str_replace('node_uw_ct_', '' , $form_id); + $node_type = str_replace('_edit', '' , $node_type); + $node_type = str_replace('_form', '' , $node_type); + + $remove_hero_image_nodes = [ + 'web_page', + ]; + + if (in_array($node_type, $remove_hero_image_nodes)) { + unset($form['field_uw_type_of_media']['widget']['#options']['image']); + } + // Set the states for the hero image. $form['field_uw_hero_image']['#states'] = [ 'visible' => [ @@ -1452,7 +1466,8 @@ function uw_cfg_common_preprocess_html(&$variables): void { */ function _uw_cfg_common_allowed_media_types( FieldStorageConfig $definition, - ContentEntityInterface $entity = NULL, $cacheable + ContentEntityInterface $entity = NULL, + $cacheable ) { return [ -- GitLab From 8936fdbb06dc99a86f6145a034710b3935316fcb Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Fri, 14 Oct 2022 10:02:54 -0400 Subject: [PATCH 100/180] ISTWCMS-5880: adding code to remove hero image from media for certain content types --- uw_cfg_common.module | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/uw_cfg_common.module b/uw_cfg_common.module index 4843c0f..3b252cc 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -893,14 +893,17 @@ function uw_cfg_common_form_alter(array &$form, FormStateInterface $form_state, // actual media types in the hero section. if (isset($form['field_uw_type_of_media'])) { - $node_type = str_replace('node_uw_ct_', '' , $form_id); - $node_type = str_replace('_edit', '' , $node_type); - $node_type = str_replace('_form', '' , $node_type); + // Get the node type from the form id. + $node_type = str_replace('node_uw_ct_', '', $form_id); + $node_type = str_replace('_edit', '', $node_type); + $node_type = str_replace('_form', '', $node_type); + // Content types to remove the hero image from media. $remove_hero_image_nodes = [ 'web_page', ]; + // If the node type can not have hero image, remove the option. if (in_array($node_type, $remove_hero_image_nodes)) { unset($form['field_uw_type_of_media']['widget']['#options']['image']); } -- GitLab From 98bfe684c3d4be47894a1a6ad162ad58f3b74c0e Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Fri, 14 Oct 2022 10:03:55 -0400 Subject: [PATCH 101/180] ISTWCMS-5880: coding standards --- uw_cfg_common.module | 2 -- 1 file changed, 2 deletions(-) diff --git a/uw_cfg_common.module b/uw_cfg_common.module index 3b252cc..f0c1348 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -886,8 +886,6 @@ function uw_cfg_common_form_alter(array &$form, FormStateInterface $form_state, } } - $node = \Drupal::routeMatch()->getParameter('node'); - // If there is a type of media field, it means that we are // on a node add/edit page, so add the states for the // actual media types in the hero section. -- GitLab From 8b0d3e58c6138d0e33746f54ff101853c0a52b90 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Fri, 14 Oct 2022 10:49:09 -0400 Subject: [PATCH 102/180] ISTWCMS-5880: adding settings to banners on node pages --- src/Service/UwNodeFieldValue.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Service/UwNodeFieldValue.php b/src/Service/UwNodeFieldValue.php index 0a9e12e..f5cc929 100644 --- a/src/Service/UwNodeFieldValue.php +++ b/src/Service/UwNodeFieldValue.php @@ -300,10 +300,10 @@ class UwNodeFieldValue { $banners = [ 'images' => $images, - // 'autoplay' => $block_content->field_uw_autoplay->value, - // 'slide_speed' => $block_content->field_uw_slide_speed->value, - // 'style' => $block_content->field_uw_text_overlay_style->value, - // 'transition_speed' => $block_content->field_uw_transition_speed->value, + 'autoplay' => $node->field_uw_autoplay->value, + 'slide_speed' => $node->field_uw_slide_speed->value, + 'style' => $node->field_uw_text_overlay_style->value, + 'transition_speed' => $node->field_uw_transition_speed->value, ]; return $banners; -- GitLab From 91482c5c78fd74b8624839f54baffd5605b98dff Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Fri, 14 Oct 2022 16:33:55 -0400 Subject: [PATCH 103/180] ISTWCMS-5880: adding the custom validation for banners --- uw_cfg_common.module | 68 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 67 insertions(+), 1 deletion(-) diff --git a/uw_cfg_common.module b/uw_cfg_common.module index f0c1348..a34618a 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -928,7 +928,7 @@ function uw_cfg_common_form_alter(array &$form, FormStateInterface $form_state, ], ]; - // Set the states for the banner. + // Set the states for the banner settings. $form['group_banner_settings']['#states'] = [ 'visible' => [ [ @@ -938,6 +938,9 @@ function uw_cfg_common_form_alter(array &$form, FormStateInterface $form_state, ], ], ]; + + // Add our custom validation for banners. + $form['#validate'][] = '_uw_cfg_common_banner_validate'; } // If we are on the media upload form, we want to restrict @@ -1040,6 +1043,69 @@ function _uw_cfg_common_alias_validate(array &$form, FormStateInterface $form_st } } +/** + * Validates submission values for banners on nodes. + */ +function _uw_cfg_common_banner_validate(array &$form, FormStateInterface $form_state) { + + // Get the values of the form state. + $values = $form_state->getValues(); + + // If there is a type of media set and it is banners, + // then perform the validation. + if ( + isset($values['field_uw_type_of_media']) && + $values['field_uw_type_of_media'][0]['value'] == 'banner' + ) { + + // Since the add more button is in the values, and there is + // a mix of integers and strings as keys, we need to count + // the array keys and if it is less than or equal to one + // means that the user has not entered a banner at all. + if (count(array_keys($values['field_uw_banner'])) <= 1) { + + $form_state->setError($form['field_uw_banner'], t('You must add at least one banner.')); + } + // At least one banner, now check that there is an + // image in each banner. + else { + + // Step through all the values of banners and check for an image. + foreach ($values['field_uw_banner'] as $key => $value) { + + // Ensure that the key is an integer, since there is an add_more + // in the values. + if (is_int($key)) { + + // If there is no selection on the media, then there is no image, + // so set the error. + // @TO-DO: fix so that inline errors show. + if (!isset($value['subform']['field_uw_ban_image']['selection'])) { + + // Set the error that an image is missing. + $form_state->setError($form['field_uw_banner']['widget'][$key]['subform']['field_uw_ban_image'], t('Banner image field is required.')); + } + } + } + } + } +} + +/** + * Implements hook_field_widget_WIDGET_TYPE_form_alter(). + */ +function uw_cfg_common_field_widget_entity_reference_paragraphs_form_alter(&$element, &$form_state, $context) { + if ($element['#paragraph_type'] == 'uw_para_image_banner') { + if (!isset($context['form']['#block'])) { + $element['subform']['field_uw_ban_image']['widget']['#attributes']['class'] = 'form-required js-form-required'; + } + else { + $element['subform']['field_uw_ban_image']['widget']['#required'] = TRUE; + } + } +} + + /** * Implements hook_field_widget_WIDGET_TYPE_form_alter(). */ -- GitLab From 3e5d0e4339bf58e9803757265accb2189c3ebca3 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Fri, 14 Oct 2022 16:35:27 -0400 Subject: [PATCH 104/180] ISTWCMS-5880: coding standards --- uw_cfg_common.module | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/uw_cfg_common.module b/uw_cfg_common.module index a34618a..457e942 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -1079,7 +1079,7 @@ function _uw_cfg_common_banner_validate(array &$form, FormStateInterface $form_s // If there is no selection on the media, then there is no image, // so set the error. - // @TO-DO: fix so that inline errors show. + // @todo: fix so that inline errors show. if (!isset($value['subform']['field_uw_ban_image']['selection'])) { // Set the error that an image is missing. @@ -1105,7 +1105,6 @@ function uw_cfg_common_field_widget_entity_reference_paragraphs_form_alter(&$ele } } - /** * Implements hook_field_widget_WIDGET_TYPE_form_alter(). */ -- GitLab From 1419e345351ee7bb083436b94fdf7f6be521e0d2 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Fri, 14 Oct 2022 16:36:22 -0400 Subject: [PATCH 105/180] ISTWCMS-5880: coding standards --- uw_cfg_common.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uw_cfg_common.module b/uw_cfg_common.module index 457e942..68b9e45 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -1079,7 +1079,7 @@ function _uw_cfg_common_banner_validate(array &$form, FormStateInterface $form_s // If there is no selection on the media, then there is no image, // so set the error. - // @todo: fix so that inline errors show. + // @todo fix so that inline errors show. if (!isset($value['subform']['field_uw_ban_image']['selection'])) { // Set the error that an image is missing. -- GitLab From 2af11fd9532ed07955560a476fa07b0f9f13d24d Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Fri, 14 Oct 2022 20:03:31 -0400 Subject: [PATCH 106/180] ISTWCMS-5880: moving banners paragraphs from custom blocks here --- ...paragraph.uw_para_image_banner.default.yml | 51 +++++++++++++++ ...paragraph.uw_para_image_banner.default.yml | 54 ++++++++++++++++ ...aph.uw_para_local_video_banner.default.yml | 64 +++++++++++++++++++ ...ara_image_banner.field_uw_ban_big_text.yml | 23 +++++++ ...w_para_image_banner.field_uw_ban_image.yml | 28 ++++++++ ...uw_para_image_banner.field_uw_ban_link.yml | 26 ++++++++ ...a_image_banner.field_uw_ban_small_text.yml | 23 +++++++ ...cal_video_banner.field_uw_ban_big_text.yml | 23 +++++++ ...deo_banner.field_uw_ban_fallback_image.yml | 33 ++++++++++ ...a_local_video_banner.field_uw_ban_link.yml | 26 ++++++++ ...l_video_banner.field_uw_ban_small_text.yml | 23 +++++++ ..._local_video_banner.field_uw_ban_video.yml | 33 ++++++++++ ...meo_video_banner.field_uw_ban_big_text.yml | 23 +++++++ ...deo_banner.field_uw_ban_fallback_image.yml | 33 ++++++++++ ...a_vimeo_video_banner.field_uw_ban_link.yml | 26 ++++++++ ...o_video_banner.field_uw_ban_small_text.yml | 23 +++++++ ..._video_banner.field_uw_ban_vimeo_video.yml | 33 ++++++++++ .../field.storage.node.field_uw_audience.yml | 19 ++++++ ...field.storage.node.field_uw_hero_image.yml | 19 ++++++ ...torage.paragraph.field_uw_ban_big_text.yml | 20 ++++++ ....paragraph.field_uw_ban_fallback_image.yml | 19 ++++++ ...d.storage.paragraph.field_uw_ban_image.yml | 19 ++++++ ...ld.storage.paragraph.field_uw_ban_link.yml | 18 ++++++ ...rage.paragraph.field_uw_ban_small_text.yml | 20 ++++++ ...d.storage.paragraph.field_uw_ban_video.yml | 19 ++++++ ...age.paragraph.field_uw_ban_vimeo_video.yml | 19 ++++++ ...s.paragraphs_type.uw_para_image_banner.yml | 9 +++ ...graphs_type.uw_para_local_video_banner.yml | 9 +++ ...graphs_type.uw_para_vimeo_video_banner.yml | 9 +++ 29 files changed, 744 insertions(+) create mode 100644 config/install/core.entity_form_display.paragraph.uw_para_image_banner.default.yml create mode 100644 config/install/core.entity_view_display.paragraph.uw_para_image_banner.default.yml create mode 100644 config/install/core.entity_view_display.paragraph.uw_para_local_video_banner.default.yml create mode 100644 config/install/field.field.paragraph.uw_para_image_banner.field_uw_ban_big_text.yml create mode 100644 config/install/field.field.paragraph.uw_para_image_banner.field_uw_ban_image.yml create mode 100644 config/install/field.field.paragraph.uw_para_image_banner.field_uw_ban_link.yml create mode 100644 config/install/field.field.paragraph.uw_para_image_banner.field_uw_ban_small_text.yml create mode 100644 config/install/field.field.paragraph.uw_para_local_video_banner.field_uw_ban_big_text.yml create mode 100644 config/install/field.field.paragraph.uw_para_local_video_banner.field_uw_ban_fallback_image.yml create mode 100644 config/install/field.field.paragraph.uw_para_local_video_banner.field_uw_ban_link.yml create mode 100644 config/install/field.field.paragraph.uw_para_local_video_banner.field_uw_ban_small_text.yml create mode 100644 config/install/field.field.paragraph.uw_para_local_video_banner.field_uw_ban_video.yml create mode 100644 config/install/field.field.paragraph.uw_para_vimeo_video_banner.field_uw_ban_big_text.yml create mode 100644 config/install/field.field.paragraph.uw_para_vimeo_video_banner.field_uw_ban_fallback_image.yml create mode 100644 config/install/field.field.paragraph.uw_para_vimeo_video_banner.field_uw_ban_link.yml create mode 100644 config/install/field.field.paragraph.uw_para_vimeo_video_banner.field_uw_ban_small_text.yml create mode 100644 config/install/field.field.paragraph.uw_para_vimeo_video_banner.field_uw_ban_vimeo_video.yml create mode 100644 config/install/field.storage.node.field_uw_audience.yml create mode 100644 config/install/field.storage.node.field_uw_hero_image.yml create mode 100644 config/install/field.storage.paragraph.field_uw_ban_big_text.yml create mode 100644 config/install/field.storage.paragraph.field_uw_ban_fallback_image.yml create mode 100644 config/install/field.storage.paragraph.field_uw_ban_image.yml create mode 100644 config/install/field.storage.paragraph.field_uw_ban_link.yml create mode 100644 config/install/field.storage.paragraph.field_uw_ban_small_text.yml create mode 100644 config/install/field.storage.paragraph.field_uw_ban_video.yml create mode 100644 config/install/field.storage.paragraph.field_uw_ban_vimeo_video.yml create mode 100644 config/install/paragraphs.paragraphs_type.uw_para_image_banner.yml create mode 100644 config/install/paragraphs.paragraphs_type.uw_para_local_video_banner.yml create mode 100644 config/install/paragraphs.paragraphs_type.uw_para_vimeo_video_banner.yml diff --git a/config/install/core.entity_form_display.paragraph.uw_para_image_banner.default.yml b/config/install/core.entity_form_display.paragraph.uw_para_image_banner.default.yml new file mode 100644 index 0000000..07bbcab --- /dev/null +++ b/config/install/core.entity_form_display.paragraph.uw_para_image_banner.default.yml @@ -0,0 +1,51 @@ +langcode: en +status: true +dependencies: + config: + - field.field.paragraph.uw_para_image_banner.field_uw_ban_big_text + - field.field.paragraph.uw_para_image_banner.field_uw_ban_image + - field.field.paragraph.uw_para_image_banner.field_uw_ban_link + - field.field.paragraph.uw_para_image_banner.field_uw_ban_small_text + - paragraphs.paragraphs_type.uw_para_image_banner + module: + - link + - media_library +id: paragraph.uw_para_image_banner.default +targetEntityType: paragraph +bundle: uw_para_image_banner +mode: default +content: + field_uw_ban_big_text: + weight: 2 + settings: + size: 60 + placeholder: '' + third_party_settings: { } + type: string_textfield + region: content + field_uw_ban_image: + type: media_library_widget + weight: 0 + settings: + media_types: { } + third_party_settings: { } + region: content + field_uw_ban_link: + weight: 1 + settings: + placeholder_url: '' + placeholder_title: '' + third_party_settings: { } + type: link_default + region: content + field_uw_ban_small_text: + weight: 3 + settings: + size: 60 + placeholder: '' + third_party_settings: { } + type: string_textfield + region: content +hidden: + created: true + status: true diff --git a/config/install/core.entity_view_display.paragraph.uw_para_image_banner.default.yml b/config/install/core.entity_view_display.paragraph.uw_para_image_banner.default.yml new file mode 100644 index 0000000..45af8a2 --- /dev/null +++ b/config/install/core.entity_view_display.paragraph.uw_para_image_banner.default.yml @@ -0,0 +1,54 @@ +langcode: en +status: true +dependencies: + config: + - field.field.paragraph.uw_para_image_banner.field_uw_ban_big_text + - field.field.paragraph.uw_para_image_banner.field_uw_ban_image + - field.field.paragraph.uw_para_image_banner.field_uw_ban_link + - field.field.paragraph.uw_para_image_banner.field_uw_ban_small_text + - paragraphs.paragraphs_type.uw_para_image_banner + module: + - link +id: paragraph.uw_para_image_banner.default +targetEntityType: paragraph +bundle: uw_para_image_banner +mode: default +content: + field_uw_ban_big_text: + weight: 2 + label: hidden + settings: + link_to_entity: false + third_party_settings: { } + type: string + region: content + field_uw_ban_image: + type: entity_reference_entity_view + weight: 0 + label: hidden + settings: + view_mode: default + link: false + third_party_settings: { } + region: content + field_uw_ban_link: + weight: 1 + label: hidden + settings: + trim_length: 80 + url_only: false + url_plain: false + rel: '' + target: '' + third_party_settings: { } + type: link + region: content + field_uw_ban_small_text: + weight: 3 + label: hidden + settings: + link_to_entity: false + third_party_settings: { } + type: string + region: content +hidden: { } diff --git a/config/install/core.entity_view_display.paragraph.uw_para_local_video_banner.default.yml b/config/install/core.entity_view_display.paragraph.uw_para_local_video_banner.default.yml new file mode 100644 index 0000000..7977e9e --- /dev/null +++ b/config/install/core.entity_view_display.paragraph.uw_para_local_video_banner.default.yml @@ -0,0 +1,64 @@ +langcode: en +status: true +dependencies: + config: + - field.field.paragraph.uw_para_local_video_banner.field_uw_ban_big_text + - field.field.paragraph.uw_para_local_video_banner.field_uw_ban_fallback_image + - field.field.paragraph.uw_para_local_video_banner.field_uw_ban_link + - field.field.paragraph.uw_para_local_video_banner.field_uw_ban_small_text + - field.field.paragraph.uw_para_local_video_banner.field_uw_ban_video + - paragraphs.paragraphs_type.uw_para_local_video_banner + module: + - link +id: paragraph.uw_para_local_video_banner.default +targetEntityType: paragraph +bundle: uw_para_local_video_banner +mode: default +content: + field_uw_ban_big_text: + weight: 3 + label: hidden + settings: + link_to_entity: false + third_party_settings: { } + type: string + region: content + field_uw_ban_fallback_image: + type: entity_reference_entity_view + weight: 1 + label: hidden + settings: + view_mode: default + link: false + third_party_settings: { } + region: content + field_uw_ban_link: + weight: 2 + label: hidden + settings: + trim_length: 80 + url_only: false + url_plain: false + rel: '' + target: '' + third_party_settings: { } + type: link + region: content + field_uw_ban_small_text: + weight: 4 + label: hidden + settings: + link_to_entity: false + third_party_settings: { } + type: string + region: content + field_uw_ban_video: + type: entity_reference_entity_view + weight: 0 + label: hidden + settings: + view_mode: default + link: false + third_party_settings: { } + region: content +hidden: { } diff --git a/config/install/field.field.paragraph.uw_para_image_banner.field_uw_ban_big_text.yml b/config/install/field.field.paragraph.uw_para_image_banner.field_uw_ban_big_text.yml new file mode 100644 index 0000000..6af8db6 --- /dev/null +++ b/config/install/field.field.paragraph.uw_para_image_banner.field_uw_ban_big_text.yml @@ -0,0 +1,23 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_uw_ban_big_text + - paragraphs.paragraphs_type.uw_para_image_banner + module: + - require_on_publish +third_party_settings: + require_on_publish: + require_on_publish: false +id: paragraph.uw_para_image_banner.field_uw_ban_big_text +field_name: field_uw_ban_big_text +entity_type: paragraph +bundle: uw_para_image_banner +label: 'Big text' +description: 'Big text appears at a larger size, and, if both are set, above the small text.' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: string diff --git a/config/install/field.field.paragraph.uw_para_image_banner.field_uw_ban_image.yml b/config/install/field.field.paragraph.uw_para_image_banner.field_uw_ban_image.yml new file mode 100644 index 0000000..5f38655 --- /dev/null +++ b/config/install/field.field.paragraph.uw_para_image_banner.field_uw_ban_image.yml @@ -0,0 +1,28 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_uw_ban_image + - media.type.uw_mt_image + - paragraphs.paragraphs_type.uw_para_image_banner +id: paragraph.uw_para_image_banner.field_uw_ban_image +field_name: field_uw_ban_image +entity_type: paragraph +bundle: uw_para_image_banner +label: Image +description: 'A minimum banner size of 1010x300 is recommended. Banners that are narrower or wider than their location will be automatically scaled to fit.' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:media' + handler_settings: + target_bundles: + uw_mt_image: uw_mt_image + sort: + field: _none + direction: ASC + auto_create: false + auto_create_bundle: '' +field_type: entity_reference diff --git a/config/install/field.field.paragraph.uw_para_image_banner.field_uw_ban_link.yml b/config/install/field.field.paragraph.uw_para_image_banner.field_uw_ban_link.yml new file mode 100644 index 0000000..e4a1d1f --- /dev/null +++ b/config/install/field.field.paragraph.uw_para_image_banner.field_uw_ban_link.yml @@ -0,0 +1,26 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_uw_ban_link + - paragraphs.paragraphs_type.uw_para_image_banner + module: + - link + - require_on_publish +third_party_settings: + require_on_publish: + require_on_publish: false +id: paragraph.uw_para_image_banner.field_uw_ban_link +field_name: field_uw_ban_link +entity_type: paragraph +bundle: uw_para_image_banner +label: Link +description: 'Provide an optional link for this banner.' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + link_type: 17 + title: 0 +field_type: link diff --git a/config/install/field.field.paragraph.uw_para_image_banner.field_uw_ban_small_text.yml b/config/install/field.field.paragraph.uw_para_image_banner.field_uw_ban_small_text.yml new file mode 100644 index 0000000..ea2b96a --- /dev/null +++ b/config/install/field.field.paragraph.uw_para_image_banner.field_uw_ban_small_text.yml @@ -0,0 +1,23 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_uw_ban_small_text + - paragraphs.paragraphs_type.uw_para_image_banner + module: + - require_on_publish +third_party_settings: + require_on_publish: + require_on_publish: false +id: paragraph.uw_para_image_banner.field_uw_ban_small_text +field_name: field_uw_ban_small_text +entity_type: paragraph +bundle: uw_para_image_banner +label: 'Small text' +description: 'Small text appears at a smaller size, and, if both are set, below the big text.' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: string diff --git a/config/install/field.field.paragraph.uw_para_local_video_banner.field_uw_ban_big_text.yml b/config/install/field.field.paragraph.uw_para_local_video_banner.field_uw_ban_big_text.yml new file mode 100644 index 0000000..f19518a --- /dev/null +++ b/config/install/field.field.paragraph.uw_para_local_video_banner.field_uw_ban_big_text.yml @@ -0,0 +1,23 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_uw_ban_big_text + - paragraphs.paragraphs_type.uw_para_local_video_banner + module: + - require_on_publish +third_party_settings: + require_on_publish: + require_on_publish: false +id: paragraph.uw_para_local_video_banner.field_uw_ban_big_text +field_name: field_uw_ban_big_text +entity_type: paragraph +bundle: uw_para_local_video_banner +label: 'Big text' +description: 'Provide an optional link for this banner.' +required: false +translatable: true +default_value: { } +default_value_callback: '' +settings: { } +field_type: string diff --git a/config/install/field.field.paragraph.uw_para_local_video_banner.field_uw_ban_fallback_image.yml b/config/install/field.field.paragraph.uw_para_local_video_banner.field_uw_ban_fallback_image.yml new file mode 100644 index 0000000..98e1b2b --- /dev/null +++ b/config/install/field.field.paragraph.uw_para_local_video_banner.field_uw_ban_fallback_image.yml @@ -0,0 +1,33 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_uw_ban_fallback_image + - media.type.uw_mt_image + - paragraphs.paragraphs_type.uw_para_local_video_banner + module: + - require_on_publish +third_party_settings: + require_on_publish: + require_on_publish: false +id: paragraph.uw_para_local_video_banner.field_uw_ban_fallback_image +field_name: field_uw_ban_fallback_image +entity_type: paragraph +bundle: uw_para_local_video_banner +label: 'Fallback image' +description: 'This image will be used as a fallback in case the video doesn''t load.' +required: true +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:media' + handler_settings: + target_bundles: + uw_mt_image: uw_mt_image + sort: + field: name + direction: ASC + auto_create: false + auto_create_bundle: '' +field_type: entity_reference diff --git a/config/install/field.field.paragraph.uw_para_local_video_banner.field_uw_ban_link.yml b/config/install/field.field.paragraph.uw_para_local_video_banner.field_uw_ban_link.yml new file mode 100644 index 0000000..598ba61 --- /dev/null +++ b/config/install/field.field.paragraph.uw_para_local_video_banner.field_uw_ban_link.yml @@ -0,0 +1,26 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_uw_ban_link + - paragraphs.paragraphs_type.uw_para_local_video_banner + module: + - link + - require_on_publish +third_party_settings: + require_on_publish: + require_on_publish: false +id: paragraph.uw_para_local_video_banner.field_uw_ban_link +field_name: field_uw_ban_link +entity_type: paragraph +bundle: uw_para_local_video_banner +label: Link +description: 'Provide an optional link for this banner.' +required: false +translatable: true +default_value: { } +default_value_callback: '' +settings: + link_type: 17 + title: 0 +field_type: link diff --git a/config/install/field.field.paragraph.uw_para_local_video_banner.field_uw_ban_small_text.yml b/config/install/field.field.paragraph.uw_para_local_video_banner.field_uw_ban_small_text.yml new file mode 100644 index 0000000..f4eebfb --- /dev/null +++ b/config/install/field.field.paragraph.uw_para_local_video_banner.field_uw_ban_small_text.yml @@ -0,0 +1,23 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_uw_ban_small_text + - paragraphs.paragraphs_type.uw_para_local_video_banner + module: + - require_on_publish +third_party_settings: + require_on_publish: + require_on_publish: false +id: paragraph.uw_para_local_video_banner.field_uw_ban_small_text +field_name: field_uw_ban_small_text +entity_type: paragraph +bundle: uw_para_local_video_banner +label: 'Small text' +description: 'Small text appears at a smaller size, and, if both are set, below the big text.' +required: false +translatable: true +default_value: { } +default_value_callback: '' +settings: { } +field_type: string diff --git a/config/install/field.field.paragraph.uw_para_local_video_banner.field_uw_ban_video.yml b/config/install/field.field.paragraph.uw_para_local_video_banner.field_uw_ban_video.yml new file mode 100644 index 0000000..b351fe5 --- /dev/null +++ b/config/install/field.field.paragraph.uw_para_local_video_banner.field_uw_ban_video.yml @@ -0,0 +1,33 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_uw_ban_video + - media.type.uw_mt_local_video + - paragraphs.paragraphs_type.uw_para_local_video_banner + module: + - require_on_publish +third_party_settings: + require_on_publish: + require_on_publish: false +id: paragraph.uw_para_local_video_banner.field_uw_ban_video +field_name: field_uw_ban_video +entity_type: paragraph +bundle: uw_para_local_video_banner +label: Video +description: 'For best results, the video should be 1080 pixels wide. Video banners that are narrower or wider than their location will be automatically scaled to fit.' +required: true +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:media' + handler_settings: + target_bundles: + uw_mt_local_video: uw_mt_local_video + sort: + field: name + direction: ASC + auto_create: false + auto_create_bundle: '' +field_type: entity_reference diff --git a/config/install/field.field.paragraph.uw_para_vimeo_video_banner.field_uw_ban_big_text.yml b/config/install/field.field.paragraph.uw_para_vimeo_video_banner.field_uw_ban_big_text.yml new file mode 100644 index 0000000..e6c14ba --- /dev/null +++ b/config/install/field.field.paragraph.uw_para_vimeo_video_banner.field_uw_ban_big_text.yml @@ -0,0 +1,23 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_uw_ban_big_text + - paragraphs.paragraphs_type.uw_para_vimeo_video_banner + module: + - require_on_publish +third_party_settings: + require_on_publish: + require_on_publish: false +id: paragraph.uw_para_vimeo_video_banner.field_uw_ban_big_text +field_name: field_uw_ban_big_text +entity_type: paragraph +bundle: uw_para_vimeo_video_banner +label: 'Big text' +description: 'Big text appears at a larger size, and, if both are set, above the small text.' +required: false +translatable: true +default_value: { } +default_value_callback: '' +settings: { } +field_type: string diff --git a/config/install/field.field.paragraph.uw_para_vimeo_video_banner.field_uw_ban_fallback_image.yml b/config/install/field.field.paragraph.uw_para_vimeo_video_banner.field_uw_ban_fallback_image.yml new file mode 100644 index 0000000..1289f73 --- /dev/null +++ b/config/install/field.field.paragraph.uw_para_vimeo_video_banner.field_uw_ban_fallback_image.yml @@ -0,0 +1,33 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_uw_ban_fallback_image + - media.type.uw_mt_image + - paragraphs.paragraphs_type.uw_para_vimeo_video_banner + module: + - require_on_publish +third_party_settings: + require_on_publish: + require_on_publish: false +id: paragraph.uw_para_vimeo_video_banner.field_uw_ban_fallback_image +field_name: field_uw_ban_fallback_image +entity_type: paragraph +bundle: uw_para_vimeo_video_banner +label: 'Fallback image' +description: 'This image will be used as a fallback in case the video doesn''t load.' +required: true +translatable: true +default_value: { } +default_value_callback: '' +settings: + handler: 'default:media' + handler_settings: + target_bundles: + uw_mt_image: uw_mt_image + sort: + field: name + direction: ASC + auto_create: false + auto_create_bundle: '' +field_type: entity_reference diff --git a/config/install/field.field.paragraph.uw_para_vimeo_video_banner.field_uw_ban_link.yml b/config/install/field.field.paragraph.uw_para_vimeo_video_banner.field_uw_ban_link.yml new file mode 100644 index 0000000..d3cbed2 --- /dev/null +++ b/config/install/field.field.paragraph.uw_para_vimeo_video_banner.field_uw_ban_link.yml @@ -0,0 +1,26 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_uw_ban_link + - paragraphs.paragraphs_type.uw_para_vimeo_video_banner + module: + - link + - require_on_publish +third_party_settings: + require_on_publish: + require_on_publish: false +id: paragraph.uw_para_vimeo_video_banner.field_uw_ban_link +field_name: field_uw_ban_link +entity_type: paragraph +bundle: uw_para_vimeo_video_banner +label: Link +description: 'Provide an optional link for this banner.' +required: false +translatable: true +default_value: { } +default_value_callback: '' +settings: + link_type: 17 + title: 0 +field_type: link diff --git a/config/install/field.field.paragraph.uw_para_vimeo_video_banner.field_uw_ban_small_text.yml b/config/install/field.field.paragraph.uw_para_vimeo_video_banner.field_uw_ban_small_text.yml new file mode 100644 index 0000000..399dfef --- /dev/null +++ b/config/install/field.field.paragraph.uw_para_vimeo_video_banner.field_uw_ban_small_text.yml @@ -0,0 +1,23 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_uw_ban_small_text + - paragraphs.paragraphs_type.uw_para_vimeo_video_banner + module: + - require_on_publish +third_party_settings: + require_on_publish: + require_on_publish: false +id: paragraph.uw_para_vimeo_video_banner.field_uw_ban_small_text +field_name: field_uw_ban_small_text +entity_type: paragraph +bundle: uw_para_vimeo_video_banner +label: 'Small text' +description: 'Small text appears at a smaller size, and, if both are set, below the big text.' +required: false +translatable: true +default_value: { } +default_value_callback: '' +settings: { } +field_type: string diff --git a/config/install/field.field.paragraph.uw_para_vimeo_video_banner.field_uw_ban_vimeo_video.yml b/config/install/field.field.paragraph.uw_para_vimeo_video_banner.field_uw_ban_vimeo_video.yml new file mode 100644 index 0000000..e33d5c4 --- /dev/null +++ b/config/install/field.field.paragraph.uw_para_vimeo_video_banner.field_uw_ban_vimeo_video.yml @@ -0,0 +1,33 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_uw_ban_vimeo_video + - media.type.uw_mt_vimeo_banner_video + - paragraphs.paragraphs_type.uw_para_vimeo_video_banner + module: + - require_on_publish +third_party_settings: + require_on_publish: + require_on_publish: false +id: paragraph.uw_para_vimeo_video_banner.field_uw_ban_vimeo_video +field_name: field_uw_ban_vimeo_video +entity_type: paragraph +bundle: uw_para_vimeo_video_banner +label: 'Vimeo video' +description: 'This MUST be from a paid Vimeo account. Videos from free accounts will display Vimeo''s player and branding.' +required: true +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:media' + handler_settings: + target_bundles: + uw_mt_vimeo_banner_video: uw_mt_vimeo_banner_video + sort: + field: name + direction: ASC + auto_create: false + auto_create_bundle: '' +field_type: entity_reference diff --git a/config/install/field.storage.node.field_uw_audience.yml b/config/install/field.storage.node.field_uw_audience.yml new file mode 100644 index 0000000..2801f27 --- /dev/null +++ b/config/install/field.storage.node.field_uw_audience.yml @@ -0,0 +1,19 @@ +langcode: en +status: true +dependencies: + module: + - node + - taxonomy +id: node.field_uw_audience +field_name: field_uw_audience +entity_type: node +type: entity_reference +settings: + target_type: taxonomy_term +module: core +locked: false +cardinality: -1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/install/field.storage.node.field_uw_hero_image.yml b/config/install/field.storage.node.field_uw_hero_image.yml new file mode 100644 index 0000000..e075939 --- /dev/null +++ b/config/install/field.storage.node.field_uw_hero_image.yml @@ -0,0 +1,19 @@ +langcode: en +status: true +dependencies: + module: + - media + - node +id: node.field_uw_hero_image +field_name: field_uw_hero_image +entity_type: node +type: entity_reference +settings: + target_type: media +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/install/field.storage.paragraph.field_uw_ban_big_text.yml b/config/install/field.storage.paragraph.field_uw_ban_big_text.yml new file mode 100644 index 0000000..82334c0 --- /dev/null +++ b/config/install/field.storage.paragraph.field_uw_ban_big_text.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + module: + - paragraphs +id: paragraph.field_uw_ban_big_text +field_name: field_uw_ban_big_text +entity_type: paragraph +type: string +settings: + max_length: 128 + is_ascii: false + case_sensitive: false +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/install/field.storage.paragraph.field_uw_ban_fallback_image.yml b/config/install/field.storage.paragraph.field_uw_ban_fallback_image.yml new file mode 100644 index 0000000..ca6321c --- /dev/null +++ b/config/install/field.storage.paragraph.field_uw_ban_fallback_image.yml @@ -0,0 +1,19 @@ +langcode: en +status: true +dependencies: + module: + - media + - paragraphs +id: paragraph.field_uw_ban_fallback_image +field_name: field_uw_ban_fallback_image +entity_type: paragraph +type: entity_reference +settings: + target_type: media +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/install/field.storage.paragraph.field_uw_ban_image.yml b/config/install/field.storage.paragraph.field_uw_ban_image.yml new file mode 100644 index 0000000..fa4f848 --- /dev/null +++ b/config/install/field.storage.paragraph.field_uw_ban_image.yml @@ -0,0 +1,19 @@ +langcode: en +status: true +dependencies: + module: + - media + - paragraphs +id: paragraph.field_uw_ban_image +field_name: field_uw_ban_image +entity_type: paragraph +type: entity_reference +settings: + target_type: media +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/install/field.storage.paragraph.field_uw_ban_link.yml b/config/install/field.storage.paragraph.field_uw_ban_link.yml new file mode 100644 index 0000000..99b6646 --- /dev/null +++ b/config/install/field.storage.paragraph.field_uw_ban_link.yml @@ -0,0 +1,18 @@ +langcode: en +status: true +dependencies: + module: + - link + - paragraphs +id: paragraph.field_uw_ban_link +field_name: field_uw_ban_link +entity_type: paragraph +type: link +settings: { } +module: link +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/install/field.storage.paragraph.field_uw_ban_small_text.yml b/config/install/field.storage.paragraph.field_uw_ban_small_text.yml new file mode 100644 index 0000000..30de97b --- /dev/null +++ b/config/install/field.storage.paragraph.field_uw_ban_small_text.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + module: + - paragraphs +id: paragraph.field_uw_ban_small_text +field_name: field_uw_ban_small_text +entity_type: paragraph +type: string +settings: + max_length: 255 + is_ascii: false + case_sensitive: false +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/install/field.storage.paragraph.field_uw_ban_video.yml b/config/install/field.storage.paragraph.field_uw_ban_video.yml new file mode 100644 index 0000000..e839cbb --- /dev/null +++ b/config/install/field.storage.paragraph.field_uw_ban_video.yml @@ -0,0 +1,19 @@ +langcode: en +status: true +dependencies: + module: + - media + - paragraphs +id: paragraph.field_uw_ban_video +field_name: field_uw_ban_video +entity_type: paragraph +type: entity_reference +settings: + target_type: media +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/install/field.storage.paragraph.field_uw_ban_vimeo_video.yml b/config/install/field.storage.paragraph.field_uw_ban_vimeo_video.yml new file mode 100644 index 0000000..df04da2 --- /dev/null +++ b/config/install/field.storage.paragraph.field_uw_ban_vimeo_video.yml @@ -0,0 +1,19 @@ +langcode: en +status: true +dependencies: + module: + - media + - paragraphs +id: paragraph.field_uw_ban_vimeo_video +field_name: field_uw_ban_vimeo_video +entity_type: paragraph +type: entity_reference +settings: + target_type: media +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/install/paragraphs.paragraphs_type.uw_para_image_banner.yml b/config/install/paragraphs.paragraphs_type.uw_para_image_banner.yml new file mode 100644 index 0000000..8cc48ca --- /dev/null +++ b/config/install/paragraphs.paragraphs_type.uw_para_image_banner.yml @@ -0,0 +1,9 @@ +langcode: en +status: true +dependencies: { } +id: uw_para_image_banner +label: 'Image banner' +icon_uuid: null +icon_default: null +description: '' +behavior_plugins: { } diff --git a/config/install/paragraphs.paragraphs_type.uw_para_local_video_banner.yml b/config/install/paragraphs.paragraphs_type.uw_para_local_video_banner.yml new file mode 100644 index 0000000..b10b838 --- /dev/null +++ b/config/install/paragraphs.paragraphs_type.uw_para_local_video_banner.yml @@ -0,0 +1,9 @@ +langcode: en +status: true +dependencies: { } +id: uw_para_local_video_banner +label: 'Local video banner' +icon_uuid: null +icon_default: null +description: '' +behavior_plugins: { } diff --git a/config/install/paragraphs.paragraphs_type.uw_para_vimeo_video_banner.yml b/config/install/paragraphs.paragraphs_type.uw_para_vimeo_video_banner.yml new file mode 100644 index 0000000..32e3167 --- /dev/null +++ b/config/install/paragraphs.paragraphs_type.uw_para_vimeo_video_banner.yml @@ -0,0 +1,9 @@ +langcode: en +status: true +dependencies: { } +id: uw_para_vimeo_video_banner +label: 'Vimeo video banner' +icon_uuid: null +icon_default: null +description: '' +behavior_plugins: { } -- GitLab From 0a4ad3ade91e3f603d37b979717f84f6ea4d91b9 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Fri, 14 Oct 2022 20:23:25 -0400 Subject: [PATCH 107/180] ISTWCMS-5880: fixing banner validation when banners are closed in the node edit --- uw_cfg_common.module | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/uw_cfg_common.module b/uw_cfg_common.module index 68b9e45..f149a9f 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -1074,8 +1074,12 @@ function _uw_cfg_common_banner_validate(array &$form, FormStateInterface $form_s foreach ($values['field_uw_banner'] as $key => $value) { // Ensure that the key is an integer, since there is an add_more - // in the values. - if (is_int($key)) { + // in the values. We also need to check if there is "top" in the + // array, as this is what paragraphs uses for closed items. These + // closed items have already been validated so if there is a closed + // item we can just ignore it, only open items, meaning it has values + // in the fields needs to be validated. + if (is_int($key) && !$value['top']) { // If there is no selection on the media, then there is no image, // so set the error. -- GitLab From 8165fc5d78619451ebda6d342de5dcdf8a474942 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Fri, 14 Oct 2022 20:29:34 -0400 Subject: [PATCH 108/180] ISTWCMS-5880: fixing banner validation when no media or non banner is selected --- uw_cfg_common.module | 1 + 1 file changed, 1 insertion(+) diff --git a/uw_cfg_common.module b/uw_cfg_common.module index f149a9f..95884f4 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -1055,6 +1055,7 @@ function _uw_cfg_common_banner_validate(array &$form, FormStateInterface $form_s // then perform the validation. if ( isset($values['field_uw_type_of_media']) && + !empty($values['field_uw_type_of_media']) && $values['field_uw_type_of_media'][0]['value'] == 'banner' ) { -- GitLab From 2edda91b95b845fed4f16d6e8757e6a814423129 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Mon, 17 Oct 2022 07:13:30 -0400 Subject: [PATCH 109/180] ISTWCMS-5880: adding banners to catalogs --- src/Service/UWService.php | 1 + src/Service/UwNodeContent.php | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/Service/UWService.php b/src/Service/UWService.php index a6c9018..9a84b18 100644 --- a/src/Service/UWService.php +++ b/src/Service/UWService.php @@ -231,6 +231,7 @@ class UWService implements UWServiceInterface { case 'media': $preprocess = [ 'uw_ct_blog', + 'uw_ct_catalog_item', 'uw_ct_event', 'uw_ct_news_item', 'uw_ct_web_page', diff --git a/src/Service/UwNodeContent.php b/src/Service/UwNodeContent.php index d7abe39..3818950 100644 --- a/src/Service/UwNodeContent.php +++ b/src/Service/UwNodeContent.php @@ -482,6 +482,10 @@ class UwNodeContent { $content_data['content'] = $this->addToContentData('content', 'field_uw_news_summary'); } + if ($node_flags['get_media']) { + $content_data['media'] = $this->addToContentData('media', NULL); + } + // Get the footer for catalog items. if ($node_flags['get_footer']) { -- GitLab From 14bb207919a592af938b6cc8bc69df3047ea9c3c Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Mon, 17 Oct 2022 07:16:01 -0400 Subject: [PATCH 110/180] ISTWCMS-5880: removing hero image from catalog --- uw_cfg_common.module | 2 ++ 1 file changed, 2 insertions(+) diff --git a/uw_cfg_common.module b/uw_cfg_common.module index 95884f4..a28ffbe 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -895,10 +895,12 @@ function uw_cfg_common_form_alter(array &$form, FormStateInterface $form_state, $node_type = str_replace('node_uw_ct_', '', $form_id); $node_type = str_replace('_edit', '', $node_type); $node_type = str_replace('_form', '', $node_type); + $node_type = str_replace('_item', '', $node_type); // Content types to remove the hero image from media. $remove_hero_image_nodes = [ 'web_page', + 'catalog', ]; // If the node type can not have hero image, remove the option. -- GitLab From 3c806183e25a0eef1bd813e217d1212986152c06 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Mon, 17 Oct 2022 08:35:12 -0400 Subject: [PATCH 111/180] ISTWCMS-5880: adding media to service --- src/Service/UWService.php | 1 + src/Service/UwNodeContent.php | 4 ++++ uw_cfg_common.module | 1 + 3 files changed, 6 insertions(+) diff --git a/src/Service/UWService.php b/src/Service/UWService.php index 9a84b18..8b9426e 100644 --- a/src/Service/UWService.php +++ b/src/Service/UWService.php @@ -234,6 +234,7 @@ class UWService implements UWServiceInterface { 'uw_ct_catalog_item', 'uw_ct_event', 'uw_ct_news_item', + 'uw_ct_service', 'uw_ct_web_page', ]; break; diff --git a/src/Service/UwNodeContent.php b/src/Service/UwNodeContent.php index 3818950..108c902 100644 --- a/src/Service/UwNodeContent.php +++ b/src/Service/UwNodeContent.php @@ -729,6 +729,10 @@ class UwNodeContent { $content_data['content'] = $this->addToContentData('content', 'field_uw_service_summary'); } + if ($node_flags['get_media']) { + $content_data['media'] = $this->addToContentData('media', NULL); + } + // Get the footer for the profile. if ($node_flags['get_footer']) { $content_data['footer']['service_information']['has_children'] = TRUE; diff --git a/uw_cfg_common.module b/uw_cfg_common.module index a28ffbe..7e28b39 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -901,6 +901,7 @@ function uw_cfg_common_form_alter(array &$form, FormStateInterface $form_state, $remove_hero_image_nodes = [ 'web_page', 'catalog', + 'service', ]; // If the node type can not have hero image, remove the option. -- GitLab From ea92fd819ef02087a2e6cd38ad0e00c497016a85 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Mon, 17 Oct 2022 08:56:18 -0400 Subject: [PATCH 112/180] ISTWCMS-5880: adding project to media above --- src/Service/UWService.php | 1 + src/Service/UwNodeContent.php | 4 ++++ uw_cfg_common.module | 1 + 3 files changed, 6 insertions(+) diff --git a/src/Service/UWService.php b/src/Service/UWService.php index 8b9426e..5a0c6bd 100644 --- a/src/Service/UWService.php +++ b/src/Service/UWService.php @@ -234,6 +234,7 @@ class UWService implements UWServiceInterface { 'uw_ct_catalog_item', 'uw_ct_event', 'uw_ct_news_item', + 'uw_ct_project', 'uw_ct_service', 'uw_ct_web_page', ]; diff --git a/src/Service/UwNodeContent.php b/src/Service/UwNodeContent.php index 108c902..6e27ef5 100644 --- a/src/Service/UwNodeContent.php +++ b/src/Service/UwNodeContent.php @@ -675,6 +675,10 @@ class UwNodeContent { $content_data['content'] = $this->addToContentData('content', 'field_uw_project_summary'); } + if ($node_flags['get_media']) { + $content_data['media'] = $this->addToContentData('media', NULL); + } + // Get listing image. if ($node_flags['get_image']) { $content_data['image'] = $this->addToContentData('image', 'field_uw_project_listing_image'); diff --git a/uw_cfg_common.module b/uw_cfg_common.module index 7e28b39..3e31f26 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -901,6 +901,7 @@ function uw_cfg_common_form_alter(array &$form, FormStateInterface $form_state, $remove_hero_image_nodes = [ 'web_page', 'catalog', + 'project', 'service', ]; -- GitLab From ffc032fe772d69846b11183e8a966848581e1378 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Mon, 17 Oct 2022 09:04:13 -0400 Subject: [PATCH 113/180] ISTWCMS-5880: adding profile to media above --- src/Service/UWService.php | 1 + src/Service/UwNodeContent.php | 4 ++++ uw_cfg_common.module | 1 + 3 files changed, 6 insertions(+) diff --git a/src/Service/UWService.php b/src/Service/UWService.php index 5a0c6bd..38d5e60 100644 --- a/src/Service/UWService.php +++ b/src/Service/UWService.php @@ -234,6 +234,7 @@ class UWService implements UWServiceInterface { 'uw_ct_catalog_item', 'uw_ct_event', 'uw_ct_news_item', + 'uw_ct_profile', 'uw_ct_project', 'uw_ct_service', 'uw_ct_web_page', diff --git a/src/Service/UwNodeContent.php b/src/Service/UwNodeContent.php index 6e27ef5..fb75d16 100644 --- a/src/Service/UwNodeContent.php +++ b/src/Service/UwNodeContent.php @@ -635,6 +635,10 @@ class UwNodeContent { $content_data['content'] = $this->addToContentData('content', 'field_uw_profile_summary'); } + if ($node_flags['get_media']) { + $content_data['media'] = $this->addToContentData('media', NULL); + } + // Get the footer for the profile. if ($node_flags['get_footer']) { $content_data['footer']['links']['has_children'] = TRUE; diff --git a/uw_cfg_common.module b/uw_cfg_common.module index 3e31f26..cb7b2df 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -901,6 +901,7 @@ function uw_cfg_common_form_alter(array &$form, FormStateInterface $form_state, $remove_hero_image_nodes = [ 'web_page', 'catalog', + 'profile', 'project', 'service', ]; -- GitLab From 0f9782dbd3f7c29117c2d6269cb624b3979c5de5 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Mon, 17 Oct 2022 09:04:53 -0400 Subject: [PATCH 114/180] ISTWCMS-5880: renaming banners in type of media --- uw_cfg_common.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uw_cfg_common.module b/uw_cfg_common.module index cb7b2df..7ce56cc 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -1547,7 +1547,7 @@ function _uw_cfg_common_allowed_media_types( ) { return [ - 'banner' => 'Banner images', + 'banner' => 'Banner', 'image' => 'Image', ]; } -- GitLab From 51b2ca7b485d6e6c0dee13a1c2d61e8f5e419b6b Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Mon, 17 Oct 2022 09:19:42 -0400 Subject: [PATCH 115/180] ISTWCMS-5880: adding opportunity to media above --- src/Service/UWService.php | 1 + src/Service/UwNodeContent.php | 4 ++++ uw_cfg_common.module | 1 + 3 files changed, 6 insertions(+) diff --git a/src/Service/UWService.php b/src/Service/UWService.php index 38d5e60..da15393 100644 --- a/src/Service/UWService.php +++ b/src/Service/UWService.php @@ -234,6 +234,7 @@ class UWService implements UWServiceInterface { 'uw_ct_catalog_item', 'uw_ct_event', 'uw_ct_news_item', + 'uw_ct_opportunity', 'uw_ct_profile', 'uw_ct_project', 'uw_ct_service', diff --git a/src/Service/UwNodeContent.php b/src/Service/UwNodeContent.php index fb75d16..8029855 100644 --- a/src/Service/UwNodeContent.php +++ b/src/Service/UwNodeContent.php @@ -833,6 +833,10 @@ class UwNodeContent { $content_data['content'] = $this->addToContentData('content', 'field_uw_opportunity_position'); } + if ($node_flags['get_media']) { + $content_data['media'] = $this->addToContentData('media', NULL); + } + return $content_data; } diff --git a/uw_cfg_common.module b/uw_cfg_common.module index 7ce56cc..f18b8d4 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -901,6 +901,7 @@ function uw_cfg_common_form_alter(array &$form, FormStateInterface $form_state, $remove_hero_image_nodes = [ 'web_page', 'catalog', + 'opportunity', 'profile', 'project', 'service', -- GitLab From be6ac9fce619b468385ddcb6f44dfdd44e49f2e8 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Mon, 17 Oct 2022 09:42:35 -0400 Subject: [PATCH 116/180] ISTWCMS-5880: adding contact to media above --- src/Service/UWService.php | 1 + src/Service/UwNodeContent.php | 4 ++++ uw_cfg_common.module | 1 + 3 files changed, 6 insertions(+) diff --git a/src/Service/UWService.php b/src/Service/UWService.php index da15393..b63cfea 100644 --- a/src/Service/UWService.php +++ b/src/Service/UWService.php @@ -232,6 +232,7 @@ class UWService implements UWServiceInterface { $preprocess = [ 'uw_ct_blog', 'uw_ct_catalog_item', + 'uw_ct_contact', 'uw_ct_event', 'uw_ct_news_item', 'uw_ct_opportunity', diff --git a/src/Service/UwNodeContent.php b/src/Service/UwNodeContent.php index 8029855..32ec456 100644 --- a/src/Service/UwNodeContent.php +++ b/src/Service/UwNodeContent.php @@ -572,6 +572,10 @@ class UwNodeContent { $content_data['content'] = $this->addToContentData('content', NULL); } + if ($node_flags['get_media']) { + $content_data['media'] = $this->addToContentData('media', NULL); + } + // Get the footer data. if ($node_flags['get_footer']) { diff --git a/uw_cfg_common.module b/uw_cfg_common.module index f18b8d4..dddb5d0 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -901,6 +901,7 @@ function uw_cfg_common_form_alter(array &$form, FormStateInterface $form_state, $remove_hero_image_nodes = [ 'web_page', 'catalog', + 'contact', 'opportunity', 'profile', 'project', -- GitLab From b38e9c62af61a9c328873c8fd46bb21f884a8265 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Mon, 17 Oct 2022 14:03:41 -0400 Subject: [PATCH 117/180] ISTWCMS-5880: trying to fix null elements so that titles show correctly --- src/Service/UwNodeData.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Service/UwNodeData.php b/src/Service/UwNodeData.php index 2eaa511..c9b61e9 100644 --- a/src/Service/UwNodeData.php +++ b/src/Service/UwNodeData.php @@ -180,7 +180,7 @@ class UwNodeData { // If the element is empty, unset it. if ($data == NULL && empty($data)) { - unset($node_data[$index]); + unset($node_data[$index][$sub_index]); } } } -- GitLab From f73de6fb710f2354c5c98b338dbfc4665ca9344b Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Tue, 18 Oct 2022 10:34:25 -0400 Subject: [PATCH 118/180] ISTWCMS-5880: updating the states for media and adding allowed value function for media width --- uw_cfg_common.module | 42 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/uw_cfg_common.module b/uw_cfg_common.module index dddb5d0..db7398e 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -589,6 +589,41 @@ function uw_cfg_common_preprocess_node(&$variables) { } } +/** + * Get the layout builder styles as options. + * + * @param \Drupal\field\Entity\FieldStorageConfig $definition + * The field definition. + * @param \Drupal\Core\Entity\ContentEntityInterface|null $entity + * The entity being created if applicable. + * @param bool $cacheable + * Boolean indicating if the results are cacheable. + * + * @return array + * An array of possible key and value options. + * + * @see options_allowed_values() + */ +function _uw_cfg_common_get_layout_builder_styles ( + FieldStorageConfig $definition, + ContentEntityInterface $entity = NULL, + $cacheable +) { + + // Get all the styles for sections. + $all_styles = _layout_builder_styles_retrieve_by_type('section'); + + // Array of options. + $options = []; + + // Step through each style and get the info. + foreach ($all_styles as $style) { + $options[$style->id()] = $style->label(); + } + + return $options; +} + /** * Implements hook_page_attachments(). */ @@ -925,7 +960,7 @@ function uw_cfg_common_form_alter(array &$form, FormStateInterface $form_state, ]; // Set the states for the banner. - $form['field_uw_banner']['#states'] = [ + $form['group_banner']['#states'] = [ 'visible' => [ [ 'select[name="field_uw_type_of_media"]' => [ @@ -936,12 +971,15 @@ function uw_cfg_common_form_alter(array &$form, FormStateInterface $form_state, ]; // Set the states for the banner settings. - $form['group_banner_settings']['#states'] = [ + $form['field_uw_media_width']['#states'] = [ 'visible' => [ [ 'select[name="field_uw_type_of_media"]' => [ ['value' => 'banner'], ], + 'select[name="field_uw_text_overlay_style"]' => [ + ['value' => 'full-width'], + ], ], ], ]; -- GitLab From 5d2e35270b58aa5489521b2a510e0bbad1364d75 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Tue, 18 Oct 2022 10:34:53 -0400 Subject: [PATCH 119/180] ISTWCMS-5880: adding field storage for media width --- ...ield.storage.node.field_uw_media_width.yml | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 config/install/field.storage.node.field_uw_media_width.yml diff --git a/config/install/field.storage.node.field_uw_media_width.yml b/config/install/field.storage.node.field_uw_media_width.yml new file mode 100644 index 0000000..59ec105 --- /dev/null +++ b/config/install/field.storage.node.field_uw_media_width.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + module: + - node + - options +id: node.field_uw_media_width +field_name: field_uw_media_width +entity_type: node +type: list_string +settings: + allowed_values: { } + allowed_values_function: '_uw_cfg_common_get_layout_builder_styles' +module: options +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false -- GitLab From 971471802eed55cb84bb2f714c0f08931145d799 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Tue, 18 Oct 2022 10:35:13 -0400 Subject: [PATCH 120/180] ISTWCMS-5880: updating banners get node content --- src/Service/UwNodeFieldValue.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Service/UwNodeFieldValue.php b/src/Service/UwNodeFieldValue.php index f5cc929..cc4f703 100644 --- a/src/Service/UwNodeFieldValue.php +++ b/src/Service/UwNodeFieldValue.php @@ -250,6 +250,13 @@ class UwNodeFieldValue { // Set the banners as empty in case we do not have any. $banners = []; + // Get the layout builder style based from the node value + // of media width. + $layout_builder_style = $layout_style = \Drupal::entityTypeManager()->getStorage('layout_builder_style')->load($node->field_uw_media_width->value); + + // Get the classes associated with the layout builder style. + $media_width_classes = $layout_builder_style->getClasses(); + // Process banner images. foreach ($node->$field_name as $banner_item) { @@ -292,6 +299,7 @@ class UwNodeFieldValue { $banner['sources'] = $banner['image']['responsive_sources']; $banner['img_element'] = $banner['image']['img_element']['#uri']; $banner['alt'] = $banner['image']['alt']; + $banner['media_width'] = $media_width_classes; unset($banner['image']); } -- GitLab From 4997fcbce13d21fa46f69df12ad11ef4a52c7c2e Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Tue, 18 Oct 2022 10:36:25 -0400 Subject: [PATCH 121/180] ISTWCMS-5880: coding standards --- uw_cfg_common.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uw_cfg_common.module b/uw_cfg_common.module index db7398e..1df6499 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -604,7 +604,7 @@ function uw_cfg_common_preprocess_node(&$variables) { * * @see options_allowed_values() */ -function _uw_cfg_common_get_layout_builder_styles ( +function _uw_cfg_common_get_layout_builder_styles( FieldStorageConfig $definition, ContentEntityInterface $entity = NULL, $cacheable -- GitLab From 6cea29198ccddaaf071c75dc6eea85514aabf98a Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Tue, 18 Oct 2022 10:42:28 -0400 Subject: [PATCH 122/180] ISTWCMS-5880: fixing getting media with in banners --- src/Service/UwNodeFieldValue.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Service/UwNodeFieldValue.php b/src/Service/UwNodeFieldValue.php index cc4f703..d5d6367 100644 --- a/src/Service/UwNodeFieldValue.php +++ b/src/Service/UwNodeFieldValue.php @@ -250,12 +250,14 @@ class UwNodeFieldValue { // Set the banners as empty in case we do not have any. $banners = []; - // Get the layout builder style based from the node value - // of media width. - $layout_builder_style = $layout_style = \Drupal::entityTypeManager()->getStorage('layout_builder_style')->load($node->field_uw_media_width->value); + if ($node->field_uw_media_width) { + // Get the layout builder style based from the node value + // of media width. + $layout_builder_style = $layout_style = \Drupal::entityTypeManager()->getStorage('layout_builder_style')->load($node->field_uw_media_width->value); - // Get the classes associated with the layout builder style. - $media_width_classes = $layout_builder_style->getClasses(); + // Get the classes associated with the layout builder style. + $media_width_classes = $layout_builder_style->getClasses(); + } // Process banner images. foreach ($node->$field_name as $banner_item) { @@ -299,7 +301,7 @@ class UwNodeFieldValue { $banner['sources'] = $banner['image']['responsive_sources']; $banner['img_element'] = $banner['image']['img_element']['#uri']; $banner['alt'] = $banner['image']['alt']; - $banner['media_width'] = $media_width_classes; + $banner['media_width'] = $media_width_classes ?? NULL; unset($banner['image']); } -- GitLab From 23afa21c25706d9d4e0811c3ea905ba5cfda2383 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Tue, 18 Oct 2022 10:44:20 -0400 Subject: [PATCH 123/180] ISTWCMS-5880: fixing media with in banners again --- src/Service/UwNodeFieldValue.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Service/UwNodeFieldValue.php b/src/Service/UwNodeFieldValue.php index d5d6367..6e9399c 100644 --- a/src/Service/UwNodeFieldValue.php +++ b/src/Service/UwNodeFieldValue.php @@ -250,7 +250,10 @@ class UwNodeFieldValue { // Set the banners as empty in case we do not have any. $banners = []; - if ($node->field_uw_media_width) { + // Ensure that there is a media with and if so get + // the classes for the width. + if ($node->hasField('field_uw_media_width')) { + // Get the layout builder style based from the node value // of media width. $layout_builder_style = $layout_style = \Drupal::entityTypeManager()->getStorage('layout_builder_style')->load($node->field_uw_media_width->value); -- GitLab From 378a26576a98bf9462c4a1d1c50a92ca256bac1c Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Tue, 18 Oct 2022 10:56:58 -0400 Subject: [PATCH 124/180] ISTWCMS-5880: fixing media with location --- src/Service/UwNodeFieldValue.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Service/UwNodeFieldValue.php b/src/Service/UwNodeFieldValue.php index 6e9399c..bb9a247 100644 --- a/src/Service/UwNodeFieldValue.php +++ b/src/Service/UwNodeFieldValue.php @@ -304,7 +304,6 @@ class UwNodeFieldValue { $banner['sources'] = $banner['image']['responsive_sources']; $banner['img_element'] = $banner['image']['img_element']['#uri']; $banner['alt'] = $banner['image']['alt']; - $banner['media_width'] = $media_width_classes ?? NULL; unset($banner['image']); } @@ -317,6 +316,7 @@ class UwNodeFieldValue { 'slide_speed' => $node->field_uw_slide_speed->value, 'style' => $node->field_uw_text_overlay_style->value, 'transition_speed' => $node->field_uw_transition_speed->value, + 'media_width' => $media_width_classes ?? NULL, ]; return $banners; -- GitLab From 9979bb0a418e07c101286a71961a47a23219660c Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Tue, 18 Oct 2022 14:36:33 -0400 Subject: [PATCH 125/180] ISTWCMS-5880: ensuring that correct media gets set based on user choices --- uw_cfg_common.module | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/uw_cfg_common.module b/uw_cfg_common.module index 1df6499..8586bd9 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -170,6 +170,24 @@ function uw_cfg_common_entity_presave(EntityInterface $entity) { if ($type_of_media == NULL) { $entity->set('field_uw_hero_image', NULL); } + else { + + // If the media type is anything but banner, set it + // to have full width style, otherwise check that it + // can have other things besides full width. + if ($type_of_media !== 'banner') { + $entity->field_uw_media_width = 'uw_lbs_full_width'; + } + else { + + // If the banner is not fdsu (full-width), have the + // style set to full-width. This ensures that we will + // always have full width for things that are not fdsu. + if ($entity->field_uw_text_overlay_style->value !== 'full-width') { + $entity->field_uw_media_width = 'uw_lbs_full_width'; + } + } + } } } } -- GitLab From e0032fa1e2ae53dc4218a2b3921ae09778a3fae7 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Wed, 19 Oct 2022 07:43:48 -0400 Subject: [PATCH 126/180] ISTWCMS-5880: adding update hook for media fields --- uw_cfg_common.install | 171 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 171 insertions(+) diff --git a/uw_cfg_common.install b/uw_cfg_common.install index 415955e..f1fc1a3 100644 --- a/uw_cfg_common.install +++ b/uw_cfg_common.install @@ -6,6 +6,7 @@ */ use Drupal\Core\Config\FileStorage; +use Drupal\field\Entity\FieldConfig; use Drupal\node\Entity\Node; use Drupal\taxonomy\Entity\Term; use Drupal\user\Entity\Role; @@ -458,3 +459,173 @@ function uw_cfg_common_update_9105(&$sandbox) { $active_storage = \Drupal::service('config.storage'); $active_storage->write($name, $source->read($name)); } + +/** + * Add new fields for banners above. + */ +function uw_cfg_common_update_9106(&$sandbox) { + + // The content types that are not getting any changes. + $cts_not_to_install = [ + 'uw_ct_sidebar', + 'uw_ct_site_footer', + 'uw_ct_expand_collapse_group', + ]; + + // The content types with media already in it (hero image). + $cts_with_media = [ + 'uw_ct_blog', + 'uw_ct_event', + 'uw_ct_news_item', + ]; + + // Get all the node types. + $node_types = \Drupal::entityTypeManager()->getStorage('node_type')->loadMultiple(); + + // Step through each node type and get the path to + // the module and the machine name. + foreach ($node_types as $node_type) { + + // Get the id from the node type. + $id = $node_type->id(); + + // Ensure we are only getting the node type + // that need updating. + if (!in_array($id, $cts_not_to_install)) { + + // Catalogs and opportunities have different paths + // and ids, so setup the content types array with + // the correct info. + if ($id == 'uw_ct_catalog_item') { + $content_types['uw_ct_catalog'] = $id; + } else if ($id == 'uw_ct_opportunity') { + $content_types['uw_ct_opportunities'] = $id; + } else { + $content_types[$id] = $id; + } + } + } + + // Get the type of media field that we need to udpate. + $type_of_media = current(\Drupal::entityTypeManager()->getStorage('field_storage_config')->loadByProperties(array('id' => 'node.field_uw_type_of_media'))); + + // Get the type of media settings. + $settings = $type_of_media->getSettings(); + + // Update the settings to remove the allowed values and + // add the allowed values function. + $settings['allowed_values'] = []; + $settings['allowed_values_function'] = '_uw_cfg_common_allowed_media_types'; + + // Set the update settings. + $type_of_media->setSettings($settings); + + // Save the field. + $type_of_media->save(); + + // The names of the fields we need to install. + $names = [ + 'field.storage.node.field_uw_banner', + 'field.storage.node.field_uw_media_width', + 'field.storage.node.field_uw_slide_speed', + 'field.storage.node.field_uw_transition_speed', + 'field.storage.node.field_uw_text_overlay_style', + ]; + + // Get the path to cfg common config install directory. + $path = \Drupal::service('extension.list.module')->getPath('uw_cfg_common') . '/config/install/'; + $config_dir = new FileStorage($path); + + // Step through each of the field names and install them. + foreach ($names as $name) { + + // Get the config from the yml file into an array. + $config_record = $config_dir->read($name); + + // Get the entity type. + $entity_type = \Drupal::service('config.manager')->getEntityTypeIdByName($name); + + // Get the storage. + $storage = \Drupal::entityTypeManager()->getStorage($entity_type); + + // Create the new field from the converted yml. + $field = $storage->createFromStorageRecord($config_record); + + // Save the new field. + $field->save(); + } + + // Step through each of the content types and install the fields, + // and also setup default values for the fields. + foreach ($content_types as $path => $id) { + + // Get the path to the content type. + $path = \Drupal::service('extension.list.module')->getPath($path) . '/config/install/'; + $config_dir = new FileStorage($path); + + // The names of the fields to install. + $names = [ + 'field.field.node.' . $id . '.field_uw_banner', + 'field.field.node.' . $id . '.field_uw_type_of_media', + 'field.field.node.' . $id . '.field_uw_media_width', + 'field.field.node.' . $id . '.field_uw_text_overlay_style', + 'field.field.node.' . $id . '.field_uw_transition_speed', + ]; + + // Step through each of the fields and install them. + foreach ($names as $name) { + + // Get the config from the yml into an array. + $config_record = $config_dir->read($name); + + // If the field config is not install, install it. + if (!FieldConfig::loadByName( + $config_record['entity_type'], + $config_record['bundle'], + $config_record['field_name']) + ) { + FieldConfig::create($config_record)->save(); + } + } + + // If there is no media yet on the content type, + // then install the type of hero image field. + if (!in_array($id, $cts_with_media)) { + + // Name of the hero image field. + $name = 'field.field.node.' . $id . '.field_uw_hero_image'; + + // Get the config from the yml into an array. + $config_record = $config_dir->read($name); + + // If the field config is not install, install it. + if (!FieldConfig::loadByName($config_record['entity_type'], $config_record['bundle'], $config_record['field_name'])) { + FieldConfig::create($config_record)->save(); + } + } + + // Get all the nodes of the content type. + $nodes = \Drupal::entityTypeManager()->getStorage('node')->loadByProperties(['type' => $id]); + + // Step through each of the nodes and set the default + // values of the fields. + foreach ($nodes as $node) { + + // Set default values for banners. + $node->field_uw_banner = NULL; + $node->field_uw_media_width = 'uw_lbs_full_width'; + $node->field_uw_slide_speed = 7000; + $node->field_uw_transition_speed = 400; + $node->field_uw_text_overlay_style = 'full-width'; + + // If the content type does not have media yet, + // set the default value for type of media. + if (!in_array($id, $cts_with_media)) { + $node->field_uw_type_of_media = NULL; + } + + // Save the node. + $node->save(); + } + } +} -- GitLab From dbe0daf5bb622dbd6d953d09c3c7a7cc19dbdf99 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Wed, 19 Oct 2022 08:01:35 -0400 Subject: [PATCH 127/180] ISTWCMS-5880: coding standards --- uw_cfg_common.install | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/uw_cfg_common.install b/uw_cfg_common.install index f1fc1a3..ebd4db8 100644 --- a/uw_cfg_common.install +++ b/uw_cfg_common.install @@ -498,9 +498,11 @@ function uw_cfg_common_update_9106(&$sandbox) { // the correct info. if ($id == 'uw_ct_catalog_item') { $content_types['uw_ct_catalog'] = $id; - } else if ($id == 'uw_ct_opportunity') { + } + elseif ($id == 'uw_ct_opportunity') { $content_types['uw_ct_opportunities'] = $id; - } else { + } + else { $content_types[$id] = $id; } } -- GitLab From 9b1957d94d583041b08a2477049a4b4f72a437ed Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Wed, 19 Oct 2022 08:01:57 -0400 Subject: [PATCH 128/180] ISTWCMS-5880: trying to get features correct --- ....paragraph.uw_para_image_banner.field_uw_ban_image.yml | 8 ++++++-- config/install/field.storage.node.field_uw_banner.yml | 2 +- .../install/field.storage.node.field_uw_media_width.yml | 2 +- .../install/field.storage.node.field_uw_type_of_media.yml | 2 +- ...layout_builder_styles.style.uw_lbs_contained_width.yml | 2 +- ...builder_styles.style.uw_lbs_contained_width_narrow.yml | 2 +- ...t_builder_styles.style.uw_lbs_contained_width_wide.yml | 2 +- .../layout_builder_styles.style.uw_lbs_full_width.yml | 2 +- uw_cfg_common.info.yml | 5 +++++ 9 files changed, 18 insertions(+), 9 deletions(-) diff --git a/config/install/field.field.paragraph.uw_para_image_banner.field_uw_ban_image.yml b/config/install/field.field.paragraph.uw_para_image_banner.field_uw_ban_image.yml index 5f38655..95b29ce 100644 --- a/config/install/field.field.paragraph.uw_para_image_banner.field_uw_ban_image.yml +++ b/config/install/field.field.paragraph.uw_para_image_banner.field_uw_ban_image.yml @@ -5,13 +5,18 @@ dependencies: - field.storage.paragraph.field_uw_ban_image - media.type.uw_mt_image - paragraphs.paragraphs_type.uw_para_image_banner + module: + - require_on_publish +third_party_settings: + require_on_publish: + require_on_publish: false id: paragraph.uw_para_image_banner.field_uw_ban_image field_name: field_uw_ban_image entity_type: paragraph bundle: uw_para_image_banner label: Image description: 'A minimum banner size of 1010x300 is recommended. Banners that are narrower or wider than their location will be automatically scaled to fit.' -required: false +required: true translatable: false default_value: { } default_value_callback: '' @@ -22,7 +27,6 @@ settings: uw_mt_image: uw_mt_image sort: field: _none - direction: ASC auto_create: false auto_create_bundle: '' field_type: entity_reference diff --git a/config/install/field.storage.node.field_uw_banner.yml b/config/install/field.storage.node.field_uw_banner.yml index 38e4c28..097743b 100644 --- a/config/install/field.storage.node.field_uw_banner.yml +++ b/config/install/field.storage.node.field_uw_banner.yml @@ -13,7 +13,7 @@ settings: target_type: paragraph module: entity_reference_revisions locked: false -cardinality: -1 +cardinality: 8 translatable: true indexes: { } persist_with_no_fields: false diff --git a/config/install/field.storage.node.field_uw_media_width.yml b/config/install/field.storage.node.field_uw_media_width.yml index 59ec105..ad32cfd 100644 --- a/config/install/field.storage.node.field_uw_media_width.yml +++ b/config/install/field.storage.node.field_uw_media_width.yml @@ -10,7 +10,7 @@ entity_type: node type: list_string settings: allowed_values: { } - allowed_values_function: '_uw_cfg_common_get_layout_builder_styles' + allowed_values_function: _uw_cfg_common_get_layout_builder_styles module: options locked: false cardinality: 1 diff --git a/config/install/field.storage.node.field_uw_type_of_media.yml b/config/install/field.storage.node.field_uw_type_of_media.yml index 196be0a..bec04cb 100644 --- a/config/install/field.storage.node.field_uw_type_of_media.yml +++ b/config/install/field.storage.node.field_uw_type_of_media.yml @@ -10,7 +10,7 @@ entity_type: node type: list_string settings: allowed_values: { } - allowed_values_function: '_uw_cfg_common_allowed_media_types' + allowed_values_function: _uw_cfg_common_allowed_media_types module: options locked: false cardinality: 1 diff --git a/config/install/layout_builder_styles.style.uw_lbs_contained_width.yml b/config/install/layout_builder_styles.style.uw_lbs_contained_width.yml index 0eb0779..621cb4f 100644 --- a/config/install/layout_builder_styles.style.uw_lbs_contained_width.yml +++ b/config/install/layout_builder_styles.style.uw_lbs_contained_width.yml @@ -6,6 +6,7 @@ label: 'Extra-wide contained width' classes: uw-contained-width type: section group: default +weight: -4 block_restrictions: - 'inline_block:uw_cbl_call_to_action' - 'inline_block:uw_cbl_copy_text' @@ -13,4 +14,3 @@ block_restrictions: - 'inline_block:uw_cbl_image' - 'inline_block:uw_cbl_remote_video' layout_restrictions: { } -weight: -4 diff --git a/config/install/layout_builder_styles.style.uw_lbs_contained_width_narrow.yml b/config/install/layout_builder_styles.style.uw_lbs_contained_width_narrow.yml index b0cd3fe..c120b5b 100644 --- a/config/install/layout_builder_styles.style.uw_lbs_contained_width_narrow.yml +++ b/config/install/layout_builder_styles.style.uw_lbs_contained_width_narrow.yml @@ -6,6 +6,6 @@ label: 'Narrow contained width' classes: "uw-contained-width\r\nuw-contained-width--narrow" type: section group: default +weight: -6 block_restrictions: { } layout_restrictions: { } -weight: -6 diff --git a/config/install/layout_builder_styles.style.uw_lbs_contained_width_wide.yml b/config/install/layout_builder_styles.style.uw_lbs_contained_width_wide.yml index d18394f..7f62da9 100644 --- a/config/install/layout_builder_styles.style.uw_lbs_contained_width_wide.yml +++ b/config/install/layout_builder_styles.style.uw_lbs_contained_width_wide.yml @@ -6,6 +6,6 @@ label: 'Wide contained width' classes: "uw-contained-width\r\nuw-contained-width--wide" type: section group: default +weight: -5 block_restrictions: { } layout_restrictions: { } -weight: -5 diff --git a/config/install/layout_builder_styles.style.uw_lbs_full_width.yml b/config/install/layout_builder_styles.style.uw_lbs_full_width.yml index f0da2d6..f3124d8 100644 --- a/config/install/layout_builder_styles.style.uw_lbs_full_width.yml +++ b/config/install/layout_builder_styles.style.uw_lbs_full_width.yml @@ -6,6 +6,7 @@ label: 'Full width' classes: uw-full-width type: section group: default +weight: -3 block_restrictions: - 'inline_block:uw_cbl_call_to_action' - 'inline_block:uw_cbl_copy_text' @@ -13,4 +14,3 @@ block_restrictions: - 'inline_block:uw_cbl_image' - 'inline_block:uw_cbl_remote_video' layout_restrictions: { } -weight: -3 diff --git a/uw_cfg_common.info.yml b/uw_cfg_common.info.yml index f79c137..75235a6 100644 --- a/uw_cfg_common.info.yml +++ b/uw_cfg_common.info.yml @@ -30,10 +30,12 @@ dependencies: - 'drupal:layout_builder_modal' - 'drupal:layout_builder_restrictions' - 'drupal:layout_builder_styles' + - 'drupal:link' - 'drupal:linkit' - 'drupal:mailsystem' - 'drupal:media' - 'drupal:media_embed_extra' + - 'drupal:media_library' - 'drupal:metatag' - 'drupal:node' - 'drupal:options' @@ -51,11 +53,14 @@ dependencies: - 'drupal:user' - 'drupal:userprotect' - 'drupal:views' + - 'entity_reference_revisions:entity_reference_revisions' - 'fillpdf:fillpdf' - 'layout_builder_ids:layout_builder_ids' - 'maxlength:maxlength' - 'metatag:metatag_extended_perms' + - 'paragraphs:paragraphs' - 'quick_node_clone:quick_node_clone' + - 'require_on_publish:require_on_publish' - 'scheduler:scheduler' - 'simple_sitemap:simple_sitemap' - 'subpathauto:subpathauto' -- GitLab From fd3962ef74b8aad2265eb9fbb24b0bfdb846c992 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Wed, 19 Oct 2022 08:03:26 -0400 Subject: [PATCH 129/180] ISTWCMS-5880: coding standards --- uw_cfg_common.install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uw_cfg_common.install b/uw_cfg_common.install index ebd4db8..1c622d7 100644 --- a/uw_cfg_common.install +++ b/uw_cfg_common.install @@ -509,7 +509,7 @@ function uw_cfg_common_update_9106(&$sandbox) { } // Get the type of media field that we need to udpate. - $type_of_media = current(\Drupal::entityTypeManager()->getStorage('field_storage_config')->loadByProperties(array('id' => 'node.field_uw_type_of_media'))); + $type_of_media = current(\Drupal::entityTypeManager()->getStorage('field_storage_config')->loadByProperties(['id' => 'node.field_uw_type_of_media'])); // Get the type of media settings. $settings = $type_of_media->getSettings(); -- GitLab From 077032dda4cc2b6e766a3e43a94d45450196cff0 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Wed, 19 Oct 2022 10:07:41 -0400 Subject: [PATCH 130/180] ISTWCMS-5880: fixing the required for image in banners --- uw_cfg_common.module | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/uw_cfg_common.module b/uw_cfg_common.module index 8586bd9..e4aec49 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -1163,9 +1163,25 @@ function _uw_cfg_common_banner_validate(array &$form, FormStateInterface $form_s * Implements hook_field_widget_WIDGET_TYPE_form_alter(). */ function uw_cfg_common_field_widget_entity_reference_paragraphs_form_alter(&$element, &$form_state, $context) { + + // If this is a banner image, add the required manually. if ($element['#paragraph_type'] == 'uw_para_image_banner') { + + // If this is not a block, add the class for required + // on the image, we need to do this so that when using + // banners with media, the required does not work properly + // when banners are not selected. + // If it is a block, just add the required to the element. if (!isset($context['form']['#block'])) { - $element['subform']['field_uw_ban_image']['widget']['#attributes']['class'] = 'form-required js-form-required'; + + // If there already is classes set, then add to the array. + // If no classes yet, add as an array. + if (isset( $element['subform']['field_uw_ban_image']['widget']['#attributes']['class'])) { + $element['subform']['field_uw_ban_image']['widget']['#attributes']['class'][] = 'form-required'; + } + else { + $element['subform']['field_uw_ban_image']['widget']['#attributes']['class'] = ['form-required']; + } } else { $element['subform']['field_uw_ban_image']['widget']['#required'] = TRUE; -- GitLab From e1860e9546dd5aac2fb18a52b803660938f798f0 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Wed, 19 Oct 2022 10:08:59 -0400 Subject: [PATCH 131/180] ISTWCMS-5880: coding standards --- uw_cfg_common.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uw_cfg_common.module b/uw_cfg_common.module index e4aec49..82b79e4 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -1176,7 +1176,7 @@ function uw_cfg_common_field_widget_entity_reference_paragraphs_form_alter(&$ele // If there already is classes set, then add to the array. // If no classes yet, add as an array. - if (isset( $element['subform']['field_uw_ban_image']['widget']['#attributes']['class'])) { + if (isset($element['subform']['field_uw_ban_image']['widget']['#attributes']['class'])) { $element['subform']['field_uw_ban_image']['widget']['#attributes']['class'][] = 'form-required'; } else { -- GitLab From 7bf834acac016e7bf103697e428f37aaefb0f77e Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Wed, 19 Oct 2022 11:17:44 -0400 Subject: [PATCH 132/180] ISTWCMS-5880: ensuring that web page gets the correct default value for media width --- uw_cfg_common.module | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/uw_cfg_common.module b/uw_cfg_common.module index 82b79e4..41cf845 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -1004,6 +1004,23 @@ function uw_cfg_common_form_alter(array &$form, FormStateInterface $form_state, // Add our custom validation for banners. $form['#validate'][] = '_uw_cfg_common_banner_validate'; + + // Get the node object from the form state. Need to get + // it this way so that if we are on an add node, we can + // at least grab the basics of the node. + $node = $form_state->getFormObject()->getEntity(); + + // If we are on a web page, ensure that if there is no + // media set that the default value for the media with + // is the extra wide contained width. + if ($node->getType() == 'uw_ct_web_page') { + + // If there is no type of media yet, set the default for + // the media width. + if (empty($form['field_uw_type_of_media']['widget']['#default_value'])) { + $form['field_uw_media_width']['widget']['#default_value'] = ['uw_lbs_contained_width']; + } + } } // If we are on the media upload form, we want to restrict -- GitLab From 7e6f4548390c4d221a260946b7af9631101407c9 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Wed, 19 Oct 2022 15:25:37 -0400 Subject: [PATCH 133/180] ISTWCMS-5880: adding function to get the media flags --- src/Service/UWService.php | 40 ++++++++++++++++++++++++++++++ src/Service/UWServiceInterface.php | 11 ++++++++ src/Service/UwNodeFieldValue.php | 1 + 3 files changed, 52 insertions(+) diff --git a/src/Service/UWService.php b/src/Service/UWService.php index b63cfea..850b778 100644 --- a/src/Service/UWService.php +++ b/src/Service/UWService.php @@ -247,6 +247,46 @@ class UWService implements UWServiceInterface { return $preprocess; } + /** + * {@inheritDoc} + */ + public function uwGetMediaFlags(Node $node): array { + + // Set the defaults for the flags to false. + $media_flags['has_media'] = FALSE; + $media_flags['show_header_in_media'] = FALSE; + + // If there is a type of media field, continue to look + // for media flags. + if ($node->hasField('field_uw_type_of_media')) { + + // If there is a type of media set, then set has_media, + // and look for media in header. + if ($type_of_media = $node->field_uw_type_of_media->value) { + + // Set has_media flag. + $media_flags['has_media'] = TRUE; + + // If the type of media is image, the header needs to + // go inside the media, so set the flag. + if ($type_of_media == 'image') { + $media_flags['show_header_in_media'] = TRUE; + } + } + // Special case is contact, we need to look if there + // is a portrait image and if so set the has_media. + else if ($node->getType() == 'uw_ct_contact') { + + // If there is a portrait image, set the has_media. + if ($node->field_uw_ct_contact_image->getValue()) { + $media_flags['has_media'] = TRUE; + } + } + } + + return $media_flags; + } + /** * {@inheritDoc} */ diff --git a/src/Service/UWServiceInterface.php b/src/Service/UWServiceInterface.php index b8eaee2..a9fe706 100644 --- a/src/Service/UWServiceInterface.php +++ b/src/Service/UWServiceInterface.php @@ -59,6 +59,17 @@ interface UWServiceInterface { */ public function uwGetNodePreprocessing(string $type): array; + /** + * Gets the flags for showing media on nodes. + * + * @param \Drupal\node\Node $node + * Node entity. + * + * @return array + * Array of flags for media. + */ + public function uwGetMediaFlags(Node $node): array; + /** * Gets dates from node. * diff --git a/src/Service/UwNodeFieldValue.php b/src/Service/UwNodeFieldValue.php index bb9a247..6ea5bbc 100644 --- a/src/Service/UwNodeFieldValue.php +++ b/src/Service/UwNodeFieldValue.php @@ -317,6 +317,7 @@ class UwNodeFieldValue { 'style' => $node->field_uw_text_overlay_style->value, 'transition_speed' => $node->field_uw_transition_speed->value, 'media_width' => $media_width_classes ?? NULL, + 'bundle' => $node->getType(), ]; return $banners; -- GitLab From 0ea6dc563502b91f59e1dc6bf365621b8ea9989e Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Wed, 19 Oct 2022 15:26:52 -0400 Subject: [PATCH 134/180] ISTWMCS-5880: coding standards --- src/Service/UWService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Service/UWService.php b/src/Service/UWService.php index 850b778..284fccb 100644 --- a/src/Service/UWService.php +++ b/src/Service/UWService.php @@ -275,7 +275,7 @@ class UWService implements UWServiceInterface { } // Special case is contact, we need to look if there // is a portrait image and if so set the has_media. - else if ($node->getType() == 'uw_ct_contact') { + elseif ($node->getType() == 'uw_ct_contact') { // If there is a portrait image, set the has_media. if ($node->field_uw_ct_contact_image->getValue()) { -- GitLab From 4c78b5fcbd2056f1d5c62f714474c270aae6b9f4 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Wed, 19 Oct 2022 15:49:40 -0400 Subject: [PATCH 135/180] ISTWCMS-5880: adding get media flags to preprocess node --- uw_cfg_common.module | 31 ++++--------------------------- 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/uw_cfg_common.module b/uw_cfg_common.module index 41cf845..9e0759a 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -605,6 +605,10 @@ function uw_cfg_common_preprocess_node(&$variables) { $variables['uw_content_moderation_form'] = $render; } + + $variables['media_flags'] = \Drupal::service('uw_cfg_common.uw_service')->uwGetMediaFlags($variables['node']); + + $test = ''; } /** @@ -1615,30 +1619,3 @@ function uw_cfg_common_preprocess_html(&$variables): void { $variables['page']['#attached']['html_head'][] = [$noindex, 'noindex']; } } - -/** - * Set dynamic allowed values for the type of media field. - * - * @param \Drupal\field\Entity\FieldStorageConfig $definition - * The field definition. - * @param \Drupal\Core\Entity\ContentEntityInterface|null $entity - * The entity being created if applicable. - * @param bool $cacheable - * Boolean indicating if the results are cacheable. - * - * @return array - * An array of possible key and value options. - * - * @see options_allowed_values() - */ -function _uw_cfg_common_allowed_media_types( - FieldStorageConfig $definition, - ContentEntityInterface $entity = NULL, - $cacheable -) { - - return [ - 'banner' => 'Banner', - 'image' => 'Image', - ]; -} -- GitLab From 8a73903dbbf8acdf96a111d33497829ae9a28c3e Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Wed, 19 Oct 2022 15:51:40 -0400 Subject: [PATCH 136/180] ISTWCMS-5880: adding back allowed values function --- uw_cfg_common.module | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/uw_cfg_common.module b/uw_cfg_common.module index 9e0759a..e4d4670 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -1619,3 +1619,30 @@ function uw_cfg_common_preprocess_html(&$variables): void { $variables['page']['#attached']['html_head'][] = [$noindex, 'noindex']; } } + +/** + * Set dynamic allowed values for the type of media field. + * + * @param \Drupal\field\Entity\FieldStorageConfig $definition + * The field definition. + * @param \Drupal\Core\Entity\ContentEntityInterface|null $entity + * The entity being created if applicable. + * @param bool $cacheable + * Boolean indicating if the results are cacheable. + * + * @return array + * An array of possible key and value options. + * + * @see options_allowed_values() + */ +function _uw_cfg_common_allowed_media_types( + FieldStorageConfig $definition, + ContentEntityInterface $entity = NULL, + $cacheable +) { + + return [ + 'banner' => 'Banner', + 'image' => 'Image', + ]; +} -- GitLab From 3a51a65ed6525c514b363a9a5786168f5aac98af Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Wed, 19 Oct 2022 18:40:46 -0400 Subject: [PATCH 137/180] ISTWCMS-5880: adding logic to get out contact media --- src/Service/UWService.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Service/UWService.php b/src/Service/UWService.php index 284fccb..5df3c26 100644 --- a/src/Service/UWService.php +++ b/src/Service/UWService.php @@ -255,6 +255,7 @@ class UWService implements UWServiceInterface { // Set the defaults for the flags to false. $media_flags['has_media'] = FALSE; $media_flags['show_header_in_media'] = FALSE; + $media_flags['has_portrait'] = FALSE; // If there is a type of media field, continue to look // for media flags. @@ -273,13 +274,14 @@ class UWService implements UWServiceInterface { $media_flags['show_header_in_media'] = TRUE; } } + // Special case is contact, we need to look if there // is a portrait image and if so set the has_media. - elseif ($node->getType() == 'uw_ct_contact') { + if ($node->getType() == 'uw_ct_contact') { // If there is a portrait image, set the has_media. if ($node->field_uw_ct_contact_image->getValue()) { - $media_flags['has_media'] = TRUE; + $media_flags['has_portrait'] = TRUE; } } } -- GitLab From 898bfa4fd3d2cc8fde154869055c8cbc6a166930 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Wed, 19 Oct 2022 18:42:24 -0400 Subject: [PATCH 138/180] ISTWCMS-5880: coding standards --- uw_cfg_common.module | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/uw_cfg_common.module b/uw_cfg_common.module index e4d4670..3d0c12a 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -606,9 +606,8 @@ function uw_cfg_common_preprocess_node(&$variables) { $variables['uw_content_moderation_form'] = $render; } + // Set the media flags for the node. $variables['media_flags'] = \Drupal::service('uw_cfg_common.uw_service')->uwGetMediaFlags($variables['node']); - - $test = ''; } /** -- GitLab From 028adc6939d4d35ae6a20826f0a12f1115863134 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Thu, 20 Oct 2022 10:34:04 -0400 Subject: [PATCH 139/180] ISTWCMS-5880: fixing node preprocess for anon users --- uw_cfg_common.module | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/uw_cfg_common.module b/uw_cfg_common.module index 3d0c12a..dd6e8bb 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -19,6 +19,7 @@ use Drupal\field\Entity\FieldStorageConfig; use Drupal\fillpdf\Controller\HandlePdfController; use Drupal\fillpdf\Form\FillPdfFormForm; use Drupal\media_library\MediaLibraryState; +use Drupal\node\Entity\Node; use Drupal\user\UserInterface; use Drupal\uw_cfg_common\Service\UWService; use Drupal\webform\WebformInterface; @@ -597,13 +598,15 @@ function uw_cfg_common_preprocess_node(&$variables) { // Return empty render array if user doesn't have access. // $access_result can be boolean or an AccessResult class. - if (is_object($access_result) && $access_result->isForbidden() || is_bool($access_result) && !$access_result) { - return []; - } - - $render = $plugin_block->build(); + if ( + is_object($access_result) && + $access_result->isForbidden() || + is_bool($access_result) + && $access_result + ) { - $variables['uw_content_moderation_form'] = $render; + $variables['uw_content_moderation_form'] = $plugin_block->build(); + } } // Set the media flags for the node. -- GitLab From 224fc6a17a6ad386d47402f94288b73c71911c3c Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Thu, 20 Oct 2022 10:35:53 -0400 Subject: [PATCH 140/180] ISTWCMS-5880: coding standards --- uw_cfg_common.module | 1 - 1 file changed, 1 deletion(-) diff --git a/uw_cfg_common.module b/uw_cfg_common.module index dd6e8bb..3d4ce59 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -19,7 +19,6 @@ use Drupal\field\Entity\FieldStorageConfig; use Drupal\fillpdf\Controller\HandlePdfController; use Drupal\fillpdf\Form\FillPdfFormForm; use Drupal\media_library\MediaLibraryState; -use Drupal\node\Entity\Node; use Drupal\user\UserInterface; use Drupal\uw_cfg_common\Service\UWService; use Drupal\webform\WebformInterface; -- GitLab From fca686377e93bd5c48219ca31b8f09c8dd9652bc Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Thu, 20 Oct 2022 10:50:53 -0400 Subject: [PATCH 141/180] ISTWCMS-5880: fixing teasers with media --- src/Service/UWService.php | 44 ++++++++++++++++-------------- src/Service/UWServiceInterface.php | 4 ++- 2 files changed, 27 insertions(+), 21 deletions(-) diff --git a/src/Service/UWService.php b/src/Service/UWService.php index 5df3c26..365aad3 100644 --- a/src/Service/UWService.php +++ b/src/Service/UWService.php @@ -250,38 +250,42 @@ class UWService implements UWServiceInterface { /** * {@inheritDoc} */ - public function uwGetMediaFlags(Node $node): array { + public function uwGetMediaFlags(Node $node, string $view_mode = NULL): array { // Set the defaults for the flags to false. $media_flags['has_media'] = FALSE; $media_flags['show_header_in_media'] = FALSE; $media_flags['has_portrait'] = FALSE; - // If there is a type of media field, continue to look - // for media flags. - if ($node->hasField('field_uw_type_of_media')) { + // If we are not on a teaser, then set the media flags. + if ($view_mode !== 'teaser') { - // If there is a type of media set, then set has_media, - // and look for media in header. - if ($type_of_media = $node->field_uw_type_of_media->value) { + // If there is a type of media field, continue to look + // for media flags. + if ($node->hasField('field_uw_type_of_media')) { + + // If there is a type of media set, then set has_media, + // and look for media in header. + if ($type_of_media = $node->field_uw_type_of_media->value) { - // Set has_media flag. - $media_flags['has_media'] = TRUE; + // Set has_media flag. + $media_flags['has_media'] = TRUE; - // If the type of media is image, the header needs to - // go inside the media, so set the flag. - if ($type_of_media == 'image') { - $media_flags['show_header_in_media'] = TRUE; + // If the type of media is image, the header needs to + // go inside the media, so set the flag. + if ($type_of_media == 'image') { + $media_flags['show_header_in_media'] = TRUE; + } } - } - // Special case is contact, we need to look if there - // is a portrait image and if so set the has_media. - if ($node->getType() == 'uw_ct_contact') { + // Special case is contact, we need to look if there + // is a portrait image and if so set the has_media. + if ($node->getType() == 'uw_ct_contact') { - // If there is a portrait image, set the has_media. - if ($node->field_uw_ct_contact_image->getValue()) { - $media_flags['has_portrait'] = TRUE; + // If there is a portrait image, set the has_media. + if ($node->field_uw_ct_contact_image->getValue()) { + $media_flags['has_portrait'] = TRUE; + } } } } diff --git a/src/Service/UWServiceInterface.php b/src/Service/UWServiceInterface.php index a9fe706..6c50490 100644 --- a/src/Service/UWServiceInterface.php +++ b/src/Service/UWServiceInterface.php @@ -64,11 +64,13 @@ interface UWServiceInterface { * * @param \Drupal\node\Node $node * Node entity. + * @param string $view_mode + * The view mode of the node. * * @return array * Array of flags for media. */ - public function uwGetMediaFlags(Node $node): array; + public function uwGetMediaFlags(Node $node, string $view_mode = NULL): array; /** * Gets dates from node. -- GitLab From 38a5b6b9b4a9e1653378926f04f330900197e8ef Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Thu, 20 Oct 2022 10:57:57 -0400 Subject: [PATCH 142/180] ISTWCMS-5880: adding view type for media flags on nodes --- src/Service/UwNodeFieldValue.php | 1 + uw_cfg_common.module | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Service/UwNodeFieldValue.php b/src/Service/UwNodeFieldValue.php index 6ea5bbc..f0519a9 100644 --- a/src/Service/UwNodeFieldValue.php +++ b/src/Service/UwNodeFieldValue.php @@ -318,6 +318,7 @@ class UwNodeFieldValue { 'transition_speed' => $node->field_uw_transition_speed->value, 'media_width' => $media_width_classes ?? NULL, 'bundle' => $node->getType(), + 'uuid' => uniqid(), ]; return $banners; diff --git a/uw_cfg_common.module b/uw_cfg_common.module index 3d4ce59..7a3b59f 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -609,7 +609,7 @@ function uw_cfg_common_preprocess_node(&$variables) { } // Set the media flags for the node. - $variables['media_flags'] = \Drupal::service('uw_cfg_common.uw_service')->uwGetMediaFlags($variables['node']); + $variables['media_flags'] = \Drupal::service('uw_cfg_common.uw_service')->uwGetMediaFlags($variables['node'], $variables['view_mode']); } /** -- GitLab From eaf156d503a2d71f9324fe778ae7e6a6f2c9316b Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Thu, 20 Oct 2022 11:05:02 -0400 Subject: [PATCH 143/180] ISTWCMS-5880: fixing update hook for existing sites and media --- uw_cfg_common.install | 65 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/uw_cfg_common.install b/uw_cfg_common.install index 1c622d7..fc7c4b3 100644 --- a/uw_cfg_common.install +++ b/uw_cfg_common.install @@ -465,6 +465,46 @@ function uw_cfg_common_update_9105(&$sandbox) { */ function uw_cfg_common_update_9106(&$sandbox) { + // The database service. + $database = \Drupal::database(); + + // The tables to be used for fields to get and remove. + $tables = [ + 'node__field_uw_type_of_media', + 'node_revision__field_uw_type_of_media', + 'node__field_uw_hero_image', + 'node_revision__field_uw_hero_image', + ]; + + // Step through each of the tables and get the data, + // then truncate them. We need to truncate the table + // so that we are able to modify the fields, if there + // is data in these tables, Drupal throws an error about + // data already existing in the fields. We will insert + // the data back into the tables after everything is + // completed. + foreach ($tables as $table) { + + // Get the rows in the table. + $values = $database->select($table, 'n') + ->fields('n') + ->execute() + ->fetchAll(); + + // Step through each of the rows and add to variable. + foreach ($values as $value) { + + // Add to the variable and cast to an array so that + // we are not using an object, just makes it easier + // to work with when inserting these rows back + // into the database. + $node_data[$table][] = (array)$value; + } + + // Truncate the table. + $database->truncate($table)->execute(); + } + // The content types that are not getting any changes. $cts_not_to_install = [ 'uw_ct_sidebar', @@ -630,4 +670,29 @@ function uw_cfg_common_update_9106(&$sandbox) { $node->save(); } } + + // Step through all the tables and insert back into + // the database. + foreach ($node_data as $table => $data) { + + // Get all the rows from the table. + foreach ($data as $field_data) { + + // Reset the fields array, so we are working with + // a blank array to insert. + $fields = []; + + // Step through all the entries in the row and add + // to the fields array, this makes it much easier to + // do one insert command. + foreach ($field_data as $key => $value) { + $fields[$key] = $value; + } + + // Insert the row into the database. + $result = $database->insert($table) + ->fields($fields) + ->execute(); + } + } } -- GitLab From 6e4c5aa2e1e7c5e41d5b713a588d232b1f2ac707 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Thu, 20 Oct 2022 11:13:10 -0400 Subject: [PATCH 144/180] ISTWCMS-5880: coding standards --- uw_cfg_common.install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/uw_cfg_common.install b/uw_cfg_common.install index fc7c4b3..7af7ee8 100644 --- a/uw_cfg_common.install +++ b/uw_cfg_common.install @@ -498,7 +498,7 @@ function uw_cfg_common_update_9106(&$sandbox) { // we are not using an object, just makes it easier // to work with when inserting these rows back // into the database. - $node_data[$table][] = (array)$value; + $node_data[$table][] = (array) $value; } // Truncate the table. @@ -690,7 +690,7 @@ function uw_cfg_common_update_9106(&$sandbox) { } // Insert the row into the database. - $result = $database->insert($table) + $database->insert($table) ->fields($fields) ->execute(); } -- GitLab From a6b71e4b4b17f8363f9ebcf2f8eecbdd3e786031 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Thu, 20 Oct 2022 15:37:53 -0400 Subject: [PATCH 145/180] ISTWCMS-5880: finally fixing update hook for media --- uw_cfg_common.install | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/uw_cfg_common.install b/uw_cfg_common.install index 7af7ee8..f139bc0 100644 --- a/uw_cfg_common.install +++ b/uw_cfg_common.install @@ -571,6 +571,7 @@ function uw_cfg_common_update_9106(&$sandbox) { 'field.storage.node.field_uw_media_width', 'field.storage.node.field_uw_slide_speed', 'field.storage.node.field_uw_transition_speed', + 'field.storage.node.field_uw_autoplay', 'field.storage.node.field_uw_text_overlay_style', ]; @@ -610,6 +611,8 @@ function uw_cfg_common_update_9106(&$sandbox) { 'field.field.node.' . $id . '.field_uw_banner', 'field.field.node.' . $id . '.field_uw_type_of_media', 'field.field.node.' . $id . '.field_uw_media_width', + 'field.field.node.' . $id . '.field_uw_slide_speed', + 'field.field.node.' . $id . '.field_uw_autoplay', 'field.field.node.' . $id . '.field_uw_text_overlay_style', 'field.field.node.' . $id . '.field_uw_transition_speed', ]; @@ -658,6 +661,7 @@ function uw_cfg_common_update_9106(&$sandbox) { $node->field_uw_media_width = 'uw_lbs_full_width'; $node->field_uw_slide_speed = 7000; $node->field_uw_transition_speed = 400; + $node->field_uw_autoplay = TRUE; $node->field_uw_text_overlay_style = 'full-width'; // If the content type does not have media yet, -- GitLab From da89f07dc1edc16e8b659a5d4321442164d9df8e Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Tue, 25 Oct 2022 10:27:30 -0400 Subject: [PATCH 146/180] ISTWCMS-5880: fixing update hook for banners to ensure no undefined index or unknown variable error --- uw_cfg_common.install | 44 +++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/uw_cfg_common.install b/uw_cfg_common.install index f139bc0..c5c52ba 100644 --- a/uw_cfg_common.install +++ b/uw_cfg_common.install @@ -476,6 +476,10 @@ function uw_cfg_common_update_9106(&$sandbox) { 'node_revision__field_uw_hero_image', ]; + // Setting up an empty array so that we do not get + // undefined index or unknown variable error. + $node_data = []; + // Step through each of the tables and get the data, // then truncate them. We need to truncate the table // so that we are able to modify the fields, if there @@ -675,28 +679,32 @@ function uw_cfg_common_update_9106(&$sandbox) { } } - // Step through all the tables and insert back into - // the database. - foreach ($node_data as $table => $data) { + // Ensure that we have some data to put back in the DB. + if (!empty($node_data)) { - // Get all the rows from the table. - foreach ($data as $field_data) { + // Step through all the tables and insert back into + // the database. + foreach ($node_data as $table => $data) { - // Reset the fields array, so we are working with - // a blank array to insert. - $fields = []; + // Get all the rows from the table. + foreach ($data as $field_data) { - // Step through all the entries in the row and add - // to the fields array, this makes it much easier to - // do one insert command. - foreach ($field_data as $key => $value) { - $fields[$key] = $value; - } + // Reset the fields array, so we are working with + // a blank array to insert. + $fields = []; - // Insert the row into the database. - $database->insert($table) - ->fields($fields) - ->execute(); + // Step through all the entries in the row and add + // to the fields array, this makes it much easier to + // do one insert command. + foreach ($field_data as $key => $value) { + $fields[$key] = $value; + } + + // Insert the row into the database. + $database->insert($table) + ->fields($fields) + ->execute(); + } } } } -- GitLab From 13ee3027c348d337ebb9ad0a167dd979c2f0253c Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Tue, 25 Oct 2022 16:12:08 -0400 Subject: [PATCH 147/180] ISTWCMS-5880: removing code that was making media with defaulted for web page, it should respect what is in the content type now and saved to the node --- uw_cfg_common.module | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/uw_cfg_common.module b/uw_cfg_common.module index 7a3b59f..7075246 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -1014,18 +1014,6 @@ function uw_cfg_common_form_alter(array &$form, FormStateInterface $form_state, // it this way so that if we are on an add node, we can // at least grab the basics of the node. $node = $form_state->getFormObject()->getEntity(); - - // If we are on a web page, ensure that if there is no - // media set that the default value for the media with - // is the extra wide contained width. - if ($node->getType() == 'uw_ct_web_page') { - - // If there is no type of media yet, set the default for - // the media width. - if (empty($form['field_uw_type_of_media']['widget']['#default_value'])) { - $form['field_uw_media_width']['widget']['#default_value'] = ['uw_lbs_contained_width']; - } - } } // If we are on the media upload form, we want to restrict -- GitLab From 8c6c337be636203561dcaabd2f2d75bc3e9c5e06 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Tue, 25 Oct 2022 16:13:18 -0400 Subject: [PATCH 148/180] ISTWCMS-5880: coding standards --- uw_cfg_common.module | 5 ----- 1 file changed, 5 deletions(-) diff --git a/uw_cfg_common.module b/uw_cfg_common.module index 7075246..a8fd0e5 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -1009,11 +1009,6 @@ function uw_cfg_common_form_alter(array &$form, FormStateInterface $form_state, // Add our custom validation for banners. $form['#validate'][] = '_uw_cfg_common_banner_validate'; - - // Get the node object from the form state. Need to get - // it this way so that if we are on an add node, we can - // at least grab the basics of the node. - $node = $form_state->getFormObject()->getEntity(); } // If we are on the media upload form, we want to restrict -- GitLab From 4de9165e52303bbfdf18158ad59e9468d35b1df8 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Fri, 28 Oct 2022 14:39:56 -0400 Subject: [PATCH 149/180] ISTWCMS-5880: fixing remembering values for media above --- uw_cfg_common.module | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/uw_cfg_common.module b/uw_cfg_common.module index a8fd0e5..3aa19a0 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -158,37 +158,6 @@ function uw_cfg_common_entity_presave(EntityInterface $entity) { } } } - - // If there is a type of media, ensure that we do only have - // values in the fields that are selected. - if ($entity->hasField('field_uw_type_of_media')) { - - // Get the type of media. - $type_of_media = $entity->field_uw_type_of_media->value; - - // If it is null then set the hero image to null. - if ($type_of_media == NULL) { - $entity->set('field_uw_hero_image', NULL); - } - else { - - // If the media type is anything but banner, set it - // to have full width style, otherwise check that it - // can have other things besides full width. - if ($type_of_media !== 'banner') { - $entity->field_uw_media_width = 'uw_lbs_full_width'; - } - else { - - // If the banner is not fdsu (full-width), have the - // style set to full-width. This ensures that we will - // always have full width for things that are not fdsu. - if ($entity->field_uw_text_overlay_style->value !== 'full-width') { - $entity->field_uw_media_width = 'uw_lbs_full_width'; - } - } - } - } } } -- GitLab From 742d7ae1d2a0028322c864eaab0a6b635f022058 Mon Sep 17 00:00:00 2001 From: Kevin Paxman Date: Tue, 8 Nov 2022 15:50:06 -0500 Subject: [PATCH 150/180] ISTWCMS-5880: only load styles from the default group, which contains the section widths - needed for when other section styles ship --- uw_cfg_common.module | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/uw_cfg_common.module b/uw_cfg_common.module index 3aa19a0..d3b0b0a 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -604,13 +604,17 @@ function _uw_cfg_common_get_layout_builder_styles( // Get all the styles for sections. $all_styles = _layout_builder_styles_retrieve_by_type('section'); - // Array of options. $options = []; // Step through each style and get the info. foreach ($all_styles as $style) { - $options[$style->id()] = $style->label(); + // Only load styles from the "default" group, + // which contains the section widths. + // Needed for when other section styles ship. + if ($style->getGroup() == 'default') { + $options[$style->id()] = $style->label(); + } } return $options; -- GitLab From d0ec1971c94f382774acdb4c157727faba1697bf Mon Sep 17 00:00:00 2001 From: Kevin Paxman Date: Mon, 14 Nov 2022 16:36:37 -0500 Subject: [PATCH 151/180] Experimentation hour: add the start of a form to bulk register users --- src/Form/UwAddUsersForm.php | 62 ++++++++++++++++++++++++++++++++++++ uw_cfg_common.links.menu.yml | 5 +++ uw_cfg_common.routing.yml | 7 ++++ 3 files changed, 74 insertions(+) create mode 100644 src/Form/UwAddUsersForm.php diff --git a/src/Form/UwAddUsersForm.php b/src/Form/UwAddUsersForm.php new file mode 100644 index 0000000..c635708 --- /dev/null +++ b/src/Form/UwAddUsersForm.php @@ -0,0 +1,62 @@ + 'WatIAM user ID(s) (maximum 8 characters per ID)', + '#description' => 'Enter a single WatIAM user ID, or multiple WatIAM user IDs, one per line.
You can use authenticated WatIAM search if you don\'t know their user ID (will open a new window).', + '#type' => 'textarea', + '#required' => TRUE, + ]; + + // The submit button. + $form['actions']['#type'] = 'actions'; + $form['actions']['submit'] = [ + '#type' => 'submit', + '#value' => $this->t('Create new account(s)'), + '#button_type' => 'primary', + ]; + + return $form; + } + + /** + * {@inheritdoc} + */ + public function submitForm(array &$form, FormStateInterface $form_state) { + + // The permissions array that was submitted in the form. + $submitted_users = explode(PHP_EOL, $form_state->getValue('users')); + + // Step through each of the submitted users to create if needed/possible, + // or show a message if not. + foreach ($submitted_users as $row_name => $submitted_user) { + $this->messenger()->addStatus($this->t('Normally something would happen here...')); + } + // Set the message that the users have been created. + $this->messenger()->addStatus($this->t('Finished creating users.')); + } + +} diff --git a/uw_cfg_common.links.menu.yml b/uw_cfg_common.links.menu.yml index b205bda..86f9b95 100644 --- a/uw_cfg_common.links.menu.yml +++ b/uw_cfg_common.links.menu.yml @@ -450,3 +450,8 @@ uw_site_management.uw_menu_report_csv: menu_name: uw-menu-site-management route_name: uw_cfg_common.uw_menu_report_csv weight: 0 +uw_site_management.uw_add_users: + title: 'Add UWaterloo user(s)' + menu_name: uw-menu-site-management + route_name: uw_add_users.form + weight: 0 diff --git a/uw_cfg_common.routing.yml b/uw_cfg_common.routing.yml index c5bdcfe..033a9a5 100644 --- a/uw_cfg_common.routing.yml +++ b/uw_cfg_common.routing.yml @@ -48,3 +48,10 @@ uw_cfg_common.uw_menu_report_csv: _controller: \Drupal\uw_cfg_common\Controller\UwDownloadCsvController::uwMenuReport requirements: _permission: 'view UW CSV reports' +uw_add_users.form: + path: '/admin/add-uwaterloo-users' + defaults: + _title: 'Add UWaterloo User(s)' + _form: '\Drupal\uw_cfg_common\Form\UwAddUsersForm' + requirements: + _permission: 'administer users' -- GitLab From d8fab34b8025e1ac00472d1f3375ebb9bd1c12a1 Mon Sep 17 00:00:00 2001 From: Kevin Paxman Date: Mon, 14 Nov 2022 16:38:48 -0500 Subject: [PATCH 152/180] Code standards --- src/Form/UwAddUsersForm.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Form/UwAddUsersForm.php b/src/Form/UwAddUsersForm.php index c635708..4e0ae1b 100644 --- a/src/Form/UwAddUsersForm.php +++ b/src/Form/UwAddUsersForm.php @@ -4,7 +4,6 @@ namespace Drupal\uw_cfg_common\Form; use Drupal\Core\Form\FormBase; use Drupal\Core\Form\FormStateInterface; -use Drupal\uw_cfg_common\UwPermissions\UwPermissions; /** * Form class for the content access form. @@ -25,8 +24,8 @@ class UwAddUsersForm extends FormBase { // The list of users this form. $form['users'] = [ - '#title' => 'WatIAM user ID(s) (maximum 8 characters per ID)', - '#description' => 'Enter a single WatIAM user ID, or multiple WatIAM user IDs, one per line.
You can use authenticated WatIAM search if you don\'t know their user ID (will open a new window).', + '#title' => t('WatIAM user ID(s) (maximum 8 characters per ID)'), + '#description' => t('Enter a single WatIAM user ID, or multiple WatIAM user IDs, one per line.
You can use authenticated WatIAM search if you don\'t know their user ID (will open a new window).'), '#type' => 'textarea', '#required' => TRUE, ]; @@ -52,9 +51,9 @@ class UwAddUsersForm extends FormBase { // Step through each of the submitted users to create if needed/possible, // or show a message if not. - foreach ($submitted_users as $row_name => $submitted_user) { + foreach ($submitted_users as $user) { $this->messenger()->addStatus($this->t('Normally something would happen here...')); - } + } // Set the message that the users have been created. $this->messenger()->addStatus($this->t('Finished creating users.')); } -- GitLab From 05ba3f1b099dd0e868bad99470a0948a25d640d8 Mon Sep 17 00:00:00 2001 From: Kevin Paxman Date: Mon, 14 Nov 2022 16:41:32 -0500 Subject: [PATCH 153/180] Code standards try 2 --- src/Form/UwAddUsersForm.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Form/UwAddUsersForm.php b/src/Form/UwAddUsersForm.php index 4e0ae1b..42fcef4 100644 --- a/src/Form/UwAddUsersForm.php +++ b/src/Form/UwAddUsersForm.php @@ -24,8 +24,8 @@ class UwAddUsersForm extends FormBase { // The list of users this form. $form['users'] = [ - '#title' => t('WatIAM user ID(s) (maximum 8 characters per ID)'), - '#description' => t('Enter a single WatIAM user ID, or multiple WatIAM user IDs, one per line.
You can use authenticated WatIAM search if you don\'t know their user ID (will open a new window).'), + '#title' => $this->t('WatIAM user ID(s) (maximum 8 characters per ID)'), + '#description' => $this->t('Enter a single WatIAM user ID, or multiple WatIAM user IDs, one per line.
You can use authenticated WatIAM search if you don\'t know their user ID (will open a new window).'), '#type' => 'textarea', '#required' => TRUE, ]; @@ -52,6 +52,8 @@ class UwAddUsersForm extends FormBase { // Step through each of the submitted users to create if needed/possible, // or show a message if not. foreach ($submitted_users as $user) { + // Let's be nice and remove whitespace. + $user = trim(user); $this->messenger()->addStatus($this->t('Normally something would happen here...')); } // Set the message that the users have been created. -- GitLab From 5a0cf99efaa6f83af5e09b756d9938dad23fc459 Mon Sep 17 00:00:00 2001 From: Kevin Paxman Date: Mon, 14 Nov 2022 16:42:37 -0500 Subject: [PATCH 154/180] Code standards try 3 --- src/Form/UwAddUsersForm.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Form/UwAddUsersForm.php b/src/Form/UwAddUsersForm.php index 42fcef4..023992a 100644 --- a/src/Form/UwAddUsersForm.php +++ b/src/Form/UwAddUsersForm.php @@ -53,7 +53,7 @@ class UwAddUsersForm extends FormBase { // or show a message if not. foreach ($submitted_users as $user) { // Let's be nice and remove whitespace. - $user = trim(user); + $user = trim($user); $this->messenger()->addStatus($this->t('Normally something would happen here...')); } // Set the message that the users have been created. -- GitLab From ad200c89e2ff42ed7939f98ddc44a56c34bf7374 Mon Sep 17 00:00:00 2001 From: Kevin Paxman Date: Mon, 14 Nov 2022 18:33:28 -0500 Subject: [PATCH 155/180] EXPHR: Get bulk account creation basically working, minus WatIAM lookup and link on people page --- src/Form/UwAddUsersForm.php | 76 +++++++++++++++++++++++++++++++++---- uw_cfg_common.routing.yml | 2 +- 2 files changed, 70 insertions(+), 8 deletions(-) diff --git a/src/Form/UwAddUsersForm.php b/src/Form/UwAddUsersForm.php index 023992a..78770c1 100644 --- a/src/Form/UwAddUsersForm.php +++ b/src/Form/UwAddUsersForm.php @@ -22,10 +22,10 @@ class UwAddUsersForm extends FormBase { */ public function buildForm(array $form, FormStateInterface $form_state) { - // The list of users this form. + // The list of users from this form. $form['users'] = [ - '#title' => $this->t('WatIAM user ID(s) (maximum 8 characters per ID)'), - '#description' => $this->t('Enter a single WatIAM user ID, or multiple WatIAM user IDs, one per line.
You can use authenticated WatIAM search if you don\'t know their user ID (will open a new window).'), + '#title' => $this->t('WatIAM user ID(s): (maximum 8 characters per ID)'), + '#description' => $this->t('Enter a single WatIAM user ID, or multiple WatIAM user IDs, one per line. All letters will be converted to lower case. Duplicates will be ignored.
You can use authenticated WatIAM search if you don\'t know their user ID (will open a new window).'), '#type' => 'textarea', '#required' => TRUE, ]; @@ -46,16 +46,78 @@ class UwAddUsersForm extends FormBase { */ public function submitForm(array &$form, FormStateInterface $form_state) { - // The permissions array that was submitted in the form. + // The user ID list that was submitted in the form. $submitted_users = explode(PHP_EOL, $form_state->getValue('users')); + // Be nice and remove whitespace. + $submitted_users = array_map('trim', $submitted_users); + + // Remove any duplicates. + $submitted_users = array_unique($submitted_users); + // Step through each of the submitted users to create if needed/possible, // or show a message if not. foreach ($submitted_users as $user) { - // Let's be nice and remove whitespace. - $user = trim($user); - $this->messenger()->addStatus($this->t('Normally something would happen here...')); + // Make sure the user ID is in lower case. + $user = strtolower($user); + + // Ignore blank lines. + if (!strlen($user)) { + continue; + } + + // Don't process long user IDs. + if (strlen($user) > 8) { + $this->messenger()->addError($this->t('The user ID @user is too long and was skipped.', array('@user' => $user))); + continue; + } + + // Don't process user IDs with invalid characters. + if (!preg_match('/^[a-z0-9]+$/', $user)) { + $this->messenger()->addError($this->t('The user ID @user contains invalid characters and was skipped.', array('@user' => $user))); + continue; + } + + $existing_user = user_load_by_name($user); + if ($existing_user) { + $this->messenger()->addError($this->t('The user ID @user already exists and was skipped.', array('@link' => \Drupal::service('path_alias.manager')->getAliasByPath('/user/' . $existing_user->uid->value),'@user' => $user))); + continue; + } + + // Seems OK. + + // Create a strong random password. + $sets[] = 'abcdefghijklmnopqrstuvwxyz'; + $sets[] = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; + $sets[] = '0123456789'; + $sets[] = '!@#$%^&*()-_=+[]{}?`~"'; + $password = ''; + $password_length = rand(16,32); + while(strlen($password) < $password_length) { + foreach ($sets as $set) { + $password .= $set[array_rand(str_split($set))]; + if (strlen($password) == $password_length) { + break; + } + } + } + $password = str_shuffle($password); + + // Add the user. + // TODO: look up info from WatIAM. + $new_user = \Drupal\user\Entity\User::create(); + $new_user->setPassword($password); + $new_user->enforceIsNew(); + $new_user->setEmail($user . '@uwaterloo.ca'); + $new_user->setUsername($user); + $new_user->set('field_uw_first_name', 'Firstname'); + $new_user->set('field_uw_last_name', 'Lastname'); + $new_user->activate(); + $new_user->save(); + + $this->messenger()->addStatus($this->t('Created a new user with the user ID @user.', array('@link' => \Drupal::service('path_alias.manager')->getAliasByPath('/user/' . $new_user->uid->value),'@user' => $user))); } + // Set the message that the users have been created. $this->messenger()->addStatus($this->t('Finished creating users.')); } diff --git a/uw_cfg_common.routing.yml b/uw_cfg_common.routing.yml index 033a9a5..87ef7aa 100644 --- a/uw_cfg_common.routing.yml +++ b/uw_cfg_common.routing.yml @@ -51,7 +51,7 @@ uw_cfg_common.uw_menu_report_csv: uw_add_users.form: path: '/admin/add-uwaterloo-users' defaults: - _title: 'Add UWaterloo User(s)' + _title: 'Add UWaterloo user(s)' _form: '\Drupal\uw_cfg_common\Form\UwAddUsersForm' requirements: _permission: 'administer users' -- GitLab From 5bbaee8bf95ba3a885c0bd26ab43f94de62cc964 Mon Sep 17 00:00:00 2001 From: Kevin Paxman Date: Mon, 5 Dec 2022 14:27:24 -0500 Subject: [PATCH 156/180] EXPHR: get LDAP lookup working for bulk account creation --- src/Form/UwAddUsersForm.php | 42 ++++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/src/Form/UwAddUsersForm.php b/src/Form/UwAddUsersForm.php index 78770c1..d2453be 100644 --- a/src/Form/UwAddUsersForm.php +++ b/src/Form/UwAddUsersForm.php @@ -68,32 +68,36 @@ class UwAddUsersForm extends FormBase { // Don't process long user IDs. if (strlen($user) > 8) { - $this->messenger()->addError($this->t('The user ID @user is too long and was skipped.', array('@user' => $user))); + $this->messenger()->addError($this->t('The user ID @user is too long and was skipped.', [ '@user' => $user ] )); continue; } // Don't process user IDs with invalid characters. if (!preg_match('/^[a-z0-9]+$/', $user)) { - $this->messenger()->addError($this->t('The user ID @user contains invalid characters and was skipped.', array('@user' => $user))); + $this->messenger()->addError($this->t('The user ID @user contains invalid characters and was skipped.', [ '@user' => $user ] )); continue; } $existing_user = user_load_by_name($user); if ($existing_user) { - $this->messenger()->addError($this->t('The user ID @user already exists and was skipped.', array('@link' => \Drupal::service('path_alias.manager')->getAliasByPath('/user/' . $existing_user->uid->value),'@user' => $user))); + $this->messenger()->addError($this->t('The user ID @user already exists and was skipped.', + [ + '@link' => \Drupal::service('path_alias.manager')->getAliasByPath('/user/' . $existing_user->uid->value), + '@user' => $user, + ] + )); continue; } - // Seems OK. - + // Seems OK - move on. // Create a strong random password. $sets[] = 'abcdefghijklmnopqrstuvwxyz'; $sets[] = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; $sets[] = '0123456789'; $sets[] = '!@#$%^&*()-_=+[]{}?`~"'; $password = ''; - $password_length = rand(16,32); - while(strlen($password) < $password_length) { + $password_length = rand(16, 32); + while (strlen($password) < $password_length) { foreach ($sets as $set) { $password .= $set[array_rand(str_split($set))]; if (strlen($password) == $password_length) { @@ -103,19 +107,33 @@ class UwAddUsersForm extends FormBase { } $password = str_shuffle($password); + // Do the LDAP lookup. + $person = \Drupal::service('uw_cfg_common.uw_ldap')->lookupPerson($user); + if (!$person) { + $this->messenger()->addError($this->t('The user ID @user could not be found (or was set to private) and was skipped.', [ '@user' => $user ] )); + continue; + } + $firstname = empty($person['givenname'][0]) ? 'Firstname' : $person['givenname'][0]; + $lastname = empty($person['sn'][0]) ? 'Lastname' : $person['sn'][0]; + $email = empty($person['mail'][0]) ? $user . '@uwaterloo.ca' : $person['mail'][0]; + // Add the user. - // TODO: look up info from WatIAM. $new_user = \Drupal\user\Entity\User::create(); $new_user->setPassword($password); $new_user->enforceIsNew(); - $new_user->setEmail($user . '@uwaterloo.ca'); + $new_user->setEmail($email); $new_user->setUsername($user); - $new_user->set('field_uw_first_name', 'Firstname'); - $new_user->set('field_uw_last_name', 'Lastname'); + $new_user->set('field_uw_first_name', $firstname); + $new_user->set('field_uw_last_name', $lastname); $new_user->activate(); $new_user->save(); - $this->messenger()->addStatus($this->t('Created a new user with the user ID @user.', array('@link' => \Drupal::service('path_alias.manager')->getAliasByPath('/user/' . $new_user->uid->value),'@user' => $user))); + $this->messenger()->addStatus($this->t('Created a new user with the user ID @user.', + [ + '@link' => \Drupal::service('path_alias.manager')->getAliasByPath('/user/' . $new_user->uid->value), + '@user' => $user, + ] + )); } // Set the message that the users have been created. -- GitLab From 362dfb00122ee1efcdd62477b79c73c45935dab8 Mon Sep 17 00:00:00 2001 From: Kevin Paxman Date: Mon, 5 Dec 2022 14:41:47 -0500 Subject: [PATCH 157/180] EXPHR: code standards and update link --- src/Form/UwAddUsersForm.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Form/UwAddUsersForm.php b/src/Form/UwAddUsersForm.php index d2453be..51d3e4c 100644 --- a/src/Form/UwAddUsersForm.php +++ b/src/Form/UwAddUsersForm.php @@ -25,7 +25,7 @@ class UwAddUsersForm extends FormBase { // The list of users from this form. $form['users'] = [ '#title' => $this->t('WatIAM user ID(s): (maximum 8 characters per ID)'), - '#description' => $this->t('Enter a single WatIAM user ID, or multiple WatIAM user IDs, one per line. All letters will be converted to lower case. Duplicates will be ignored.
You can use authenticated WatIAM search if you don\'t know their user ID (will open a new window).'), + '#description' => $this->t('Enter a single WatIAM user ID, or multiple WatIAM user IDs, one per line. All letters will be converted to lower case. Duplicates will be ignored.
You can use authenticated campus people directory if you don\'t know their user ID (will open a new window).'), '#type' => 'textarea', '#required' => TRUE, ]; @@ -68,13 +68,13 @@ class UwAddUsersForm extends FormBase { // Don't process long user IDs. if (strlen($user) > 8) { - $this->messenger()->addError($this->t('The user ID @user is too long and was skipped.', [ '@user' => $user ] )); + $this->messenger()->addError($this->t('The user ID @user is too long and was skipped.', ['@user' => $user])); continue; } // Don't process user IDs with invalid characters. if (!preg_match('/^[a-z0-9]+$/', $user)) { - $this->messenger()->addError($this->t('The user ID @user contains invalid characters and was skipped.', [ '@user' => $user ] )); + $this->messenger()->addError($this->t('The user ID @user contains invalid characters and was skipped.', ['@user' => $user])); continue; } @@ -110,7 +110,7 @@ class UwAddUsersForm extends FormBase { // Do the LDAP lookup. $person = \Drupal::service('uw_cfg_common.uw_ldap')->lookupPerson($user); if (!$person) { - $this->messenger()->addError($this->t('The user ID @user could not be found (or was set to private) and was skipped.', [ '@user' => $user ] )); + $this->messenger()->addError($this->t('The user ID @user could not be found (or was set to private) and was skipped.', ['@user' => $user])); continue; } $firstname = empty($person['givenname'][0]) ? 'Firstname' : $person['givenname'][0]; -- GitLab From a5b25af19dd0b7b4dc8779a62662a8a166831c9a Mon Sep 17 00:00:00 2001 From: Kevin Paxman Date: Mon, 5 Dec 2022 15:43:03 -0500 Subject: [PATCH 158/180] EXPHR: move bulk user creation link to people page --- uw_cfg_common.links.action.yml | 5 +++++ uw_cfg_common.links.menu.yml | 5 ----- uw_cfg_common.routing.yml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) create mode 100644 uw_cfg_common.links.action.yml diff --git a/uw_cfg_common.links.action.yml b/uw_cfg_common.links.action.yml new file mode 100644 index 0000000..3564322 --- /dev/null +++ b/uw_cfg_common.links.action.yml @@ -0,0 +1,5 @@ +uw_cfg_common.add_uw_users: + route_name: uw_cfg_common.add_uw_users_form + title: 'Add UWaterloo user(s)' + appears_on: + - entity.user.collection diff --git a/uw_cfg_common.links.menu.yml b/uw_cfg_common.links.menu.yml index 86f9b95..b205bda 100644 --- a/uw_cfg_common.links.menu.yml +++ b/uw_cfg_common.links.menu.yml @@ -450,8 +450,3 @@ uw_site_management.uw_menu_report_csv: menu_name: uw-menu-site-management route_name: uw_cfg_common.uw_menu_report_csv weight: 0 -uw_site_management.uw_add_users: - title: 'Add UWaterloo user(s)' - menu_name: uw-menu-site-management - route_name: uw_add_users.form - weight: 0 diff --git a/uw_cfg_common.routing.yml b/uw_cfg_common.routing.yml index 87ef7aa..7c15c59 100644 --- a/uw_cfg_common.routing.yml +++ b/uw_cfg_common.routing.yml @@ -48,7 +48,7 @@ uw_cfg_common.uw_menu_report_csv: _controller: \Drupal\uw_cfg_common\Controller\UwDownloadCsvController::uwMenuReport requirements: _permission: 'view UW CSV reports' -uw_add_users.form: +uw_cfg_common.add_uw_users_form: path: '/admin/add-uwaterloo-users' defaults: _title: 'Add UWaterloo user(s)' -- GitLab From 7d93c298cc0dd3d66d8c6ab61a0c10dca6f215bd Mon Sep 17 00:00:00 2001 From: Igor Biki Date: Mon, 5 Dec 2022 16:12:03 -0500 Subject: [PATCH 159/180] EXPHR: Adding di services. --- src/Form/UwAddUsersForm.php | 41 +++++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/src/Form/UwAddUsersForm.php b/src/Form/UwAddUsersForm.php index 51d3e4c..4e4668e 100644 --- a/src/Form/UwAddUsersForm.php +++ b/src/Form/UwAddUsersForm.php @@ -4,12 +4,45 @@ namespace Drupal\uw_cfg_common\Form; use Drupal\Core\Form\FormBase; use Drupal\Core\Form\FormStateInterface; +use Drupal\path_alias\AliasManager; +use Drupal\user\Entity\User; +use Drupal\uw_cfg_common\Service\UWLdap; +use Symfony\Component\DependencyInjection\ContainerInterface; /** * Form class for the content access form. */ class UwAddUsersForm extends FormBase { + /** + * Path alias manager from core. + */ + protected AliasManager $pathAliasManager; + + /** + * UW Ldap service from uw_cfg_common module. + */ + protected UWLdap $uwLdap; + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container) { + // Instantiates this form class. + return new static( + $container->get('path_alias.manager'), + $container->get('uw_cfg_common.uw_ldap') + ); + } + + /** + * Class constructor. + */ + public function __construct(AliasManager $pathAliasManager, UWLdap $uwLdap) { + $this->pathAliasManager = $pathAliasManager; + $this->uwLdap = $uwLdap; + } + /** * {@inheritdoc} */ @@ -82,7 +115,7 @@ class UwAddUsersForm extends FormBase { if ($existing_user) { $this->messenger()->addError($this->t('The user ID @user already exists and was skipped.', [ - '@link' => \Drupal::service('path_alias.manager')->getAliasByPath('/user/' . $existing_user->uid->value), + '@link' => $this->pathAliasManager->getAliasByPath('/user/' . $existing_user->uid->value), '@user' => $user, ] )); @@ -108,7 +141,7 @@ class UwAddUsersForm extends FormBase { $password = str_shuffle($password); // Do the LDAP lookup. - $person = \Drupal::service('uw_cfg_common.uw_ldap')->lookupPerson($user); + $person = $this->UWLdap->lookupPerson($user); if (!$person) { $this->messenger()->addError($this->t('The user ID @user could not be found (or was set to private) and was skipped.', ['@user' => $user])); continue; @@ -118,7 +151,7 @@ class UwAddUsersForm extends FormBase { $email = empty($person['mail'][0]) ? $user . '@uwaterloo.ca' : $person['mail'][0]; // Add the user. - $new_user = \Drupal\user\Entity\User::create(); + $new_user = User::create(); $new_user->setPassword($password); $new_user->enforceIsNew(); $new_user->setEmail($email); @@ -130,7 +163,7 @@ class UwAddUsersForm extends FormBase { $this->messenger()->addStatus($this->t('Created a new user with the user ID @user.', [ - '@link' => \Drupal::service('path_alias.manager')->getAliasByPath('/user/' . $new_user->uid->value), + '@link' => $this->pathAliasManager->getAliasByPath('/user/' . $new_user->uid->value), '@user' => $user, ] )); -- GitLab From 00790af837a748f4c35bd38654882b06d1dc9ac1 Mon Sep 17 00:00:00 2001 From: Igor Biki Date: Mon, 5 Dec 2022 16:13:43 -0500 Subject: [PATCH 160/180] EXPHR: Using correct name for ldap service. --- src/Form/UwAddUsersForm.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Form/UwAddUsersForm.php b/src/Form/UwAddUsersForm.php index 4e4668e..4ecd37e 100644 --- a/src/Form/UwAddUsersForm.php +++ b/src/Form/UwAddUsersForm.php @@ -141,7 +141,7 @@ class UwAddUsersForm extends FormBase { $password = str_shuffle($password); // Do the LDAP lookup. - $person = $this->UWLdap->lookupPerson($user); + $person = $this->uwLdap->lookupPerson($user); if (!$person) { $this->messenger()->addError($this->t('The user ID @user could not be found (or was set to private) and was skipped.', ['@user' => $user])); continue; -- GitLab From c6115d8ac54798f3d8bec722b0f082b6872cc3ad Mon Sep 17 00:00:00 2001 From: Kevin Paxman Date: Mon, 5 Dec 2022 16:26:22 -0500 Subject: [PATCH 161/180] EXPHR: some changes suggested by Igor --- src/Form/UwAddUsersForm.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Form/UwAddUsersForm.php b/src/Form/UwAddUsersForm.php index 4ecd37e..5420420 100644 --- a/src/Form/UwAddUsersForm.php +++ b/src/Form/UwAddUsersForm.php @@ -111,11 +111,12 @@ class UwAddUsersForm extends FormBase { continue; } + /** @var UserInterface $existing_user */ $existing_user = user_load_by_name($user); if ($existing_user) { $this->messenger()->addError($this->t('The user ID @user already exists and was skipped.', [ - '@link' => $this->pathAliasManager->getAliasByPath('/user/' . $existing_user->uid->value), + '@link' => $this->pathAliasManager->getAliasByPath('/user/' . $existing_user->id), '@user' => $user, ] )); @@ -163,7 +164,7 @@ class UwAddUsersForm extends FormBase { $this->messenger()->addStatus($this->t('Created a new user with the user ID @user.', [ - '@link' => $this->pathAliasManager->getAliasByPath('/user/' . $new_user->uid->value), + '@link' => $this->pathAliasManager->getAliasByPath('/user/' . $new_user->id()), '@user' => $user, ] )); -- GitLab From 98c08c910f8305102f0c2601394f59916b3f46a2 Mon Sep 17 00:00:00 2001 From: Igor Biki Date: Tue, 6 Dec 2022 09:37:40 -0500 Subject: [PATCH 162/180] ISTWCMS-5983: Code standards with logic to load user using entity_type.manager service. --- src/Form/UwAddUsersForm.php | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/src/Form/UwAddUsersForm.php b/src/Form/UwAddUsersForm.php index 5420420..cce2b9d 100644 --- a/src/Form/UwAddUsersForm.php +++ b/src/Form/UwAddUsersForm.php @@ -2,6 +2,7 @@ namespace Drupal\uw_cfg_common\Form; +use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Form\FormBase; use Drupal\Core\Form\FormStateInterface; use Drupal\path_alias\AliasManager; @@ -24,6 +25,13 @@ class UwAddUsersForm extends FormBase { */ protected UWLdap $uwLdap; + /** + * Entity type interface manager from core. + * + * @var \Drupal\Core\Entity\EntityTypeManagerInterface + */ + protected EntityTypeManagerInterface $entityTypeManager; + /** * {@inheritdoc} */ @@ -31,16 +39,18 @@ class UwAddUsersForm extends FormBase { // Instantiates this form class. return new static( $container->get('path_alias.manager'), - $container->get('uw_cfg_common.uw_ldap') + $container->get('uw_cfg_common.uw_ldap'), + $container->get('entity_type.manager') ); } /** * Class constructor. */ - public function __construct(AliasManager $pathAliasManager, UWLdap $uwLdap) { + public function __construct(AliasManager $pathAliasManager, UWLdap $uwLdap, EntityTypeManagerInterface $entityTypeManager) { $this->pathAliasManager = $pathAliasManager; $this->uwLdap = $uwLdap; + $this->entityTypeManager = $entityTypeManager; } /** @@ -76,6 +86,7 @@ class UwAddUsersForm extends FormBase { /** * {@inheritdoc} + * @throws \Exception */ public function submitForm(array &$form, FormStateInterface $form_state) { @@ -95,7 +106,7 @@ class UwAddUsersForm extends FormBase { $user = strtolower($user); // Ignore blank lines. - if (!strlen($user)) { + if ($user === '') { continue; } @@ -111,12 +122,17 @@ class UwAddUsersForm extends FormBase { continue; } - /** @var UserInterface $existing_user */ - $existing_user = user_load_by_name($user); + $existing_user = $this->entityTypeManager->getStorage('user')->loadByProperties([ + ['name' => $user], + ]); + + /** @var \Drupal\user\UserInterface|bool $existing_user */ + $existing_user = $existing_user ? reset($existing_user) : FALSE; + if ($existing_user) { $this->messenger()->addError($this->t('The user ID @user already exists and was skipped.', [ - '@link' => $this->pathAliasManager->getAliasByPath('/user/' . $existing_user->id), + '@link' => $this->pathAliasManager->getAliasByPath('/user/' . $existing_user->id()), '@user' => $user, ] )); @@ -130,11 +146,11 @@ class UwAddUsersForm extends FormBase { $sets[] = '0123456789'; $sets[] = '!@#$%^&*()-_=+[]{}?`~"'; $password = ''; - $password_length = rand(16, 32); + $password_length = random_int(16, 32); while (strlen($password) < $password_length) { foreach ($sets as $set) { $password .= $set[array_rand(str_split($set))]; - if (strlen($password) == $password_length) { + if (strlen($password) === $password_length) { break; } } -- GitLab From 909911fdfd12d120531f1966b6a20fedec73ccf8 Mon Sep 17 00:00:00 2001 From: Igor Biki Date: Tue, 6 Dec 2022 09:49:49 -0500 Subject: [PATCH 163/180] ISTWCMS-5983: Removing extra array wrapping when loading existing user. --- src/Form/UwAddUsersForm.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Form/UwAddUsersForm.php b/src/Form/UwAddUsersForm.php index cce2b9d..5cb5db5 100644 --- a/src/Form/UwAddUsersForm.php +++ b/src/Form/UwAddUsersForm.php @@ -86,7 +86,6 @@ class UwAddUsersForm extends FormBase { /** * {@inheritdoc} - * @throws \Exception */ public function submitForm(array &$form, FormStateInterface $form_state) { @@ -123,7 +122,7 @@ class UwAddUsersForm extends FormBase { } $existing_user = $this->entityTypeManager->getStorage('user')->loadByProperties([ - ['name' => $user], + 'name' => $user, ]); /** @var \Drupal\user\UserInterface|bool $existing_user */ -- GitLab From 35f448852d14432d8a201e3536ef614c08386f71 Mon Sep 17 00:00:00 2001 From: Igor Biki Date: Tue, 6 Dec 2022 09:52:01 -0500 Subject: [PATCH 164/180] ISTWCMS-5983: Adding @var classes for members. --- src/Form/UwAddUsersForm.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Form/UwAddUsersForm.php b/src/Form/UwAddUsersForm.php index 5cb5db5..a6c9cf0 100644 --- a/src/Form/UwAddUsersForm.php +++ b/src/Form/UwAddUsersForm.php @@ -17,11 +17,15 @@ class UwAddUsersForm extends FormBase { /** * Path alias manager from core. + * + * @var \Drupal\path_alias\AliasManager */ protected AliasManager $pathAliasManager; /** * UW Ldap service from uw_cfg_common module. + * + * @var \Drupal\uw_cfg_common\Service\UWLdap */ protected UWLdap $uwLdap; -- GitLab From f0e3351d18fa83a1d656703a96329ba87dda8e74 Mon Sep 17 00:00:00 2001 From: Igor Biki Date: Tue, 6 Dec 2022 10:49:10 -0500 Subject: [PATCH 165/180] ISTWCMS-5983: Adding array_filter and array_map to remove empty lines, and transform all to lower case. --- src/Form/UwAddUsersForm.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/Form/UwAddUsersForm.php b/src/Form/UwAddUsersForm.php index a6c9cf0..ecb363a 100644 --- a/src/Form/UwAddUsersForm.php +++ b/src/Form/UwAddUsersForm.php @@ -98,21 +98,16 @@ class UwAddUsersForm extends FormBase { // Be nice and remove whitespace. $submitted_users = array_map('trim', $submitted_users); - + // Remove empty lines. + $submitted_users = array_filter($submitted_users); + // Apply to lower case on all lines. + $submitted_users = array_map('strtolower', $submitted_users); // Remove any duplicates. $submitted_users = array_unique($submitted_users); // Step through each of the submitted users to create if needed/possible, // or show a message if not. foreach ($submitted_users as $user) { - // Make sure the user ID is in lower case. - $user = strtolower($user); - - // Ignore blank lines. - if ($user === '') { - continue; - } - // Don't process long user IDs. if (strlen($user) > 8) { $this->messenger()->addError($this->t('The user ID @user is too long and was skipped.', ['@user' => $user])); -- GitLab From 491f92e83e1139416acf0887b1d8ad8755344155 Mon Sep 17 00:00:00 2001 From: l26yan Date: Tue, 15 Feb 2022 15:30:05 -0500 Subject: [PATCH 166/180] ISTWCMS-5398 Add BibCite items to Content Management menu for Dashboard --- uw_cfg_common.links.menu.yml | 277 +++++++++++++++++++++++++++++++++++ 1 file changed, 277 insertions(+) diff --git a/uw_cfg_common.links.menu.yml b/uw_cfg_common.links.menu.yml index b205bda..48cfc1d 100644 --- a/uw_cfg_common.links.menu.yml +++ b/uw_cfg_common.links.menu.yml @@ -390,6 +390,283 @@ uw_site_management.authenticated_site_settings: menu_name: uw-menu-site-management url: internal:/admin/config/system/auth_site weight: 0 + +uw_content_management.references: + title: 'References' + menu_name: uw-menu-content-management + url: internal:/dashboard/my_dashboard + weight: 0 + +uw_content_management.references.references: + title: 'References' + parent: uw_content_management.references + url: internal:/bibcite/reference/add + weight: 0 + +uw_content_management.references.references.list: + title: 'List' + parent: uw_content_management.references.references + url: internal:/admin/content/bibcite/reference + weight: 0 + +uw_content_management.references.references.artwork: + title: 'Add artwork' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/artwork + weight: 1 + +uw_content_management.references.references.audiovisual: + title: 'Add audiovisual' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/audiovisual + weight: 2 + +uw_content_management.references.references.bill: + title: 'Add bill' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/bill + weight: 3 + +uw_content_management.references.references.book: + title: 'Add book' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/book + weight: 4 + +uw_content_management.references.references.book_chapter: + title: 'Add book chapter' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/book_chapter + weight: 5 + +uw_content_management.references.references.broadcast: + title: 'Add broadcast' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/broadcast + weight: 6 + +uw_content_management.references.references.case: + title: 'Add case' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/case + weight: 7 + +uw_content_management.references.references.chart: + title: 'Add chart' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/chart + weight: 8 + +uw_content_management.references.references.classical: + title: 'Add classical' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/classical + weight: 9 + +uw_content_management.references.references.conference_paper: + title: 'Add conference paper' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/conference_paper + weight: 10 + +uw_content_management.references.references.conference_proceedings: + title: 'Add conference proceedings' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/conference_proceedings + weight: 11 + +uw_content_management.references.references.database: + title: 'Add database' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/database + weight: 12 + +uw_content_management.references.references.film: + title: 'Add film' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/film + weight: 13 + +uw_content_management.references.references.government_report: + title: 'Add government report' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/government_report + weight: 14 + +uw_content_management.references.references.hearing: + title: 'Add hearing' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/hearing + weight: 15 + +uw_content_management.references.references.journal: + title: 'Add journal' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/journal + weight: 16 + +uw_content_management.references.references.journal_article: + title: 'Add journal article' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/journal_article + weight: 17 + +uw_content_management.references.references.legal_ruling: + title: 'Add legal ruling' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/legal_ruling + weight: 18 + +uw_content_management.references.references.magazine_article: + title: 'Add magazine article' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/magazine_article + weight: 19 + +uw_content_management.references.references.manuscript: + title: 'Add manuscript' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/manuscript + weight: 20 + +uw_content_management.references.references.map: + title: 'Add map' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/map + weight: 21 + +uw_content_management.references.references.miscellaneous: + title: 'Add miscellaneous' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/miscellaneous + weight: 22 + +uw_content_management.references.references.miscellaneous_section: + title: 'Add miscellaneous section' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/miscellaneous_section + weight: 23 + +uw_content_management.references.references.newspaper_article: + title: 'Add newspaper article' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/newspaper_article + weight: 24 + +uw_content_management.references.references.patent: + title: 'Add patent' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/patent + weight: 25 + +uw_content_management.references.references.personal: + title: 'Add personal' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/personal + weight: 26 + +uw_content_management.references.references.presentation: + title: 'Add presentation' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/presentation + weight: 27 + +uw_content_management.references.references.report: + title: 'Add report' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/report + weight: 28 + +uw_content_management.references.references.software: + title: 'Add software' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/software + weight: 29 + +uw_content_management.references.references.statute: + title: 'Add statute' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/statute + weight: 30 + +uw_content_management.references.references.thesis: + title: 'Add thesis' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/thesis + weight: 31 + +uw_content_management.references.references.unpublished: + title: 'Add unpublished' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/unpublished + weight: 32 + +uw_content_management.references.references.website: + title: 'Add website' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/website + weight: 33 + +uw_content_management.references.references.web_article: + title: 'Add web article' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/web_article + weight: 34 + +uw_content_management.references.references.web_project_page: + title: 'Add web project page' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/web_project_page + weight: 35 + +uw_content_management.references.references.web_service: + title: 'Add web service' + parent: uw_content_management.references.references + url: internal:/bibcite/reference/add/web_service + weight: 36 + +uw_content_management.references.contributors: + title: 'Contributors' + parent: uw_content_management.references + url: internal:/bibcite/contributor/add + weight: 1 + +uw_content_management.references.contributors.list: + title: 'List' + parent: uw_content_management.references.contributors + url: internal:/admin/content/bibcite/contributor + weight: 0 + +uw_content_management.references.keywords: + title: 'Keywords' + parent: uw_content_management.references + url: internal:/bibcite/keyword/add + weight: 2 + +uw_content_management.references.keywords.list: + title: 'List' + parent: uw_content_management.references.keywords + url: internal:/admin/content/bibcite/keyword + weight: 0 + +uw_content_management.references.actions: + title: 'Actions' + parent: uw_content_management.references + url: internal:/admin/content/bibcite/reference/import + weight: 3 + +uw_content_management.references.actions.populate: + title: 'Populate' + parent: uw_content_management.references.actions + url: internal:/admin/content/bibcite/reference/populate + weight: 0 + +uw_content_management.references.actions.export: + title: 'Export' + parent: uw_content_management.references.actions + url: internal:/admin/content/bibcite/reference/export + weight: 1 + uw_site_management.content_access: title: 'Content access' menu_name: uw-menu-site-management -- GitLab From e7890f57606687a2f1038a13d9c2d3a9ab13ece1 Mon Sep 17 00:00:00 2001 From: l26yan Date: Wed, 16 Feb 2022 16:15:12 -0500 Subject: [PATCH 167/180] ISTWCMS-5399 Add BibCite permissions to content access page --- src/UwPermissions/UwPermissions.php | 71 +++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/src/UwPermissions/UwPermissions.php b/src/UwPermissions/UwPermissions.php index 7681d80..593a30f 100644 --- a/src/UwPermissions/UwPermissions.php +++ b/src/UwPermissions/UwPermissions.php @@ -241,6 +241,76 @@ class UwPermissions { UwPermissions::buildRolePermissionsListTaxonomyTerm( 'uw_vocab_project_topics', ['delete'] + + // References permissions. + 'References' => [ + 'Create new Contributor entities' => + UwPermissions::buildRolePermissionsListCustom( + 'create bibcite_contributor' + ), + 'Create new Keyword entities' => + UwPermissions::buildRolePermissionsListCustom( + 'create bibcite_keyword' + ), + 'Create new Reference entity of any type' => + UwPermissions::buildRolePermissionsListCustom( + 'create bibcite_reference' + ), + 'Edit contributor entities' => + UwPermissions::buildRolePermissionsListCustom( + 'edit bibcite_contributor' + ), + 'Edit Keyword entities' => + UwPermissions::buildRolePermissionsListCustom( + 'edit bibcite_keyword' + ), + 'Edit any Reference entity of any type' => + UwPermissions::buildRolePermissionsListCustom( + 'edit any bibcite_reference' + ), + 'Revert all Reference revisions' => + UwPermissions::buildRolePermissionsListCustom( + 'revert all bibcite_reference revisions' + ), + 'Administer Contributor entities' => + UwPermissions::buildRolePermissionsListCustom( + 'administer bibcite_contributor' + ), + 'Administer Keyword entities' => + UwPermissions::buildRolePermissionsListCustom( + 'administer bibcite_keyword' + ), + 'Administer Reference entities' => + UwPermissions::buildRolePermissionsListCustom( + 'administer bibcite_reference' + ), + 'Delete Contributor entities' => + UwPermissions::buildRolePermissionsListCustom( + 'delete bibcite_contributor' + ), + 'Delete Keyword entities' => + UwPermissions::buildRolePermissionsListCustom( + 'delete bibcite_keyword' + ), + 'Delete all Reference revisions' => + UwPermissions::buildRolePermissionsListCustom( + 'delete all bibcite_reference revisions' + ), + 'Delete any Reference entity of any type' => + UwPermissions::buildRolePermissionsListCustom( + 'delete any bibcite_reference' + ), + 'Access Reference Export' => + UwPermissions::buildRolePermissionsListCustom( + 'access bibcite export' + ), + 'Access to import form' => + UwPermissions::buildRolePermissionsListCustom( + 'bibcite import' + ), + 'Access to populate form' => + UwPermissions::buildRolePermissionsListCustom( + 'bibcite populate' ), ], @@ -293,6 +363,7 @@ class UwPermissions { 'uw_ct_web_page' ), ], + ]; return $uw_permissions; -- GitLab From 82d7f8d82291d6372cea72ef6ad7d62d985efcb5 Mon Sep 17 00:00:00 2001 From: l26yan Date: Tue, 18 Jan 2022 14:45:39 -0500 Subject: [PATCH 168/180] ISTWCMS-5311 Begin BibCite implementation --- config/install/pathauto.settings.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/install/pathauto.settings.yml b/config/install/pathauto.settings.yml index 6d7bc22..b521d66 100644 --- a/config/install/pathauto.settings.yml +++ b/config/install/pathauto.settings.yml @@ -1,4 +1,7 @@ enabled_entity_types: + - bibcite_contributor + - bibcite_keyword + - bibcite_reference - block_content - user punctuation: -- GitLab From 6eb67a5d09aacfb3404f53395d81a9e2333daf53 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Wed, 2 Mar 2022 19:03:38 +0000 Subject: [PATCH 169/180] ISTWCMS-5413: adding layout builder browser for reference list --- ...ut_builder_browser_block.uw_lbb_reference_list.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_list.yml diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_list.yml b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_list.yml new file mode 100644 index 0000000..0c3cde6 --- /dev/null +++ b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_list.yml @@ -0,0 +1,11 @@ +langcode: en +status: true +dependencies: { } +id: uw_lbb_reference_list +block_id: 'views_block:bibcite_reference-bibcite_reference_block' +category: uw_bc_listings +label: 'Reference list' +image_path: images/layout_builder_browser/referencelist.svg +image_path_base: 'theme:uw_fdsu_theme_resp' +image_alt: 'Reference list' +weight: null -- GitLab From 5cda0da8872dc8145b5385172fad64d94fdf26cf Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Wed, 2 Mar 2022 19:05:41 +0000 Subject: [PATCH 170/180] ISTWCMS-5413: adding layout builder browser for reference teaser --- ..._builder_browser_block.uw_lbb_reference_teaser.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_teaser.yml diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_teaser.yml b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_teaser.yml new file mode 100644 index 0000000..604cd49 --- /dev/null +++ b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_teaser.yml @@ -0,0 +1,11 @@ +langcode: en +status: true +dependencies: { } +id: uw_lbb_reference_teaser +block_id: uw_cbl_reference_teaser +category: uw_bc_teasers +label: 'Reference teaser' +image_path: images/layout_builder_browser/referenceteaser.svg +image_path_base: 'theme:uw_fdsu_theme_resp' +image_alt: 'Reference teaser' +weight: null -- GitLab From d79fdc20332edd83a6ca3765e4e6fb4df9b54962 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Fri, 11 Mar 2022 15:44:48 +0000 Subject: [PATCH 171/180] ISTWCMS-5413: updating layout builder browser blocks for all bibcite --- ...ut_builder_browser_block.uw_lbb_reference_list.yml | 2 +- ..._builder_browser_block.uw_lbb_reference_search.yml | 11 +++++++++++ ..._builder_browser_block.uw_lbb_reference_teaser.yml | 4 ++-- 3 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_search.yml diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_list.yml b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_list.yml index 0c3cde6..eb9557c 100644 --- a/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_list.yml +++ b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_list.yml @@ -8,4 +8,4 @@ label: 'Reference list' image_path: images/layout_builder_browser/referencelist.svg image_path_base: 'theme:uw_fdsu_theme_resp' image_alt: 'Reference list' -weight: null +weight: 0 diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_search.yml b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_search.yml new file mode 100644 index 0000000..6304fa5 --- /dev/null +++ b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_search.yml @@ -0,0 +1,11 @@ +langcode: en +status: true +dependencies: { } +id: uw_lbb_reference_search +block_id: bibcite_cbl_reference_search +category: uw_bc_searches +label: 'Reference search' +image_path: images/layout_builder_browser/referencesearch.svg +image_path_base: 'theme:uw_fdsu_theme_resp' +image_alt: 'Reference search' +weight: 0 diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_teaser.yml b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_teaser.yml index 604cd49..e7e46dc 100644 --- a/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_teaser.yml +++ b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_teaser.yml @@ -2,10 +2,10 @@ langcode: en status: true dependencies: { } id: uw_lbb_reference_teaser -block_id: uw_cbl_reference_teaser +block_id: bibcite_cbl_reference_teaser category: uw_bc_teasers label: 'Reference teaser' image_path: images/layout_builder_browser/referenceteaser.svg image_path_base: 'theme:uw_fdsu_theme_resp' image_alt: 'Reference teaser' -weight: null +weight: -100 -- GitLab From 47d8081f8bea75a05445aff4d58af8607a4a1916 Mon Sep 17 00:00:00 2001 From: kpaxman Date: Thu, 31 Mar 2022 09:52:12 -0400 Subject: [PATCH 172/180] ISTWCMS-5413: allow the reference teaser to sort alphabetically --- ...ser.layout_builder_browser_block.uw_lbb_reference_teaser.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_teaser.yml b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_teaser.yml index e7e46dc..7b41d4e 100644 --- a/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_teaser.yml +++ b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_teaser.yml @@ -8,4 +8,4 @@ label: 'Reference teaser' image_path: images/layout_builder_browser/referenceteaser.svg image_path_base: 'theme:uw_fdsu_theme_resp' image_alt: 'Reference teaser' -weight: -100 +weight: 0 -- GitLab From ad6d1c4f620d7ae637aeb0d6d993a265789a8e3d Mon Sep 17 00:00:00 2001 From: Kevin Paxman Date: Wed, 25 May 2022 17:10:55 -0400 Subject: [PATCH 173/180] Fix rebase error --- src/UwPermissions/UwPermissions.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/UwPermissions/UwPermissions.php b/src/UwPermissions/UwPermissions.php index 593a30f..69e5344 100644 --- a/src/UwPermissions/UwPermissions.php +++ b/src/UwPermissions/UwPermissions.php @@ -241,6 +241,8 @@ class UwPermissions { UwPermissions::buildRolePermissionsListTaxonomyTerm( 'uw_vocab_project_topics', ['delete'] + ), + ], // References permissions. 'References' => [ -- GitLab From 86a151dea49e6f437db9e956001a949337f696e1 Mon Sep 17 00:00:00 2001 From: Eric Bremner Date: Mon, 5 Dec 2022 09:37:09 -0500 Subject: [PATCH 174/180] ISTWCMS-5397: adding bibcite to workflows --- .../custom/workflows.workflow.uw_workflow.yml | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/config/custom/workflows.workflow.uw_workflow.yml b/config/custom/workflows.workflow.uw_workflow.yml index 9351d03..9c54017 100644 --- a/config/custom/workflows.workflow.uw_workflow.yml +++ b/config/custom/workflows.workflow.uw_workflow.yml @@ -2,6 +2,42 @@ langcode: en status: true dependencies: config: + - bibcite_entity.bibcite_reference_type.artwork + - bibcite_entity.bibcite_reference_type.audiovisual + - bibcite_entity.bibcite_reference_type.bill + - bibcite_entity.bibcite_reference_type.book + - bibcite_entity.bibcite_reference_type.book_chapter + - bibcite_entity.bibcite_reference_type.broadcast + - bibcite_entity.bibcite_reference_type.case + - bibcite_entity.bibcite_reference_type.chart + - bibcite_entity.bibcite_reference_type.classical + - bibcite_entity.bibcite_reference_type.conference_paper + - bibcite_entity.bibcite_reference_type.conference_proceedings + - bibcite_entity.bibcite_reference_type.database + - bibcite_entity.bibcite_reference_type.film + - bibcite_entity.bibcite_reference_type.government_report + - bibcite_entity.bibcite_reference_type.hearing + - bibcite_entity.bibcite_reference_type.journal + - bibcite_entity.bibcite_reference_type.journal_article + - bibcite_entity.bibcite_reference_type.legal_ruling + - bibcite_entity.bibcite_reference_type.magazine_article + - bibcite_entity.bibcite_reference_type.manuscript + - bibcite_entity.bibcite_reference_type.map + - bibcite_entity.bibcite_reference_type.miscellaneous + - bibcite_entity.bibcite_reference_type.miscellaneous_section + - bibcite_entity.bibcite_reference_type.newspaper_article + - bibcite_entity.bibcite_reference_type.patent + - bibcite_entity.bibcite_reference_type.personal + - bibcite_entity.bibcite_reference_type.presentation + - bibcite_entity.bibcite_reference_type.report + - bibcite_entity.bibcite_reference_type.software + - bibcite_entity.bibcite_reference_type.statute + - bibcite_entity.bibcite_reference_type.thesis + - bibcite_entity.bibcite_reference_type.unpublished + - bibcite_entity.bibcite_reference_type.web_article + - bibcite_entity.bibcite_reference_type.web_project_page + - bibcite_entity.bibcite_reference_type.web_service + - bibcite_entity.bibcite_reference_type.website - node.type.uw_ct_blog - node.type.uw_ct_catalog_item - node.type.uw_ct_contact @@ -91,6 +127,43 @@ type_settings: to: draft weight: 4 entity_types: + bibcite_reference: + - artwork + - audiovisual + - bill + - book + - book_chapter + - broadcast + - case + - chart + - classical + - conference_paper + - conference_proceedings + - database + - film + - government_report + - hearing + - journal + - journal_article + - legal_ruling + - magazine_article + - manuscript + - map + - miscellaneous + - miscellaneous_section + - newspaper_article + - patent + - personal + - presentation + - report + - software + - statute + - thesis + - unpublished + - web_article + - web_project_page + - web_service + - website node: - uw_ct_blog - uw_ct_catalog_item -- GitLab From 753f2958767d9104cc0fa10aec1d2e489d2c396d Mon Sep 17 00:00:00 2001 From: Anuprita Kulkarni Date: Wed, 10 Aug 2022 14:01:40 -0400 Subject: [PATCH 175/180] ISTWCMS-5668 Rename References to Publications uw_cfg_common --- ...ser.layout_builder_browser_block.uw_lbb_reference_list.yml | 4 ++-- ...r.layout_builder_browser_block.uw_lbb_reference_search.yml | 4 ++-- ...r.layout_builder_browser_block.uw_lbb_reference_teaser.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_list.yml b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_list.yml index eb9557c..4bb8ae9 100644 --- a/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_list.yml +++ b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_list.yml @@ -4,8 +4,8 @@ dependencies: { } id: uw_lbb_reference_list block_id: 'views_block:bibcite_reference-bibcite_reference_block' category: uw_bc_listings -label: 'Reference list' +label: 'Publication reference list' image_path: images/layout_builder_browser/referencelist.svg image_path_base: 'theme:uw_fdsu_theme_resp' -image_alt: 'Reference list' +image_alt: 'Publication reference list' weight: 0 diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_search.yml b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_search.yml index 6304fa5..2591099 100644 --- a/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_search.yml +++ b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_search.yml @@ -4,8 +4,8 @@ dependencies: { } id: uw_lbb_reference_search block_id: bibcite_cbl_reference_search category: uw_bc_searches -label: 'Reference search' +label: 'Publication reference search' image_path: images/layout_builder_browser/referencesearch.svg image_path_base: 'theme:uw_fdsu_theme_resp' -image_alt: 'Reference search' +image_alt: 'Publication reference search' weight: 0 diff --git a/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_teaser.yml b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_teaser.yml index 7b41d4e..e1d24bb 100644 --- a/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_teaser.yml +++ b/config/install/layout_builder_browser.layout_builder_browser_block.uw_lbb_reference_teaser.yml @@ -4,8 +4,8 @@ dependencies: { } id: uw_lbb_reference_teaser block_id: bibcite_cbl_reference_teaser category: uw_bc_teasers -label: 'Reference teaser' +label: 'Publication reference teaser' image_path: images/layout_builder_browser/referenceteaser.svg image_path_base: 'theme:uw_fdsu_theme_resp' -image_alt: 'Reference teaser' +image_alt: 'Publication reference teaser' weight: 0 -- GitLab From a5964d2593cb4253901872890bb5ff1ed75ecbbf Mon Sep 17 00:00:00 2001 From: Anuprita Kulkarni Date: Thu, 11 Aug 2022 10:22:20 -0400 Subject: [PATCH 176/180] ISTWCMS-5668 Rename References to Publications uw_cfg_common menu changes --- uw_cfg_common.links.menu.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/uw_cfg_common.links.menu.yml b/uw_cfg_common.links.menu.yml index 48cfc1d..7e94e4a 100644 --- a/uw_cfg_common.links.menu.yml +++ b/uw_cfg_common.links.menu.yml @@ -392,13 +392,13 @@ uw_site_management.authenticated_site_settings: weight: 0 uw_content_management.references: - title: 'References' + title: 'Publications' menu_name: uw-menu-content-management url: internal:/dashboard/my_dashboard weight: 0 uw_content_management.references.references: - title: 'References' + title: 'Publications' parent: uw_content_management.references url: internal:/bibcite/reference/add weight: 0 -- GitLab From 4628bdcf9fa84e2dfa9d471b1efef58cf66d2e02 Mon Sep 17 00:00:00 2001 From: Anuprita Kulkarni Date: Thu, 11 Aug 2022 16:14:58 -0400 Subject: [PATCH 177/180] ISTWCMS-5668 Rename References to Publications uw_cfg_common new yml --- uw_cfg_common.links.task.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 uw_cfg_common.links.task.yml diff --git a/uw_cfg_common.links.task.yml b/uw_cfg_common.links.task.yml new file mode 100644 index 0000000..55e023e --- /dev/null +++ b/uw_cfg_common.links.task.yml @@ -0,0 +1,12 @@ +# Reference routing definition +entity.bibcite_reference.admin: + title: Publication references + route_name: entity.bibcite_reference.collection + base_route: system.admin_content + weight: 50 + +entity.bibcite_reference.collection: + route_name: entity.bibcite_reference.collection + parent_id: entity.bibcite_reference.admin + title: Publication reference + -- GitLab From 3b54d93c848f119b96cced55204d3a610ec278b2 Mon Sep 17 00:00:00 2001 From: Anuprita Kulkarni Date: Mon, 22 Aug 2022 11:27:30 -0400 Subject: [PATCH 178/180] ISTWCMS-5668 Fixing coding standards --- uw_cfg_common.links.task.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/uw_cfg_common.links.task.yml b/uw_cfg_common.links.task.yml index 55e023e..de5bc5a 100644 --- a/uw_cfg_common.links.task.yml +++ b/uw_cfg_common.links.task.yml @@ -9,4 +9,3 @@ entity.bibcite_reference.collection: route_name: entity.bibcite_reference.collection parent_id: entity.bibcite_reference.admin title: Publication reference - -- GitLab From c9ccbcade3f5d0f9d36aed3e8e38006806dcb8c4 Mon Sep 17 00:00:00 2001 From: Anuprita Kulkarni Date: Tue, 23 Aug 2022 15:41:17 -0400 Subject: [PATCH 179/180] ISTWCMS-5668 Rename References to Publications Changed Populate reference title --- uw_cfg_common.routing.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/uw_cfg_common.routing.yml b/uw_cfg_common.routing.yml index 7c15c59..39f4c65 100644 --- a/uw_cfg_common.routing.yml +++ b/uw_cfg_common.routing.yml @@ -55,3 +55,10 @@ uw_cfg_common.add_uw_users_form: _form: '\Drupal\uw_cfg_common\Form\UwAddUsersForm' requirements: _permission: 'administer users' +bibcite_import.populate: + path: '/admin/content/bibcite/reference/populate' + defaults: + _form: '\Drupal\bibcite_import\Form\PopulateForm' + _title: 'Populate publication reference values' + requirements: + _permission: 'bibcite populate+administer bibcite' -- GitLab From 90e75913f895403942fbe7bc24201662e548d3f7 Mon Sep 17 00:00:00 2001 From: Anuprita Kulkarni Date: Mon, 29 Aug 2022 10:42:59 -0400 Subject: [PATCH 180/180] ISTWCMS-5668 Rename References to Publications Changed Dashboard blocks title --- uw_cfg_common.links.menu.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/uw_cfg_common.links.menu.yml b/uw_cfg_common.links.menu.yml index 7e94e4a..4c87180 100644 --- a/uw_cfg_common.links.menu.yml +++ b/uw_cfg_common.links.menu.yml @@ -392,13 +392,13 @@ uw_site_management.authenticated_site_settings: weight: 0 uw_content_management.references: - title: 'Publications' + title: 'Publication reference' menu_name: uw-menu-content-management url: internal:/dashboard/my_dashboard weight: 0 uw_content_management.references.references: - title: 'Publications' + title: 'Publication reference' parent: uw_content_management.references url: internal:/bibcite/reference/add weight: 0 -- GitLab