Notifications

27 views

Description

The variable name passed to widget's client controller script has changed in London release. In Kingston the variable's name was passed eg. "user". In London, the value "IO:72a6531ddb73634013e60032ba9619e4" is being passed. This change is causing the customer's script to fail after upgrade to London.

Steps to Reproduce

Reproduced with standard London Patch 5

1. create a new Service Portal Widget:

Name = ParmsTest

HTML Template:
<div>Test</div>

client controller script:

function($rootScope) {
var c = this;
$rootScope.$on("field.change", function(evt, parms) {
console.log(parms);
});
}

2. add new variables to standard catalog item "Apple iPad 3":

name = user
question = user
type= reference
reference = sys_user

name = w
question = w
type = macro with label
widget = ParmsTest

3. go to catalog item on service portal:
/sp?id=sc_cat_item&sys_id=060f3afa3731300054b6a3549dbe5d3e

4. select a user

see in browser console see that the client controller code has been executed.

5. browse the parms object and view value of parms.field.variable_name

In Kingston it will be the name of the variable that was changed eg. "user"
In London it will have a value similar to the following "IO:72a6531ddb73634013e60032ba9619e4"

This change is causing customers existing code to be failing after upgrade to London release.

Workaround

You might have code in the client controller code that is referencing the parms.field.variable_name property to only executed when a specific variable is changed value.

For example:

$rootScope.$on("field.change", function(evt, parms) {
if (parms.field.variable_name == 'status') {
c.data.results = "123";
}

This should set c.data.results to value "123" whenever the variable "status" is changed by the user.

However, because of this problem the code would no longer work after upgrade to London. The code to set c.data.results would not be executed and this could result in unexpected appearance of the widget if it is dependent on the value.

The workaround would be to modify the code to reference parms.field.name instead.

The above code would then become:

$rootScope.$on("field.change", function(evt, parms) {
if (parms.field.name == 'status') {
c.data.results = "123";
}

Testing has confirmed that it should give expected behavior in instance that has been updated to London release.


Related Problem: PRB1328008

Seen In

London Patch 5

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2019-03-21 10:33:36
Published:2019-03-04