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:
QuoteThe 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) | | |
Name | Nickname | City | Persons | Motorcycles |
Member1 | column 1 | column 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] |
Member | column 1 | column 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...
[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]
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.
Grrr, I thought I nailed it, find attached a piece of code that WILL give the issue
Actually this also effects SMF 2.1.
Deelnemer(s) | |
Naam
|
Forum naam
|
Woonplaats
|
Personen
|
Motoren
|
Martin Smit | ikke127 | Den Haag | 2 | 1 |
Martin Wiegers | M@rtin | Amersfoort | 1 | 1 |
Quote from: Antes on September 28, 2016, 09:46:37 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?
Seems to work here.... ???
Quote from: Kindred on September 28, 2016, 09:49:34 AM
Seems to work here.... ???
Compare the code they are different.
Quote from: @rjen on September 28, 2016, 09:49:12 AM
Quote from: Antes on September 28, 2016, 09:46:37 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?
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.
Did you try the code I posted?
What did you change?
I'm guessing it doesn't like the look of the first unclosed [center] tag
Deelnemer(s) |
Naam
| Forum naam
| Woonplaats
|
Personen
|
Motoren
|
Martin Smit | ikke127 | Den Haag | 2 | 1 |
Martin Wiegers | M@rtin | Amersfoort | 1 | 1 |
yup... closing all the center tags makes it work
[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]
Deelnemer(s) |
Naam
| Forum naam
| Woonplaats
|
Personen
|
Motoren
|
Martin Smit | ikke127 | Den Haag | 2 | 1 |
Martin Wiegers | M@rtin | Amersfoort | 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:
QuoteThe 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... :-\
Its expected, but your code has invalid bbc usage (no closure for center tag). Try to post with fixing those center tags.
QuoteIts 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...
Quote from: Antes on September 28, 2016, 09:46:37 AM
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?
Quote from: @rjen on September 28, 2016, 11:09:58 AM
QuoteIts 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...
Quote from: Antes on September 28, 2016, 09:46:37 AM
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.
QuoteIts 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...
:'(
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...
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
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.
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:
// Remove empty bbc.
$message = preg_replace('~\[([^\]=\s]+)[^\]]*\](?' . '>\s|(?R))*?\[/\1\]\s?~i', '', $message);
Please guys fix it, this bug is really annoying us, at our forums we can't even update things.
I've tested this yesterday and I confirm it's from the table BBC.
this is not a bug. it is intentional and there is nothing to be fixed
correct your BBC and it will all be correct.
The reason you are seeing issues is because you are not entering correct/closed BBC tags
Quote from: Kindred on October 01, 2016, 07:18:04 PM
this is not a bug. it is intentional and there is nothing to be fixed
correct your BBC and it will all be correct.
The reason you are seeing issues is because you are not entering correct/closed BBC tags
Did you read my post above and test the provided example that triggers it? It should only take a few seconds.
Quote from: Kindred on October 01, 2016, 07:18:04 PM
this is not a bug. it is intentional and there is nothing to be fixed
correct your BBC and it will all be correct.
The reason you are seeing issues is because you are not entering correct/closed BBC tags
Not really, we are entering a correct BBCodes, there is something that make the post invalid. Not only from our forums, people from other forums and use SMF 2.0.12 got this issue.
Quote from: Kindred on October 01, 2016, 07:18:04 PM
this is not a bug. it is intentional and there is nothing to be fixed
correct your BBC and it will all be correct.
The reason you are seeing issues is because you are not entering correct/closed BBC tags
Like the others say, this is a bug
on multiple levels:
1. It rejects perfectly valid BBCode. Here's another example that breaks: http://pastebin.com/LmA1MbAJ I cannot post it on this forum because otherwise it will tell me the post is empty, hence I posted a link.
2.
It doesn't tell the user. When your post just turns up empty, it's not your fault, it's the forum's fault. Especially if the forum doesn't tell you why.
That being said, this kind of problem really should not be solved with regular expressions.
And here's an even more minimal test case: http://pastebin.com/f8wHXK8D
Quote from: _Jojo_ on October 05, 2016, 04:04:12 PM
Quote from: Kindred on October 01, 2016, 07:18:04 PM
this is not a bug. it is intentional and there is nothing to be fixed
correct your BBC and it will all be correct.
The reason you are seeing issues is because you are not entering correct/closed BBC tags
Like the others say, this is a bug on multiple levels:
1. It rejects perfectly valid BBCode. Here's another example that breaks: http://pastebin.com/LmA1MbAJ I cannot post it on this forum because otherwise it will tell me the post is empty, hence I posted a link.
2. It doesn't tell the user. When your post just turns up empty, it's not your fault, it's the forum's fault. Especially if the forum doesn't tell you why.
That being said, this kind of problem really should not be solved with regular expressions.
Yes, it is a bug, an incidental one but a bug in the end.
The problem you're facing is a derivative from another one (prevent empty BBC codes). The regex used doesn't caught several BBC formats already posted here, the code's logic dictates to remove the failed test, which result in an empty post and thus the "your message is empty" message appear.
The empty message problem shouldn't be dealt with regex, thats for sure, but the empty BBC tags (the original issue) does.
We cannot change our current BBC parser to another more robust solution like a string tokenizer, therefore, regex and/or a combination of php logic plus regex is what we are going to use.
If you would like to help us, please keep posting valid BBC formats that breaks the current regex, that way we have more options to test our patch against.
Is a solution to use html blocks?
That would only work for admins I'm afraid.
I discovered (for my case) that the problem appears every time i use the center bbc code.
Sometimes i insert a (alt+space) character after the closed center tag and it works.
Here is another example of bbcode that gives me the "empty message"... This is tested to be working great in SMF 2.0.11... I installed a fresh SMF in a test subdomain (2.0.11), created a new post with this bbcode and it worked. Installed the 2.0.12 patch and cannot post this anymore... (using the nobbc since the bbcode "code" doesn't work, as seen in this example...
If I remove the part enclosed in "code", it works... If I add a . (a simple dot) between the code bbcode and the bold, it also works...
[center][font=courier][size=18pt][glow=yellow,2,300]Thread Header[/glow][/size][/font][/center][hr]
[b][font=papyrus][size=18pt][color=darkkhaki]When: [/color][/size][/font][/b]
[b][font=papyrus][size=18pt][color=darkkhaki]Where: [/color][/size][/font][/b]
[hr]
[code]
[b][size=18pt][font=papyrus][color=darkkhaki]When: [/color][/font][/size][/b]
[b][size=18pt][font=papyrus][color=darkkhaki]Where: [/color][/font][/size][/b]
[hr]
[/code]
a simpler version of the same code that fails (still between nobbc). Again, adding a simple . character at some locations (for example, before the first bold tag in both sections solves the issue...
[center][font=courier][size=18pt][glow=yellow,2,300]Thread Header[/glow][/size][/font][/center][hr]
[font=papyrus][size=18pt][color=darkkhaki][b]When: [/b]
[b]Where: [/b] [/color][/size][/font]
[hr]
[code]
[size=18pt][font=papyrus][color=darkkhaki][b]When: [/b]
[b]Where: [/b][/color][/font][/size]
[hr]
[/code]
Quote from: @rjen on September 28, 2016, 11:09:58 AM
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...
Exactly. This error-message is absolutely misleading and therefore bad - no matter where it comes from.
It is the result what counts.
My roleplay forum is having issues as well, I assumed this was due ot the "BBC With style" mod but all of these bugs seem to be appearing on my forum as well, one of my admins is testing this out with several different codes in order to figure out whats causing it as well, if needed we can provide what we found as well.
I have noticed the issue when trying to post text that includes square brackets in a table.
A very stripped down example is here (https://paste.ee/p/p4FB9), because I cannot post it, even inside [nobbc] or [code] tags.
Please fix it.
Edit: image.
(https://www.simplemachines.org/community/index.php?action=dlattach;topic=549271.0;attach=250053;image)
[center][color=orange][size=18pt][font=georgia]Yes[/font][/size][/color][/center]
[center][color=green][size=14pt][font=georgia]No[/font][/size][/color][/center]
I created a support topic about this but I expect that having all of these combinations in one topic will help. The above runs in to the issue with no tables or anything. There's no broken tags as far as I can see either.
Quote from: BaileyD on October 15, 2016, 07:12:50 PM
[center][color=orange][size=18pt][font=georgia]Yes[/font][/size][/color][/center]
[center][color=green][size=14pt][font=georgia]No[/font][/size][/color][/center]
I created a support topic about this but I expect that having all of these combinations in one topic will help. The above runs in to the issue with no tables or anything. There's no broken tags as far as I can see either.
Confirmed. Strange though, because if you remove the closing center tags in this case it works.
[center][color=orange][size=18pt][font=georgia]Yes[/font][/size][/color]
[center][color=green][size=14pt][font=georgia]No[/font][/size][/color]
Quote from: Marceline on October 06, 2016, 11:49:42 AM
If you would like to help us, please keep posting valid BBC formats that breaks the current regex, that way we have more options to test our patch against.
Happy to help, if only in a limited way. The code below
[table]
[tr][td]R1C1[/td][td]R1C2[/td][td]R1C3[/td][/tr]
[tr][td]R2C1[/td][td] [/td][td]R2C3[/td][/tr]
[tr][td]R3C1[/td][td]R3C2[/td][td]R3C3[/td][/tr]
[/table]
now displays, instead of the expected blank middle cell,
R1C1 | R1C2 | R1C3 |
R2C1 | R2C3 |
R3C1 | R3C2 | R3C3 |
and removes the
[td] [/td]
that was entered in the second table row.
Appreciate your efforts to restore proper table formatting.
So the problem is this:
With the latest patch you guys added the following code to the Subs-Post.php file:
// Remove empty bbc.
$message = preg_replace('~\[([^\]=\s]+)[^\]]*\](?' . '>\s|(?R))*?\[/\1\]\s?~i', '', $message);
My preg knowledge is not enough to know what exactly this does but it is creating problems for us.
If a user uses too many BBC codes or something the whole message gets truncated into nothing and they get an error that the message body is empty, also when clicking Preview, the preview would be empty.
For my forum I just commented out this whole line and it solved our problems.
Any idea what is going on?
Here is a test code to reproduce it:
http: // paste . ubuntu . com/23415521/
(remove spaces)
I tried adding the above code in a CODE bracket on this forum but it gave me the same error:
(https://i.imgur.com/8tmb5I3.png)
yes... we know (did you read the whole thread?).
We are working on a fix.
I have to uninstall the patch 2.0.12 because of the same error, I can not edit my old posts on the forum and create new... it's a shame, I'm waiting for the patch of this patch :)
True. And I wonder what takes so long to release a fix for this - this bug has been reported 2 months ago.
If some certain heroes would invest the time they put into cheeky and snarky remarks rather into this fix, it would long be done.
this fix is not as easy as some may think it is. when it is confirmed that it has been fixed and fixed correctly the team will release the next patch. do remember not everyone on the team works on making the patches, we all have our own tasks and abilities.
found this thread as pointed out by oddguy here: http://www.simplemachines.org/community/index.php?topic=548926
This also applies to multilevel nested quotes.
Quote from: NekoSensei on November 11, 2016, 05:11:19 PM
I have to uninstall the patch 2.0.12 because of the same error, I can not edit my old posts on the forum and create new... it's a shame, I'm waiting for the patch of this patch :)
Full ACK!
This is the most nerve-cutting thing with this bug: It used to work before and existing posts cannot be changed unless you work through every detail (which was NOT (!) needed prior to 2.0.12)
When is the fix coming? Any date known yet?
Hello!
Soon, we all hope, but we don't have any official information yet. According to this post (http://www.simplemachines.org/community/index.php?topic=548881.msg3899851#msg3899851), 2.0.13 is currently being tested.
Regards :)
and you should know that we NEVER promise dates.
Sorry if this should be posted elsewhere, but is anyone aware of any problems with downgrading to 2.0.11 while waiting for this update?
There shouldn't be any problems. Just in case, before downgrading, make a backup of your whole forum.
Regards :)
Quote from: d3vcho on November 20, 2016, 12:51:35 PM
Hello!
Soon, we all hope, but we don't have any official information yet. According to this post (http://www.simplemachines.org/community/index.php?topic=548881.msg3899851#msg3899851), 2.0.13 is currently being tested.
Regards :)
Nice!
Now let them work...
This bug does NOT occur inside [nobbc] tags. So it's definitely somewhere in the BBCode functions.
[table]
[tr]
[td][quote][/quote][/td]
[/tr]
[/table]
[table]
[tr]
[td][b][/b][/td]
[/tr]
[/table]
Testing if it's just the open tag...
[table]
[tr]
[td][b]recreated format with just the open tag[/td]
[/tr]
[/table]
So if you only have an open tag in the second table, the second table survives, but not the first.
Testing with only open tags in both tables...
[table]
[tr]
[td][quote][/td]
[/tr]
[/table]
[table]
[tr]
[td][b][/td]
[/tr]
[/table]
Well, three tables with only open tags makes it yell at me.
Two open tags only also breaks it.
Testing mismatched open/close...
[table]
[tr]
[td][quote][/quote][/td]
[/tr]
[/table]
[table]
[tr]
[td][b][i][/b][/td]
[/tr]
[/table]
It preserves the second table but eats the first again.
Testing double mismatching...
[table]
[tr]
[td][quote][b][/quote][/td]
[/tr]
[/table]
[table]
[tr]
[td][b][i][/b][/td]
[/tr]
[/table]
Doesn't work.
Quote from: Vincenz0 on November 02, 2016, 06:34:48 AM
So the problem is this:
With the latest patch you guys added the following code to the Subs-Post.php file:
// Remove empty bbc.
$message = preg_replace('~\[([^\]=\s]+)[^\]]*\](?' . '>\s|(?R))*?\[/\1\]\s?~i', '', $message);
My preg knowledge is not enough to know what exactly this does but it is creating problems for us.
If a user uses too many BBC codes or something the whole message gets truncated into nothing and they get an error that the message body is empty, also when clicking Preview, the preview would be empty.
For my forum I just commented out this whole line and it solved our problems.
Any idea what is going on?
Here is a test code to reproduce it:
http: // paste . ubuntu . com/23415521/
(remove spaces)
I tried adding the above code in a CODE bracket on this forum but it gave me the same error:
(https://i.imgur.com/8tmb5I3.png)
Quote from: Kindred on November 02, 2016, 07:43:25 AM
yes... we know (did you read the whole thread?).
We are working on a fix.
...Is this removing BBCode from the post itself? Why is it even doing that...?
E: ...carp. Sorry about doubleposting (please don't hurt me)
Well the edit button disappeared, that is a thing and it is very annoying.
Found another breaking expression:
[color=lightblue][i][Any text in brackets] [/i][/color]
It leaves behind the open tags up to italics, and the closing color tag.
Hmm, what version is THIS forum running on? The following code does not work on our forum:
[table][tr][td][right][b]Table 1[/b][/right][/td][/tr][tr][td]Row 1[/td][/tr][tr][td][right][b]Row 2[/b][/right][/td][/tr][/table]
[table][tr][td][right][b]Table 2[/b][/right][/td][/tr][tr][td]Row 1[/td][/tr][/table]
The key seems to be [b] tags on subsequent rows (you can have them in the first row), and having a second table tag. But note that there are no open tags!
This forum? It's running 2.0.12.
Yours should say if you scroll down to the bottom of the page, and there are apparently admin tools to check your version if you doubt that.
Got another one:
[quote]
[quote]
[any text]
[/quote]
[/quote]
[any text]
*I would edit to clarify but cannot: The brackets around [any text] are actually there in the post.
You should attach the problematic BBC combination as txt file here. We already have a patch on testing lane so we can run your combination and return the result.
Apparently
[quote][/quote]
bugs out too.
It eats up to one trailing linebreak, judging from posting it here. (Someone else ran across the bug, I'm just crossposting.)
and empty quote is invalid anyway
Quote from: Kindred on December 29, 2016, 07:07:47 PM.
Empty quote with attributes is not invalid, though, right? Because I mean a lot of people use that.
Got another one:
[img width=100]image[/img]
[quote author=authorname link=topic=144549.msg6597134#msg6597134 date=1446937214]
[center][color=magenta][size=14pt][glow=purple,2,300][b]text[/b][/glow][/size][/color][/center]
[/quote]
any empty quote is invalid, IMO.... I have never seen anyone use a quote box, even with attributes, without having textual content IN the quote....
Please test the issue again in SMF 2.0.13 if you are having issue open a new topic with [SMF 2.0.13] tag on topic.
Thank you.
Quote from: Kindred on January 04, 2017, 03:10:55 PM
any empty quote is invalid, IMO.... I have never seen anyone use a quote box, even with attributes, without having textual content IN the quote....
I have.
Quote from: Antes on January 06, 2017, 09:34:39 PM
Please test the issue again in SMF 2.0.13 if you are having issue open a new topic with [SMF 2.0.13] tag on topic.
Thank you.
Problem fixed!!!!
Thank you SMF team.
Quote from: Antes on January 06, 2017, 09:34:39 PM
Please test the issue again in SMF 2.0.13 if you are having issue open a new topic with [SMF 2.0.13] tag on topic.
Thank you.
Fixed. Thank
you!