-
-
Notifications
You must be signed in to change notification settings - Fork 825
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
[dev/core#3470] Search Kit: Mailing labels don't work #25164
Conversation
@alifrumin Style check failures. |
]; | ||
|
||
//break out mailing labels for redirect instead of crmPopup | ||
if ($task['title'] == 'Mailing labels - print') { |
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.
I haven't run this but I think it would be better to check the loop index $id, to be more translation-friendly. if $id == CRM_Core_Task::LABEL_CONTACTS
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.
good suggestion just updated the code
$tasks[$entity['name']]['contact.' . $id] = [ | ||
'title' => $task['title'], | ||
'icon' => $task['icon'] ?? 'fa-gear', | ||
'crmPopup' => [ |
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.
It appears the only difference between these 2 blocks of code is this one line 'crmPopup' vs. 'redirect'. That could be a variable. Like
// Print Labels action does not support popups, open full-screen
$actionType = $id == CRM_Core_Task::LABEL_CONTACTS ? 'redirect' : 'crmPopup';
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.
That does make for a smaller more elegant code change, thanks @colemanw
@civicrm-builder retest this please |
Overview
When one creates a SearchKit Search for the "Contacts" entity the Actions dropdown includes an option: "Mailing labels - Print". This action is broken. This PR fixes it. More details can be found on this issue: https://lab.civicrm.org/dev/core/-/issues/3470.
Before
The Search Kit action "Mailing labels - Print" for contact searches does NOT work.
After
The Search Kit action "Mailing labels - Print" for contact searches work.