ChangeSet ID: 17335 CVSROOT: /opt/cvs-commit Module name: appdb Changes by: wineowner@wine.codeweavers.com 2005/05/06 23:14:19 Modified files: admin : adminAppQueue.php Log message: Chris Morgan Delete the matching version submission when deleting an application submission. Otherwise we will orphan the version submission and it will remain queued but won't be visible because there is no application to link it to anymore. Patch: http://cvs.winehq.org/patch.py?id=17335 Old revision New revision Changes Path 1.28 1.29 +14 -0 appdb/admin/adminAppQueue.php Index: appdb/admin/adminAppQueue.php diff -u -p appdb/admin/adminAppQueue.php:1.28 appdb/admin/adminAppQueue.php:1.29 --- appdb/admin/adminAppQueue.php:1.28 Wed May 22 05:21:25 2013 +++ appdb/admin/adminAppQueue.php Wed May 22 05:21:25 2013 @@ -220,8 +220,22 @@ if ($_REQUEST['sub']) { if (is_numeric($_REQUEST['appId']) && !is_numeric($_REQUEST['versionId'])) // application { + // delete the application entry $oApp = new Application($_REQUEST['appId']); $oApp->delete(); + + // get the queued versions that refers to the application entry we just removed + // and delete them as we implicitly added a version entry when adding a new application + $sQuery = "SELECT versionId FROM appVersion WHERE appVersion.appId = '".$_REQUEST['appId']."' AND appVersion.queued = 'true';"; + $hResult = query_appdb($sQuery); + if($hResult) + { + while($oRow = mysql_fetch_object($hResult)) + { + $oVersion = new Version($oRow->versionId); + $oVersion->delete(); + } + } } else if(is_numeric($_REQUEST['versionId'])) // version { $oVersion = new Version($_REQUEST['versionId']);