Fixed show order of poll options
authorAlexander Ebert <ebert@woltlab.com>
Tue, 11 Mar 2014 15:06:29 +0000 (16:06 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 11 Mar 2014 15:06:29 +0000 (16:06 +0100)
wcfsetup/install/files/lib/data/poll/Poll.class.php

index 7444d3024f68d1d27ee8702c7a7aaac5f618b952..07257f459fa5060576bf7791e7819c560f7be368 100644 (file)
@@ -78,6 +78,12 @@ class Poll extends DatabaseObject {
                                return ($a->votes > $b->votes) ? -1 : 1;
                        });
                }
+               else {
+                       // order options by show order
+                       uasort($this->options, function($a, $b) {
+                               return ($a->showOrder < $b->showOrder) ? -1 : 1;
+                       });
+               }
                
                return $this->options;
        }