Bug Using <visible>!IsEmpty($PARAM[foobar])</visible> is opposite expected behaviour
#1
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.
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#2
that code only seems correct for InfoLabels, and even then it should be
Code:
<label>$INFO[$PARAM[foo]]</label>
.
Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply
#3
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>
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#4
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
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#5
yeah but your way would lead to "!IsEmpty($LOCALIZE[xxx]) which is not supported. In that case you would have to use another PARAM.
Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply

Logout Mark Read Team Forum Stats Members Help
Using <visible>!IsEmpty($PARAM[foobar])</visible> is opposite expected behaviour0