OklahomaGreyBeard / erlandplugins

Automatically exported from code.google.com/p/erlandplugins
0 stars 1 forks source link

Double quotes cause custom browse menu failure. #106

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Which plugin is the bug/enhancement related to ?

Custom Browse (?)

What version of SlimServer/SqueezeCeneter are you using? On what operating
system?

7.6.0~31707

Could you describe the problem or enhancment ?

When items with double quotes appear in a menu, the sub-menu items for that 
item fail to appear.

What steps will reproduce the problem?
1. Create a menu structure and items with double quotes in their text
2. Try to bring up the sub-menu for these menu items

Here's a backtrace from the server.log that may be relevant:

[11-01-09 12:56:51.6426] Slim::Schema::Storage::throw_exception (119) Backtrace:

   frame 0: Slim::Utils::Log::logBacktrace (/usr/share/perl5/Slim/Schema/Storage.pm line 119)
   frame 1: Slim::Schema::Storage::throw_exception (/usr/share/squeezeboxserver/CPAN/DBIx/Class/Storage/DBI.pm line 1006)
   frame 2: DBIx::Class::Storage::DBI::__ANON__ (/usr/share/perl5/Slim/Utils/SQLiteHelper.pm line 181)
   frame 3: (eval) (/usr/share/perl5/Slim/Utils/SQLiteHelper.pm line 181)
   frame 4: Slim::Utils::SQLiteHelper::collate (/usr/share/perl5/Slim/Control/Queries.pm line 6270)
   frame 5: Slim::Control::Queries::_getTagDataForTracks (/usr/share/perl5/Slim/Control/Queries.pm line 4082)
   frame 6: Slim::Control::Queries::statusQuery (/usr/share/perl5/Slim/Control/Request.pm line 1922)
   frame 7: (eval) (/usr/share/perl5/Slim/Control/Request.pm line 1922)
   frame 8: Slim::Control::Request::execute (/usr/share/perl5/Slim/Control/Request.pm line 2576)
   frame 9: Slim::Control::Request::__autoexecute (/usr/share/perl5/Slim/Utils/Timers.pm line 253)
   frame 10: (eval) (/usr/share/perl5/Slim/Utils/Timers.pm line 253)
   frame 11: Slim::Utils::Timers::__ANON__ (/usr/share/perl5/Slim/Networking/IO/Select.pm line 183)
   frame 12: (eval) (/usr/share/perl5/Slim/Networking/IO/Select.pm line 183)
   frame 13: Slim::Networking::IO::Select::loop (/usr/sbin/squeezeboxserver line 684)
   frame 14: main::idle (/usr/sbin/squeezeboxserver line 634)
   frame 15: main::main (/usr/sbin/squeezeboxserver line 1129)

[11-01-09 12:56:51.6429] Slim::Utils::SQLiteHelper::collate (183) SQLite ICU 
collation en_US failed: Carp::Clan::__ANON__(): DBI Exception: DBD::SQLite::db 
do failed: SQL logic error or missing database
ICU error: ucol_open(): U_FILE_ACCESS_ERROR [for Statement "SELECT 
icu_load_collation('en_US', 'en_US')"] at 
/usr/share/perl5/Slim/Schema/Storage.pm line 123

Original issue reported on code.google.com by dav...@gmail.com on 9 Jan 2011 at 9:05

GoogleCodeExporter commented 8 years ago
This is for Custom Browse v2.10.3296.

Original comment by dav...@gmail.com on 9 Jan 2011 at 9:07

GoogleCodeExporter commented 8 years ago
The problem also occurs with single quotes.

Original comment by dav...@gmail.com on 9 Jan 2011 at 9:35

GoogleCodeExporter commented 8 years ago
Looks like this may be a purely an SBS issue

http://forums.slimdevices.com/showthread.php?t=83890

I'll test this tonight to see whether this fixes the problem.

Original comment by dav...@gmail.com on 11 Jan 2011 at 7:55

GoogleCodeExporter commented 8 years ago
Well, I've fixed the ICU errors, but the double quote problem is still present, 
so it it does not seem related to the error I pasted in above.

Original comment by dav...@gmail.com on 12 Jan 2011 at 4:00

GoogleCodeExporter commented 8 years ago
The relevant SQL is

select distinct 
customscan_track_attributes.extravalue,customscan_track_attributes.value,substr(
customscan_track_attributes.value,1,1),ifnull(customscan_track_attributes.valuet
ype,'mixedtagWORK') from customscan_track_attributes 
                            where 
                                module='mixedtag' and
                                attr='WORK' and
                                extravalue='Symphony No. 3 \"Eroica\"'

I think the backslashes are causing the problem.  If I paste the query into the 
Database Query plugin and remove the backslashes, the query seems to work.  Was 
escaping the double quotes necessary for mysql?  It doesn't seem to work with 
sqlite.

More from the log below:

[11-03-14 17:58:04.7566] 
Plugins::CustomBrowse::MenuHandler::SQLHandler::getData (50) Preparing SQL: 
                    select distinct customscan_track_attributes.extravalue,customscan_track_attributes.value,substr(customscan_track_attributes.value,1,1),ifnull(customscan_track_attributes.valuetype,'mixedtagWORK') from customscan_track_attributes 
                            where 
                                module='mixedtag' and
                                attr='WORK' and
                                extravalue='{context.itemid}'

[11-03-14 17:58:04.7584] 
Plugins::CustomBrowse::MenuHandler::SQLHandler::_execute (72) Executing: select 
distinct 
customscan_track_attributes.extravalue,customscan_track_attributes.value,substr(
customscan_track_attributes.value,1,1),ifnull(customscan_track_attributes.valuet
ype,'mixedtagWORK') from customscan_track_attributes 
                            where 
                                module='mixedtag' and
                                attr='WORK' and
                                extravalue='Symphony No. 3 \"Eroica\"'
[11-03-14 17:58:04.7593] 
Plugins::CustomBrowse::MenuHandler::SQLHandler::_execute (79) Executing and 
collecting: select distinct 
customscan_track_attributes.extravalue,customscan_track_attributes.value,substr(
customscan_track_attributes.value,1,1),ifnull(customscan_track_attributes.valuet
ype,'mixedtagWORK') from customscan_track_attributes 
                            where 
                                module='mixedtag' and
                                attr='WORK' and
                                extravalue='Symphony No. 3 \"Eroica\"'
[11-03-14 17:58:04.7606] Plugins::CustomBrowse::Plugin::cliJiveHandlerImpl 
(4037) Exiting cliJiveHandler

Original comment by dav...@gmail.com on 15 Mar 2011 at 1:11

GoogleCodeExporter commented 8 years ago
I "fixed" this by brute force by adding a line below line 70 in SQLHandler.pm:

$sql =~ s/\\"/"/g;

Hopefully someone with more knowledge of Perl and this sql package can provide 
a proper fix.

Original comment by dav...@gmail.com on 15 Mar 2011 at 10:15