X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FController.php;h=3924aa464173e07a943e57f9fbc16a0d7508f223;hb=26ad621a0eb1aa1757755684d45cb162f6284985;hp=68c653185855e6a0c726458358ef90da6addef69;hpb=a51d361acfd183b9fee6bbb62a6ebcedc74cd604;p=civicrm-core.git diff --git a/CRM/Core/Controller.php b/CRM/Core/Controller.php index 68c6531858..3924aa4641 100644 --- a/CRM/Core/Controller.php +++ b/CRM/Core/Controller.php @@ -172,6 +172,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller { if (!isset(self::$_template)) { self::$_template = CRM_Core_Smarty::singleton(); self::$_session = CRM_Core_Session::singleton(); + self::$_template->ensureVariablesAreAssigned(['formTpl']); } // lets try to get it from the session and/or the request vars @@ -241,6 +242,11 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller { // in this case we'll also cache the url as a hidden form variable, this allows us to // redirect in case the session has disappeared on us $this->_entryURL = CRM_Utils_System::makeURL(NULL, TRUE, FALSE, NULL, TRUE); + // In WordPress Shortcodes the standard entryURL generated via makeURL doesn't generally have id=x&reset=1 included so we add them here + // This prevents infinite loops caused when the session has timed out. + if (stripos($this->_entryURL, 'id') === FALSE && (stripos($this->_entryURL, 'transact') !== FALSE || stripos($this->_entryURL, 'register') !== FALSE)) { + $this->_entryURL .= '&id=' . CRM_Utils_Request::retrieveValue('id', 'Positive') . '&reset=1'; + } $this->set('entryURL', $this->_entryURL); }