diff --git a/user_guide_src/source/changelogs/v4.5.0.rst b/user_guide_src/source/changelogs/v4.5.0.rst index c999b562172f..610a3b0c9314 100644 --- a/user_guide_src/source/changelogs/v4.5.0.rst +++ b/user_guide_src/source/changelogs/v4.5.0.rst @@ -20,6 +20,12 @@ BREAKING Behavior Changes ================ +Filter Execution Order +---------------------- + +The order in which Controller Filters are executed has changed. See +:ref:`Upgrading Guide ` for details. + Interface Changes ================= diff --git a/user_guide_src/source/incoming/filters.rst b/user_guide_src/source/incoming/filters.rst index bbeebdd87ff4..9dda87c9bb23 100644 --- a/user_guide_src/source/incoming/filters.rst +++ b/user_guide_src/source/incoming/filters.rst @@ -184,6 +184,8 @@ will be passed in ``$arguments`` to the ``group`` filter's ``before()`` methods. When the URI matches ``admin/users/*'``, the array ``['users.manage']`` will be passed in ``$arguments`` to the ``permission`` filter's ``before()`` methods. +.. _filter-execution-order: + Filter Execution Order ====================== @@ -198,7 +200,8 @@ Filters are executed in the following order: .. note:: Prior to v4.5.0, the filters that are specified to a route (in **app/Config/Routes.php**) are executed before the filters specified in - **app/Config/Filters.php**. + **app/Config/Filters.php**. See + :ref:`Upgrading Guide ` for details. ****************** Confirming Filters diff --git a/user_guide_src/source/installation/upgrade_450.rst b/user_guide_src/source/installation/upgrade_450.rst index a9925320bf2d..261bb904327d 100644 --- a/user_guide_src/source/installation/upgrade_450.rst +++ b/user_guide_src/source/installation/upgrade_450.rst @@ -18,6 +18,26 @@ Mandatory File Changes Breaking Changes **************** +.. _upgrade-450-filter-execution-order: + +Filter Execution Order +---------------------- + +The order in which Controller Filters are executed has changed. + +Before Filters:: + + Previous: route → globals → methods → filters + Now: globals → methods → filters → route + +After Filters:: + + Previous: route → globals → filters + Now: route → filters → globals + +If you wish to maintain the same execution order as in previous versions, set +``true`` to ``Config\Feature::$oldFilterOrder``. See also :ref:`filter-execution-order`. + Removed Deprecated Items ========================