Bugzilla – Bug 17525
No CLI response for items with coderefs
Last modified: 2011-09-02 11:22:48 UTC
Json clients using non menu mode get no response for menu items with coderefs as urls as json serialisation breaks. This is common with the new browse menu interface and plugins which do this. Seen by iPeng with plugins, but its a general case and there is no value in sending coderefs in the response, so they should be screened out. Propose: --- Slim/Control/XMLBrowser.pm (revision 33279) +++ Slim/Control/XMLBrowser.pm (working copy) @@ -1326,9 +1326,13 @@ $hash{name} = $name if defined $name; $hash{type} = $item->{type} if defined $item->{type}; $hash{title} = $item->{title} if defined $item->{title}; - $hash{url} = $item->{url} if $want_url && defined $item->{url}; $hash{image} = $item->{image} if defined $item->{image}; - + + # add url entries if requested unless they are coderefs as this breaks serialisation + if ($want_url && defined $item->{url} && (!ref $item->{url} || ref $item->{url} ne 'CODE')) { + $hash{url} = $item->{url}; + } + $hash{isaudio} = defined(hasAudio($item)) + 0; # Bug 7684, set hasitems to 1 if any of the following are true:
Michael - do you agree?
Makes sense.
== Auto-comment from SVN commit #33302 to the slim repo by adrian == == http://svn.slimdevices.com/slim?view=revision&revision=33302 == Bug: 17525 Description: avoid including coderef urls when what_url is requested for non menumode as it breaks serialisation resulting in no json response.