Skip to content
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

Revert "[REF] use generic loadStandardSearchOptionsFromUrl". Fix search selections. #14918

Merged
merged 1 commit into from
Jul 30, 2019

Conversation

totten
Copy link
Member

@totten totten commented Jul 30, 2019

Overview

This reverts commit a5ca2ad
and fixes a bug in management of the prev/next cache. The
bug is visible when following this procedure:

  1. In browser, use "Quick search" to search for text "am"
  2. In browser, select checkboxes next to two items
  3. In MySQL CLI, run select * from civicrm_prevnext_cache where is_selected =1;. Observe that there are two selections.
  4. In browser, continue to next page. Observe that selection count drops to zero.
  5. In MySQL CLI, re-run SQL query. Observe that the selections have disappeared.

Before

Proceeding to another page of search results causes loss of selections

After

Selections are preserved

…ch selections.

Overview
-------------------

This reverts commit a5ca2ad
and fixes a bug in management of the prev/next cache. The
bug is visible when following this procedure:

1. In browser, use "Quick search" to search for text "am"
2. In browser, select checkboxes next to two items
3. In MySQL CLI, run `select * from civicrm_prevnext_cache where is_selected =1;`
4. In browser, continue to next page. Observe that there are no more selection.
5. In MySQL CLI, re-run SQL query. Observe that the selections have disappeared.

Before
-------------------

Proceeding to another page of search results causes loss of selections

After
-------------------

Selections are preserved
@civibot
Copy link

civibot bot commented Jul 30, 2019

(Standard links)

@civibot civibot bot added the master label Jul 30, 2019
@seamuslee001
Copy link
Contributor

@totten i note this is against master but not 5.16?

@totten totten changed the base branch from master to 5.16 July 30, 2019 06:22
@civibot civibot bot added 5.16 and removed master labels Jul 30, 2019
@totten
Copy link
Member Author

totten commented Jul 30, 2019

Thanks @seamuslee001. Fixed.

@totten
Copy link
Member Author

totten commented Jul 30, 2019

This is fairly simple revert (based on bisecting to uncover the problem). FWIW, the difference appears to stem from changing the lookup params for force. The following is alternative patch that also fixes this issue for me.

diff --git a/CRM/Core/Form/Search.php b/CRM/Core/Form/Search.php
index 2957645991..4086c1b3a4 100644
--- a/CRM/Core/Form/Search.php
+++ b/CRM/Core/Form/Search.php
@@ -414,7 +414,7 @@ class CRM_Core_Form_Search extends CRM_Core_Form {
    */
   protected function loadStandardSearchOptionsFromUrl() {
     $this->_reset = CRM_Utils_Request::retrieve('reset', 'Boolean');
-    $this->_force = CRM_Utils_Request::retrieve('force', 'Boolean', $this, FALSE);
+    $this->_force = CRM_Utils_Request::retrieve('force', 'Boolean');
     $this->_limit = CRM_Utils_Request::retrieve('limit', 'Positive', $this);
     $this->_context = CRM_Utils_Request::retrieve('context', 'Alphanumeric', $this, FALSE, 'search');
     $this->_ssID = CRM_Utils_Request::retrieve('ssID', 'Positive', $this);

I've not investigated the goals/context/scope of the original change - so don't have an opinion on which framing is better.

@totten totten changed the title Revert "[REF] use generic loadStandardSearchOptionsFromUrl". Fix searrch selections Revert "[REF] use generic loadStandardSearchOptionsFromUrl". Fix search selections. Jul 30, 2019
@totten
Copy link
Member Author

totten commented Jul 30, 2019

CC @monishdeb

@monishdeb
Copy link
Member

Agree with this revert. Tested and does fix the issue mentioned in the PR description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants