CRM-20630: Modifying CRM_Activity_Form_Search to use URL parameters as search form values when passing force=1. #10957
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This is a simplified version of #10418 and does affect Activity Search Form only.
It allows to pass URL parameters as Search Form values when using with 'force=1' parameter.
It does not affect any other classes than CRM_Activity_Form_Search and does not modify $_defaults class property.
Before
Is not possible to do Activity search using URL parameters even if we use 'force=1' parameter.
For example, doing a GET request with following URLs does not work:
/civicrm/activity/search?force=1&activity_type_id[]=9&cid=3
/civicrm/activity/search?force=1&activity_type_id[]=9&activity_date_relative=earlier.year&activity_date_low=1&activity_date_high=1
Below we try to search for "Tell a Friend" activities (activity type id = 9) and for specified amount of time. As search results we Activities of all types and dates.
Results don't fit search values passed in URL:
Also search criteria are not set the URL values:
After
It's possible to pass search criteria with URL parameters.
Search results reflect URL parameters:
Fields of Search Form are set to values passed in URL: