salesagility / SuiteCRM

SuiteCRM - Open source CRM for the world
https://www.suitecrm.com
GNU Affero General Public License v3.0
4.55k stars 2.1k forks source link

Using Browser "Back" Button Causes err_cache_miss #7321

Open deuks opened 5 years ago

deuks commented 5 years ago

Issue

After searching within a module, if a user inspects a record and then tries click "back" to return to the search results, a page load error occurs (err_cache_miss on chrome, other browser have different names for the page but the overall result is the same).

Expected Behavior

You should be able to click "back" and return to your search results.

Actual Behavior

A page load error occurs. Logs don't necessarily indicate that anything is broken but access logs do show that a POST statement is made when searching, most likely why you cannot go back. Furthermore, if instead of going back, you chose to go to a different module or return to the search via the module menus, your query will still be there (depending on what your config settings are). You can then click a record and now the back button works (because when you return to the module, your query is being recalled using a GET statement instead of the POST statement used when you first search)

Possible Fix

Possibly has to do with the POST statement used when first searching. Not an expert but I'm guessing using a GET statement would fix the issue due to my earlier stated actual behavior.

Steps to Reproduce

Was able to replicate the issue on SuiteCRM 7.7.6, 7.10.14-7.10.16, 7.11.3 and then demo. When reproducing on demo steps are:

  1. Choose a module (for mine I chose contacts but any module should suffice)
  2. Search using a filter (for the demo I just chose to search for one of the existing contact names)
  3. Click on said record to view their detail view
  4. Use back button on browser

DOES NOT HAPPEN IF:

  1. Repeat Steps 1, 2, and 3 from above
  2. Go anywhere else (go to a different module, or use the actual "view contacts" button)
  3. Click the same record from the listview (in the demo your filter will still be applied, but via GET not POST)
  4. Go back

Your Environment

I work on an Ubuntu LEMP stack (PHP 7.3) but it has been repeated on all manner of LAMP stacks (CentOS) with different version of PHP

pgorod commented 5 years ago

I confirm I can reproduce this on 7.11.4.

rsiasat00 commented 5 years ago

Was able to encounter this issue and found a quick-fix (not sure if there are issues with the fix).

In themes/SuiteP/include/SearchForm/tpls/header.tpl:

Change the form method from POST to GET.

Before: <form name='search_form' id='search_form' class='search_form {if !$searchFormInPopup} non-popup{/if}' method='post' action='index.php?module={$module}&action={$action}' onkeydown='submitOnEnter(event);'>

After: <form name='search_form' id='search_form' class='search_form {if !$searchFormInPopup} non-popup{/if}' method='get' action='index.php?module={$module}&action={$action}' onkeydown='submitOnEnter(event);'>

deuks commented 5 years ago

I tried this and it does work. I did not receive any other errors, but not sure if there are unexpected consequences.

pgorod commented 5 years ago

@cameronblaikie @Mac-Rae @Dillon-Brown maybe this can get a Fix proposed label?... and Hacktoberfest also!

akuljana commented 4 years ago

Hi there, the same error occurs when you go further than the first page and try to go back. Check here

sunzhongwei commented 1 month ago

Hi there, the same error occurs when you go further than the first page and try to go back. Check here

Same issue