Repository navigation
fix: index crash with hidebots enabled; phpBB 4.0 coding standard - #23
Merged
Merged
Conversation
The listener type-hinted its optional hidebots and relativedates services with class names that were never imported, so PHP expected classes in this extension's namespace. With hidebots enabled, every index page failed with a TypeError. Both are now plain object|null. Also declares the lookback property instead of creating it dynamically, moves static after public for phpBB 4.0's code sniffer, documents who sees the activity block, and drops the guest report from docs/BUGS.md: it is a core permission setting, not this extension. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First pass on activity24hours as a phpbbmodders extension: a crash fix plus the phpBB 4.0 baseline.
Crash with hidebots enabled. The listener type-hinted its optional services as
hidebots $hidebots = nullandrelativedates $relativedates = nullwithout importing those classes, so PHP expected classes inside this extension's namespace. With hidebots enabled, every index page failed:Both are now
object|null. The same change also clears two PHP 8 deprecations: an optional parameter before a required one, and an implicitly nullable type.phpBB 4.0. The 3.3.19 minimum was already in place and there is no 4.0 ceiling. The events, template events and core classes the extension uses all exist on phpBB master. This PR also:
$lookbackinstead of creating it as a dynamic property (deprecated since PHP 8.2);public staticinstead ofstatic public, which phpBB 4.0's code sniffer requires.Guest report.
docs/BUGS.mdlisted a support topic where guests could not see who is online. On both test boards, phpBB's "Who is online" block was the same with this extension enabled and disabled. Guests see usernames there only with the core permission "Can view profiles, memberlist and online list"; the reporter had set "Can view hidden online users". The extension's own block needs its own permission, which the install does not give to guests. The README now explains both, and the entry is removed fromdocs/BUGS.md.Testing. Claude ran the new
feature_checks.pyactivity24hours check (phpbbmodders/phpbb-release-tools, separate PR) on seed-forum boards with phpBB 3.3.19 and phpBB master, both SQLite, with hidebots mounted:phpcspasses with the 3.3.x and 4.0 extension rulesets, and PHP lint passes on 8.3 and 8.4 with--strict.Investigated and written by Claude on behalf of William Jacoby (bonelifer).
🤖 Generated with Claude Code