diff options
author | Florian Pritz <bluewind@xinu.at> | 2011-09-23 12:39:38 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2011-09-24 18:41:56 +0200 |
commit | 934b18405a7991eeb1e9ec7606f0d3c322c1482b (patch) | |
tree | e1f7567d157dc30499c8d984caf6caaa6847ac53 /apps/bookmarks/ajax | |
parent | ff1030375587ddcaec6585d20f5b66e05467c8f1 (diff) | |
download | nextcloud-server-934b18405a7991eeb1e9ec7606f0d3c322c1482b.tar.gz nextcloud-server-934b18405a7991eeb1e9ec7606f0d3c322c1482b.zip |
fix apps/bookmarks if oc_bookmarks_tags is empty
If you have bookmarks, but there are no tags in oc_bookmarks_tags, the
query doesn't return any results. Using a left join fixes this.
Reference:
http://stackoverflow.com/questions/3171276/select-multiple-tables-when-one-table-is-empty-in-mysql
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'apps/bookmarks/ajax')
-rw-r--r-- | apps/bookmarks/ajax/updateList.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/bookmarks/ajax/updateList.php b/apps/bookmarks/ajax/updateList.php index 67acb2190ca..e9051a8dbfa 100644 --- a/apps/bookmarks/ajax/updateList.php +++ b/apps/bookmarks/ajax/updateList.php @@ -70,7 +70,8 @@ $query = OC_DB::prepare(' ELSE \' \' END AS tags - FROM *PREFIX*bookmarks, *PREFIX*bookmarks_tags + FROM *PREFIX*bookmarks + LEFT JOIN *PREFIX*bookmarks_tags ON 1=1 WHERE (*PREFIX*bookmarks.id = *PREFIX*bookmarks_tags.bookmark_id OR *PREFIX*bookmarks.id NOT IN ( SELECT *PREFIX*bookmarks_tags.bookmark_id FROM *PREFIX*bookmarks_tags |