From 982dc97756e75be2ff09b27f99976c097af3ee03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Nicolaysen=20S=C3=B8rnes?= Date: Tue, 24 Apr 2007 23:38:41 +0000 Subject: [PATCH] Always read input first in downloadurl::outputEditorSingle(). Makes sure changes aren't lost when reloading the form due to input errors --- include/downloadurl.php | 12 +++++++----- include/version_queue.php | 2 ++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/include/downloadurl.php b/include/downloadurl.php index 9631f90..2223b89 100644 --- a/include/downloadurl.php +++ b/include/downloadurl.php @@ -224,7 +224,12 @@ class downloadurl /* Output an editor for a single new URL */ function outputEditorSingle($iVersionId = NULL, $aValues = NULL) { - if($iVersionId) + if($aValues["sDownloadUrlUrl"] && + $aValues["sDownloadUrlDescription"]) + { + $sDownloadUrlUrl = $aValues["sDownloadUrlUrl"]; + $sDownloadUrlDescription = $aValues["sDownloadUrlDescription"]; + } else if($iVersionId) { if($hResult = appData::getData($iVersionId, "downloadurl", TRUE, TRUE)) @@ -233,12 +238,9 @@ class downloadurl $sDownloadUrlUrl = $oRow->url; $sDownloadUrlDescription = $oRow->description; } - } else - { - $sDownloadUrlUrl = $aValues["sDownloadUrlUrl"]; - $sDownloadUrlDescription = $aValues["sDownloadUrlDescription"]; } + $sReturn .= html_frame_start("Download URL","90%"); $sReturn .= html_table_begin(""); diff --git a/include/version_queue.php b/include/version_queue.php index 7511f67..66ef456 100644 --- a/include/version_queue.php +++ b/include/version_queue.php @@ -71,6 +71,8 @@ class version_queue function outputEditor() { + global $aClean; + /* Display duplicate list if this is a an existing version */ if($this->oVersion->iVersionId) $this->displayMoveTestTable();