Skip to content

Keep BBCode when articles are reparsed - #42

Merged
bonelifer merged 1 commit into
mainfrom
fix/reparse-keeps-bbcode
Oct 12, 2026
Merged

bonelifer merged 1 commit into
mainfrom
fix/reparse-keeps-bbcode

Conversation

@bonelifer

Copy link
Copy Markdown
Contributor

Reparsing wiki articles turned their BBCode into plain text.

What went wrong. php bin/phpbbcli.php reparser:reparse phpbbmodders_wiki_article rebuilds each article from its stored text. The wiki table has no column saying whether BBCode was on, so phpBB core guesses from the text, and for XML text with no bbcode_uid it guesses no. Every [b], [list] and [url] in an article then came back as plain text, while [[links]] and [[File:]] survived because the wiki's own tags are added separately. The README and the #40 text tell people to run this command after upgrading, so anyone who did may have unformatted articles.

The fix. The wiki always saves articles with BBCode, smilies and links on (see wiki/edit.php), so the reparser plugin now says so instead of leaving core to guess. Affected articles are repaired by running the same command again once this is installed: the stored text still contains the tags, and reparsing now turns them back into BBCode. I confirmed that on a board where it had happened.

Tests

  • New article_reparser_test.php: it fails without the change and passes with it. Unit suite: 126 tests, 265 assertions, all pass.
  • Fresh MySQL 8.0 and PostgreSQL 16 boards seeded with fixtures: reparsing leaves the 4 articles with BBCode tags and the 48 with link tags unchanged. Before the change, the same command on MySQL took 3 articles with BBCode tags down to none.
  • phpBB 4.0.0-a3-dev with SQLite: reparsing an article whose BBCode had been flattened restores it. The Main Page shows "fixture wiki" in bold again.
  • phpBB 3.3.19 with SQLite: the reparser runs to completion.

Investigated and written by Claude on behalf of William Jacoby (bonelifer).

The reparser guessed from the stored text whether an article used BBCode, and for
text stored as XML without a bbcode_uid it guessed no, so reparsing turned every
[b], [list] and [url] into plain text. The wiki always saves with BBCode,
smilies and links on, so the plugin now says so.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@bonelifer
bonelifer merged commit b041325 into main Oct 12, 2026
58 checks passed
@bonelifer
bonelifer deleted the fix/reparse-keeps-bbcode branch October 12, 2026 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant