Alexander Nicolaysen Sørnes : Properly handle queued apps with more than one version

Alexander Nicolaysen Sørnes asornes at winehq.org
Sun Jun 28 07:51:36 CDT 2009


Module: appdb
Branch: master
Commit: 9f52eca642bb3a1814b92260575290844c5b056d
URL:    http://source.winehq.org/git/appdb.git/?a=commit;h=9f52eca642bb3a1814b92260575290844c5b056d

Author: Alexander Nicolaysen Sørnes <alex at thehandofagony.com>
Date:   Sun Jun 28 14:37:38 2009 +0200

Properly handle queued apps with more than one version

---

 include/application_queue.php |   12 ++++++++++++
 include/version.php           |    3 +++
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/include/application_queue.php b/include/application_queue.php
index c2b31e2..c3c51d1 100644
--- a/include/application_queue.php
+++ b/include/application_queue.php
@@ -99,6 +99,18 @@ class application_queue
 
         $this->oApp->unQueue();
         $this->oVersionQueue->unQueue();
+
+        /* Has anyone submitted new versions while the app was queued?
+           If so we need to change their state from pending to queued */
+        $aOtherVersions = $this->oApp->objectGetChildrenClassSpecific('version');
+        foreach($aOtherVersions as $oVersion)
+        {
+            if($oVersion->objectGetState() == 'pending')
+            {
+                $oVersion->objectSetState('queued');
+                $oVersion->update();
+            }
+        }
     }
 
     function reQueue()
diff --git a/include/version.php b/include/version.php
index 055a530..b1bceae 100644
--- a/include/version.php
+++ b/include/version.php
@@ -247,6 +247,9 @@ class version {
             }
         }
 
+        if($this->objectGetState() != $oVersion->objectGetState())
+            query_parameters("UPDATE appVersion SET state = '?' WHERE versionId = '?'", $this->objectGetState(), $this->objectGetId());
+
         if($sWhatChanged and !$bSilent)
             $this->SendNotificationMail("edit",$sWhatChanged);
         return true;




More information about the wine-cvs mailing list