forked from civicrm/org.civicrm.civicase
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #958 from compucorp/GIZ-348-fix-for-high-number-re…
…quests GIZ-348: Remove tabsactivate event listener for Contact Summary tabs
- Loading branch information
Showing
2 changed files
with
34 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
(function ($) { | ||
/** | ||
* The following line of code is to fix GIZ-348. | ||
* | ||
* In Contact Summary tab, we faced an issue where if we click 2 angular based | ||
* tabs(For example: Activity, Case, Awards tabs) very quickly. Then thousands | ||
* of network requests are being sent to the backend, which is freezing the | ||
* webpage and sometimes crashing the server. | ||
* | ||
* This issue was found after upgrading to CiviCRM 5.51 from 5.39. | ||
* | ||
* Later we identified the issue in CiviCRM core, specifically in | ||
* https://github.com/civicrm/civicrm-core/commit/1ed9f5c505fc61802542e8dc05415fe4a1d99198. | ||
* | ||
* In the above commit in CiviCRM core, code was introduced to add `selectedChild` | ||
* query parameter whenever we click on a Contact Summary page tab. And because | ||
* of this, as the route was changed, AngularJS router was getting confused. | ||
* | ||
* So we are adding this fix, where we remove the `tabsactivate` listener from | ||
* `#mainTabContainer` so that `selectedChild` is not added to the URL. | ||
* | ||
* Note: This is not a perfect solution, but it will work fine for now. | ||
* In the long run, we should try to contact with CiviCRM core, and get it fixed | ||
* there. This issue should be reproducible(need to confirm) in a vanilla | ||
* CiviCRM Core site, with https://github.com/civicrm/org.civicrm.civicase installed. | ||
* That way it will be easier to convince Core team to fix this. | ||
*/ | ||
$(function ($) { | ||
$('#mainTabContainer').off('tabsactivate'); | ||
}); | ||
})(CRM.$); |