[geeklog-cvs] geeklog: Fixed replacing the [imageX] tags when changing a story...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sat Jan 29 09:31:20 EST 2011


changeset 8080:e7269564603f
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/e7269564603f
user: Dirk Haun <dirk at haun-online.de>
date: Sat Jan 29 14:18:20 2011 +0100
description:
Fixed replacing the [imageX] tags when changing a story's id (bug #0001256)

diffstat:

 system/classes/story.class.php |  13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diffs (23 lines):

diff -r a6e259d6ff3f -r e7269564603f system/classes/story.class.php
--- a/system/classes/story.class.php	Sat Jan 29 12:47:11 2011 +0100
+++ b/system/classes/story.class.php	Sat Jan 29 14:18:20 2011 +0100
@@ -1108,9 +1108,16 @@
         $body = $this->_bodytext;
         $fulltext = "$intro $body";
 
-        $result = DB_query("SELECT ai_filename FROM {$_TABLES['article_images']} WHERE "
-                            ."ai_sid = '{$this->_sid}' ORDER BY ai_img_num"
-                          );
+        // check if we have a (different) old sid - the article_images table
+        // will only be updated later! cf. bug #0001256
+        if (! empty($this->_originalSid) &&
+                ($this->_sid != $this->_originalSid)) {
+            $ai_sid = $this->_originalSid;
+        } else {
+            $ai_sid = $this->_sid;
+        }
+
+        $result = DB_query("SELECT ai_filename FROM {$_TABLES['article_images']} WHERE ai_sid = '{$ai_sid}' ORDER BY ai_img_num");
         $nrows = DB_numRows($result);
         $errors = array();
         $stdImageLoc = true;



More information about the geeklog-cvs mailing list