refactor!: register addon backend pages via Addon::getPages()#6529
Merged
Conversation
Replace the package.yml `page`/`pages` configuration with an overridable `Addon::getPages()` method returning Page objects. The path-by-convention behavior (pages/index.php for the main page, pages/<key>.php for others) is preserved; live_mode filtering and cross-tree insertion become explicit PHP instead of magic keys. Drops the deferred `foo/bar` insert mechanism in favor of load order + getPageObject() or the PAGES_PREPARED extension point. The debug addon is converted accordingly and its package.yml removed. The package.yml schema is reduced to default_config.
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.
Summary
Replaces the package.yml
page/pagesconfiguration with an overridableAddon::getPages()method that returnsPageobjects — the last functional bit of package.yml besidesdefault_config.Details
pages/<key>.php, orpages/index.phpfor the main page whose key equals the addon name. Subpaths keep the dotted-prefix scheme.live_modefiltering is now explicit PHP (if (Core::isLiveMode()) return;) instead of a YAML flag.foo/barkey-matching mechanism is dropped.getPages()runs in load order after the core pages, soController::getPageObject()can attach subpages to core/earlier-loading addons; later-loading targets useLoadOrder::Lateor thePAGES_PREPAREDextension point.MainPage(shown in navigation); a plainPageremains valid for hidden, key/URL-reachable entry points (same as core'sprofile/credits).debugaddon is converted and itspackage.ymlremoved; the package.yml schema is reduced todefault_config.Net −314 lines. The array-parsing helpers (
pageCreate,pageAddProperties) are gone.Compatibility
Breaking change for addons that defined pages in
package.yml— they move toAddon::getPages(). Acceptable on6.x(no stable release yet).