Alexander Nicolaysen Sørnes : url: Fix moving to a new version
Module: appdb Branch: master Commit: 8be4e24864a190c5885f8d730fba1c07a9d3e37c URL: http://source.winehq.org/git/appdb.git/?a=commit;h=8be4e24864a190c5885f8d730... Author: Alexander Nicolaysen Sørnes <alex(a)thehandofagony.com> Date: Thu Jul 23 15:33:47 2009 +0200 url: Fix moving to a new version --- include/url.php | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/include/url.php b/include/url.php index 93e11ae..0419168 100644 --- a/include/url.php +++ b/include/url.php @@ -138,6 +138,10 @@ class Url { if(!$this->iUrlId) return FALSE; + $oUrl = new url($this->iUrlId); + + if($this->iVersionId && !$iVersionId) + $iVersionId = $this->iVersionId; $sWhatChanged = ""; @@ -159,7 +163,7 @@ class Url { $this->sUrl = $sUrl; } - if ($iVersionId && $iVersionId!=$this->iVersionId) + if ($iVersionId && $iVersionId!=$oUrl->iVersionId) { if (!query_parameters("UPDATE appData SET versionId = '?' WHERE id = '?'", $iVersionId, $this->iUrlId)) @@ -519,8 +523,10 @@ class Url { public function objectSetParent($iNewId, $sClass = '') { - $oAppData = new appData($this->iUrlId, null, $this); - return $oAppData->objectSetParent($iNewId, $sClass); + if($this->iVersionId) + $this->iVersionId = $iNewId; + else + $this->iAppId = $iNewId; } function objectGetChildren($bIncludeDeleted = false)
participants (1)
-
Alexander Nicolaysen Sørnes