PROBLEM - Unable to delete private messages

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
espicom
Registered User
Posts: 17905
Joined: Wed Dec 22, 2004 1:14 am
Location: Woodstock, IL

Re: PROBLEM - Unable to delete private messages

Post by espicom » Sat Nov 29, 2008 5:47 pm

What version of the Attachment MOD do you have installed? Some versions are not compatible with PHP v5, and can have these symptoms. If you installed Attachments on the test board from the new code, it can respond differently than the old code.

I'd try replacing the attachment include files with the newest version...
Jeff
Fixing 1016/1030/1034 Errors | (obsolete link) | MySQL 4.1/5.x Client Error | phpBBv2 Logo in ACP
Support requests via PM are ignored!
"To be fully alive is to feel that everything is possible." - Eric Hoffer

brasoveanul
Registered User
Posts: 19
Joined: Wed Nov 26, 2008 6:19 pm

Re: PROBLEM - Unable to delete private messages

Post by brasoveanul » Sat Nov 29, 2008 6:04 pm

I have Attachment MOD 2.4.5, which is the most recent one I think. Am I wrong?

espicom
Registered User
Posts: 17905
Joined: Wed Dec 22, 2004 1:14 am
Location: Woodstock, IL

Re: PROBLEM - Unable to delete private messages

Post by espicom » Sat Nov 29, 2008 8:28 pm

Yes, 2.4.5 seems to be the newest out there, and it's what I have installed on my system, too... but I am not using PHP5, either.

When you delete the message, do you get a blank screen, or a "message deleted" screen that refreshes to your inbox again? Just after the attachment code's call to delete any attachments associated with the messages, is the code to actually delete the entries from the PM tables. If the program was dying in the attachment code, it would never reach that, and you'd only have a header displayed, maybe not even that.

Do you have access to the HTTP server logs, specifically the error logs? Watching them while trying to do the delete might reveal necessary information on why it is failing.
Jeff
Fixing 1016/1030/1034 Errors | (obsolete link) | MySQL 4.1/5.x Client Error | phpBBv2 Logo in ACP
Support requests via PM are ignored!
"To be fully alive is to feel that everything is possible." - Eric Hoffer

brasoveanul
Registered User
Posts: 19
Joined: Wed Nov 26, 2008 6:19 pm

Re: PROBLEM - Unable to delete private messages

Post by brasoveanul » Sat Nov 29, 2008 9:17 pm

Dear Jeff, it happens like this: I select the message or the messages, the number is not important, because the behavior is the same. I press the delete button, I am asked for confirmation, I press the YES button to confirm, right after that the forum screen goes back to the folder I was in previously, smoothly, no errors, nothing, and all the messages are displayed, including the ones that I have marked for deletion. I don't see any "message deleted" screen, but I haven't seen any in the vanilla phpBB 2.0.22 test forum that worked fine. If you want to see for yourself what exactly happens, I can create a test account for you, just let me know.

LE: I have access to the error log in cpanel, no error is generated there when trying to delete private messages.

brasoveanul
Registered User
Posts: 19
Joined: Wed Nov 26, 2008 6:19 pm

Re: PROBLEM - Unable to delete private messages

Post by brasoveanul » Sun Nov 30, 2008 10:21 pm

Any ideas in order to solve my issue? I took a look at the code that may generate problems, I pasted it in a previous post, I studied server logs for possible explanatory errors, everything seems to be fine, but the problem is always present, though. I am sure you, as experienced phpBB developers and PHP coders, can help me. So, please, help me. Just tell me what should I do or what information should I provide to you.

espicom
Registered User
Posts: 17905
Joined: Wed Dec 22, 2004 1:14 am
Location: Woodstock, IL

Re: PROBLEM - Unable to delete private messages

Post by espicom » Mon Dec 01, 2008 2:56 am

Well, that's the way it's supposed to look... (just went to one of my forums to test it). No error messages or log entries make it rather difficult to say how to proceed beyond this point...

Have tried backing up the current copy of privmsg.php, copying an unmodified one in from the distribution archive (no MODs installed), and seeing if it allows you to delete a PM? Don't do one with an attachment, just pick a regular PM and try deleting it. If that works, then there is something with the code in privmsg.php. If it still doesn't, try rebuilding the index on the two private message tables... It could be that MySQL is refusing the delete because the index is screwed up.
Jeff
Fixing 1016/1030/1034 Errors | (obsolete link) | MySQL 4.1/5.x Client Error | phpBBv2 Logo in ACP
Support requests via PM are ignored!
"To be fully alive is to feel that everything is possible." - Eric Hoffer

brasoveanul
Registered User
Posts: 19
Joined: Wed Nov 26, 2008 6:19 pm

Re: PROBLEM - Unable to delete private messages

Post by brasoveanul » Mon Dec 01, 2008 8:54 am

I used a vanilla privmsg.php and it works. indeed. So, the problem is in privmsg.php. Now, where should I look in privmsg.php to discover the error? I can attach my privmsg.php to a message here, if you want to take a look.

User avatar
ric323
Former Team Member
Posts: 22909
Joined: Tue Feb 06, 2007 12:33 am
Location: Melbourne, Australia
Name: Ric
Contact:

Re: PROBLEM - Unable to delete private messages

Post by ric323 » Mon Dec 01, 2008 9:09 am

Download a copy of WINMERGE and you can easily check what the differences are yourself. :)
The Knowledge Base contains solutions to many common problems!
How to fix "Doesn't have a default value" and "Incorrect string value: xxx for column 'post_text' " errors.
How to do a clean re-install of the latest phpBB3 version.
Problems with permissions? Read phpBB3 Permissions

brasoveanul
Registered User
Posts: 19
Joined: Wed Nov 26, 2008 6:19 pm

Re: PROBLEM - Unable to delete private messages

Post by brasoveanul » Mon Dec 01, 2008 9:52 am

It seems I fixed it...what I did: at line 701, relative to the vanilla privmsg.php file I had something like this:

Code: Select all

else if ($confirm) && $sid === $userdata['session_id'])
I just commented the

Code: Select all

&& $sid === $userdata['session_id']
part.

What is the role of this piece of code? Is it unsafe somehow for my forum to let it commented?

User avatar
ric323
Former Team Member
Posts: 22909
Joined: Tue Feb 06, 2007 12:33 am
Location: Melbourne, Australia
Name: Ric
Contact:

Re: PROBLEM - Unable to delete private messages

Post by ric323 » Mon Dec 01, 2008 9:55 am

It is a security measure to make sure other people cannot hijack your sessions.
If that was the problem, then you were missing a bit of code elsewhere that adds the session ID.
The Knowledge Base contains solutions to many common problems!
How to fix "Doesn't have a default value" and "Incorrect string value: xxx for column 'post_text' " errors.
How to do a clean re-install of the latest phpBB3 version.
Problems with permissions? Read phpBB3 Permissions

brasoveanul
Registered User
Posts: 19
Joined: Wed Nov 26, 2008 6:19 pm

Re: PROBLEM - Unable to delete private messages

Post by brasoveanul » Mon Dec 01, 2008 10:02 am

I took a look and I figured out that this was one code change from 2.0.22 to 2.0.23. It is very unlikely to miss setting the correct session id somewhere else, as I carefully conducted all the modifications. Yes, it seems this was the problem. Can I leave it like this?

espicom
Registered User
Posts: 17905
Joined: Wed Dec 22, 2004 1:14 am
Location: Woodstock, IL

Re: PROBLEM - Unable to delete private messages

Post by espicom » Tue Dec 02, 2008 2:56 am

Did you do all the template patches to ALL your styles? The value of $sid would be passed as a POST variable. If your template for the confirmation screen does not have the hidden variable for "sid", that would cause this...
Jeff
Fixing 1016/1030/1034 Errors | (obsolete link) | MySQL 4.1/5.x Client Error | phpBBv2 Logo in ACP
Support requests via PM are ignored!
"To be fully alive is to feel that everything is possible." - Eric Hoffer

brasoveanul
Registered User
Posts: 19
Joined: Wed Nov 26, 2008 6:19 pm

Re: PROBLEM - Unable to delete private messages

Post by brasoveanul » Tue Dec 02, 2008 9:33 am

I use only subSilver. I didi all the patches I was told to do in the modification. Where should I look, in what file, in order to fix this?

User avatar
ric323
Former Team Member
Posts: 22909
Joined: Tue Feb 06, 2007 12:33 am
Location: Melbourne, Australia
Name: Ric
Contact:

Re: PROBLEM - Unable to delete private messages

Post by ric323 » Tue Dec 02, 2008 9:52 am

ok, please check this:

Open

Code: Select all

./privmsg.php
Find

Code: Select all

    if ( !$confirm ) 
make sure it is followed by all four of these lines:

Code: Select all

    {
        $s_hidden_fields = '<input type="hidden" name="mode" value="' . $mode . '" />';
        $s_hidden_fields .= ( isset($HTTP_POST_VARS['delete']) ) ? '<input type="hidden" name="delete" value="true" />' : '<input type="hidden" name="deleteall" value="true" />';
        $s_hidden_fields .= '<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; 

open

Code: Select all

./templates/subSilver/confirm_body.tpl
make sure it contains this code

Code: Select all

        <td class="row1" align="center"><form action="{S_CONFIRM_ACTION}" method="post"><span class="gen"><br />{MESSAGE_TEXT}<br /><br />{S_HIDDEN_FIELDS}<input type="submit" name="confirm" value="{L_YES}" class="mainoption" />&nbsp;&nbsp;<input type="submit" name="cancel" value="{L_NO}" class="liteoption" /></span></form></td> 
The Knowledge Base contains solutions to many common problems!
How to fix "Doesn't have a default value" and "Incorrect string value: xxx for column 'post_text' " errors.
How to do a clean re-install of the latest phpBB3 version.
Problems with permissions? Read phpBB3 Permissions

brasoveanul
Registered User
Posts: 19
Joined: Wed Nov 26, 2008 6:19 pm

Re: PROBLEM - Unable to delete private messages

Post by brasoveanul » Tue Dec 02, 2008 10:59 am

I triple checked, and all of these pieces of code are present inside the appropriate files, exactly as you told me.

Locked

Return to “2.0.x Support Forum”