-
-
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
[REF] Consolidate retrieval of searchFormValues #18591
Conversation
(Standard links)
|
$values = $this->controller->exportValues('Custom'); | ||
} | ||
else { | ||
if ($entityShortname !== 'Contact') { |
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.
entityShortName will be contact if $this->get('entity') !== 'Contact'
fa51c16
to
8ec0637
Compare
CRM/Event/Form/Search.php
Outdated
@@ -79,6 +79,9 @@ public function getDefaultEntity() { | |||
* @throws \CiviCRM_API3_Exception | |||
*/ | |||
public function preProcess() { | |||
// SearchFormName is deprecated & to be removed - the replacement is for the task to | |||
// call $this->form->getFormValues() |
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 think all these new comment blocks have a typo. Shouldn't it be
// call $this->form->getFormValues() | |
// call $this->form->getSearchFormValues() |
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.
oh yeah - I renamed the fn - will fix
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.
@colemanw fixed
Currently there are 3 ways in which the values from the searchForm are retrieved 1) the search form sets a value 'searchFormName' on the form during search which can be later retrieved 2) the search task has an action that reflects the form it came from 3) as per 2 but there is additional handling for the fact it might be the contact search (knowable because the entity has been set to 'Contact' I'm not 100% sure at this stage that the selected method (3) in this PR is the best - but it seems 'as good' as 1 with less form-state stuff and this PR consolidates it into 1 place so it is handled consistently
8ec0637
to
2d09a0c
Compare
Overview
[REF] Consolidate retrieval of searchFormValues
Before
Currently there are 3 ways in which the values from the searchForm are retrieved
be later retrieved
the contact search (knowable because the entity has been set to 'Contact'
After
used in all places - it uses method 3
Technical Details
I'm not 100% sure at this stage that the selected method (3) in this PR is the best -
but it seems 'as good' as 1 with less form-state stuff and this PR consolidates it
into 1 place so it is handled consistently
Comments