Skip to content

Register back-end navigation, widgets and settings in a worker from the plugin - #2

Merged
austinderrick merged 1 commit into
mainfrom
register-backend-extensions
Oct 16, 2026
Merged

austinderrick merged 1 commit into
mainfrom
register-backend-extensions

Conversation

@austinderrick

Copy link
Copy Markdown
Collaborator

Moves the change from wintercms/winter#1511 into this plugin, so core needs no Octane-specific check.

Winter's System, Backend and Cms providers register back-end navigation, widgets and settings only for back-end requests. A worker registers its providers once, against a request that is not a back-end request, so a worker served every back-end page with empty menus and settings. The plugin now makes those registrations itself in a worker. It runs them from a booting callback, after every provider has registered and before any provider or plugin boots, so core's callbacks run in the same order as under PHP-FPM. Outside a worker it does nothing.

Also:

  • CI runs against wintercms/winter and wintercms/storm wip/1.3 instead of the #1511 fork branches.
  • The README tells plugin authors not to put registrations behind App::runningInBackend(), because a worker never registers anything behind that check.

Testing

OctaneRegistrationTest checks that the registrations are made in a worker and not outside one. The suite (44 tests), phpcs and PHPStan pass against Winter wip/1.3. A cold boot through Octane's ApplicationFactory with the client bound registers 3 navigation, 3 settings and 2 form widget callbacks, and none without it.

@austinderrick
austinderrick merged commit 7ab0f1b into main Oct 16, 2026
2 checks passed
@austinderrick
austinderrick deleted the register-backend-extensions branch October 16, 2026 04:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant