Skip to main content
Topic: Post Warning Drops Post Body (Read 3412 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Post Warning Drops Post Body

So today I was posting a message and again someone posted while I was.  This time when the page came back to me the entire body of the message was gone.  That's pretty darn annoying.

Similar to the subject bug I would guess.

This was using the master pulled late friday.

Re: Post Warning Drops Post Body

Reply #1

Also seems to drop the body when in QR and you hit preview, you see the preview and the body is gone ... well at least you can cut and paste from the preview in that case :D

Re: Post Warning Drops Post Body

Reply #2

This is the commit that is causing the problems.

http://www.elkarte.net/community/index.php?action=post;topic=1354.0;last_msg=9183

getFormMsgSubject seems the wrong call as it overwrites the message with '' many times when it clearly shouldn't.

It was put in because the subject was disappearing again.

http://www.elkarte.net/community/index.php?topic=1320.0

ETA:  To clarify, when I said getFormMsgSubject is filling the message with '' when it shouldn't I mean in the context of this one call to it.
Last Edit: April 13, 2014, 05:55:46 pm by scripple

Re: Post Warning Drops Post Body

Reply #3

 emanuele invokes the master or censorship: can you please cover any term I would like to say now? O:-)

I hate that f*****ing function (method) that is post (and post2 as well).
It's impossible, every time something is changed there, something else breaks. DARN!!!!!
Last Edit: April 18, 2014, 03:04:04 am by emanuele
Bugs creator.
Features destroyer.
Template killer.

Re: Post Warning Drops Post Body

Reply #4

For my active forum I put in a terrible kludge to store the returns from getFormMsgSubject in temp variables and only overwrite the actual form variables if they are empty.

Re: Post Warning Drops Post Body

Reply #5

At the moment I can't test it, could you please try replacing the code of my commit with:
Code: [Select]
			elseif (isset($_REQUEST['last_msg']) && $form_subject, === '')
list ($form_subject, ) = getFormMsgSubject(false, $topic, $first_subject);
It may work, but TBH I have no idea if it fixes all the possible paths or not.

Well, that piece of code is still pretty ugly, so not a biggie adding more ugly code... lol (well, not really but okay).

@Spuds Y U NO USE DRAFTS!?
Bugs creator.
Features destroyer.
Template killer.

Re: Post Warning Drops Post Body

Reply #6

Quote from: emanuele –
 emanuele invokes the mast or censorship: can you please cover any term I would like to say now? O:-)

I hate that f*****ing function (method) that is post (and post2 as well).
It's impossible, every time something is changed there, something else breaks. DARN!!!!!
Yup ... there are so many paths in and out of those two functions, a true mess, I hate messing around with it as well.
Quote from: emanuele – At the moment I can't test it, could you please try replacing the code of my commit with:
Code: [Select]
			elseif (isset($_REQUEST['last_msg']) && $form_subject, === '')
list ($form_subject, ) = getFormMsgSubject(false, $topic, $first_subject);
It may work, but TBH I have no idea if it fixes all the possible paths or not.

Well, that piece of code is still pretty ugly, so not a biggie adding more ugly code... lol (well, not really but okay).

@Spuds Y U NO USE DRAFTS!?
I just press all the buttons that are presented to me to see what they do, sometimes they even post !

Re: Post Warning Drops Post Body

Reply #7

Well I had a nice reply written until spuds posted before me.  :P

But drop the extra comma after form_subject in the if clause and it's working for the test I've been doing.  At least we know this one can't overwrite the message body.  :)

Re: Post Warning Drops Post Body

Reply #8

Your welcome :P

With the first parameter to getFormMsgSubject being false it looks like it returns an array so the , should be there I would think, then again it would help if I looked at how things were being used !

Re: Post Warning Drops Post Body

Reply #9

Quote from: Spuds –
Quote from: emanuele –
 emanuele invokes the mast or censorship: can you please cover any term I would like to say now? O:-)

I hate that f*****ing function (method) that is post (and post2 as well).
It's impossible, every time something is changed there, something else breaks. DARN!!!!!
Yup ... there are so many paths in and out of those two functions, a true mess, I hate messing around with it as well.
As soon as I rebase for the third time the love_for_search branch, I'll try to destroy that piece of code too... :scared: <= imagine here a face like http://stream1.gifsoup.com/view/294143/scared-o.gif
Bugs creator.
Features destroyer.
Template killer.

Re: Post Warning Drops Post Body

Reply #10

Is that you when doing the work -or- everyone else when you are done :P :P

I agree 100% that function needs to be broken down in to chunks, tiss an ill behaved monster!
Last Edit: April 16, 2014, 09:53:10 am by Spuds

Re: Post Warning Drops Post Body

Reply #11

We are just coder not good enough, SMF's one is more complex than this and nobody complains! :P
Bugs creator.
Features destroyer.
Template killer.

Re: Post Warning Drops Post Body

Reply #12

AFAIR this should be fixed and committed.
Bugs creator.
Features destroyer.
Template killer.