2019-02-28, 08:42
I have a strange situation, seems like a bug but don't see a reason for it.
I was refactoring some code. I cut and pasted some code from an include and created a new parameterized include and called it from the original include. I couldn't get it to show up. I experimented with various things (nothing showed up in debug logs). I could see the new include worked fine if I didn't define a parameter, but with a parameter it was no-go.
So I stripped it down to what seemed like minimum functionality and made a label display $PARAM[param_name]
what I saw is that $PARAM wasn't being evaluated, instead it was just being passed as a string to the label. So I did a bunch more testing to see what was happening, created an include from scratch that worked fine. At that point I was ready to post here for help. So I could post the code I cleaned it up some including removing a comment from a line. When I went to check to make sure my code still ran (with bug) to my surprise now $PARAM was being evaluated! I've checked this comment decoded from utf-8 etc and there's no hidden or non-spacing chars or anything else strange about this comment. I can't see any reason why the comment would somehow affect just the $PARAM eval and everything else works just fine. Here's the test include which I also verified in Estuary placing it in Includes.xml:
and calling it from View_55_WideList.xml:
and as I wrote, running Kodi 18.0 with this I get Param is: $PARAM[sety]
And then deleting the comment like this:
and now I get Param is: 20 as expected.
Any ideas what's going on here?
scott s.
.
I was refactoring some code. I cut and pasted some code from an include and created a new parameterized include and called it from the original include. I couldn't get it to show up. I experimented with various things (nothing showed up in debug logs). I could see the new include worked fine if I didn't define a parameter, but with a parameter it was no-go.
So I stripped it down to what seemed like minimum functionality and made a label display $PARAM[param_name]
what I saw is that $PARAM wasn't being evaluated, instead it was just being passed as a string to the label. So I did a bunch more testing to see what was happening, created an include from scratch that worked fine. At that point I was ready to post here for help. So I could post the code I cleaned it up some including removing a comment from a line. When I went to check to make sure my code still ran (with bug) to my surprise now $PARAM was being evaluated! I've checked this comment decoded from utf-8 etc and there's no hidden or non-spacing chars or anything else strange about this comment. I can't see any reason why the comment would somehow affect just the $PARAM eval and everything else works just fine. Here's the test include which I also verified in Estuary placing it in Includes.xml:
Code:
<include name="Test_param">
<param name="sety">100</param>
<definition>
<control type="grouplist"><!-- labels higher when no lang or subs flags -->
<posx>800</posx>
<posy>100</posy>
<width>500</width>
<height>1080</height>
<orientation>vertical</orientation>
<itemgap>0</itemgap>
<control type="label">
<description>DURATION</description>
<height>33</height>
<width>500</width>
<font>font13</font>
<aligny>center</aligny>
<align>left</align>
<textcolor>FFFF0000</textcolor>
<textoffsetx>0</textoffsetx>
<textoffsety>0</textoffsety>
<label>Param is: $PARAM[sety]</label>
</control>
</control>
</definition>
</include>
and calling it from View_55_WideList.xml:
Code:
<include content="Test_param">
<param name="sety">20</param>
</include>
and as I wrote, running Kodi 18.0 with this I get Param is: $PARAM[sety]
And then deleting the comment like this:
Code:
<include name="Test_param">
<param name="sety">100</param>
<definition>
<control type="grouplist">
<posx>800</posx>
<posy>100</posy>
<width>500</width>
<height>1080</height>
<orientation>vertical</orientation>
<itemgap>0</itemgap>
<control type="label">
<description>DURATION</description>
<height>33</height>
<width>500</width>
<font>font13</font>
<aligny>center</aligny>
<align>left</align>
<textcolor>FFFF0000</textcolor>
<textoffsetx>0</textoffsetx>
<textoffsety>0</textoffsety>
<label>Param is: $PARAM[sety]</label>
</control>
</control>
</definition>
</include>
and now I get Param is: 20 as expected.
Any ideas what's going on here?
scott s.
.