Skip to content

Commit

Permalink
Merge branch '11.x' of https://github.com/SU-SWS/stanford_profile int…
Browse files Browse the repository at this point in the history
…o 11.x
  • Loading branch information
pookmish committed Oct 25, 2023
2 parents b778980 + 0bbdca0 commit 81a672c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# SOE Profile

11.0.7
-------------------------------------------------------------------------------
- Invalidate cache tag when saving site contact details
- Allow figure and figcaption in embeddables

11.0.6
-------------------------------------------------------------------------------
- Fixed event day display with timezones.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ content:
settings:
max_width: 0
max_height: 0
allowed_tags: 'a aside audio b blockquote br button caption cite code dd dl div drupal-media dt em embed form h1 h2 h3 h4 h5 hr i iframe img input label li object ol option p param pre s script select source span strong sub sup table tbody textarea td tfoot th thead tr ul video'
allowed_tags: 'a aside audio b blockquote br button caption cite code dd dl div drupal-media dt em embed form h1 h2 h3 h4 h5 hr i iframe img input label li object ol option p param pre s script select source span strong sub sup table tbody textarea td tfoot th thead tr ul video figure figcaption'
third_party_settings: { }
weight: 1
region: content
Expand Down
2 changes: 1 addition & 1 deletion soe_profile.info.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 'SOE Profile'
description: 'Jumpstart Website Profile'
version: 11.0.6
version: 11.0.7
type: profile
project: Stanford
core_version_requirement: ^9 || ^10
Expand Down
4 changes: 3 additions & 1 deletion src/EventSubscriber/EventSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Drupal\soe_profile\EventSubscriber;

use Acquia\DrupalEnvironmentDetector\AcquiaDrupalEnvironmentDetector;
use Drupal\Core\Cache\Cache;
use Drupal\Core\File\FileSystemInterface;
use Drupal\Core\Installer\InstallerKernel;
use Drupal\Core\Logger\LoggerChannelFactoryInterface;
Expand Down Expand Up @@ -104,6 +105,7 @@ public function onEntityPreSave(EntityPresaveEvent $event) {
) {
$renewal_date = time() + (InstallerKernel::installationAttempted() ? 0 : 60 * 60 * 24 * 365);
$entity->set('su_site_renewal_due', date(DateTimeItemInterface::DATETIME_STORAGE_FORMAT, $renewal_date));
Cache::invalidateTags(['site-renew-date']);
}
}

Expand Down Expand Up @@ -159,7 +161,7 @@ protected static function redirectUser() {

// If the renewal date has passed, they should be redirected.
$needs_renewal = !getenv('CI') && $site_manager && (strtotime($renewal_date) - time() < 60 * 60 * 24);
$cache->set('su_renew_site:' . $current_user->id(), $needs_renewal, time() + 60 * 60 * 24);
$cache->set('su_renew_site:' . $current_user->id(), $needs_renewal, time() + 60 * 60 * 24, ['site-renew-date']);

return $needs_renewal;
}
Expand Down

0 comments on commit 81a672c

Please sign in to comment.