Skip to content

[2.1] Deprecate hooks without standard prefixes#9255

Open
live627 wants to merge 1 commit into
SimpleMachines:release-2.1from
live627:2.1/hooks
Open

[2.1] Deprecate hooks without standard prefixes#9255
live627 wants to merge 1 commit into
SimpleMachines:release-2.1from
live627:2.1/hooks

Conversation

@live627
Copy link
Copy Markdown
Contributor

@live627 live627 commented Jun 5, 2026

Summary

This pull request adds new integration hooks to the Who's Online action processing flow while preserving backward compatibility with existing hooks.

Changes

  • Added a new integrate_who_allowed hook before action determination begins, allowing integrations to modify the list of allowed actions used by determineActions().
  • Added a new integrate_whos_online_after hook after Who's Online data has been processed, allowing integrations to inspect or modify the generated URL list and user activity data.
  • Retained the existing who_allowed and whos_online_after hooks for backward compatibility.
  • Added comments marking the legacy hooks as deprecated because they do not follow the standard integrate_ hook naming convention.

Why

The existing hooks were created without the standard integrate_ prefix used throughout SMF's integration system. Adding correctly named hooks provides a consistent API for new integrations while ensuring older modifications continue to function unchanged.

Compatibility

  • No breaking changes.
  • Existing integrations using who_allowed or whos_online_after will continue to work, but should be updated to use integrate_who_allowed and integrate_whos_online_after instead.

@live627 live627 added Housekeeping SMF code reorganization Hooks labels Jun 5, 2026
@live627
Copy link
Copy Markdown
Contributor Author

live627 commented Jun 5, 2026

Pass $url_data instead of $urls to integrate_whos_online_after so that integrations won't need to do such shenanigans as

// Fix the anomaly where $urls is a string when
// coming from the profile section.
foreach (!is_array($urls) ? [[$urls, 0]] : $urls as $k => $url) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Hooks Housekeeping SMF code reorganization

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant