[RESOLVED] Custom BBCODE failure after upgrade from 3.0.14 to 3.2.1

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
User avatar
RiTz21
Registered User
Posts: 205
Joined: Tue May 31, 2005 5:20 pm

[RESOLVED] Custom BBCODE failure after upgrade from 3.0.14 to 3.2.1

Post by RiTz21 » Wed Nov 01, 2017 4:29 am

Updated from 3.0.14 to 3.2.1
I noted that some of my custom BBCodes are no longer working - and I don't know why.

For instance, this used to work fine in 3.0.14:
USAGE:
[1effect]{TEXT1}|{TEXT2}|{TEXT3}|{TEXT4}[/1effect]

HTML replacement:
<B>Permanency</B>: <span style="color:green">{TEXT1}</span><br>
<B>Effect #1 Name</B>: <span style="color:green">{TEXT2}</span><br>
<B>Effect #1 Type</B>: <span style="color:green">{TEXT3}</span><br>
<B>Effect #1 Modifier</B>: <span style="color:green">{TEXT4}</span>
Help Line:
[1effect]Perm?|Name|Type|Modifier[/1effect]

When used, it simply displays the code written by the user, without any interpretation/formatting...:
Preview:
[1effect]a|b|c|d[/1effect]
What has changed in 3.2.1 to make this BBCODE fail? how can I fix this?

Thank you for your time!
RiTz21
Last edited by RiTz21 on Sun Nov 05, 2017 3:08 am, edited 2 times in total.
Image

User avatar
RiTz21
Registered User
Posts: 205
Joined: Tue May 31, 2005 5:20 pm

Re: BBCODE failure after upgrade from 3.0.14 to 3.2.1

Post by RiTz21 » Thu Nov 02, 2017 3:30 pm

UPDATE: ok I have been at this, and I think I figured out what the issue is...YET I need help!

I think that the vertical line we have been using as a separator in the USAGE section of 3.0.14 is not working in 3.2 anymore:
[1effect]{TEXT1}|{TEXT2}|{TEXT3}|{TEXT4}[/1effect]

The [big] problem is that I cannot use comma to separate the {TEXT} fields, as this BBCODE needs to be able to support Excel formulas (which can contain any number of commas!!)
For example, we typed:

Code: Select all

[1effect]Yes|Dagger +2 Corrosive Burst Attack|Enhancement|=IF(b_Magic,2,1)[/2effect]
And the reader saw this:
Permanency: Yes
Effect #1 Name: Dagger +2 Corrosive Burst Attack
Effect #1 Type: Enhancement
Effect #1 Modifier: =IF(b_Magic,2,1)

As you can see, the Modifier entry is a formula that uses commas (for an Excel formula).
Using the vertical Line (which is NOT used in Excel) allowed the custom bbcode to work...! BUT not in version 3.2.

So the question is: HOW do I tell the Forum/BBCode that the vertical line should be used as the separator for this specific custom BBCODE?

THANKS for your help!
RiTz21
Image

User avatar
RiTz21
Registered User
Posts: 205
Joined: Tue May 31, 2005 5:20 pm

Re: Custom BBCODE failure after upgrade from 3.0.14 to 3.2.1

Post by RiTz21 » Thu Nov 02, 2017 9:16 pm

I've been scouring the forum to see if I can find answers... here is a list of what I found that have fimilar issues (I'll edit/add as I find more)
RiTz21
Image

User avatar
JoshyPHP
Code Contributor
Posts: 948
Joined: Mon Jul 11, 2011 12:28 am

Re: Custom BBCODE failure after upgrade from 3.0.14 to 3.2.1

Post by JoshyPHP » Thu Nov 02, 2017 9:37 pm

Quoting from viewtopic.php?p=14851156#p14851156
JoshyPHP wrote:
Sat Oct 21, 2017 11:46 pm
The short version is this: if you want the BBCodes to apply recursively you can only use one single {TEXT} token for its content. Otherwise, you need multiple BBCodes because everything else is displayed as-is.
I wrote the thing that does BBCodes in 3.2.

User avatar
RiTz21
Registered User
Posts: 205
Joined: Tue May 31, 2005 5:20 pm

Re: Custom BBCODE failure after upgrade from 3.0.14 to 3.2.1

Post by RiTz21 » Thu Nov 02, 2017 9:53 pm

JoshyPHP wrote:
Thu Nov 02, 2017 9:37 pm
Quoting from viewtopic.php?p=14851156#p14851156
JoshyPHP wrote:
Sat Oct 21, 2017 11:46 pm
The short version is this: if you want the BBCodes to apply recursively you can only use one single {TEXT} token for its content. Otherwise, you need multiple BBCodes because everything else is displayed as-is.
Thank you for your reply!
I am not entirely sure what you mean... or rather what I have to do to fix my forum... We've been using these custom BBCODEs for 10+ years; What do I need to change in the bbcode to 'fix' them for the whole forum?

I assume by your reply that there is no way to use the vertical line anymore... (as you do not mention it)...
(I am not much of an expert regarding these issues, so I apologize for my lack of understanding)

Seems you are saying that there is no cure for this problem...
RiTz21
Image

User avatar
JoshyPHP
Code Contributor
Posts: 948
Joined: Mon Jul 11, 2011 12:28 am

Re: Custom BBCODE failure after upgrade from 3.0.14 to 3.2.1

Post by JoshyPHP » Thu Nov 02, 2017 10:11 pm

You can use | or any separator but it won't be parsed recursively. If you need it to work recursively then you'll need multiple BBCodes. There's no easy way to make irregular BBCodes work the same way as they did in 3.0.

I assume that when you say "not work" you mean "not recursively." If you mean something else, post an example of input (what the user writes), expected output and actual output.
I wrote the thing that does BBCodes in 3.2.

User avatar
RiTz21
Registered User
Posts: 205
Joined: Tue May 31, 2005 5:20 pm

Re: Custom BBCODE failure after upgrade from 3.0.14 to 3.2.1

Post by RiTz21 » Fri Nov 03, 2017 1:04 am

I did some more testing (enough so that I now have a headache) and I think I found something...

The name of my current BBCODE is [1effect]...[/1effect] - this fails miserably :(
YET if I create a NEW bbcode named [effect1]...[/effect1] (that does the same thing) IT WORKS!...

That appears to be a bug in the BBCODE, or at least a restrictions that should be indicated to users...

Here is my test case on PHPBB 3.2.1 should anyone wishes to reproduce this behavior:

FIRST BBCODE to add:
BBCode usage:

Code: Select all

[1effect]{TEXT1}|{TEXT2}|{TEXT3}|{TEXT4}[/1effect]
HTML replacement:

Code: Select all

<B>Permanency</B>: <span style="color:green">{TEXT1}</span><br>
<B>Effect #1 Name</B>: <span style="color:green">{TEXT2}</span><br>
<B>Effect #1 Type</B>: <span style="color:green">{TEXT3}</span><br>
<B>Effect #1 Modifier</B>: <span style="color:green">{TEXT4}</span>
Help line:

Code: Select all

[1effect]Perm?|Name|Type|Modifier[/1effect]
SECOND BBCODE to add:
BBCode usage:

Code: Select all

[effect1]{TEXT1}|{TEXT2}|{TEXT3}|{TEXT4}[/effect1]
HTML replacement:

Code: Select all

<B>Permanency</B>: <span style="color:green">{TEXT1}</span><br>
<B>Effect #1 Name</B>: <span style="color:green">{TEXT2}</span><br>
<B>Effect #1 Type</B>: <span style="color:green">{TEXT3}</span><br>
<B>Effect #1 Modifier</B>: <span style="color:green">{TEXT4}</span>
Help line:

Code: Select all

[effect1]Perm?|Name|Type|Modifier[/effect1]
NEW POST - Test message - type:
[1effect]a|b|C|D[/1effect]
[effect1]a|b|C|D[/effect1]

OUTPUT IMAGE: Here is what a preview shows:
As you can see, the only difference between both BBCODEs is how the tag is named. The BBCODE starting with a number fails - but moving that number to the end of the tag name *works* (the reason I used 1Effect was to say "One Effect" - and yes, I have [2Effects], [3Effects] ... up to [6Effects] defined on my forum)
preview.jpg
SOLUTION?:
* If this is a bug in BBCODE, then I would have to await an update...(which would fix those bbcodes automatically in my 10+ year old forum)
* If this is 'normal' behavior, then I guess I would have to crate new versions of my existing BBCODEs and then find a way to replace all occurrence of the old BBCODE in the database, to use the new one...:(

Should A ticket be opened for this situation??
Did I miss something?

RiTz21
Image

User avatar
JoshyPHP
Code Contributor
Posts: 948
Joined: Mon Jul 11, 2011 12:28 am

Re: Custom BBCODE failure after upgrade from 3.0.14 to 3.2.1

Post by JoshyPHP » Fri Nov 03, 2017 1:50 am

You're correct, BBCodes whose names start with a digit are ignored. This is a limitation that's unlikely to be lifted in the future so you should look into replacing your old BBCodes. What's the definition for [2effect] and the others?
I wrote the thing that does BBCodes in 3.2.

User avatar
RiTz21
Registered User
Posts: 205
Joined: Tue May 31, 2005 5:20 pm

Re: Custom BBCODE failure after upgrade from 3.0.14 to 3.2.1

Post by RiTz21 » Fri Nov 03, 2017 3:33 am

JoshyPHP wrote:
Fri Nov 03, 2017 1:50 am
You're correct, BBCodes whose names start with a digit are ignored. This is a limitation that's unlikely to be lifted in the future so you should look into replacing your old BBCodes.
Ouch... :(
If you know how to change a bbcode in the whole database (perhaps some kind of command in phpMyAdmin!?) I could try that.. I can't imagine going through years of posts to edit them... I wouldn't live long enough :P
JoshyPHP wrote:
Fri Nov 03, 2017 1:50 am
What's the definition for [2effect] and the others?
It is a repeat of the Name/Type/Modifier part, with added {TEXT} elements.

Now that I know what is wrong with my [1effect] BBCODE, can you tell me why this fails in 3.2.1 (this was working fine in 3.0.14)? It does not suffer from 'start with a digit' change...!

BBCode usage:

Code: Select all

[AE]{TEXT}[/AE]
HTML replacement:

Code: Select all

<table width="100%" border="1">
<tr><td width="100%" align="center">
<table width="100%" border="0">
  <tr>
    <td width="100%" bgcolor="#E1E4F2">
      <table width="100%" border="0" bgcolor="#F5F5FF">
        <tr>
          <td width="1%" bgcolor="#000000" nowrap align="left">
			<font color="#FFFFFF" face="Arial"><font size="1"><b>&nbsp;ACTIVE EFFECTS & CONDITIONS&nbsp;</b></font></font></td>
          <td width="99%">&nbsp;</td>
        </tr>
        <tr>
          <td width="100%" bgcolor="#FFE5BA" colspan="2">
            <table width="100%" cellpadding="2">
              <tr>
                <td width="100%" align="left" valign="top">
                  {TEXT}
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</td></tr>
</table>
<p>&nbsp;</p>
Help line:

Code: Select all

Active Effects: [AE]Text[/AE]
If I create the SAME effect under the ActiveEffect name, it works fine! So can this be attributed to the limitations of the new code? The BBCode name must be more then 2 characters? Or is [AE] suffering from another problem?

Perhaps all these limitations should be noted somewhere :)

Thanks for the help!!
RiTz21
Image

User avatar
RiTz21
Registered User
Posts: 205
Joined: Tue May 31, 2005 5:20 pm

Re: Custom BBCODE failure after upgrade from 3.0.14 to 3.2.1

Post by RiTz21 » Fri Nov 03, 2017 4:40 am

RiTz21 wrote:
Fri Nov 03, 2017 3:33 am
If I create the SAME effect under the ActiveEffect name, it works fine! So can this be attributed to the limitations of the new code? The BBCode name must be more then 2 characters? Or is [AE] suffering from another problem?
Well, belay that: [ActiveEffect] does not work anymore...
Something ain't working right with my BBCODEs and I just can't figure out *what*... :cry:

RiTz21
Image

User avatar
JoshyPHP
Code Contributor
Posts: 948
Joined: Mon Jul 11, 2011 12:28 am

Re: Custom BBCODE failure after upgrade from 3.0.14 to 3.2.1

Post by JoshyPHP » Fri Nov 03, 2017 6:16 am

RiTz21 wrote:
Fri Nov 03, 2017 3:33 am
If you know how to change a bbcode in the whole database (perhaps some kind of command in phpMyAdmin!?) I could try that..
You could use REPLACE() but modifying the database directly is risky if you're not familiar with it. I suggest you try that on a local copy rather than the live site as you may inadvertently nuke your whole forum. Either way you'll still have to reparse old posts via CLI.

Code: Select all

UPDATE phpbb_posts SET post_text = REPLACE(post_text, '1effect', 'effect1')
I tried the [AE] BBCode on my local forum and it works fine. If it doesn't on yours, you should post the original input, expected output and actual output. If you test a new BBCode, do it in a new post or using the preview button in the editor.
RiTz21 wrote:
Fri Nov 03, 2017 3:33 am
Perhaps all these limitations should be noted somewhere :)
Absolutely, but it requires a volunteer. There's a knowledge base there: https://www.phpbb.com/support/docs/en/3 ... in-phpbb3/ -- I don't know who handles it though.
I wrote the thing that does BBCodes in 3.2.

User avatar
AmigoJack
Registered User
Posts: 5263
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Custom BBCODE failure after upgrade from 3.0.14 to 3.2.1

Post by AmigoJack » Fri Nov 03, 2017 7:06 am

JoshyPHP wrote:
Fri Nov 03, 2017 1:50 am
BBCodes whose names start with a digit are ignored
Yet I'm able to create those in the ACP? It should be forbidden right there.
The worst thing about censorship is ███████████

User avatar
JoshyPHP
Code Contributor
Posts: 948
Joined: Mon Jul 11, 2011 12:28 am

Re: Custom BBCODE failure after upgrade from 3.0.14 to 3.2.1

Post by JoshyPHP » Fri Nov 03, 2017 7:28 am

And if you submit a PR for it, I'm sure it will be at some point in the future.
I wrote the thing that does BBCodes in 3.2.

User avatar
AmigoJack
Registered User
Posts: 5263
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Custom BBCODE failure after upgrade from 3.0.14 to 3.2.1

Post by AmigoJack » Fri Nov 03, 2017 11:23 am

I doubt that - my contributions thru code, RFCs and tickets had little to no impact while phpBB inconsistencies increased, so I just gave up serving the end of the work/test delegation line. Why me - why not you? Where are people from old days just saying "you're right, adding to my todo list", aka taking responsibility?
The worst thing about censorship is ███████████

User avatar
JoshyPHP
Code Contributor
Posts: 948
Joined: Mon Jul 11, 2011 12:28 am

Re: Custom BBCODE failure after upgrade from 3.0.14 to 3.2.1

Post by JoshyPHP » Fri Nov 03, 2017 4:08 pm

Opinion discarded.
I wrote the thing that does BBCodes in 3.2.

Post Reply

Return to “[3.2.x] Support Forum”

Who is online

Users browsing this forum: Beakster, david63, KevC, kinerity, Mannix_, thecoalman, thunderchero, TritonZA and 62 guests