Skip to content

Fix empty section-link text, formatter cache on fresh installs, recent changes columns - #40

Merged
bonelifer merged 3 commits into
mainfrom
fix/section-link-text-and-formatter-cache
Oct 12, 2026
Merged

bonelifer merged 3 commits into
mainfrom
fix/section-link-text-and-formatter-cache

Conversation

@bonelifer

Copy link
Copy Markdown
Contributor

Three fixes found while taking screenshots for the update post. All three come from #39 (headings and table of contents).

Section links showed no text. [[#Section]] rendered an empty link, so "See [[Getting Started#Editing]] and [[#Publishing]]" read "See Getting Started and ." They now show the article name plus #section, as MediaWiki does: [[#Publishing]] shows "#Publishing" and [[A#B]] shows "A#B". An explicit label ([[A#B|label]]) is unchanged.

Fresh CLI installs had no wiki tags. add_wiki_markup rebuilds the text formatter cache while the extension is being enabled, before the extension's listeners are registered. The cache it stored had no wiki tags, so [[links]], [[File:]] embeds and headings did not parse until something purged the cache. The new migration purge_text_formatter_cache runs after it and clears the cache, so phpBB rebuilds it with the wiki's tags on the next page. add_wiki_markup itself is untouched, because it may already have been applied on existing boards.

Correction to #39: its description said a migration reparses saved articles. It does not. Articles saved earlier are converted with php bin/phpbbcli.php reparser:reparse phpbbmodders_wiki_article. The README already said this; docs/TODO/todo-wiki-markup.md now matches it.

Recent changes columns. The Reason and Status headers had the big class, which squeezed the Article column. Status is now middle and Reason has no width class.

Screenshots. docs/update/2026-10-12/ holds the screenshots for the update post, plus a README.md that shows them all. The folder is export-ignored, so it is not in the release zip.

Tests

  • Unit tests: 124 tests, 257 assertions, all pass. They include a new link_texts data provider with five cases.
  • Fresh install with no manual cache purge, then fixtures seeded: MySQL 8.0 and PostgreSQL 16 both show 48 of 86 articles with WIKILINK tags and 2 with WIKIFILE.
  • wiki-markup-test.js browser run: 13 of 13 on phpBB 4.0.0-a3-dev with SQLite. On 3.3.19 with SQLite the first 10 checks pass. I stopped it there because the next check needs a user without the redirect permission, and that board only has admin.

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

bonelifer and others added 3 commits October 12, 2026 14:44
… changes columns

[[#Section]] rendered an empty link; it now shows the name plus #section like
MediaWiki. add_wiki_markup rebuilt the text formatter cache before the
extension's listeners existed, so a fresh CLI install had no wiki tags until a
cache purge; a new migration purges the cache afterwards. The Reason column on
the recent changes page no longer squeezes the Article column.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The default XSLT renderer needs ext-xsl, which the Windows CI runners do not
have. phpBB renders with the PHP engine anyway.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@bonelifer
bonelifer merged commit 416c113 into main Oct 12, 2026
58 checks passed
@bonelifer
bonelifer deleted the fix/section-link-text-and-formatter-cache branch October 12, 2026 20:15
bonelifer added a commit that referenced this pull request Oct 12, 2026
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](https://www.anthropic.com/claude)
on behalf of William Jacoby ([bonelifer](https://github.com/bonelifer)).

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
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