Browse Source

Added fallback sorting

Tobias Reich 8 years ago
parent
commit
6547229a3b
1 changed files with 12 additions and 0 deletions
  1. 12 0
      php/modules/Settings.php

+ 12 - 0
php/modules/Settings.php

@@ -179,6 +179,12 @@ class Settings extends Module {
 
 		}
 
+		$sorting .= ' ';
+
+		# Append fallback sorting
+		# Necessary to get a consistent sorting when multiple photos have same values
+		$sorting .= ', id DESC';
+
 		# Execute query
 		# Do not prepare $sorting because it is a true statement
 		# Preparing (escaping) the sorting would destroy it
@@ -235,6 +241,12 @@ class Settings extends Module {
 
 		}
 
+		$sorting .= ' ';
+
+		# Append fallback sorting
+		# Necessary to get a consistent sorting when multiple albums have same values
+		$sorting .= ', id DESC';
+
 		# Execute query
 		# Do not prepare $sorting because it is a true statement
 		# Preparing (escaping) the sorting would destroy it