From 932cb6e1cf6188b6d7102b72913e64f7528d77c7 Mon Sep 17 00:00:00 2001 From: Dave Hansen-Lange <1127349+dalin-@users.noreply.github.com> Date: Mon, 3 Mar 2025 21:26:45 -0500 Subject: [PATCH] fix(SHS-6113): exception on some nodes being cleaned up. --- .../su_humsci_profile/su_humsci_profile.install | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/docroot/profiles/humsci/su_humsci_profile/su_humsci_profile.install b/docroot/profiles/humsci/su_humsci_profile/su_humsci_profile.install index 2018c7097..6aa69b1fd 100644 --- a/docroot/profiles/humsci/su_humsci_profile/su_humsci_profile.install +++ b/docroot/profiles/humsci/su_humsci_profile/su_humsci_profile.install @@ -9,7 +9,6 @@ use Drupal\Core\DrupalKernel; use Drupal\Core\Entity\Entity\EntityFormDisplay; use Drupal\Core\Entity\Entity\EntityViewDisplay; use Drupal\Core\Menu\MenuTreeParameters; -use Drupal\Core\Utility\UpdateException; use Drupal\field\Entity\FieldConfig; use Drupal\field\Entity\FieldStorageConfig; use Drupal\hs_entities\Entity\HsEntityType; @@ -1319,13 +1318,6 @@ function su_humsci_profile_update_9725() { /** * Clean-up possible node settings dupes from su_humsci_profile_update_9723(). - * - * @param array $sandbox - * - * @return string - * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException - * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException - * @throws \Drupal\Core\Utility\UpdateException */ function su_humsci_profile_update_9726(&$sandbox) { $node_type = 'hs_private_page'; @@ -1349,7 +1341,9 @@ function su_humsci_profile_update_9726(&$sandbox) { if ($node_settings) { foreach ($node_settings as $node_operation => &$node_permissions) { if (!is_array($node_permissions)) { - throw new UpdateException('Error on node ' . $node->id() . "where operation $node_operation is not an array."); + // Oddly enough, we can get a "per_node" operation here. That might be + // a bug with the module. + continue; } $clean_permissions = array_unique($node_permissions); if ($clean_permissions !== $node_permissions) {