X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FInvoke.php;h=7df01124bf0a3212513e0fbf6eb3fd182b3e980b;hb=4a05187c4ebd6b2b7c0ee8afc8dc105abaed43b6;hp=96583f77dacfe2ddbfe785f2d0399685b12151e6;hpb=56afbb85e737a30597957106086291f0bcc3f85c;p=civicrm-core.git diff --git a/CRM/Core/Invoke.php b/CRM/Core/Invoke.php index 96583f77da..7df01124bf 100644 --- a/CRM/Core/Invoke.php +++ b/CRM/Core/Invoke.php @@ -1,7 +1,7 @@ getErrorData(); + $message = $e->getMessage(); + if (isset($params['legacy_status_bounce'])) { + //@todo remove this- see comments on + //https://github.com/eileenmcnaughton/civicrm-core/commit/ae686b09e2c987091612bb25ba0a58e520a203e7 + CRM_Core_Error::statusBounce($params['message']); + } + else { + $session = CRM_Core_Session::singleton(); + $session->setStatus( + $message, + CRM_Utils_Array::value('message_title', $params), + CRM_Utils_Array::value('message_type', $params, 'error') + ); + + // @todo remove this code - legacy redirect path is an interim measure for moving redirects out of BAO + // to somewhere slightly more acceptable. they should not be part of the exception class & should + // be managed @ the form level - if you find a form that is triggering this piece of code + // you should log a ticket for it to be removed with details about the form you were on. + if(!empty($params['legacy_redirect_path'])) { + if(CRM_Utils_System::isDevelopment()) { + // here we could set a message telling devs to log it per above + } + CRM_Utils_System::redirect($params['legacy_redirect_path'], $params['legacy_redirect_query']); + } + } + } + catch (Exception $e) { // Recall: CRM_Core_Config is initialized before calling CRM_Core_Invoke $config = CRM_Core_Config::singleton(); return CRM_Core_Error::handleUnhandledException($e); @@ -425,8 +456,13 @@ class CRM_Core_Invoke { } } - $page = new CRM_Profile_Page_Listings(); - return $page->run(); + if ($secondArg == 'view' || empty($secondArg)) { + $page = new CRM_Profile_Page_Listings(); + return $page->run(); + } + + CRM_Utils_System::permissionDenied(); + return; } /** @@ -447,18 +483,21 @@ class CRM_Core_Invoke { $config = CRM_Core_Config::singleton(); $config->clearModuleList(); + // also cleanup all caches + $config->cleanupCaches($sessionReset || CRM_Utils_Request::retrieve('sessionReset', 'Boolean', CRM_Core_DAO::$_nullObject, FALSE, 0, 'GET')); + CRM_Core_Menu::store(); // also reset navigation CRM_Core_BAO_Navigation::resetNavigation(); - // also cleanup all caches - $config->cleanupCaches($sessionReset || CRM_Utils_Request::retrieve('sessionReset', 'Boolean', CRM_Core_DAO::$_nullObject, FALSE, 0, 'GET')); - // also cleanup module permissions $config->cleanupPermissions(); - CRM_Core_BAO_SETTING::updateSettingsFromMetaData(); + // also rebuild word replacement cache + CRM_Core_BAO_WordReplacement::rebuild(); + + CRM_Core_BAO_Setting::updateSettingsFromMetaData(); CRM_Core_Resources::singleton()->resetCacheCode(); // also rebuild triggers if requested explicitly @@ -468,7 +507,7 @@ class CRM_Core_Invoke { ) { CRM_Core_DAO::triggerRebuild(); } - + CRM_Core_DAO_AllCoreTables::reinitializeCache(TRUE); CRM_Core_ManagedEntities::singleton(TRUE)->reconcile(); } }