News:

Wondering if this will always be free?  See why free is better.

Main Menu

Cannot delete topic (RC2)

Started by Simon9863, December 31, 2005, 06:43:50 PM

Previous topic - Next topic

Kuzmitch

Solved! I have searched through all files which include "attachmentType" and fixed slashes. Now it works!

JayBachatero

JahaS you forgot to change this one.

        // Delete attachment(s) if they exist.
        require_once($sourcedir . '/ManageAttachments.php');
        removeAttachments('a.attachmentType = 0 AND a.ID_MSG = ' . $message);  <====
    }
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

MadPax

Well thnx guys for the help and Xenovanis to point me here.

I did solve my problem apparantely, but I would really like to have a precise list of files and lines to alter in order to not to have any flaws in the future before doing this on my live site.

Anyone know exactly? I think this would serve other not so sure user types.

Thanx in advance,
Pax

tethead

i'm having the same problem, so i did the fix in the RemoveTopic.php but still had other problems with Subs.php so i just disabled attachments on our boards until further notice. 

can somebody please post an exact list of the files that need to be changed as a workaround to this MySQL bug, and what needs to be changed?

guess i should have read here before upgrading from MySQL 4.x to 5.x
week4paug.net - a website for all things PHiSH

JayBachatero

Did you edit both places that you had to edit?  That link that you are searching for comes out twice in that file.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

tethead

it fails at line 419 of Subs.php , and i don't see anything dealing with attachments to edit around that... 

if you can please provide details for a semi-n00b on which files to change and what to change, i'd be very much appreciative!
week4paug.net - a website for all things PHiSH

tethead

btw, i'm running version 5.0.19 or MySQL and SMF 1.1 RC2 on a Debian (Sarge) server. 
week4paug.net - a website for all things PHiSH

JayBachatero

Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Simon9863

Hmm, I upgraded to mysql 5.0.20 today and suddenly I can delete and modify again without problems.
Hopefully this bug has been solved, even though the MySQL bug report doesn't say this has been fixed.
Can anyone else having this problem verify that the bug has gone away with 5.0.20 ?

If so, then i'll add that to the bug submission at mySQL and close the report.

Thanks
Regards
Simon

tiko

Simon, after reading your post I upgraded my mysql installation to 5.0.20 as well.  I can confirm that the problem is gone using 5.0.20 (RC2 w/ most recent patch).

tethead

week4paug.net - a website for all things PHiSH

Tikkas

I have the same problem. I fixed the reomovetopic and it worked fine after that.

Today however I wanted to edit a reply with and attach in it and got the same thing.
So I looked for the code in Post.php and changed it there too:

removeAttachments('a.attachmentType = '/0/' AND a.ID_MSG = ' . (int) $_REQUEST['msg'] . ' AND a.ID_ATTACH NOT IN (' . implode(', ', $del_temp) . ')');

That fixed the problem.

Just thought I would share it  ;)

cheers

Tikkas

Prime_8

this code will cause your forum to remove all attachments
Quote from: Tikkas on May 10, 2006, 06:10:21 AM
removeAttachments('a.attachmentType = '/0/' AND a.ID_MSG = ' . (int) $_REQUEST['msg'] . ' AND a.ID_ATTACH NOT IN (' . implode(', ', $del_temp) . ')');

to fix simply use teh patter set  in earlier post
removeAttachments('a.attachmentType = \'0\' AND a.ID_MSG = ' . (int) $_REQUEST['msg'] . ' AND a.ID_ATTACH NOT IN (' . implode(', ', $del_temp) . ')');

see the diff ?

this will alow for safe removal of  an attachment from just the one post you are editing not every post in the forum .  ;)


mimicria

I have some messages about server down and lost connection with mysql

I use Mysql 5.0.18 and php 5 on linux server on SuSe 10.1 (SMF 1.1 RC2)

After reading some post on this site a solve all problems with my forum. Thanks for all authors !

You can solve problems:

Changing in ManageAttachments.php, Removetopics.php and maybe in other files ...

a.attachmentType = 0 AND m.ID_TOPIC

to

a.attachmentType = \'0\' AND m.ID_TOPIC

and changing in Removetopics.php (in my file line 557)

LEFT JOIN {$db_prefix}attachments AS thumb_parent ON (a.attachmentType = 3 AND thumb_parent.ID_THUMB = a.ID_ATTACH)

with no sumbols (') !

to
LEFT JOIN {$db_prefix}attachments AS thumb_parent ON (a.attachmentType = '3' AND thumb_parent.ID_THUMB = a.ID_ATTACH)

mxw65

Quote from: Grudge on January 01, 2006, 01:28:17 PM

removeAttachments('a.attachmentType = '0' AND m.ID_TOPIC ' . $condition, 'messages');

To:

removeAttachments('a.attachmentType = \'0\' AND m.ID_TOPIC ' . $condition, 'messages');


Thanks a million. This fix worked for me as well.

auroris

Same problem here; the issues were that I could not edit a post containing an attachment and could not remove a topic. Grudge's fix worked. I am running Simplemachines 1.1.1; MySQL 5.1.6 on FreeBSD 6; PHP 5.2.0.

As an aside, an unmodified install of Simple Machines 1.0.10 on the same server using has no problems with attachments whatsoever.

HakTom

I can confirm this too.

running SMF 1.1.1, Mysql 5.0.18 on Debian, PHP 4.3.10

rulaman

Quote from: Grudge on January 01, 2006, 01:28:17 PM
Simon,

I've fixed it, but I think this *may* actually be a bug with the MySQL you are running. I basically worked around it. It was actually an attachments query which was failing. Whenever using WHERE attachmentType = in the query, it lost connection to the server. I fixed it by changing these lines in RemoveTopic.php:

removeAttachments('a.attachmentType = '0' AND m.ID_TOPIC ' . $condition, 'messages');


To:

removeAttachments('a.attachmentType = \'0\' AND m.ID_TOPIC ' . $condition, 'messages');


However, that should NOT be needed, it's effectively casting the 0 as a string, although attachmentType is an integer - very, very odd.

Grudge

EDIT:  You need to make these changes to Post.php file.
Find a.attachmentType = 0
Replace a.attachmentType = \'0\'


I had the same problem with my SMF 1.1.4.

Thanks for this workaround, it works fine ! ;)

Advertisement: