← 输入框|github.com|刷新
Skip to content

Ticket/17752 Set avatar_img before the MCP template events on master - #7101

Open
bonelifer wants to merge 2 commits into
phpbb:masterfrom
bonelifer:ticket/17752
Open

bonelifer wants to merge 2 commits into
phpbb:masterfrom
bonelifer:ticket/17752

Conversation

@bonelifer

Copy link
Copy Markdown
Member

Checklist:

  • Correct branch: master for new features; 3.3.x for fixes
  • Tests pass
  • Code follows coding guidelines: master and 3.3.x
  • Commit follows commit message format

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_vars and core.mcp_notes_user_modify_template_vars) pass avatar_img to compact(). On 3.3.x that variable comes from phpbb_get_user_avatar(), but master builds the avatar with the avatar.helper service, 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 show compact(): Undefined variable $avatar_img.

This sets $avatar_img = $avatar['html']; before each event. The helper's array always has an html key, 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.php opens 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).

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants