-
-
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
CiviGrant - Use SearchKit for contact summary tab #22467
CiviGrant - Use SearchKit for contact summary tab #22467
Conversation
(Standard links)
|
9159fc0
to
1cd7651
Compare
* Add grants tab to contact summary screen. | ||
*/ | ||
function civigrant_civicrm_tabSet($tabSetName, &$tabs, $context) { | ||
if ($tabSetName === 'civicrm/contact/view' && !empty($context['contact_id'])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eileenmcnaughton I see the permission problem you noted in #22064 (comment) - this was adding the tab unconditionally without checking "access CiviGrant". This PR replaces rather than fixes that code :)
"title": "Grants", | ||
"contact_summary": "tab", | ||
"server_route": "", | ||
"permission": "access CiviGrant" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Permission check here
This would potentially force a change on sites with customisations - I just posted on product mtce to check people are comfortable with this - feels safe-ish for civigrant due to low usage but seeing what people think |
"Force" is a strong word. Sites with code customizations would have to update their code to re-implement the tabset hook and delete the search display. |
@colemanw probably redundant question: how does this play with the refactoring of civigrant into core extension? It just works if the extension is enabled and doesn't cause an error if it isn't, right? @monishdeb pls test next week, and review against our various grant extensions. @eileenmcnaughton Is the concern that all of the customizations using form hooks would break when the form is dispensed with? I think Release Notes are likely good enough for this uncommonly used functionality as we have most of the main extensions in this area. FWIW JMA are starting a large contract on grants that will likely result in significant enhancements in the coming 12 - 24 months. |
@JoeMurray the refactoring of Component => Extension is complete :) #22064 has been merged. With that done, it's now possible to package Afforms and Search Displays in the new CiviGrant extension, and you are correct, they will only appear when the extension is enabled, and will not cause errors when the extension is disabled. |
@JoeMurray yes - that is correct. I think some people have customised various screens and those customisations would break. I think for grant that is heavy mitigated by the relatively low usage it gets @JoeMurray also, as an aside is this extension still in use https://github.com/JMAConsulting/biz.jmaconsulting.grantapplications/blob/1da4aee5bd616237398bd0a2803ed8a813cf7603/CRM/Grant/Form/Grant/Confirm.php#L724 (the linked line is to a function that we want to remove from core) |
Test fail is odd Fatal error: Uncaught Exception: API error: API (SearchDisplay, create) does not exist (join the API team and implement it!) on SearchDisplay.create in /home/jenkins/bknix-dfl/build/core-22467-5b2ld/web/sites/all/modules/civicrm/CRM/Core/ManagedEntities.php on line 624 Exception: API error: API (SearchDisplay, create) does not exist (join the API team and implement it!) on SearchDisplay.create in /home/jenkins/bknix-dfl/build/core-22467-5b2ld/web/sites/all/modules/civicrm/CRM/Core/ManagedEntities.php on line 624 |
Just to qualify this statement:
The only screen this PR affects is the Grants tab on the Contact Summary screen. If anyone has customized that screen, they would either need to re-implement the hook being removed in this PR to bring the "classic" tab back, or re-do their customization in the SearchKit UI. |
Hmm, test fail suggests that search_kit and afform are missing. |
Retest this please |
Parsing schema description /home/jenkins/bknix-dfl/build/core-22467-5drgk/web/sites/all/modules/civicrm/xml/schema/Schema.xml Fatal error: Uncaught Exception: API error: API (SearchDisplay, create) does not exist (join the API team and implement it!) on SearchDisplay.create in /home/jenkins/bknix-dfl/build/core-22467-5drgk/web/sites/all/modules/civicrm/CRM/Core/ManagedEntities.php on line 624 Exception: API error: API (SearchDisplay, create) does not exist (join the API team and implement it!) on SearchDisplay.create in /home/jenkins/bknix-dfl/build/core-22467-5drgk/web/sites/all/modules/civicrm/CRM/Core/ManagedEntities.php on line 624 Specifically the civigrant tests are failing like this |
@eileenmcnaughton I think it would be nice if we updated |
@colemanw OK - let's merge this & I will include in the dev list & if there is a bigger concern we can work with anyone who hits it to get the hook option working for them |
Overview
Following-up on #22064, this switches the Grants tab on the contact summary page to use a Search Display.
It looks nearly identical before and after, but is now easily customizable via the SearchKit & Form-Builder GUI.
Before
Tab rendered with Smarty and old
BAO_Query
object.After
Tab rendered with user-configurable search display.