Advertisement:

Author Topic: [2.0.12] Cannot post tables in messages anymore due to [h r] in table  (Read 17083 times)

Offline @rjen

  • Jr. Member
  • **
  • Posts: 171
  • Gender: Male
    • FJR-club Nederland
Yesterday I patched my forum to version 2.0.12. All looked fine, but now I get reports from users that they are having problems updating posts made previously that contain certain tables.

When updating these posts, the system incorrectly issues the message:

Quote
The following error or errors occurred while posting this message:
The message body was left empty.

I reverted back to 2.0.11 and the problem is gone. Now I tried to post the same data on this forum and it has the same problem!
I did some tests to find that the version 2.0.12 does not allow me to use a horizontal line ( [h r] ) inside a table cell. It immediately throws above error message and I cannot save the post.

This works:

Member(s)
NameNicknameCity
Persons
Motorcycles
Member1column 1column 2


This does NOT work:
(I put spaces in the bbc code for it to display)

Member(s)
[h r]Name[h r][h r]Nickname[h r][h r]City[h r][h r]Persons[h r][h r]Motorcycles[h r]
Membercolumn 1column 2

This used to work fine in 2.0.11... (see attachment), any fix?

Yopu can just try to post below table code in a message here, same problem...
Code: [Select]
[table]
[tr][td]Member(s)[/td][/tr]
[tr][td][h r][b]Name[/b][hr][/td][td][hr][b]Nickname[/b][hr][/td][td][hr][b]City[/b][hr][/td][td][hr][b]Persons[/b][hr][/td][td][hr][b]Motorcycles[/b][hr][/td][/tr]
[tr][td]Member[/td][td]column 1[/td][td]column 2[/td][/tr]
[/table]
Running SMF 2.0 with Tinyportal 1.3R at www.fjr-club.nl
Testing SMF 2.1 beta 3 with Tinyportal 2.0 at http://test2.fjr-club.nl/

Offline Antes

  • Evil Black Cat
  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,646
  • Gender: Male
  • Black cat rulz!
    • Antes on GitHub
    • merta on LinkedIn
    • @antesistan on Twitter
    • Lunarfall
Re: [2.0.12] Cannot post tables in messages anymore due to [h r] in table
« Reply #1 on: September 28, 2016, 09:00:26 AM »
Unfortunately, I can't reproduce this issue on my localhost.

I can paste the code, then edit the post with both quick edit & normal edit.
Active Project(s): [ SimpleDesk ] # [ Lunarfall ] # [ CoreStore ]

Past Project(s): [ ezPortal ]

Offline @rjen

  • Jr. Member
  • **
  • Posts: 171
  • Gender: Male
    • FJR-club Nederland
Re: [2.0.12] Cannot post tables in messages anymore due to [h r] in table
« Reply #2 on: September 28, 2016, 09:35:39 AM »
Grrr, I thought I nailed it, find attached a piece of code that WILL give the issue
Running SMF 2.0 with Tinyportal 1.3R at www.fjr-club.nl
Testing SMF 2.1 beta 3 with Tinyportal 2.0 at http://test2.fjr-club.nl/

Offline Antes

  • Evil Black Cat
  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,646
  • Gender: Male
  • Black cat rulz!
    • Antes on GitHub
    • merta on LinkedIn
    • @antesistan on Twitter
    • Lunarfall
Re: [2.0.12] Cannot post tables in messages anymore due to [h r] in table
« Reply #3 on: September 28, 2016, 09:46:37 AM »
Actually this also effects SMF 2.1.
Active Project(s): [ SimpleDesk ] # [ Lunarfall ] # [ CoreStore ]

Past Project(s): [ ezPortal ]

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 55,098
  • Gender: Male
    • Kindred-999 on GitHub
Re: [2.0.12] Cannot post tables in messages anymore due to [h r] in table
« Reply #4 on: September 28, 2016, 09:48:32 AM »
Deelnemer(s)

Naam


Forum naam


Woonplaats


Personen


Motoren

Martin Smitikke127Den Haag21
Martin WiegersM@rtinAmersfoort11
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline @rjen

  • Jr. Member
  • **
  • Posts: 171
  • Gender: Male
    • FJR-club Nederland
Re: [2.0.12] Cannot post tables in messages anymore due to [h r] in table
« Reply #5 on: September 28, 2016, 09:49:12 AM »
Actually this also effects SMF 2.1.


Interesting, but it Does work in 2.0.11.

It seems it may not be the [h r] bbc code that causes it? But what does?
Can you tell me what exactly is the problem? Can I work around it somehow?
Running SMF 2.0 with Tinyportal 1.3R at www.fjr-club.nl
Testing SMF 2.1 beta 3 with Tinyportal 2.0 at http://test2.fjr-club.nl/

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 55,098
  • Gender: Male
    • Kindred-999 on GitHub
Re: [2.0.12] Cannot post tables in messages anymore due to [h r] in table
« Reply #6 on: September 28, 2016, 09:49:34 AM »
Seems to work here....  ???
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Antes

  • Evil Black Cat
  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,646
  • Gender: Male
  • Black cat rulz!
    • Antes on GitHub
    • merta on LinkedIn
    • @antesistan on Twitter
    • Lunarfall
Re: [2.0.12] Cannot post tables in messages anymore due to [h r] in table
« Reply #7 on: September 28, 2016, 09:51:06 AM »
Seems to work here....  ???

Compare the code they are different.

Actually this also effects SMF 2.1.


Interesting, but it Does work in 2.0.11.

It seems it may not be the [h r] bbc code that causes it? But what does?
Can you tell me what exactly is the problem? Can I work around it somehow?

Are you sure SMF was not fixing the output in 2.0.11 ? (like trimming empty td tags etc...), which is what it does with the Kindred's post above.
Active Project(s): [ SimpleDesk ] # [ Lunarfall ] # [ CoreStore ]

Past Project(s): [ ezPortal ]

Offline @rjen

  • Jr. Member
  • **
  • Posts: 171
  • Gender: Male
    • FJR-club Nederland
Re: [2.0.12] Cannot post tables in messages anymore due to [h r] in table
« Reply #8 on: September 28, 2016, 09:52:18 AM »
Did you try the code I posted?

What did you change?
Running SMF 2.0 with Tinyportal 1.3R at www.fjr-club.nl
Testing SMF 2.1 beta 3 with Tinyportal 2.0 at http://test2.fjr-club.nl/

Offline sǝๅqɯɐɥS

  • SMF Hero
  • ******
  • Posts: 4,509
  • Gender: Male
    • i30 Owners Club
Re: [2.0.12] Cannot post tables in messages anymore due to [h r] in table
« Reply #9 on: September 28, 2016, 10:34:38 AM »
I'm guessing it doesn't like the look of the first unclosed [center] tag

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 55,098
  • Gender: Male
    • Kindred-999 on GitHub
Re: [2.0.12] Cannot post tables in messages anymore due to [h r] in table
« Reply #10 on: September 28, 2016, 10:41:41 AM »
Deelnemer(s)

Naam

Forum naam

Woonplaats

Personen


Motoren

Martin Smitikke127Den Haag
2
1
Martin WiegersM@rtinAmersfoort
1
1

yup... closing all the center tags makes it work

Code: [Select]
[table]
[tr][td]Deelnemer(s)[/td][/tr]
[tr][td][hr][b]Naam[/b][hr][/td][td][hr][b]Forum naam[/b][hr][/td][td][hr][b]Woonplaats[/b][hr][/td][td][hr][center][b]Personen[/b][/center][hr][/td][td][hr][center][b]Motoren[/b][/center][hr][/td][/tr]
[tr][td]Martin Smit[/td][td]ikke127[/td][td]Den Haag[/td][td][center]2[/center][/td][td][center]1[/center][/td][/tr]
[tr][td]Martin Wiegers[/td][td]M@rtin[/td][td]Amersfoort[/td][td][center]1[/center][/td][td][center]1[/center][/td][/tr]
[/table]
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline @rjen

  • Jr. Member
  • **
  • Posts: 171
  • Gender: Male
    • FJR-club Nederland
Re: [2.0.12] Cannot post tables in messages anymore due to [h r] in table
« Reply #11 on: September 28, 2016, 10:46:47 AM »
Deelnemer(s)

Naam

Forum naam

Woonplaats

Personen


Motoren

Martin Smitikke127Den Haag
2
1
Martin WiegersM@rtinAmersfoort
1
1

Looks like you are right. Now the question is: is this 'expected' behaviour?

Why does 2.0.12 all of a sudden consider this an issue? And more importantly: it may not be good form to not close these tags, but is the error:

Quote
The following error or errors occurred while posting this message:
The message body was left empty.

the correct response?  Let's put it this way: It will be hard to explain this behaviour to my users...  :-\
Running SMF 2.0 with Tinyportal 1.3R at www.fjr-club.nl
Testing SMF 2.1 beta 3 with Tinyportal 2.0 at http://test2.fjr-club.nl/

Offline Antes

  • Evil Black Cat
  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,646
  • Gender: Male
  • Black cat rulz!
    • Antes on GitHub
    • merta on LinkedIn
    • @antesistan on Twitter
    • Lunarfall
Re: [2.0.12] Cannot post tables in messages anymore due to [h r] in table
« Reply #12 on: September 28, 2016, 11:07:32 AM »
Its expected, but your code has invalid bbc usage (no closure for center tag). Try to post with fixing those center tags.
Active Project(s): [ SimpleDesk ] # [ Lunarfall ] # [ CoreStore ]

Past Project(s): [ ezPortal ]

Offline @rjen

  • Jr. Member
  • **
  • Posts: 171
  • Gender: Male
    • FJR-club Nederland
Re: [2.0.12] Cannot post tables in messages anymore due to [h r] in table
« Reply #13 on: September 28, 2016, 11:09:58 AM »
Quote
Its expected, but your code has invalid bbc usage (no closure for center tag). Try to post with fixing those center tags.

I already did in my previous post, but that does not answer my question: the error does not explain what is wrong: users will NOT understand what they did wrong...


Actually this also effects SMF 2.1.

I just tested this in my SMF 2.1 beta 2 test forum: and it works fine there.
Are you referring to the beta 3 version?
Running SMF 2.0 with Tinyportal 1.3R at www.fjr-club.nl
Testing SMF 2.1 beta 3 with Tinyportal 2.0 at http://test2.fjr-club.nl/

Offline Antes

  • Evil Black Cat
  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,646
  • Gender: Male
  • Black cat rulz!
    • Antes on GitHub
    • merta on LinkedIn
    • @antesistan on Twitter
    • Lunarfall
Re: [2.0.12] Cannot post tables in messages anymore due to [h r] in table
« Reply #14 on: September 28, 2016, 11:16:06 AM »
Quote
Its expected, but your code has invalid bbc usage (no closure for center tag). Try to post with fixing those center tags.

I already did in my previous post, but that does not answer my question: the error does not explain what is wrong: users will NOT understand what they did wrong...


Actually this also effects SMF 2.1.

I just tested this in my SMF 2.1 beta 2 test forum: and it works fine there.
Are you referring to the beta 3 version?

Its not telling user which BBC breaking the post, its too techy for me if it should be (or it can be). If you are talking about fixed version yes, it shouldn't be creating error on SMF 2.1 as well.
Active Project(s): [ SimpleDesk ] # [ Lunarfall ] # [ CoreStore ]

Past Project(s): [ ezPortal ]

Offline @rjen

  • Jr. Member
  • **
  • Posts: 171
  • Gender: Male
    • FJR-club Nederland
Re: [2.0.12] Cannot post tables in messages anymore due to [h r] in table
« Reply #15 on: September 28, 2016, 11:23:40 AM »
Quote
Its not telling user which BBC breaking the post,

Indeed, it is actually not telling the user that something is wrong with the bbc at all: it is telling the user the message text is missing, which they clearly see on their screen in front of them, so the next step is informing the administrator that they have an incorrect error message...

 :'(
Running SMF 2.0 with Tinyportal 1.3R at www.fjr-club.nl
Testing SMF 2.1 beta 3 with Tinyportal 2.0 at http://test2.fjr-club.nl/

Offline @rjen

  • Jr. Member
  • **
  • Posts: 171
  • Gender: Male
    • FJR-club Nederland
Re: [2.0.12] Cannot post tables in messages anymore due to [h r] in table
« Reply #16 on: September 28, 2016, 01:04:22 PM »
It's strange. I have been playing a bit with these tables, and the problem is fixed by just adding one character in the first line in one of the empty cells that have a [ center] div. No matter which... 
Running SMF 2.0 with Tinyportal 1.3R at www.fjr-club.nl
Testing SMF 2.1 beta 3 with Tinyportal 2.0 at http://test2.fjr-club.nl/

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 55,098
  • Gender: Male
    • Kindred-999 on GitHub
Re: [2.0.12] Cannot post tables in messages anymore due to [h r] in table
« Reply #17 on: September 28, 2016, 03:16:54 PM »
probably....   empty BBC tags have been known to cause issues with the "no message body" error in some other cases...
(a message with nothing but an img BBC tag used to trigger exactly what error... so it is possible that this is related)

those center tags SHOULD be closed - otherwise it's not proper code anyway... :P
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Suki

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 15,084
  • Kaizoku Jotei
    • MissAllSunday on GitHub
    • SMF mods
Re: [2.0.12] Cannot post tables in messages anymore due to [h r] in table
« Reply #18 on: September 28, 2016, 07:00:51 PM »
This should be the effect of not allowing empty BBC tags.

Unfortunately,  give a more accurate error response is somehow difficult,  the parser isn't actually checking for malformed BBC  tags but rather your BBC example is triggering the empty BBC check.
Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline Brettflan

  • Full Member
  • ***
  • Posts: 496
  • Gender: Male
    • TaleWorlds Forum
Re: [2.0.12] Cannot post tables in messages anymore due to [h r] in table
« Reply #19 on: September 29, 2016, 12:33:42 AM »
This problem popped up for our forum due to the 2.0.12 upgrade as well, and I can say that it's absolutely not just related to hr tags. I can provide another very specific example which triggers it for some reason. I've pared it down a bit from the example provided to me by a user.
"nobbc" tags are used below since they prevent the bug from triggering, where code tags don't.

This will result in a completely empty post ("Announcements" doesn't even appear, nor anything else you might also have in the post):

[center][table][tr][td][img]http://farm6.static.flickr.com/5188/5620582193_07207bc789_o.png[/img][/td][/tr][/table][/center]
[center][size=20pt][font=Arial]Announcements[/font][/size][/center]

Removing just the closing center tag from the top part lets it display:

[center][table][tr][td][img]http://farm6.static.flickr.com/5188/5620582193_07207bc789_o.png[/img][/td][/tr][/table]
[center][size=20pt][font=Arial]Announcements[/font][/size][/center]


Of course also removing the opening center tag on the second line would then leave it working and with valid opening and closing tags, but that's beside the point of there being a strange bug at work in the empty message detection.
Removing or changing most of the other tags also renders it as working, for example the size or font tags on the second line, or replacing the lone image in the top table with text.

There are other seemingly random instances where our users are running into the same problem with other BBCode layouts.
For now I've simply disabled this line of code which was added to Subs-Post.php by the 2.0.12 update, as a crappy workaround until a proper fix is available:
Code: [Select]
// Remove empty bbc.
$message = preg_replace('~\[([^\]=\s]+)[^\]]*\](?' . '>\s|(?R))*?\[/\1\]\s?~i', '', $message);