ChangeSet ID: 31109
CVSROOT: /opt/cvs-commit
Module name: appdb
Changes by: wineowner(a)winehq.org 2007/04/26 19:13:28
Modified files:
include : application_queue.php
Log message:
Alexander Nicolaysen Sørnes <alex(a)thehandofagony.com>
application_queue, only delete version if it exists. application_queue::delete() should
check that the version object exists because when moving a duplicate application is deleted
before the application
Patch: http://cvs.winehq.org/patch.py?id=31109
Old revision New revision Changes Path
1.1 1.2 +8 -2 appdb/include/application_queue.php
Index: appdb/include/application_queue.php
diff -u -p appdb/include/application_queue.php:1.1 appdb/include/application_queue.php:1.2
--- appdb/include/application_queue.php:1.1 27 Apr 2007 0:13:28 -0000
+++ appdb/include/application_queue.php 27 Apr 2007 0:13:28 -0000
@@ -120,8 +120,14 @@ class application_queue
if(!$this->oApp->delete())
$bSuccess = FALSE;
- if(!$this->oVersionQueue->delete())
- $bSuccess = FALSE;
+ /* When deleting a duplicate app in the application queue, the version is moved
+ to another app and so when application_queue::delete() is called there is
+ no version child to delete, so check if the versionId is valid */
+ if($this->oVersionQueue->oVersion->iVersionId)
+ {
+ if(!$this->oVersionQueue->delete())
+ $bSuccess = FALSE;
+ }
return $bSuccess;
}
ChangeSet ID: 31108
CVSROOT: /opt/cvs-commit
Module name: appdb
Changes by: wineowner(a)winehq.org 2007/04/26 19:06:07
Modified files:
include : version.php
Log message:
Alexander Nicolaysen Sørnes <alex(a)thehandofagony.com>
Return from version::delete() if there isn't a valid version id
Patch: http://cvs.winehq.org/patch.py?id=31108
Old revision New revision Changes Path
1.124 1.125 +4 -0 appdb/include/version.php
Index: appdb/include/version.php
diff -u -p appdb/include/version.php:1.124 appdb/include/version.php:1.125
--- appdb/include/version.php:1.124 27 Apr 2007 0: 6: 7 -0000
+++ appdb/include/version.php 27 Apr 2007 0: 6: 7 -0000
@@ -215,6 +215,10 @@ class Version {
*/
function delete($bSilent=false)
{
+ /* We need the versionId to continue */
+ if(!$this->iVersionId)
+ return;
+
/* is the current user allowed to delete this version? */
if(!$_SESSION['current']->canDeleteVersion($this))
return false;