Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 4.3.3
-
Fix Version/s: None
-
Component/s: Installer
-
Labels:None
-
Number of attachments :
Description
In UserInputPanel the calls to LocaleDatabase.getString(key) are expected to throw an exception if the key is not found so the corresponding value in the userInputSpec.xml txt attribute can be used for display.
Instead, the getString() call returns the key value which ends up being displayed if no userInputLang.xml file is configured.
Recommend either making the LocaleDatabase.getString() throw an exception or remove the txt attribute from the userInputSpec.xml definition and exit the installation if it is present (notifying developers/users they have configured the install definition incorrectly).
A workaround is to add:
if (text.equalsIgnoreCase(key))
{ text=null; }to UserInputPanel.getText(IXMLElement element) to trigger the code that expects the exception to be thrown.
private String getText(IXMLElement element)
{
if (element == null) { return (null); }
String key = element.getAttribute(KEY);
String text = null;
if ((key != null) && (langpack != null))
{
try
{
text = langpack.getString(key);
if (text.equalsIgnoreCase(key)) {
text=null;
}
}
catch (Throwable exception)
{
text = null;
}
}
// if there is no text in the description, then
// we were unable to retrieve it form the resource.
// In this case try to get the text directly from
// the IXMLElement
if (text == null)
{
text = element.getAttribute(TEXT);
}
// try to parse the text, and substitute any variable it finds
VariableSubstitutor vs = new VariableSubstitutor(idata.getVariables());
return (vs.substitute(text, null));
}