Settings.xml comparators stopped working in Leia
#1
After some testing, it looks like something has recently changed in Leia builds where comparators in an addons settings.xml no longer work correctly.
Code:
<setting id="a" type="select" label="Test A" values="Enabled|Disabled" default="Disabled"/>
<setting id="b" type="text" label="Test B" default="" visible="eq(-1,Enabled)"/>

B will not become visible when A is changed to Enabled. It does become visible in the latest Krypton stable build (just testing side by side). Nothing in the debug logs. Were these commands changed for Leia, or did it inadvertently break?
Reply
#2
there were quite some changes to the addon settings code in kodi:
12125 (PR)

unfortunately, there are still some bugs in the new code.
issues with visible conditions is one of them:
https://github.com/xbmc/xbmc/pull/12125#...-326826279
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#3
I wouldn't plan on Montellese finding time to fix the bug in the backward compatibility code. Best migrate to the new settings format. The bool setting in your example would be:
Code:
<setting id="a" type="boolean" label="30001">
  <default>true</default>
  <control type="toggle"/>
</setting>

A selection setting can then be made dependent on "a":
Code:
<setting id="b" type="select" label="30002">
  <default>0</default>
  <constraints>
    <options>
      <option label="30003">0</option>
      <option label="30004">1</option>
      <option label="30005">2</option>
    </options>
  </constraints>
  <control type="list" format="string"/>
  <dependencies>
    <dependency type="enable" setting="a" operator="is">true</dependency>
  </dependencies>
</setting>
BTC: 1JtXwJdGdE9YnYgThWBT2StFCU5sEYkbVD (personal), https://kodi.tv/contribute/donate-bitcoin (foundation). Donations in the form of controllers, especially ones that don't work in Kodi, are also appreciated.
Reply
#4
(2017-11-26, 07:32)garbear Wrote: I wouldn't plan on Montellese finding time to fix the bug in the backward compatibility code. Best migrate to the new settings format. The bool setting in your example would be:
Code:
<setting id="a" type="boolean" label="30001">
  <default>true</default>
  <control type="toggle"/>
</setting>

A selection setting can then be made dependent on "a":
Code:
<setting id="b" type="select" label="30002">
  <default>0</default>
  <constraints>
    <options>
      <option label="30003">0</option>
      <option label="30004">1</option>
      <option label="30005">2</option>
    </options>
  </constraints>
  <control type="list" format="string"/>
  <dependencies>
    <dependency type="enable" setting="a" operator="is">true</dependency>
  </dependencies>
</setting>
Thanks for this.  Is there any further documentation on the new settings (official or unofficial)?  I'd like to just take the plunge and rewrite it for my addon, but I'd like to make sure I get it right the first time.
Reply
#5
No unofficial guide. Our devs are trying it out now as well. The dev who made the changes has a really busy real life currently.
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#6
Until we have the new format documented, you can see examples of everything the settings system can do here: https://github.com/xbmc/xbmc/blob/master...ttings.xml
BTC: 1JtXwJdGdE9YnYgThWBT2StFCU5sEYkbVD (personal), https://kodi.tv/contribute/donate-bitcoin (foundation). Donations in the form of controllers, especially ones that don't work in Kodi, are also appreciated.
Reply
#7
after looking in to converting old-style settings to the new format for 3 days, my recommendation for now is: DO NOT USE THEM!
there are way too many bugs still present.

sadly the backward compatibility layer that parses old-style settings introduced a few issues as well...

@zachmorris try if using lower-case values fixes your problem
Code:
<setting id="a" type="select" label="Test A" values="enabled|disabled" default="disabled"/>
<setting id="b" type="text" label="Test B" default="" visible="eq(-1,enabled)"/>
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#8
Lower case settings values worked in garbears latest nightly builds.  That seems like it would be an easy fix, but updating that in an addon might muck up current users settings.

@ronie Just to clarify, are you suggesting keeping the old style settings or re-writing settings for v18 compatibility?
Reply
#9
don't use the new settings style ;-)
just keep your old-style settings for now.

this should fix your issue: 13306 (PR)
so once that's merged there's no need to lowercase your setting values either.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#10
Facing similar issues with visibility settings. I will give the PR build a try.

EDIT: Tried this build and the visibility settings are OK now, however, the boolean settings are not stored when changed.
Reply
#11
Just installed Leia and found out that one of my addons which has very complicated settings that are displayed on conditions or hidden etc doesn't work! Glad I found this thread Smile

So it should be fixed in 18.1 ?
Kodi addons: Lanik repo
Reply
#12
it's been partly fixed already in 18.0

as for the remaining issues, more info here: 15252 (GH issue)
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#13
But how are those issues going to be fixedHuh This is a huge problem for my YeeMee addon, because users can't change settings!
Kodi addons: Lanik repo
Reply
#14
Not fixed in 18.1 Sad
Kodi addons: Lanik repo
Reply
#15
Is anybody going to do something about this one day or another ?
I know it's free and a "hobby" for the devs, but regressions and breaking addons should not happen, or at least should be fixed ASAP...
Reply
 
Thread Rating:
  • 0 Vote(s) - 0 Average



Logout Mark Read Team Forum Stats Members Help
Settings.xml comparators stopped working in Leia00