#47 Bug: Change category for a torrent results in SQL error

Open
opened 7 years ago by Syunka · 1 comments
Syunka commented 7 years ago

I discovered a bug in our Gazelle and initially thought it was due to our $Categories (which are different to OT) not being reflected in takechangecategory.php. I then saw that OT categories was also never updated in the file - the original WCD categories are still there. Does this cause a bug in OT when changing a category?

Specifically I think the bug occurs as a SQL query has bad syntax due to $GroupID never being populated by any of the ‘case’ statements.

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘GROUP BY ta.GroupID’ at line 5

#0  DB_MYSQL->query(
      SELECT GROUP_CONCAT(ag.Name separator ' ')
      FROM torrents_artists AS ta
        JOIN artists_group AS ag ON ag.ArtistID = ta.ArtistID
      WHERE ta.GroupID = 
      GROUP BY ta.GroupID) called at [/var/www/html/classes/torrents.class.php:508]
#1  Torrents::update_hash() called at [/var/www/html/sections/torrents/takechangecategory.php:110]
#2  include(/var/www/html/sections/torrents/takechangecategory.php) called at [/var/www/html/sections/torrents/index.php:39]
#3  require(/var/www/html/sections/torrents/index.php) called at [/var/www/html/classes/script_start.php:393]
#4  require(/var/www/html/classes/script_start.php) called at [/var/www/html/torrents.php:3]
I discovered a bug in our Gazelle and initially thought it was due to our `$Categories` (which are different to OT) not being reflected in `takechangecategory.php`. I then saw that OT categories was also never updated in the file - the original WCD categories are still there. Does this cause a bug in OT when changing a category? Specifically I think the bug occurs as a SQL query has bad syntax due to `$GroupID` never being populated by any of the 'case' statements. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GROUP BY ta.GroupID' at line 5 ``` #0 DB_MYSQL->query( SELECT GROUP_CONCAT(ag.Name separator ' ') FROM torrents_artists AS ta JOIN artists_group AS ag ON ag.ArtistID = ta.ArtistID WHERE ta.GroupID = GROUP BY ta.GroupID) called at [/var/www/html/classes/torrents.class.php:508] #1 Torrents::update_hash() called at [/var/www/html/sections/torrents/takechangecategory.php:110] #2 include(/var/www/html/sections/torrents/takechangecategory.php) called at [/var/www/html/sections/torrents/index.php:39] #3 require(/var/www/html/sections/torrents/index.php) called at [/var/www/html/classes/script_start.php:393] #4 require(/var/www/html/classes/script_start.php) called at [/var/www/html/torrents.php:3] ```
spaghetti commented 6 years ago
Owner

I then saw that OT categories was also never updated in the file - the original WCD categories are still there. Does this cause a bug in OT when changing a category?

Yes. We haven’t bothered to update it for ourselves yet because of the work involved and the very little utility it provides.

>I then saw that OT categories was also never updated in the file - the original WCD categories are still there. Does this cause a bug in OT when changing a category? Yes. We haven't bothered to update it for ourselves yet because of the work involved and the very little utility it provides.
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
Cancel
Save
There is no content yet.