Kodi Community Forum

Full Version: Using <visible>!IsEmpty($PARAM[foobar])</visible> is opposite expected behaviour
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
On Isengard - I just noticed that if using IsEmpty to check if a $PARAM has a value it has the opposite behaviour from what is expected.

For instance if I have in my include:
Code:
<param name="foo" value="bar" />

And then I check within the include definition if the value is not empty:
Code:
<control type="label">
    <label>$PARAM[foo]</label>
    <visible>!IsEmpty($PARAM[foo])</visible>
</control>

I will get the opposite of the expected behaviour -- IsEmpty will return true and !IsEmpty will return false when it should be the other way around.
that code only seems correct for InfoLabels, and even then it should be
Code:
<label>$INFO[$PARAM[foo]]</label>
.
I'm passing through localized strings - e.g. <param name="foo" value="$LOCALIZE[8]" />

Passing a label through a param works fine. Getting the label to show isn't the problem though. Its that the IsEmpty true and false conditions are inverted for params.

e.g. this will show the label "bar" when it shouldn't (and vice versa for !IsEmpty)
Code:
<control type="label">
    <label>$PARAM[foo]</label>
    <visible>IsEmpty($PARAM[foo])</visible>
</control>
Also from the thread on params:

(2015-04-04, 02:49)rahotep Wrote: [ -> ]Any appropriate value can be passed as parameter in the new include call, including $INFO labels, $LOCALIZE, $VARs, constants, etc. Empty string (value="") can also be passed, for example to override a non-empty default value set in the include definition
yeah but your way would lead to "!IsEmpty($LOCALIZE[xxx]) which is not supported. In that case you would have to use another PARAM.