Misc fixes:
[core.git] / inc / classes / main / points / class_UserPoints.php
index f4dbad4d5cb57280a2d94ae915b47b4f17d56096..2673f05515180d04f52ceb070728eeb00051fb91 100644 (file)
@@ -63,6 +63,9 @@ class UserPoints extends BaseFrameworkSystem implements Registerable, BookablePo
                // Get result back
                $resultInstance = $wrapperInstance->doSelectByCriteria($searchInstance);
 
+               // Advance to first entry by default
+               $resultInstance->next();
+
                // Set it in this instance
                $pointsInstance->setResultInstance($resultInstance);
 
@@ -103,6 +106,9 @@ class UserPoints extends BaseFrameworkSystem implements Registerable, BookablePo
                // Get the required points entry
                $requiredPoints = $this->getConfigInstance()->getConfigEntry($action . '_action_points');
 
+               // Rewind always
+               $this->getResultInstance()->rewind();
+
                // Do we have an entry?
                if ($this->getResultInstance()->next()) {
                        // Get the entry
@@ -123,6 +129,9 @@ class UserPoints extends BaseFrameworkSystem implements Registerable, BookablePo
         * @return      void
         */
        function bookPointsDirectly ($amount) {
+               // Rewind always
+               $this->getResultInstance()->rewind();
+
                // Do we have an entry?
                if ($this->getResultInstance()->next()) {
                        // Get the entry