-
Bug
-
Resolution: Done
-
Major
-
RH-SSO-7.2.0.GA, RH-SSO-7.2.1.GA, RH-SSO-7.2.2.GA
-
None
It is not possible to export a client created on RH-SSO 7.1 in RH-SSO 7.2 with clients mapped. After updating the RH-SSO from 7.1 to 7.2 is possible to see the error message below on web console when tries to export:
TypeError: Cannot read property 'length' of undefined
at m.$scope.exportClient (clients.js:768)
at fn (eval at compile (angular.js:15551), <anonymous>:4:229)
at e (angular.js:27341)
at m.$eval (angular.js:18423)
at m.$apply (angular.js:18523)
at HTMLTableCellElement.<anonymous> (angular.js:27346)
at HTMLTableCellElement.dispatch (jquery.min.js:3)
at HTMLTableCellElement.q.handle (jquery.min.js:3)
(anonymous) @ angular.js:14700
(anonymous) @ angular.js:11142
$apply @ angular.js:18528
(anonymous) @ angular.js:27346
dispatch @ jquery.min.js:3
q.handle @ jquery.min.js:3
The issue occurs because there are no clientCopy.protocolMappers defined for clients created on RH-SSO 7.1, that has only clientCopy.protocol declared on the clientCopy. Refer client.js 1
$scope.exportClient = function(client) { var clientCopy = angular.copy(client); delete clientCopy.id; for (var i = 0; i < clientCopy.protocolMappers.length; i++) { delete clientCopy.protocolMappers[i].id; } saveAs(new Blob([angular.toJson(clientCopy, 4)], { type: 'application/json' }), clientCopy.clientId + '.json'); } });