Afform.update - If server_route changes, then clear menu/navigation system
authorTim Otten <totten@civicrm.org>
Tue, 11 Jun 2019 20:42:53 +0000 (16:42 -0400)
committerCiviCRM <info@civicrm.org>
Wed, 16 Sep 2020 02:13:18 +0000 (19:13 -0700)
ext/afform/core/Civi/Api4/Action/Afform/Update.php

index 879b26a6810f653908abe9216866f1cf4097659c..212c252fb1fbffb60be680ef9e1907b3039b0023 100644 (file)
@@ -58,6 +58,10 @@ class Update extends BasicUpdateAction {
     // We may have changed list of files covered by the cache.
     $scanner->clear();
 
+    if (isset($updates['server_route']) && $updates['server_route'] !== $orig[0]['server_route']) {
+      \CRM_Core_Menu::store();
+      \CRM_Core_BAO_Navigation::resetNavigation();
+    }
     // FIXME if `server_route` changes, then flush the menu cache.
     // FIXME if asset-caching is enabled, then flush the asset cache.