Skip to content

Let template calls nest deeper, set from the ACP - #89

Merged
bonelifer merged 3 commits into
mainfrom
deeper-nesting
Oct 15, 2026
Merged

bonelifer merged 3 commits into
mainfrom
deeper-nesting

Conversation

@bonelifer

Copy link
Copy Markdown
Contributor

A template call written in an article, and a parameter's default value ({{{name|...}}}), may now hold other calls 8 levels deep. It was 3 for calls and 1 for defaults. Template nesting depth under Extensions > Wiki > Settings changes it, from 3 to 20. Deeper calls show as written.

Saved articles need reparsing to follow a new depth. A new cron task does that 50 articles at a time on ordinary page views, after this update and after each change of the setting. The settings page shows a note while it is running. When it finishes, the category memberships are worked out again, since a call that is now read (or no longer read) can add or drop a category.

The reparse can't run in the migration: the wiki's listeners aren't loaded while the extension is being enabled, so a reparse there would turn every article's headings and templates into plain text. The migration only queues it. This update also gets the call forms added in #87 ({{formatnum:}}, {{#rel2abs:}} and others) reparsed in existing articles. The README's older "run the reparser after upgrading" notes now point to the background reparse.

Testing:

  • Unit tests for the limit at 8, the setting at 3 and 9, the depth range and the reparse queue. The suite passes on phpBB 3.3 and 4.0.
  • Claude timed the call pattern on large test articles at depths 3 to 20: under 1 ms in every case.
  • On a 3.3 test board, Claude put the board back to its pre-update state and ran the update. The reparse turned a 6-deep call into a call and kept every other article's templates and headings. Lowering the setting to 3 turned the call back into text, and raising it to 8 brought it back. An article whose deep call adds a category joined that category after the reparse.
  • On a 4.0 test board, Claude ran the update and the reparse; no markup was lost.

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

🤖 Generated with Claude Code

bonelifer and others added 3 commits October 15, 2026 13:24
Template calls written in an article, and parameter defaults, may hold
other calls 8 levels deep (it was 3, and 1 for defaults). Admins can
set it from 3 to 20 under Extensions > Wiki > Settings. Saved articles
are reparsed by a new cron task, a batch at a time on ordinary page
views, after the update and after each change of the setting: a reparse
during the migration would run without the wiki's listeners and strip
every article's wiki markup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bonelifer
bonelifer merged commit 03f81eb into main Oct 15, 2026
58 checks passed
@bonelifer
bonelifer deleted the deeper-nesting branch October 15, 2026 18:49
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