Error with misplaced '['
#1
Hi, I have a line in an xml file which reads
xml:
<include content="InfoFlag">
    <param name="visible" value="[String.IsEqual($PARAM[infolabel_prefix]ListItem.DBtype,tvshow) | String.IsEqual($PARAM[infolabel_prefix]ListItem.DBtype,episode)] + !String.IsEmpty($PARAM[infolabel_prefix]ListItem.Premiered)" />
    <param name="icon" value="lists/airdate.png" />
    <param name="label" value="$INFO[$PARAM[infolabel_prefix]ListItem.Premiered]" />
    <param name="height" value="50" />
</include>

However, when loading that xml, Kodi reports an error of
Code:
13:05:41.569 T:140454630033792   ERROR: Misplaced [
13:05:41.569 T:140454630033792   ERROR: Error parsing boolean expression [string.isequal($param[infolabel_prefix]listitem.dbtype,tvshow) | string.isequal($param[infolabel_prefix]listitem.dbtype,episode)] + !string.isempty($param[infolabel_prefix]listitem.premiered)

I've looked at it multiple times but still can't see why it's wrong !!

Anyone able to help me ? Thanks in advance !!
Learning Linux the hard way !!
Reply
#2
Use an editor that supports highlighting matching brackets. You should be able to find out faster where the problem lies.
Reply
#3
What's is infolabel_prefix exactly?
Reply
#4
(2019-01-13, 18:43)Klojum Wrote: Use an editor that supports highlighting matching brackets. You should be able to find out faster where the problem lies.
 I am, and it does Smile  Doesn't help me here though !!
Quote:What's is infolabel_prefix exactly?

Good question.  It's not my code originally, I am just trying to debug the errors, but I think it's defined in 'includes.xml'.

xml:
<include name="MediaFlags">
        <param name="infolabel_prefix"></param>
        <param name="resolution_var">$VAR[ResolutionFlagVar]</param>
        <definition>
            <control type="grouplist">
                <orientation>horizontal</orientation>
                <right>20</right>
                <top>0</top>
                <height>70</height>
                <align>right</align>
                <itemgap>28</itemgap>
                <width>1900</width>
                <usecontrolcoords>true</usecontrolcoords>
                <control type="group">
                    <width>150</width>
                    <top>-5</top>
                    <visible>String.IsEqual($PARAM[infolabel_prefix]ListItem.DBtype,tvshow)</visible>
.....
Learning Linux the hard way !!
Reply
#5
Looks like it's value is missing.
Reply
#6
Yeah, I thought that but figured if it evaluated to an empty string it might not matter.  Guess I'll try removing it from the offending line and see if the error moves or disappears.
Learning Linux the hard way !!
Reply
#7
I would assume it's meant to be a container control there but without seeing where else it appears in the skin I'm just guessing.
Reply

Logout Mark Read Team Forum Stats Members Help
Error with misplaced '['0