From 3292acdb50fa77c693bc8c094b3ba4760a864b8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Wed, 27 Jul 2016 02:02:00 +0200 Subject: [PATCH] SOLR-8596: Split UIs RAW query params only on first equal sign (cherry picked from commit c9935b4) --- solr/CHANGES.txt | 1 + solr/webapp/web/js/angular/controllers/query.js | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 9666795a4f3..a3bcaa8de93 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -134,6 +134,7 @@ Bug Fixes * SOLR-9339: NPE in CloudSolrClient when the response is null (noble) +* SOLR-8596: Web UI doesn't correctly generate queries which include local parameters (Alexandre Rafalovitch, janhoy) Optimizations ---------------------- diff --git a/solr/webapp/web/js/angular/controllers/query.js b/solr/webapp/web/js/angular/controllers/query.js index 8e89778acd1..1695647a3a0 100644 --- a/solr/webapp/web/js/angular/controllers/query.js +++ b/solr/webapp/web/js/angular/controllers/query.js @@ -61,9 +61,13 @@ solrAdminApp.controller('QueryController', if ($scope.rawParams) { var rawParams = $scope.rawParams.split(/[&\n]/); for (var i in rawParams) { - var param = rawParams[i]; - var parts = param.split("="); - set(parts[0], parts[1]); + var param = rawParams[i]; + var equalPos = param.indexOf("="); + if (equalPos > -1) { + set(param.substring(0, equalPos), param.substring(equalPos+1)); + } else { + set(param, ""); // Use empty value for params without "=" + } } }