From ea2a638999cba4a61c0178eb7ddf5dbd49f9399f Mon Sep 17 00:00:00 2001 From: Andy Vandenberghe Date: Sun, 4 Oct 2026 21:46:15 +0200 Subject: [PATCH] Clear the permission cache after adding Recent Topics permissions rt_perms::add_permissions() adds its options, role data and group grants with raw INSERTs, which skip the acl_clear_prefetch() the migrator's permission tools run. phpBB only rebuilds a user's cached user_permissions when it is empty, so existing members kept a set without u_rt_view and saw no Recent Topics after the extension was enabled, until something else happened to clear the cache. Clear it at the end of add_permissions(), the same way core's remove_orphaned_roles migration does (no $auth is injected into a migration). Closes #194 Co-Authored-By: Claude Opus 5.5 --- migrations/basics/rt_perms.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/migrations/basics/rt_perms.php b/migrations/basics/rt_perms.php index 35def2b..a5ad953 100644 --- a/migrations/basics/rt_perms.php +++ b/migrations/basics/rt_perms.php @@ -153,6 +153,12 @@ public function add_permissions() } } } + + // The raw inserts above bypass the migrator's permission tools, which would clear each + // user's cached permission set. Clear it here, as core's remove_orphaned_roles migration + // does, or existing users keep a set without u_rt_view (issue #194). + $auth = new \phpbb\auth\auth(); + $auth->acl_clear_prefetch(); } public function revert_data()