propertyfallback Values Not Being Written Correctly
Closed this issue ยท 4 comments
@anxdpanic Perhaps one more you can assist with fixing.
When troubleshooting the update, I noticed that propertyfallback values from my overrides.xml were being parsed correctly in the GUI, but not being written to the XML with the same values. The XML was always using the last fallback value with no attribute matching even though the match was present.
I believe this is due to how has_property_fallback ( https://github.com/mikesilvo164/script.skinshortcuts/blob/master/resources/lib/skinshorcuts/property_utils.py#L47 ) is called from each location.
- In gui.py ( https://github.com/mikesilvo164/script.skinshortcuts/blob/master/resources/lib/skinshorcuts/gui.py#L479 ) the request is made with a
<tuple>
and a<dict>
as parameters - this works as expected. - In xmlfunctions.py ( https://github.com/mikesilvo164/script.skinshortcuts/blob/master/resources/lib/skinshorcuts/xmlfunctions.py#L896 ) the request is made with a
<tuple>
and a<list>
as parameters - this does not work, no matches even when there should be one
My workaround for now is to place the following code at the top of the has_property_fallback function
def has_fallback_property(fallback_property, match_properties):
if isinstance(match_properties, list):
match_properties = dict(match_properties)
...
This change then causes the XML to be written with the same values the GUI displays.
thanks for the report, will be very helpful! this was next on my list to dig into ๐ I'm hoping before the end of the week to have it resolved ๐ค
Huge thanks again, can you give https://github.com/mikesilvo164/script.skinshortcuts/releases/tag/2.0.1.alpha2 a try
Looks good. Thanks for the fix!
It was your fix, I just applied it ๐ So thank you again, I'll be submitting a new version to the official repository shortly.