Skip to content

[6.x] Miscellaneous#18678

Open
riasvdv wants to merge 31 commits into6.xfrom
feature/misc-ports
Open

[6.x] Miscellaneous#18678
riasvdv wants to merge 31 commits into6.xfrom
feature/misc-ports

Conversation

@riasvdv
Copy link
Copy Markdown
Contributor

@riasvdv riasvdv commented Apr 8, 2026

Some general cleanup of controllers and classes that had not been ported over yet when porting their relevant services / helpers.

@riasvdv riasvdv marked this pull request as ready for review April 9, 2026 12:26
@riasvdv riasvdv requested review from brandonkelly and Copilot April 9, 2026 12:26
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR finishes porting several remaining Yii2-era controllers/utilities into their Laravel equivalents, while tightening up legacy adapter shims and aligning behavior with the Craft 6.x architecture.

Changes:

  • Replaces multiple legacy action endpoints (conditions, matrix, nested elements, relational fields, CP alerts, plugin licensing, health check, render endpoints) with new Laravel controllers and routes.
  • Introduces Laravel middleware + templates for error/broken-image handling and updates view resolution to support CP error templates.
  • Adds/updates legacy adapter deprecations and compatibility layers (query interfaces, expressions, missing-component traits), plus new/updated test coverage.

Reviewed changes

Copilot reviewed 118 out of 123 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
yii2-adapter/src/Behavior/LegacyBehaviorCatalog.php Simplifies legacy target discovery to rely on inheritance rather than class_alias parsing.
yii2-adapter/legacy/web/ErrorHandler.php Removes legacy broken-image routing and unused imports; relies on new middleware behavior.
yii2-adapter/legacy/utilities/Upgrade.php Reintroduces/implements legacy Upgrade utility behavior in adapter with deprecation notice.
yii2-adapter/legacy/errors/UploadFailedException.php Converts legacy exception to extend new core upload exception; adds deprecation notice.
yii2-adapter/legacy/elements/db/OrderByPlaceholderExpression.php Adds deprecation notice pointing to core expression.
yii2-adapter/legacy/elements/db/NestedElementQueryTrait.php Adds deprecation notice pointing to core concern.
yii2-adapter/legacy/elements/db/NestedElementQueryInterface.php Replaces legacy interface body with extension of new core interface + deprecation notice.
yii2-adapter/legacy/elements/db/EntryQuery.php Updates implemented nested-query interface to new core contract.
yii2-adapter/legacy/elements/db/ElementRelationParamParser.php Deprecates and forwards normalization to new ElementRelationParamFilter.
yii2-adapter/legacy/elements/db/ContentBlockQuery.php Updates implemented nested-query interface to new core contract.
yii2-adapter/legacy/elements/db/AddressQuery.php Updates implemented nested-query interface to new core contract.
yii2-adapter/legacy/db/ExcludeDescendantIdsExpression.php Adds deprecation notice pointing to new core expression.
yii2-adapter/legacy/controllers/UpgradeController.php Marks legacy controller deprecated.
yii2-adapter/legacy/controllers/TemplatesController.php Removes legacy templates controller.
yii2-adapter/legacy/controllers/SystemSettingsController.php Marks legacy controller deprecated.
yii2-adapter/legacy/controllers/SsoController.php Marks legacy controller deprecated.
yii2-adapter/legacy/controllers/RelationalFieldsController.php Removes legacy relational fields controller.
yii2-adapter/legacy/controllers/QueueController.php Marks legacy controller deprecated.
yii2-adapter/legacy/controllers/NotFoundController.php Removes legacy 404 controller.
yii2-adapter/legacy/controllers/MatrixController.php Removes legacy matrix controller.
yii2-adapter/legacy/controllers/ElementsController.php Updates nested-query contract import to core contract.
yii2-adapter/legacy/controllers/ElementIndexesController.php Switches descendant exclusion to use new core ExcludeDescendantIdsExpression.
yii2-adapter/legacy/controllers/ConditionsController.php Removes legacy conditions controller.
yii2-adapter/legacy/controllers/AppController.php Deprecates legacy controller and removes a large set of legacy endpoints.
yii2-adapter/legacy/config/GeneralConfig.php Adds deprecated errorTemplatePrefix to legacy config with deprecation logging.
yii2-adapter/legacy/config/app.web.php Removes legacy errorAction routing to removed templates controller.
yii2-adapter/legacy/base/MissingComponentTrait.php Aliases legacy trait to new core trait; adds deprecation note.
yii2-adapter/legacy/base/MissingComponentInterface.php Makes legacy interface extend new core interface; adds deprecation note.
tests/Unit/Support/ArrTest.php Adds unit tests for new Arr::containsRecursive.
tests/Feature/Http/RespondsWithFlashTest.php Ensures routes run under web middleware so flash/session behavior works in tests.
tests/Feature/Http/Middleware/ShowBrokenImageTest.php Adds feature coverage for broken-image middleware behavior.
tests/Feature/Http/Controllers/RelationalFieldsControllerTest.php Adds feature coverage for new relational fields controller endpoint.
tests/Feature/Http/Controllers/NestedElementsControllerTest.php Adds feature coverage for new nested elements controller endpoints.
tests/Feature/Http/Controllers/MatrixControllerTest.php Adds feature coverage for new matrix controller endpoints.
tests/Feature/Http/Controllers/ConditionsControllerTest.php Adds feature coverage for new conditions controller endpoints.
tests/Feature/Http/Controllers/App/RenderControllerTest.php Adds feature coverage for new app render endpoints.
tests/Feature/Http/Controllers/App/PluginsControllerTest.php Adds feature coverage for new plugin license endpoints.
tests/Feature/Http/Controllers/App/LicensesControllerTest.php Adds feature coverage for new license shun-cookie endpoint.
tests/Feature/Http/Controllers/App/HealthCheckControllerTest.php Adds feature coverage for new health check endpoint and debug/non-debug behavior.
tests/Feature/Http/Controllers/App/CpAlertsControllerTest.php Adds feature coverage for CP alerts and shun endpoints.
tests/Feature/Element/Queries/Concerns/QueriesRelatedElementsTest.php Extends related-elements tests for relation-field query modifications.
tests/Feature/Element/Policies/ElementPolicyTest.php Adds coverage for nested duplicateAsDraft authorization delegation.
tests/Feature/Element/Concerns/DisplayedInIndexTest.php Adds coverage for removing descendant-exclusion expressions from subquery wheres.
src/View/ViewServiceProvider.php Adds CP-only view path augmentation for Laravel error view discovery.
src/View/TwigEngine.php Adds fallback behavior when CP requests hit site error views; re-renders using CP error templates.
src/Utility/Utilities/Upgrade.php Removes core Upgrade utility class (moved/handled elsewhere).
src/User/Users.php Replaces Yii CP path constants with core enum CpAuthPath.
src/Twig/Extensions/CoreTwigExtension.php Switches missing-component interface to core contract and updates JS position enum usage.
src/Support/Arr.php Adds containsRecursive() helper used by Table field normalization.
src/Route/RouteServiceProvider.php Adds ShowBrokenImage to middleware group.
src/Http/Middleware/ShowBrokenImage.php New middleware to return configured broken image on 404 image requests.
src/Http/Middleware/ExtractNamespace.php Prevents merge() from receiving null by defaulting to empty array.
src/Http/Controllers/Utilities/UtilitiesController.php Changes default utilities redirect logic and return type.
src/Http/Controllers/Users/SaveUserController.php Uses Laravel uploaded file API instead of Yii UploadedFile helper.
src/Http/Controllers/Updates/UpdaterController.php Drops unused Craft Application injection; simplifies index signature.
src/Http/Controllers/RelationalFieldsController.php New Laravel controller for structured relational field input HTML.
src/Http/Controllers/PluginStore/PluginStoreController.php Removes Craft Application injection; uses core Cms::VERSION and Craft::$app.
src/Http/Controllers/PluginsController.php Removes Craft Application injection; uses Craft::$app->getView().
src/Http/Controllers/NestedElementsController.php Ports nested elements controller to Laravel controller style and validation.
src/Http/Controllers/MatrixController.php New Laravel controller for matrix utility actions (create entry, render blocks, etc.).
src/Http/Controllers/Elements/Concerns/InteractsWithElementIndexes.php Uses new descendant exclusion expression for collapsed elements.
src/Http/Controllers/Dashboard/Widgets/CraftSupportController.php Removes unused Craft Application injection in invokable controller.
src/Http/Controllers/ConfigSyncController.php Drops unused Craft Application injection; simplifies index signature.
src/Http/Controllers/ConditionsController.php New Laravel controller for condition rendering + add/remove rules.
src/Http/Controllers/BaseUpdaterController.php Drops Craft Application injection; uses Craft::$app for assets.
src/Http/Controllers/Assets/UploadController.php Switches to Laravel/Symfony UploadedFile and new temp-file handling.
src/Http/Controllers/App/RenderController.php New Laravel controller for rendering element/component chips/cards.
src/Http/Controllers/App/PluginsController.php New Laravel controller for plugin license info + license updates.
src/Http/Controllers/App/LicensesController.php New Laravel controller to set license shun cookie.
src/Http/Controllers/App/HealthCheckController.php New invokable controller implementing health-check behavior.
src/Http/Controllers/App/CpAlertsController.php New controller for CP alerts retrieval + shunning.
src/Filesystem/Filesystems/MissingFs.php Ports missing-component types to new core contracts/traits; uses Override.
src/FieldLayout/LayoutElements/CustomField.php Switches user condition import to core namespace.
src/FieldLayout/FieldLayoutComponent.php Switches user condition import to core namespace; uses Override.
src/Field/Users.php Updates UserQuery import to core query namespace.
src/Field/Table.php Replaces old ArrayHelper usage with new Arr helpers (incl. containsRecursive).
src/Field/Number.php Replaces deprecated Localization normalize with core I18N::normalizeNumber.
src/Field/MissingField.php Ports missing-component types to new core contracts/traits; uses Override.
src/Field/Matrix.php Moves siteSettings validation into rules (UriFormatRule + max template length).
src/Field/LinkTypes/BaseLinkType.php Ports base link type to new component system + configurable component contract.
src/Field/Entries.php Updates EntryQuery import to core query namespace.
src/Field/Date.php Removes unused Db helper import.
src/Field/BaseRelationField.php Replaces legacy relation param parser with new relation param filter logic.
src/Field/Assets.php Switches to Laravel UploadedFile handling for field uploads.
src/Entry/Elements/Entry.php Switches entry condition imports to core namespaces.
src/Entry/Conditions/ViewableConditionRule.php Updates EntryQuery import to core query namespace.
src/Entry/Conditions/TypeConditionRule.php Updates EntryQuery import to core query namespace; adds Override.
src/Entry/Conditions/SectionConditionRule.php Updates trait + EntryQuery imports to core namespaces; adds Override.
src/Entry/Conditions/SavableConditionRule.php Updates EntryQuery import to core query namespace.
src/Entry/Conditions/PostDateConditionRule.php Updates EntryQuery import to core query namespace.
src/Entry/Conditions/FieldConditionRule.php Updates trait + EntryQuery imports to core namespaces; adds Override.
src/Entry/Conditions/ExpiryDateConditionRule.php Updates EntryQuery import to core query namespace.
src/Entry/Conditions/EntryCondition.php Updates rule imports to core element conditions; adds Override.
src/Entry/Conditions/AuthorGroupConditionRule.php Updates EntryQuery import to core query namespace; adds Override.
src/Entry/Conditions/AuthorConditionRule.php Updates EntryQuery import to core query namespace; adds Override.
src/Element/Queries/ExcludeDescendantIdsExpression.php New SQL expression to exclude descendant IDs in queries.
src/Element/Queries/Contracts/NestedElementQueryInterface.php New core nested element query contract (ported API docs).
src/Element/Queries/Concerns/Asset/QueriesAssetProperties.php Removes legacy Assets helper import.
src/Element/Policies/ElementPolicy.php Delegates nested duplicateAsDraft to the field’s duplicate authorization checks.
src/Element/Concerns/HasCustomFields.php Uses Laravel hasFile() rather than Yii UploadedFile helper.
src/Element/Concerns/HasCanonical.php Uses core nested-query interface import; minor query chaining adjustment.
src/Element/Concerns/DisplayedInIndex.php Updates descendant-exclusion stripping to match new expression where structure.
src/Deprecator/Deprecator.php Updates template-origin detection logic and Twig extension handling.
src/Database/Migrations/Install.php Removes temporary response swapping around plugin install tasks.
src/Dashboard/Widgets/MissingWidget.php Ports missing-component types to new core contracts/traits; uses Override.
src/Config/GeneralConfig.php Removes errorTemplatePrefix from core config (moved to legacy w/ deprecation).
src/Component/Contracts/MissingComponentInterface.php New core missing-component interface contract.
src/Component/Concerns/MissingComponentTrait.php New core missing-component trait implementation.
src/Component/Concerns/ConfigurableComponent.php Adds phpstan require-implements + runtime contract enforcement for settings events.
src/Asset/Exceptions/UploadFailedException.php New core upload failure exception with user-friendly messages.
src/Asset/Elements/Asset.php Ports exceptions to core namespaces (AssetException, QueryAbortedException).
src/Asset/Commands/IndexOneAssetCommand.php Removes Craft Application injection; injects Volumes service.
src/Asset/Commands/IndexAllAssetsCommand.php Removes Craft Application injection; injects Volumes service and handles collections.
src/Asset/Commands/Concerns/IndexesAssets.php Removes Craft Application parameter from shared indexing routine.
src/Address/Elements/Address.php Switches address condition import to core namespace.
routes/actions.php Wires new Laravel controllers/routes for app endpoints, conditions, matrix, nested elements, relational fields, etc.
resources/templates/errors/503.twig Adds CP Twig error template for 503.
resources/templates/errors/500.twig Adds CP Twig error template for 500.
resources/templates/errors/404.twig Adds CP Twig error template for 404.
resources/templates/errors/403.twig Adds CP Twig error template for 403.
resources/templates/errors/400.twig Adds CP Twig error template for 400.
database/Factories/AddressFactory.php Enhances address factory to create ownership rows for nested element tests.
CHANGELOG-WIP.md Documents removals/deprecations and replacement controllers/middleware.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants