-
-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow help text to be overridden from an .extra.hlp file #13488
Conversation
(Standard links)
|
Tested working fine. Here's a screencast as 'How-to' steps: On the other hand, I encountered a separate issue which is caused by pageRun hook. Suppose some extension called a $page->getVar() inside a pageRun hook then it throws a internal error when we click on hlp icon as:
In this above example the error is generted from here as CRM_Core_Page_Inline_Help don't extend CRM_Core_Page this it don't inherit getVar() as triggered from here |
Hmm. If the pageRun hook doesn't actually work (and wasn't running anyway 99% of the time) maybe we should just remove it. |
266b1f6
to
87bf0ec
Compare
Looking at the commit history, that hook invocation was added in 6eea17d and @eileenmcnaughton references https://issues.civicrm.org/jira/browse/CRM-14021 in the commit msg. However, that issue description makes no mention of the hook, so I'm guessing she added it as an afterthought rather than because it was actually needed for something. As @monishdeb noted, the way it's invoked makes it very unlikely to be useful to anyone. @eileenmcnaughton can you confirm it's safe to remove? |
I agree with removing the Hook call in CRM_Core_Page_Inline_Help, but will wait for @eileenmcnaughton reply if theres any unwanted side effect to extensions, if we remove the hook call |
@monishdeb @colemanw I believe I am currently using the pageRun hook to manipulate the event info page. As such I would be against removing it. I would note that the hook doc iirc mentions it doesn’t run on forms only quickform pages |
@seamuslee001 we're not proposing to remove the entire hook. Just to stop invoking it in this one place when displaying help bubbles. This hook invocation is inconsistent and problematic because:
I expect that removing it here will affect precisely no one. But will wait for @eileenmcnaughton to weigh in. |
Ah on that would be ok then. I miss interpreted Monish’s statement when he said he was ok removing the hook I thought that was completely removing not just one invocation. |
@seamuslee001 I realized it and so I edited my comment soon after I saw your comment. Sorry about that :( |
@civicrm-builder retest this please |
I can't recall anything about this! I suspect the reason for the hook call is to allow extra variables to be assigned but I also think the discussion here is probably enough to warrant removing it but we should flag it in the hook change log & make sure the overview marks it such that it gets picked up as a change to highlight in release notes |
Thanks Eileen. |
@colemanw @eileenmcnaughton tested and this looks good. Implemented an extension to handle all inline help modifications. |
@colemanw do you want to update the change log as we merge this? |
Thanks @eileenmcnaughton. Done: civicrm/civicrm-dev-docs@94160f6 |
Overview
Help text is written in
.hlp
smarty files. You can append to the text by adding your own.extra.hlp
file with the same name. This allows you to also override it.NOTE the pageRun hook is removed from CRM_Core_Page_Inline_Help in this PR. Per discussion - see #13488 (comment)
Before
.extra.hlp
files could append but not override help text.After
.extra.hlp
files can be set to override on a per-item basis.How-to
Create an extension (and enable it)
Add a file:
templates/CRM/Activity/Form/Activity.extra.hlp
Add this to the file:
Go to the "new activity" screen and click the help icon for "Assigned to"
Note that the default help text is gone and only the text "I'm extra!" prints.
If you remove the
overrride=1
param, both the default help text and the new text appear, which was the previous behavior.