Skip to content

Commit

Permalink
fix notice on activity and event mgmt forms
Browse files Browse the repository at this point in the history
  • Loading branch information
demeritcowboy committed Jun 4, 2023
1 parent 697b7b8 commit 40b31ab
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions CRM/Core/Smarty/plugins/function.help.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,18 @@ function smarty_function_help($params, &$smarty) {
$vars = $smarty->get_template_vars();
$smarty->assign('id', $params['id'] . '-title');

// The way this works is a bit bonkers. All the .hlp files are expecting an
// assign called $params (which is different from our php var here called
// $params), and it does get assigned via ajax via
// CRM_Core_Page_Inline_Help when you click the help bubble (i.e. the link
// that we return at the bottom below). But right now when we fetch the
// file on the next line, there is no params. So it gives a notice. So
// let's assign something.
// It's also awkward since the ONLY reason we're fetching the file
// now is to get the help section's title and we don't care about the rest
// of the file, but that is a bit of a separate issue.
$smarty->assign('params', []);

$name = trim($smarty->fetch($params['file'] . '.hlp'));
$extraoutput = '';
$additionalTPLFile = $params['file'] . '.extra.hlp';
Expand Down
2 changes: 1 addition & 1 deletion templates/CRM/Core/Form/RecurringEntity.hlp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
| and copyright information, see https://civicrm.org/licensing |
+--------------------------------------------------------------------+
*}
{capture assign='entityType'}{$params.entityType|lower}{/capture}
{capture assign='entityType'}{if array_key_exists('entityType', $params)}{$params.entityType|lower}{/if}{/capture}

{htxt id="id-repeats-title"}
{ts}Repeats{/ts}
Expand Down

0 comments on commit 40b31ab

Please sign in to comment.