From e8fc3711a52ee79860372095d693a0e953230544 Mon Sep 17 00:00:00 2001 From: "a. bellenir" Date: Sat, 19 May 2018 15:02:48 -0400 Subject: [PATCH] skip firing onchange event with invalid page ('{{url}}') something sets the iframe url to '$BASE_URL/{{url}}' (encoded as '%7B%7Burl%7D%7D') when the page is reloaded or the URL is accessed directly. Open-ILS/web/js/ui/default/staff/cat/catalog/app.js cannot extract the record id from this value, so a blank page is ultimately loaded. superfluous reloads can be avoided by skipping the $scope.onchange event when the new url is invalid (ends with '{{url}}'). Signed-off-by: a. bellenir --- Open-ILS/web/js/ui/default/staff/services/eframe.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Open-ILS/web/js/ui/default/staff/services/eframe.js b/Open-ILS/web/js/ui/default/staff/services/eframe.js index 5096165f75..50eb10de5a 100644 --- a/Open-ILS/web/js/ui/default/staff/services/eframe.js +++ b/Open-ILS/web/js/ui/default/staff/services/eframe.js @@ -295,7 +295,8 @@ angular.module('egCoreMod') }); } - if ($scope.onchange) $scope.onchange(page); + // skip firing onchange if page url ends with "{{url}}" + if ($scope.onchange && !page.match(/%7B%7Burl%7D%7D$/)) $scope.onchange(page); } // open a new tab with the embedded URL -- 2.11.0