Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#12752 closed Bug Report - General (Fixed)

Hangs at "Loading..." when browsing music to a letter in MythWeb

Reported by: ijc@… Owned by: Stuart Auchterlonie
Priority: minor Milestone: 0.28.1
Component: Plugin - MythWeb Version: 0.27.6
Severity: medium Keywords:
Cc: Ticket locked: no

Description

I initialy mentioned this here but it was suggested to create a ticket.

With mythweb 0.27.6 if i navigate to Music -> Browse -> Some letter I just get a "LOADING..." overlay which never goes away. This was not the case in 0.27.5, between .5 and .6 is just:

  • da1e99c Fixes #12588 PHP7 Support. Switch to mysqli plugin
  • f3931a9 Refs #12588 PHP7 Support. Remove depreciated assignment.

I looked and/tried some the various follow ups in master but nothing helped.

I'm running on Debian with php5 (5.6.19+dfsg-2). I tried switching from php5-mysql to php5-mysqlnd (no I idea what the difference is), but that didn't help.

I also tried installing php7.0, php7.0-mysql, libapache2-mod-php7.0 and a2dismod php5 ; a2enmod php7.0 ; service apache2 reload but no change there either.

I see that since I initially reported this on the list 0.28 has been released. I've not yet had a chance to upgrade my system but I didn't see anything in the commit log which looked like it was relevant to this issue.

I'm running the deb-multimedia.org packages. --version output attached.

Attachments (2)

myth-versions.txt (1.9 KB) - added by ijc@… 8 years ago.
mythfrontend+ mythbackend --version
0001-Avoid-double-quoting-SQL.patch (3.5 KB) - added by ijc@… 8 years ago.
Patch to avoid double quoting the SQL

Download all attachments as: .zip

Change History (14)

Changed 8 years ago by ijc@…

Attachment: myth-versions.txt added

mythfrontend+ mythbackend --version

comment:1 Changed 8 years ago by ijc@…

I've now updated to mythtv 0.28 and mythweb 1:0.28-dmo1 (all from deb-multimedia.org) and this issue persists there too.

comment:2 Changed 8 years ago by paulh

Component: MythTV - GeneralPlugin - MythWeb
Owner: set to Stuart Auchterlonie
Summary: Hangs at "Loading..." when browsing mythmusic to a letterHangs at "Loading..." when browsing music to a letter in MythWeb

This has nothing to do with MythMusic

comment:3 Changed 8 years ago by ijc@…

I got the component wrong on initial submission and wasn't able to figure out how to change it. Thanks for fixing that!

comment:4 Changed 8 years ago by anonymous@…

I also have been experiencing this problem. Still there after updating to .28. My system is RedHat? (style) Enterprise Linux 6.

Pressing the '#' for browsing an artist beginning with a number (as opposed to a letter), works fine - just letters 'hang' at 'LOADING...'.

So far I have not been able to find error or system log entry. I will keep searching for something useful.

comment:5 Changed 8 years ago by s.p.naylor@…

Using Firebug in Firefox when trying to access a letter, the problem becomes very obvious.

Problem looks to be in: /usr/share/mythtv/mythweb/modules/music/mp3act_functions.php Line: 282 I think the $db->escape() function is wrapping its output in single speech-marks, thus causing the SQL to have contain a% as a possible output. Removing the outer single speech-marks fixes the problem for me.

comment:6 Changed 8 years ago by ijc@…

Thanks!

I edited the file in 0.28 (from the 0.28-dmo0 debian multimedia package with):

--- /tmp/mp3act_functions.php	2016-07-18 19:27:45.079200891 +0100
+++ /usr/share/mythtv/mythweb/modules/music/mp3act_functions.php	2016-07-18 19:28:08.803018212 +0100
@@ -279,7 +279,7 @@
                    "FROM music_artists " .
                    "GROUP BY artist_name_sort " .
                    "HAVING artist_name_sort " .
-                   "LIKE '" . $db->escape($itemid.'%') . "' " .
+                   "LIKE " . $db->escape($itemid.'%') . " " .
                    "ORDER BY artist_name_sort";
       }
       $sh = $db->query($query);

and I can confirm that it fixed this issue.

I see several other instances of this pattern in the same file too, I suppose they all need fixing.

Ian.

Changed 8 years ago by ijc@…

Patch to avoid double quoting the SQL

comment:7 Changed 8 years ago by ijc@…

I've attached a patch, the touched file is identical in fixes/0.28 and master so I've tested by dropping into my mythweb 0.28 based system.

I'm unable to change the ticket type from "Bug Report" to "Patch", I wasn't sure if I was supposed to file a new ticket or not, sorry if I guessed wrong.

comment:8 Changed 8 years ago by Ian Campbell <ijc@…>

In d2469d2e3978a1288f79157990cf015d421d95d4/mythweb:

Refs #12752 - [mythweb] Avoid double quoting sql

$db->escape already wraps the result in 's so there is no need to do it in the
caller.

This is a little complicated in searchMusic since the %'s need to be inside the
quoting but we do not want them to be escaped themselves. Concat them with the
search term using a SQL CONCAT().

Signed-off-by: Stuart Auchterlonie <stuarta@…>

comment:9 Changed 8 years ago by Ian Campbell <ijc@…>

In f80f8db0c03eb83d1313f3ff2ac2a6e19af65d2d/mythweb:

Refs #12752 - [mythweb] Avoid double quoting sql

$db->escape already wraps the result in 's so there is no need to do it in the
caller.

This is a little complicated in searchMusic since the %'s need to be inside the
quoting but we do not want them to be escaped themselves. Concat them with the
search term using a SQL CONCAT().

Signed-off-by: Stuart Auchterlonie <stuarta@…>
(cherry picked from commit d2469d2e3978a1288f79157990cf015d421d95d4)

comment:10 Changed 8 years ago by Ian Campbell <ijc@…>

In 7b40699e95539ebbff71ccf1772b866353952ad7/mythweb:

Refs #12752 - [mythweb] Avoid double quoting sql

$db->escape already wraps the result in 's so there is no need to do it in the
caller.

This is a little complicated in searchMusic since the %'s need to be inside the
quoting but we do not want them to be escaped themselves. Concat them with the
search term using a SQL CONCAT().

Signed-off-by: Stuart Auchterlonie <stuarta@…>
(cherry picked from commit d2469d2e3978a1288f79157990cf015d421d95d4)

comment:11 Changed 8 years ago by Stuart Auchterlonie

Milestone: unknown0.28.1
Resolution: Fixed
Status: newclosed

Fix committed to master, fixes/0.28, fixes/0.27.

Closing as fixed.

comment:12 Changed 8 years ago by anonymous@…

Absolutely, positively fixed (for me at least)... Well done!

Note: See TracTickets for help on using tickets.