View Issue Details

IDProjectCategoryView StatusLast Update
0000284XMB1Bugspublic2010-01-23 18:18
Reportermiqrogroove Assigned Tomiqrogroove  
PriorityurgentSeveritymajorReproducibilitysometimes
Status closedResolutionfixed 
Product Version1.9.11 
Target Version1.9.11.02Fixed in Version1.9.11.02 
Summary0000284: Undefined Function Error in Post Editing
DescriptionWhen I go in to edit any post I get a Fatal Error on my forum

Fatal error: Call to undefined function: getsizeformatted() in post.php on line 1295
Steps To ReproduceDisable the attachment setting for any forum.
Try to edit any post inside that forum.
Additional Informationhttp://forums.xmbforum.com/viewthread.php?tid=774111
http://forums.xmbforum.com/viewthread.php?tid=774116
http://forums.xmbforum.com/viewthread.php?tid=774117
TagsNo tags attached.
MySQL Version
PHP Version
Web Server
Browser
Flags
Original ReporterSincere
SVN Revision1755

Relationships

related to 0000288 closedmiqrogroove Admins see textnothread on Attachments Panel links 

Activities

miqrogroove

2009-03-01 06:53

administrator   ~0000160

The attached patch adds a missing "if" statement to fix this bug.

miqrogroove

2009-03-01 09:22

administrator   ~0000162

"It works.
But when i delete a post i get a blanc screen again.
It doesn't go back to the topic, the post is deleted though."

2009-03-01 10:57

 

XMB-1.9.11-post-edit-issue284.patch.txt (1,764 bytes)   
Index: post.php
===================================================================
--- post.php	(revision 1745)
+++ post.php	(working copy)
@@ -1210,6 +1210,7 @@
 
                 $db->query("UPDATE ".X_PREFIX."posts SET message='$dbmessage', usesig='$usesig', bbcodeoff='$bbcodeoff', smileyoff='$smileyoff', icon='$posticon', subject='$dbsubject' WHERE pid=$pid");
             } else {
+                require_once('include/attach.inc.php');
                 $db->query("DELETE FROM ".X_PREFIX."posts WHERE pid=$pid");
                 $db->query("UPDATE ".X_PREFIX."members SET postnum=postnum-1 WHERE username='".$db->escape_var($orig['author'])."'");
                 deleteAllAttachments($pid);
@@ -1267,9 +1268,10 @@
 
             // Fill $attachment
             $attachment = '';
+            $files = array();
+            if ($forum['attachstatus'] == 'on') {
             $query = $db->query("SELECT a.aid, a.pid, a.filename, a.filetype, a.filesize, a.downloads, a.img_size, thumbs.aid AS thumbid, thumbs.filename AS thumbname, thumbs.img_size AS thumbsize FROM ".X_PREFIX."attachments AS a LEFT JOIN ".X_PREFIX."attachments AS thumbs ON a.aid=thumbs.parentid WHERE a.pid=$pid AND a.parentid=0");
             $counter = 0;
-            $files = array();
             while ($attach = $db->fetch_array($query)) {
                 $files[] = $attach;
                 $postinfo['aid'] = $attach['aid'];
@@ -1301,6 +1303,7 @@
                 eval('$attachment .= "'.template("post_attachmentbox").'";');
             }
             $db->free_result($query);
+            }
 
             //Allow sanitized message to pass-through to template in case of: #1 preview, #2 post error
             $subject = rawHTMLsubject($postinfo['subject']);

Issue History

Date Modified Username Field Change
2009-03-01 06:05 miqrogroove New Issue
2009-03-01 06:05 miqrogroove Original Reporter => Sincere
2009-03-01 06:13 miqrogroove Status new => assigned
2009-03-01 06:13 miqrogroove Assigned To => miqrogroove
2009-03-01 06:18 miqrogroove Reproducibility have not tried => sometimes
2009-03-01 06:18 miqrogroove Projection none => minor fix
2009-03-01 06:18 miqrogroove ETA none => < 1 day
2009-03-01 06:18 miqrogroove Target Version => 1.9.11.01
2009-03-01 06:18 miqrogroove Description Updated
2009-03-01 06:18 miqrogroove Steps to Reproduce Updated
2009-03-01 06:53 miqrogroove Note Added: 0000160
2009-03-01 06:54 miqrogroove File Added: XMB-1.9.11-post-edit-issue284.patch.txt
2009-03-01 07:11 miqrogroove SVN Revision => 1750
2009-03-01 07:11 miqrogroove Status assigned => resolved
2009-03-01 07:11 miqrogroove Resolution open => fixed
2009-03-01 07:11 miqrogroove Build => 1.9.11.00
2009-03-01 07:11 miqrogroove Fixed in Version => 1.9.11.01
2009-03-01 07:11 miqrogroove Additional Information Updated
2009-03-01 09:22 miqrogroove Note Added: 0000162
2009-03-01 09:22 miqrogroove Status resolved => feedback
2009-03-01 09:22 miqrogroove Resolution fixed => reopened
2009-03-01 09:26 miqrogroove Fixed in Version 1.9.11.01 =>
2009-03-01 09:26 miqrogroove Target Version 1.9.11.01 => 1.9.11.02
2009-03-01 10:39 miqrogroove Relationship added related to 0000288
2009-03-01 10:57 miqrogroove File Deleted: XMB-1.9.11-post-edit-issue284.patch.txt
2009-03-01 10:57 miqrogroove File Added: XMB-1.9.11-post-edit-issue284.patch.txt
2009-03-01 10:58 miqrogroove SVN Revision 1750 => 1755
2009-03-01 10:58 miqrogroove Status feedback => resolved
2009-03-01 10:58 miqrogroove Fixed in Version => 1.9.11.02
2009-03-01 10:58 miqrogroove Resolution reopened => fixed
2010-01-23 18:18 miqrogroove Status resolved => closed