Skip to content

Commit

Permalink
Replace smarty.get with assigned snippet_type in tpl
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Sep 29, 2023
1 parent 51a1135 commit cecd68a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CRM/Core/Smarty.php
Expand Up @@ -136,6 +136,7 @@ private function initialize() {
'cacheCleanup' => CRM_Utils_Request::retrieveValue('cacheCleanup', 'Integer'),
'configReset' => CRM_Utils_Request::retrieveValue('configReset', 'Integer'),
]);
$this->assign('snippet_type', CRM_Utils_Request::retrieveValue('snippet', 'String'));

$tsLocale = CRM_Core_I18n::getLocale();
$this->assign('tsLocale', $tsLocale);
Expand Down
2 changes: 1 addition & 1 deletion templates/CRM/Form/validate.tpl
Expand Up @@ -9,7 +9,7 @@
*}
{* Initialize jQuery validate on a form *}
{* Extra params and functions may be added to the CRM.validate object before this template is loaded *}
{if empty($crm_form_validate_included) && ((isset($smarty.get.snippet|smarty:nodefaults) && $smarty.get.snippet neq 'json') || !isset($smarty.get.snippet|smarty:nodefaults)) && !empty($form) && !empty($form.formClass)}
{if empty($crm_form_validate_included) && $snippet_type neq 'json' && !empty($form) && !empty($form.formClass)}
{assign var=crm_form_validate_included value=1}
{literal}
<script type="text/javascript">
Expand Down

0 comments on commit cecd68a

Please sign in to comment.