Repository navigation
Conversation
The events from PHPBB-17725, PHPBB-17726 and PHPBB-17727 pass avatar_img to compact(), but master builds the avatar with the avatar.helper service and never set that variable, which raised an undefined variable warning on the MCP warn-user, warn-post and user-notes pages. Set it from the helper's rendered html, so the events give listeners the same data as on 3.3.x. Add a functional test that opens all three pages; no test covered them. PHPBB-17752
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.
Checklist:
Tracker ticket:
https://tracker.phpbb.com/browse/PHPBB-17752
The events from PHPBB-17725, PHPBB-17726 and PHPBB-17727 (
core.mcp_warn_user_modify_template_vars,core.mcp_warn_post_modify_template_varsandcore.mcp_notes_user_modify_template_vars) passavatar_imgtocompact(). On 3.3.x that variable comes fromphpbb_get_user_avatar(), but master builds the avatar with theavatar.helperservice, so after the 3.3.x merge the variable no longer exists. With debug on, the MCP warn-user, warn-post and user-notes pages showcompact(): Undefined variable $avatar_img.This sets
$avatar_img = $avatar['html'];before each event. The helper's array always has anhtmlkey, so listeners get the rendered avatar HTML, as the docblocks describe and as on 3.3.x.The new functional test
tests/functional/mcp/mcp_warn_notes_test.phpopens all three pages; no test covered them. Run locally in Docker with SQLite, it fails on current master with the warning above and passes with this change. The event exporter tests (1131) also pass.Investigated and written by Claude on behalf of William Jacoby (bonelifer).