Author: dgoette
Date: Fri May 29 21:12:38 2009
New Revision: 425
URL:
http://svn.reactos.org/svn/reactos?rev=425&view=rev
Log:
catch an error to prevent useless data in the database
Modified:
branches/danny-web/www/www.reactos.org/roscms/lib/backend/Backend_SaveDraft…
Modified:
branches/danny-web/www/www.reactos.org/roscms/lib/backend/Backend_SaveDraft…
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/r…
==============================================================================
---
branches/danny-web/www/www.reactos.org/roscms/lib/backend/Backend_SaveDraft…
[iso-8859-1] (original)
+++
branches/danny-web/www/www.reactos.org/roscms/lib/backend/Backend_SaveDraft…
[iso-8859-1] Fri May 29 21:12:38 2009
@@ -83,7 +83,7 @@
$stmt->execute();
$stable = $stmt->fetchColumn();
- if ($stable !== false) {
+ if ($stable !== false && $rev_id !== false) {
// transfer from stable entry
Tag::mergeFromRevision($stable, $rev_id);
@@ -102,6 +102,11 @@
$stmt=&DBConnection::getInstance()->prepare("DELETE FROM
".ROSCMST_TEXT." WHERE rev_id = :rev_id");
$stmt->bindParam('rev_id',$rev_id,PDO::PARAM_INT);
$stmt->execute();
+ }
+
+ if ($rev_id === false) {
+ echo 'Error while saving new draft';
+ return;
}
// insert/update short text