diff --git a/config/sync/paragraphs.paragraphs_type.stanford_faq.yml b/config/sync/paragraphs.paragraphs_type.stanford_faq.yml index 5d77c208e..a0ae5d754 100644 --- a/config/sync/paragraphs.paragraphs_type.stanford_faq.yml +++ b/config/sync/paragraphs.paragraphs_type.stanford_faq.yml @@ -5,13 +5,13 @@ dependencies: content: - 'file:file:f217e716-8074-4122-bd5c-7b0f05aef5a9' module: - - layout_paragraphs + - jumpstart_ui id: stanford_faq label: 'FAQ - Accordion List' icon_uuid: f217e716-8074-4122-bd5c-7b0f05aef5a9 -icon_default: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEwAACxMBAJqcGAAACj1JREFUeJzt3c+LHGUawPFvZmM2JK0xsAg5LBoPgkIcRbyJDsY1kWASSG4SQVwUc/PsJXgUb4mbHyL4D0hOinuIQQ/iwYuoRFnQePAQk6BIhGR0ZvbwBtJdb807neq3qt7p/n7gPfT01FPPdD3PVFd31VsgSZIkSZIkSZIkSZIkSZIkSZIkSZKm34YWY+8C/g38C/gnMGhxXZo9i8BF4BPgFPBVr9nchk3Af4AlYMXh6GAsE5pkM5nl3oNsAv4LLGSOK43jU2AvcD1XwL/lCnTTCeBw5pjSuO4D/gF82HMetR4mflt1ATgA3NljXppOW4HnCTVWfbs132NeqzpO3Bzbes1Is2AbcZO802tGq6gmeaDfdDRD9hP/cy7ONUaT9G2VujJgtPayHaTn/BRrpcXY0lpaqb+5HEGkaWWDSAk2iJRgg0gJNoiUYINICTaIlGCDSAk2iJrYALxIOHt7IVO8lwjnUD2ZIV6RqhexaHq9zK3t/Bewe8J4bwzF+xN4sEGM4uuv+ASVzbuMbuurwP0NY1VPNFwBjjSIU3z9FZ+gstlDvL2/4fZPUH0I+L0S51dgR4Ociq+/4hNUVseIt/lZxj+u3Q78r7L8EvBsw3yKr7/iE1RWc8AHxNv92BjLbiTMXVBd9vUJ8im+/opPUNkNCNP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QB/R29smenstB729hujtNUNvrwV6ew3R22uH3l4z9Pba4ez3chGIGQIxQyBmCMQMgZghEDMEYoZAeqO31wy9vWbo7TVDb68denvN0Ntrh97edQ16ewOPOCrR2xvQ22sWCL29ZoEMPnp77dDba4feXjv09tqht9cMvb0DgTMXy0UgZgjEDIGYIRAzBGKGQMwQiBkCMUNvb/vo7TVDb68VenuN0NtrPOjttUJvrxF6e23Q2wsAAAAAAAAAAACgkX8AwDAVYMrdKpUAAAAASUVORK5CYII=' description: '' behavior_plugins: - layout_paragraphs: - enabled: false - available_layouts: { } + faq_accordions: + enabled: true + heading: h2 diff --git a/src/EventSubscriber/EventSubscriber.php b/src/EventSubscriber/EventSubscriber.php index f32107f2a..5041ad813 100644 --- a/src/EventSubscriber/EventSubscriber.php +++ b/src/EventSubscriber/EventSubscriber.php @@ -113,7 +113,8 @@ public static function onEntityPreSave(EntityPresaveEvent $event) { if ( PHP_SAPI != 'cli' && $entity->getEntityTypeId() == 'config_pages' && - $entity->bundle() == 'stanford_basic_site_settings' + $entity->bundle() == 'stanford_basic_site_settings' && + self::redirectUser() ) { $renewal_date = time() + 60 * 60 * 24 * 365; $entity->set('su_site_renewal_due', date(DateTimeItemInterface::DATETIME_STORAGE_FORMAT, $renewal_date)); @@ -136,9 +137,11 @@ public function onKernelRequest(RequestEvent $event) { !str_starts_with($current_uri, '/admin/config/system/basic-site-settings') && self::redirectUser() ) { - $config_page_url = Url::fromRoute('config_pages.stanford_basic_site_settings', [], ['query' => ['destination' => $current_uri]]); + $config_page_url = Url::fromRoute('config_pages.stanford_basic_site_settings', [], ['query' => ['destination' => $current_uri]]) + ->toString(TRUE) + ->getGeneratedUrl(); $this->messenger->addWarning('Please update or verify the site contact information on the "Site Contacts" tab.'); - $event->setResponse(new RedirectResponse($config_page_url->toString(TRUE)->getGeneratedUrl() . '#contact')); + $event->setResponse(new RedirectResponse($config_page_url . '#contact')); } } @@ -173,8 +176,8 @@ protected static function redirectUser() { $site_manager = $current_user->hasPermission('edit stanford_basic_site_settings config page entity') && !in_array('administrator', $current_user->getRoles()); // If the renewal date has passed, they should be redirected. - $needs_renewal = !getenv('CI') && $site_manager && (strtotime($renewal_date) - time() < 60 * 60 * 24 * 7); - $cache->set('su_renew_site:' . $current_user->id(), $needs_renewal, Cache::PERMANENT, ['site-renew-date']); + $needs_renewal = !getenv('CI') && $site_manager && strtotime($renewal_date) < time(); + $cache->set('su_renew_site:' . $current_user->id(), $needs_renewal, strtotime($renewal_date), ['site-renew-date']); return $needs_renewal; }