Shubhendu Tripathi has uploaded a new change for review.

Change subject: webadmin: Dont replace . with _ if error not in resources
......................................................................

webadmin: Dont replace . with _ if error not in resources

Modified to not to replace . with _ if the error message is found in the
resources.
This was causing an issue if an error does not exist in resources, and
contains full stops or valid "." (e.g. IP Address / FQDN). All of the
"." were getting replaced with _ if the error message shown on the
screen.

Change-Id: I68c8354c7fec9e8a85fbea47bd7e4586f49defdf
Bug-Url: https://bugzilla.redhat.com/1024184
Signed-off-by: Shubhendu Tripathi <shtri...@redhat.com>
---
M 
frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/ErrorTranslator.java
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/83/21083/1

diff --git 
a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/ErrorTranslator.java
 
b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/ErrorTranslator.java
index c19b947..b173b8c 100644
--- 
a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/ErrorTranslator.java
+++ 
b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/ErrorTranslator.java
@@ -86,12 +86,16 @@
         String ret = ""; //$NON-NLS-1$
         try {
             if ((errorMsg != null) && (errorMsg.length() > 0)) {
+                String errMsgCopy = errorMsg; // Taking a copy of the error 
message
                 if (!isDynamicVariable(errorMsg)) {
                     errorMsg = errorMsg.replace('.', '_');
                 }
                 if (errors.getString(errorMsg) != null) {
                     ret = errors.getString(errorMsg).replace("\n", "<br/>"); 
//$NON-NLS-1$ //$NON-NLS-2$
                 } else {
+                    // The error message is not found in the errors map, 
revert to original one
+                    // without replacement of "." with "_"
+                    errorMsg = errMsgCopy;
                     if ((isDynamicVariable(errorMsg)) || (!changeIfNotFound)) {
                         ret = errorMsg;
                     } else {


-- 
To view, visit http://gerrit.ovirt.org/21083
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I68c8354c7fec9e8a85fbea47bd7e4586f49defdf
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Shubhendu Tripathi <shtri...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to