Search Query is lost when needing to login #4420

Open
opened 2026-02-20 16:17:16 -05:00 by deekerman · 2 comments
Owner

Originally created by @isleshocky77 on GitHub (Nov 4, 2020).

Issue

If you attempt to go to the search page with a query, and then need to login because you were not yet authenticated, when you are redirected back to the search page, the query has now been lost.

Expected Behavior

The query should be preserved through the login process

Actual Behavior

You are redirected to the search page with an empty query

Possible Fix

Keep the query string in the saved location a user is coming from when going through the login process

Steps to Reproduce

  1. Go to https://demo.suiteondemand.com/index.php?action=Search&search-query-string=The+Search+Term&search-query-size=10&search-query-from=0&search-engine=ElasticSearchEngine
  2. Login with will : will
  3. Search box should contain "The Search Term" and there should be results, it's blank though

Context

We have Google Chrome and Search keyboard shortcut keys which search SuiteCrm, but if you're not logged in, you need to login and then you lose your search.

Your Environment

  • SuiteCRM Version used: 7.11.15

  • Browser name and version: Google Chrome | 84.0.4147.125

  • Environment name and version (e.g. MySQL, PHP 7): MSQL php7.3

  • Operating System and version (e.g Ubuntu 16.04): Ubuntu 16.04

Originally created by @isleshocky77 on GitHub (Nov 4, 2020). <!--- Provide a general summary of the issue in the **Title** above --> <!--- Before you open an issue, please check if a similar issue already exists or has been closed before. ---> <!--- If you have discovered a security risk please report it by emailing security@suitecrm.com. This will be delivered to the product team who handle security issues. Please don't disclose security bugs publicly until they have been handled by the security team. ---> #### Issue <!--- Provide a more detailed introduction to the issue itself, and why you consider it to be a bug --> <!--- Ensure that all code ``` is surrounded ``` by triple back quotes. This can also be done over multiple lines --> If you attempt to go to the search page with a query, and then need to login because you were not yet authenticated, when you are redirected back to the search page, the query has now been lost. #### Expected Behavior <!--- Tell us what should happen --> The query should be preserved through the login process #### Actual Behavior <!--- Tell us what happens instead --> <!--- Also please check relevant logs (suitecrm.log, php error.log etc.) --> You are redirected to the search page with an empty query #### Possible Fix <!--- Not obligatory, but suggest a fix or reason for the bug --> Keep the query string in the saved location a user is coming from when going through the login process #### Steps to Reproduce <!--- Provide a link to a live example, or an unambiguous set of steps to --> <!--- reproduce this bug include code to reproduce, if relevant --> 1. Go to https://demo.suiteondemand.com/index.php?action=Search&search-query-string=The+Search+Term&search-query-size=10&search-query-from=0&search-engine=ElasticSearchEngine 2. Login with will : will 3. Search box should contain "The Search Term" and there should be results, it's blank though #### Context <!--- How has this bug affected you? What were you trying to accomplish? --> <!--- If you feel this should be a low/medium/high priority then please state so --> We have Google Chrome and Search keyboard shortcut keys which search SuiteCrm, but if you're not logged in, you need to login and then you lose your search. #### Your Environment <!--- Include as many relevant details about the environment you experienced the bug in --> * SuiteCRM Version used: 7.11.15 * Browser name and version: Google Chrome | 84.0.4147.125 * Environment name and version (e.g. MySQL, PHP 7): MSQL php7.3 * Operating System and version (e.g Ubuntu 16.04): Ubuntu 16.04
Author
Owner

@isleshocky77 commented on GitHub (Nov 10, 2020):

@johnM2401 I gave an example url from the public demo site which happens to be using ElasticSearch; however, this bug is not specific to ElasticSearch. The same thing happens when not using ElasticSearch.

@isleshocky77 commented on GitHub (Nov 10, 2020): @johnM2401 I gave an example url from the public demo site which happens to be using ElasticSearch; however, this bug is not specific to ElasticSearch. The same thing happens when not using ElasticSearch.
Author
Owner

@DJUserkent commented on GitHub (Nov 25, 2021):

This is well known.
It is because the search strings in Suite (and SugarCRM before it) are saved in the POST part of the page request - not in the URL itself (which would be a GET type effect.

If you use a browser tool you can see what the parameters are that are passed in the POST.
A work round for fixed search queries that you want to refer back to often:

  • add to the URL with the correct parameters

Eg -this will search Accounts for names like 'Royal' - in quick search

-- /index.php?module=Accounts&action=index&searchFormTab=basic_search&query=true&button=Search&name_basic=royal

@DJUserkent commented on GitHub (Nov 25, 2021): This is well known. It is because the search strings in Suite (and SugarCRM before it) are saved in the POST part of the page request - not in the URL itself (which would be a GET type effect. If you use a browser tool you can see what the parameters are that are passed in the POST. A work round for fixed search queries that you want to refer back to often: * add to the URL with the correct parameters Eg -this will search Accounts for names like 'Royal' - in quick search -- /index.php?module=Accounts&action=index&searchFormTab=basic_search&query=true&button=Search&name_basic=royal
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SuiteCRM-SuiteCRM#4420
No description provided.