[ 
https://issues.apache.org/jira/browse/OOZIE-1365?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michalis Kongtongk reopened OOZIE-1365:
---------------------------------------


Oh! dear! I think I have made a mistake in evaluating the {{if}} statement 
expression.

This will break "Child Job URLs" tab from displaying correctly

{{if (consoleUrl)}} and  {{if (externalChildIDs)}} will evaluate to {{true}} if 
value is *NOT*: _null, undefined, NaN, empty string (""), 0, false_ 
(http://stackoverflow.com/a/5515349)

Therefore there's no need to place exclamation mark "!" in front of the 
variable {{consoleUrl}} and {{externalChildIDs}} in the if statement.

This is how I tested:

*Correct evaluation:*
{code:javascript}
// Init with some values
var externalChildIDs = "/job/1,/job/2";
var consoleUrl = "job";
if(consoleUrl && externalChildIDs) {
 // will populate "Child Job URLs"
 // because consoleUrl && externalChildIDs NOT: null, undefined, NaN, empty 
string (""), 0, false
else{
 // will not trigger code in here
}
{code}

{code:javascript}
// Without values, you can also replace empty string ("") with _null, 
undefined, NaN, 0, false
var externalChildIDs = "";
var consoleUrl = "";
if(consoleUrl && externalChildIDs) {
 // wont't populate Child Job URLs
 // because consoleUrl && externalChildIDs IS: null, undefined, NaN, empty 
string (""), 0, false
else{
 // will populate Child Job URLs with "n/a"
}
{code}

*Incorrect evaluation:*
{code:javascript}
// Init with some values
var externalChildIDs = "/job/1,/job/2";
var consoleUrl = "job";
if(!consoleUrl && !externalChildIDs) {
 // wont't populate Child Job URLs
 // because consoleUrl && externalChildIDs HAVE value other than null, 
undefined, NaN, empty string (""), 0, false
else {
 // will trigger this
 // and populate Child Job URLs with "n/a" - but we have values!
}
{code}

{code:javascript}
// Without values, you can also replace empty string ("") with _null, 
undefined, NaN, 0, false
var externalChildIDs = "";
var consoleUrl = "";
if(!consoleUrl && !externalChildIDs) {
 // will trigger code in here, but both blank!
 // because consoleUrl && externalChildIDs IS null, undefined, NaN, empty 
string (""), 0, false
else{
 // will not trigger code in here
}
{code}
                
> The hive action popup in the web UI is broken when externalChildIDs is empty 
> string
> -----------------------------------------------------------------------------------
>
>                 Key: OOZIE-1365
>                 URL: https://issues.apache.org/jira/browse/OOZIE-1365
>             Project: Oozie
>          Issue Type: Bug
>    Affects Versions: trunk
>            Reporter: Robert Kanter
>            Assignee: Michalis Kongtongk
>             Fix For: trunk
>
>         Attachments: OOZIE-1365.patch, OOZIE-1365.patch, OOZIE-1365.patch, 
> oozie-console.js.1.patch
>
>
> When you click on a hive action in the web UI, it's supposed to bring up 
> another popup with the details about the action.  Once the action finishes, 
> if you try to click it nothing happens; Firefox's web console says: 
> {noformat}
> TypeError: this.items is undefined @ 
> http://localhost:11000/oozie/ext-2.2/ext-all.js:136
> {noformat}
> It seems to occur when externalChildIDs in the JSON blob is an empty string.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to