From f219120a3a17e322e76a21444ddbd38ea484e428 Mon Sep 17 00:00:00 2001 From: ECYaz Date: Thu, 30 Jul 2026 16:02:28 -0400 Subject: [PATCH] Extend the BBCode help field to match phpBB 3.3.5 phpBB 3.3.5 extended a BBCode's help from a single line to a text column with a textarea (PHPBB3-16804), but the database's submission form kept the old shape: a single line input backed by a varchar(255). Help text longer than 255 characters made the insert fail and showed an empty "User Error" page with the revision not created. Change the column to a text column and the field to a textarea like the core form, rename the label now that the help is no longer one line, and render stored line breaks on the contribution pages. Also wires up the existing but unused REVISION_HELP_LINE_EXPLAIN language string. --- contribution/bbcode/type.php | 4 +- language/en/types/bbcode.php | 4 +- migrations/bbcode_help_text.php | 57 +++++++++++++++++++ .../template/common/contribution_details.html | 2 +- .../template/common/revision_list.html | 2 +- 5 files changed, 63 insertions(+), 6 deletions(-) create mode 100644 migrations/bbcode_help_text.php diff --git a/contribution/bbcode/type.php b/contribution/bbcode/type.php index ff7d89cc4..9af3098dc 100644 --- a/contribution/bbcode/type.php +++ b/contribution/bbcode/type.php @@ -77,9 +77,9 @@ protected function configure() 'explain' => 'REVISION_BBCODE_USE_EXPLAIN', ), 'revision_bbc_help_line' => array( - 'type' => 'input', + 'type' => 'textarea', 'name' => 'REVISION_HELP_LINE', - 'explain' => '', + 'explain' => 'REVISION_HELP_LINE_EXPLAIN', ), 'revision_bbc_demo' => array( 'type' => 'textarea', diff --git a/language/en/types/bbcode.php b/language/en/types/bbcode.php index e2da7be04..e6e869078 100644 --- a/language/en/types/bbcode.php +++ b/language/en/types/bbcode.php @@ -85,8 +85,8 @@ 'PUBLIC_ATTR_WAIVED' => 'Public performance attribution has been waived.', 'REVISION_HTML_REPLACE' => 'HTML Replacement', 'REVISION_BBCODE_USE' => 'BBCode Usage', - 'REVISION_HELP_LINE' => 'Help Line', + 'REVISION_HELP_LINE' => 'BBCode Help', 'REVISION_HTML_REPLACE_EXPLAIN' => 'Here you define the default HTML replacement.', 'REVISION_BBCODE_USE_EXPLAIN' => 'Here you define how to use the BBCode.', - 'REVISION_HELP_LINE_EXPLAIN' => 'This field contains the bbcode help that shows when mouse over text of the BBCode', + 'REVISION_HELP_LINE_EXPLAIN' => 'The help text shown in the posting editor when hovering over the BBCode button.', )); diff --git a/migrations/bbcode_help_text.php b/migrations/bbcode_help_text.php new file mode 100644 index 000000000..b4cdb6928 --- /dev/null +++ b/migrations/bbcode_help_text.php @@ -0,0 +1,57 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\titania\migrations; + +/** + * Class bbcode_help_text + * Extends the BBCode help line to a text column, following phpBB 3.3.5's + * extension of bbcode_helpline (PHPBB3-16804). + * @package phpbb\titania\migrations + */ +class bbcode_help_text extends base +{ + static public function depends_on() + { + return array( + '\phpbb\titania\migrations\release_1_1_0', + '\phpbb\titania\migrations\release_1_1_1', + ); + } + + public function update_schema() + { + $table_prefix = $this->get_titania_table_prefix(); + + return array( + 'change_columns' => array( + $table_prefix . 'revisions' => array( + 'revision_bbc_help_line' => array('TEXT_UNI', ''), + ), + ), + ); + } + + public function revert_schema() + { + $table_prefix = $this->get_titania_table_prefix(); + + return array( + 'change_columns' => array( + $table_prefix . 'revisions' => array( + 'revision_bbc_help_line' => array('VCHAR:255', ''), + ), + ), + ); + } +} diff --git a/styles/prosilver/template/common/contribution_details.html b/styles/prosilver/template/common/contribution_details.html index 0a07244d7..4d1aa2bc8 100644 --- a/styles/prosilver/template/common/contribution_details.html +++ b/styles/prosilver/template/common/contribution_details.html @@ -208,7 +208,7 @@

{{ lang('SETTINGS') }}

{{ lang('REVISION_HTML_REPLACE') ~ lang('COLON') }} {{ lang('SELECT_ALL_CODE') }}
{{ CONTRIB_BBC_HTML_REPLACEMENT }}
{% if CONTRIB_BBC_HELPLINE %}
-
{{ lang('REVISION_HELP_LINE') ~ lang('COLON') }} {{ lang('SELECT_ALL_CODE') }}
{{ CONTRIB_BBC_HELPLINE }}
+
{{ lang('REVISION_HELP_LINE') ~ lang('COLON') }} {{ lang('SELECT_ALL_CODE') }}
{{ CONTRIB_BBC_HELPLINE|nl2br }}
{% endif %} diff --git a/styles/prosilver/template/common/revision_list.html b/styles/prosilver/template/common/revision_list.html index 5dab5ede5..52ef2c48a 100644 --- a/styles/prosilver/template/common/revision_list.html +++ b/styles/prosilver/template/common/revision_list.html @@ -66,7 +66,7 @@
{{ lang('REVISION_HTML_REPLACE') ~ lang('COLON') }} {{ lang('SELECT_ALL_CODE') }}
{{ revisions.BBC_HTML_REPLACEMENT }}
{% if revisions.BBC_HELPLINE %}
-
{{ lang('REVISION_HELP_LINE') ~ lang('COLON') }} {{ lang('SELECT_ALL_CODE') }}
{{ revisions.BBC_HELPLINE }}
+
{{ lang('REVISION_HELP_LINE') ~ lang('COLON') }} {{ lang('SELECT_ALL_CODE') }}
{{ revisions.BBC_HELPLINE|nl2br }}
{% endif %} {% if revisions.BBC_DEMO and S_IN_QUEUE %}