diff options
author | Paul Arthur <paul.arthur@flowerysong.com> | 2013-05-13 22:03:52 -0400 |
---|---|---|
committer | Paul Arthur <paul.arthur@flowerysong.com> | 2013-05-13 22:13:06 -0400 |
commit | ecf095fc0621f369ffcae54a168b43bccf942c2d (patch) | |
tree | bcf16f15842cdb01b1791c81beac79c4aea9b729 | |
parent | 9a62b49341445f32f2f299f29f3a4340637ba93c (diff) | |
download | ampache-ecf095fc0621f369ffcae54a168b43bccf942c2d.tar.gz ampache-ecf095fc0621f369ffcae54a168b43bccf942c2d.tar.bz2 ampache-ecf095fc0621f369ffcae54a168b43bccf942c2d.zip |
Fix Rating::gc()
The join was incorrect, sometimes resulting in loss of ratings.
Fixes GH #22
-rwxr-xr-x | docs/CHANGELOG.md | 2 | ||||
-rw-r--r-- | lib/class/rating.class.php | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 54130ede..8c66b4b6 100755 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -3,6 +3,8 @@ CHANGELOG 3.6-FUTURE ---------- +- Fixed issue that sometimes removed ratings after catalog operations (reported + by stebe) - Fixed catalog song stats (reported by stebe) - Fixed ACL text field length to allow entry of IPv6 addresses (reported by Baggypants) diff --git a/lib/class/rating.class.php b/lib/class/rating.class.php index 1e983d42..921211df 100644 --- a/lib/class/rating.class.php +++ b/lib/class/rating.class.php @@ -55,7 +55,7 @@ class Rating extends database_object { */ public static function gc() { foreach(array('song', 'album', 'artist', 'video') as $object_type) { - Dba::write("DELETE FROM `rating` USING `rating` LEFT JOIN `$object_type` ON `$object_type`.`id` = `rating`.`object_type` WHERE `object_type` = '$object_type' AND `$object_type`.`id` IS NULL"); + Dba::write("DELETE FROM `rating` USING `rating` LEFT JOIN `$object_type` ON `$object_type`.`id` = `rating`.`object_id` WHERE `object_type` = '$object_type' AND `$object_type`.`id` IS NULL"); } } |