Skip to content
Snippets Groups Projects
Commit 7e60c896 authored by srosse's avatar srosse
Browse files

OO-1623: handle gracefully reference of test which doesn't exist

parent 092e184b
No related branches found
No related tags found
No related merge requests found
...@@ -337,18 +337,18 @@ public class IQEditController extends ActivateableTabbableDefaultController impl ...@@ -337,18 +337,18 @@ public class IQEditController extends ActivateableTabbableDefaultController impl
changeTestButton = LinkFactory.createButtonSmall("command.changeRepFile", myContent, this); changeTestButton = LinkFactory.createButtonSmall("command.changeRepFile", myContent, this);
changeTestButton.setElementCssClass("o_sel_test_change_repofile"); changeTestButton.setElementCssClass("o_sel_test_change_repofile");
// fetch repository entry // fetch repository entry
RepositoryEntry re = null; RepositoryEntry re = null;
String displayName = ""; Object repoSoftkey = moduleConfiguration.get(CONFIG_KEY_REPOSITORY_SOFTKEY);
String repoSoftkey = (String) moduleConfiguration.get(CONFIG_KEY_REPOSITORY_SOFTKEY);
if (repoSoftkey != null) { if (repoSoftkey != null) {
re = getIQReference(moduleConfiguration, false); re = getIQReference(moduleConfiguration, false);
displayName = StringHelper.escapeHtml(re.getDisplayname());
} }
myContent.contextPut(VC_CHOSENTEST, re == null ? translate("no.file.chosen") : displayName); if (re == null) {
if (re != null) { myContent.contextPut(VC_CHOSENTEST, translate("no.file.chosen"));
} else {
String displayName = StringHelper.escapeHtml(re.getDisplayname());
myContent.contextPut(VC_CHOSENTEST, displayName);
myContent.contextPut("dontRenderRepositoryButton", new Boolean(true)); myContent.contextPut("dontRenderRepositoryButton", new Boolean(true));
// Put values to velocity container // Put values to velocity container
...@@ -364,7 +364,6 @@ public class IQEditController extends ActivateableTabbableDefaultController impl ...@@ -364,7 +364,6 @@ public class IQEditController extends ActivateableTabbableDefaultController impl
myContent.contextPut(CONFIG_KEY_MAXSCORE, moduleConfiguration.get(CONFIG_KEY_MAXSCORE)); myContent.contextPut(CONFIG_KEY_MAXSCORE, moduleConfiguration.get(CONFIG_KEY_MAXSCORE));
myContent.contextPut(CONFIG_KEY_CUTVALUE, moduleConfiguration.get(CONFIG_KEY_CUTVALUE)); myContent.contextPut(CONFIG_KEY_CUTVALUE, moduleConfiguration.get(CONFIG_KEY_CUTVALUE));
} }
previewLink = LinkFactory.createCustomLink("command.preview", "command.preview", displayName, Link.NONTRANSLATED, myContent, this); previewLink = LinkFactory.createCustomLink("command.preview", "command.preview", displayName, Link.NONTRANSLATED, myContent, this);
previewLink.setIconLeftCSS("o_icon o_icon-fw o_icon_preview"); previewLink.setIconLeftCSS("o_icon o_icon-fw o_icon_preview");
previewLink.setCustomEnabledLinkCSS("o_preview"); previewLink.setCustomEnabledLinkCSS("o_preview");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment