From e8dfa80b5b3488d0867bed16c0ed3fc3609763e2 Mon Sep 17 00:00:00 2001 From: Alan Stanley Date: Tue, 26 Nov 2024 14:00:51 -0400 Subject: [PATCH] Update scholartokens.module You can't explode NULL anymore. --- scholartokens.module | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scholartokens.module b/scholartokens.module index 4c20c52..aadfda2 100644 --- a/scholartokens.module +++ b/scholartokens.module @@ -75,6 +75,9 @@ function scholartokens_format_date($node) { $config = \Drupal::config('scholartokens.settings'); $field = $config->get('field'); $original = $node->get($field)->value; + if (!$original) { + return ''; + } $date_parts = explode('-', $original); if (count($date_parts) == 1) { $replacement = $date_parts[0];