Suitecrm: Popup selects are broken

Created on 14 Jun 2019  路  6Comments  路  Source: salesagility/SuiteCRM



Issue

A recent set of updates and "fixes" have broken the select option for popups (7.11.5). When trying to select options to send back from the popup the button freezes and doesnt work.

Code indications are that the send_back_selected funciton in popup_helper.js requires a 5th parameter (request_data), previous iterations of this code had an implementation that found the request data if it wasnt sent over. Additionally recent updates fixed the capability to allow modules to have their own Popup.php code. the default popup button has the 5th parameter none of the overrides do so it breaks for most.

Expected Behavior

click the button and selected contacts/leads/etc. get sent back to the parent panel.

Actual Behavior


Errors in JS console indicating that request_data is not an object that can be used

Possible Fix


All instances of send_back_selected need the 5th parameter adding.

Steps to Reproduce



1.
2.
3.
4.

Context


Your Environment

  • SuiteCRM Version used: 7.11.5
  • Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)): All browsers
  • Environment name and version (e.g. MySQL, PHP 7): PHP7.1/PHP7.0 Mysql Apache
  • Operating System and version (e.g Ubuntu 16.04): Debian Stretch
Critical Fix Proposed Bug

All 6 comments

Just for anyone else and while this gets fixed I had to add this code:

` SUGAR.util.globalEval("var temp_request_data = " + window.document.forms['popup_query_form'].request_data.value);

if (temp_request_data.jsonObject) {
var request_data = temp_request_data.jsonObject;
} else {
var request_data = temp_request_data; // passed data that is NOT incorrectly encoded via JSON.encode();
}`

At the current line 229 of jssource/src_files/include/javascript/popup_helper.js underneath the line:

SUGAR.util.globalEval("var selection_list_array = {" + array_contents.join(",") + "}");

Which is where that code was previously to get this working again.

@Dillon-Brown
I can confirm this latest revision of the updated code works!

I update to version 7.11.6 today and I still find the problem on MOZILLA FIREFOX, while on CHROME it works correctly

@enricocracco Have you tried clearing browser cache?

If I clear the browser cache it WORKS! Thanks Dillon-Brown

I updated to 7.11.6 and now it works well. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Mausino picture Mausino  路  3Comments

ajprouty87 picture ajprouty87  路  3Comments

sasha2002 picture sasha2002  路  3Comments

ArturoBurela picture ArturoBurela  路  3Comments

darouca picture darouca  路  3Comments