Kodi v18 xbmc.runplugin no longer passes arguments
#1
Hello,

I'm testing my addon with alpha builds of v18 and noticed that context menus no longer work.  I've isolated it down to running the following command:
python:
XBMC.RunPlugin(plugin://plugin.program.iarl/path_to_route?tag_value=xyz)

In Kodi v17 tag_value = xyz would get passed to my plugin as expected.  In Kodi v18 tag_value seems to be dropped and the arguments are empty when the path_to_route is executed.  Is this a bug, or is there a new way to pass values like this?

Thank you!
Reply
#2
Edit.  I figured out a workaround.  I'm convinced that XBMC.RunPlugin acts differently between v17 and v18.  I think it removes the argument as part of a plugin://path, so if you execute:
XBMC.RunPlugin(plugin://plugin.program.iarl/path_to_route?tag_value=xyz)
it will remove the tag_value now and pass it as a sys.argv instead.

The workaround I've got is to look at sys.argv as well.  If the tag is empty, then use sys.argv[2] instead.
Reply
#3
(2018-02-13, 08:38)zachmorris Wrote: Edit.  I figured out a workaround.  I'm convinced that XBMC.RunPlugin acts differently between v17 and v18.  I think it removes the argument as part of a plugin://path, so if you execute:
XBMC.RunPlugin(plugin://plugin.program.iarl/path_to_route?tag_value=xyz)
it will remove the tag_value now and pass it as a sys.argv instead.

I have no idea what XBMC.RunPlugin is. If you are using some custom library, you should clarify this explicitly. Kodi has always been passing plugin call query string via sys.argv[2]. Anything else is either a bug or unusual behavior and should not be relied upon.
Reply
#4
(2018-02-14, 10:03)Roman_V_M Wrote:
(2018-02-13, 08:38)zachmorris Wrote: Edit.  I figured out a workaround.  I'm convinced that XBMC.RunPlugin acts differently between v17 and v18.  I think it removes the argument as part of a plugin://path, so if you execute:
XBMC.RunPlugin(plugin://plugin.program.iarl/path_to_route?tag_value=xyz)
it will remove the tag_value now and pass it as a sys.argv instead.

I have no idea what XBMC.RunPlugin is. If you are using some custom library, you should clarify this explicitly. Kodi has always been passing plugin call query string via sys.argv[2]. Anything else is either a bug or unusual behavior and should not be relied upon. 
 Kodi wiki - https://kodi.wiki/view/List_of_built-in_functions
Reply
#5
(2018-02-14, 10:03)Roman_V_M Wrote:
(2018-02-13, 08:38)zachmorris Wrote: Edit.  I figured out a workaround.  I'm convinced that XBMC.RunPlugin acts differently between v17 and v18.  I think it removes the argument as part of a plugin://path, so if you execute:
XBMC.RunPlugin(plugin://plugin.program.iarl/path_to_route?tag_value=xyz)
it will remove the tag_value now and pass it as a sys.argv instead.

I have no idea what XBMC.RunPlugin is. If you are using some custom library, you should clarify this explicitly. Kodi has always been passing plugin call query string via sys.argv[2]. Anything else is either a bug or unusual behavior and should not be relied upon. 
 RunPlugin is a Kodi built in function.  As you said, it's possible it just worked incorrectly before and now the bug was fixed.  For completeness I've just posted my solution here as I'd guess other people would run into the same issue (this bug is in xbmcswift2 which is no longer supported).
Reply
#6
(2018-02-14, 17:08)Eldorado Wrote:  Kodi wiki - List_of_built-in_functions (wiki)

It's just RunPlugin, without XBMC. part, at least when it's called via xbmc.executebuiltin().
Reply
#7
(2018-02-14, 18:19)Roman_V_M Wrote:
(2018-02-14, 17:08)Eldorado Wrote:  Kodi wiki - List_of_built-in_functions (wiki)

It's just RunPlugin, without XBMC. part, at least when it's called via xbmc.executebuiltin().   
 Thanks Roman.  I was just quoting the code from xbmcswift2 and had originally followed the context menu example in the documentation.  I understand its not supported anymore.  Nevertheless, running the same code on v17 and v18 gives different results.  I'm still not entirely sure why, but if it's no longer broke I won't try to fix it.
Reply
#8
fwiw, the 'xbmc' prefix for built-in commands has been deprecated years ago.
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

Logout Mark Read Team Forum Stats Members Help
Kodi v18 xbmc.runplugin no longer passes arguments0