diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-09-12 14:30:25 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-09-12 14:30:25 -0700 |
commit | a98841613a62a27d0a6c157d6f62546e319a08b9 (patch) | |
tree | 7d923fa0222941c71a5a57966897a1d3a41479aa /modules/gallery/helpers | |
parent | 19034d140e79f774826d5a94128b0abe5020d1b3 (diff) |
LOWER() the slug and name in the find_dupes functions since DISTINCT
is case sensitive, but our dupe validation is not. Fixes ticket #1367.
Diffstat (limited to 'modules/gallery/helpers')
-rw-r--r-- | modules/gallery/helpers/gallery_task.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/gallery/helpers/gallery_task.php b/modules/gallery/helpers/gallery_task.php index 0886aad0..985346ba 100644 --- a/modules/gallery/helpers/gallery_task.php +++ b/modules/gallery/helpers/gallery_task.php @@ -596,7 +596,7 @@ class gallery_task_Core { static function find_dupe_slugs() { return db::build() ->select_distinct( - array("parent_slug" => new Database_Expression("CONCAT(`parent_id`, ':', `slug`)"))) + array("parent_slug" => new Database_Expression("CONCAT(`parent_id`, ':', LOWER(`slug`))"))) ->select("id") ->select(array("C" => "COUNT(\"*\")")) ->from("items") @@ -608,7 +608,7 @@ class gallery_task_Core { static function find_dupe_names() { return db::build() ->select_distinct( - array("parent_name" => new Database_Expression("CONCAT(`parent_id`, ':', `name`)"))) + array("parent_name" => new Database_Expression("CONCAT(`parent_id`, ':', LOWER(`name`))"))) ->select("id") ->select(array("C" => "COUNT(\"*\")")) ->from("items") |