From c672b2bd307ee9739387258cbd20241bd3c29583 Mon Sep 17 00:00:00 2001 From: Donatas Glodenis Date: Sun, 24 Sep 2023 13:06:10 +0300 Subject: [PATCH 01/11] Add note on incompatibility of general rules for file validation use --- user_guide_src/source/libraries/validation.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/user_guide_src/source/libraries/validation.rst b/user_guide_src/source/libraries/validation.rst index 3224961e0821..1d73f3b8aaae 100644 --- a/user_guide_src/source/libraries/validation.rst +++ b/user_guide_src/source/libraries/validation.rst @@ -971,6 +971,9 @@ Rule Parameter Description ======================= ========== ============================================= =================================================== uploaded Yes Fails if the name of the parameter does not ``uploaded[field_name]`` match the name of any uploaded files. + Prevents form from validating if file upload + is required. + max_size Yes Fails if the uploaded file named in the ``max_size[field_name,2048]`` parameter is larger than the second parameter in kilobytes (kb). Or if the file @@ -992,3 +995,7 @@ is_image Yes Fails if the file cannot be determined to be ======================= ========== ============================================= =================================================== The file validation rules apply for both single and multiple file uploads. + +.. note:: Only rules specifically created for file validation (like the ones listed in the table above) can be used to validate files. + Therefore, adding any general rules, like ``permit_empy``, to file validation rules array or string will prevend all rules for the + from file from being processed during validation. From 20b496b057cbc97fd929298d9ca8d8720df91dac Mon Sep 17 00:00:00 2001 From: Donatas Glodenis Date: Wed, 4 Oct 2023 17:36:39 +0300 Subject: [PATCH 02/11] Implement proposed fixes for previous suggestions --- user_guide_src/source/libraries/validation.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/user_guide_src/source/libraries/validation.rst b/user_guide_src/source/libraries/validation.rst index 1d73f3b8aaae..a527dada391c 100644 --- a/user_guide_src/source/libraries/validation.rst +++ b/user_guide_src/source/libraries/validation.rst @@ -971,8 +971,8 @@ Rule Parameter Description ======================= ========== ============================================= =================================================== uploaded Yes Fails if the name of the parameter does not ``uploaded[field_name]`` match the name of any uploaded files. - Prevents form from validating if file upload - is required. + If you want the file upload to be optional (not required), + do not define this rule. max_size Yes Fails if the uploaded file named in the ``max_size[field_name,2048]`` parameter is larger than the second @@ -997,5 +997,5 @@ is_image Yes Fails if the file cannot be determined to be The file validation rules apply for both single and multiple file uploads. .. note:: Only rules specifically created for file validation (like the ones listed in the table above) can be used to validate files. - Therefore, adding any general rules, like ``permit_empy``, to file validation rules array or string will prevend all rules for the - from file from being processed during validation. + Therefore, adding any general rules, like ``permit_empy``, to file validation rules array or string, the file validation will not + work correctly. From db7041cdb1d2cb5eb09684e50efa8e0494f31343 Mon Sep 17 00:00:00 2001 From: Donatas Glodenis Date: Fri, 6 Oct 2023 09:49:53 +0300 Subject: [PATCH 03/11] correct table format --- user_guide_src/source/libraries/validation.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user_guide_src/source/libraries/validation.rst b/user_guide_src/source/libraries/validation.rst index a527dada391c..7a26a41d49fc 100644 --- a/user_guide_src/source/libraries/validation.rst +++ b/user_guide_src/source/libraries/validation.rst @@ -971,8 +971,8 @@ Rule Parameter Description ======================= ========== ============================================= =================================================== uploaded Yes Fails if the name of the parameter does not ``uploaded[field_name]`` match the name of any uploaded files. - If you want the file upload to be optional (not required), - do not define this rule. + If you want the file upload to be optional + (not required), do not define this rule. max_size Yes Fails if the uploaded file named in the ``max_size[field_name,2048]`` parameter is larger than the second From 2b836f9c037957ff58894572d39f2fac035d73b9 Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 18 Oct 2023 10:05:28 +0900 Subject: [PATCH 04/11] docs: fix incorrect descriptions for pre_system and post_system --- user_guide_src/source/extending/events.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/user_guide_src/source/extending/events.rst b/user_guide_src/source/extending/events.rst index 74fe34b4fe70..0221657f8ff1 100644 --- a/user_guide_src/source/extending/events.rst +++ b/user_guide_src/source/extending/events.rst @@ -87,9 +87,12 @@ Event Points The following is a list of available event points within the CodeIgniter core code: -* **pre_system** Called very early during system execution. Only the benchmark and events class have been loaded at this point. No routing or other processes have happened. +* **pre_system** Called early during system execution. The URI, Request, and + Response have been instantiated, but page cache checking, routing, and execution + of "before" controller filters have not yet occurred. * **post_controller_constructor** Called immediately after your controller is instantiated, but prior to any method calls happening. -* **post_system** Called after the final rendered page is sent to the browser, at the end of system execution after the finalized data is sent to the browser. +* **post_system** Called right before the final rendered page is sent to the browser, + at the end of system execution, after the execution of "after" controller filters. * **email** Called after an email sent successfully from ``CodeIgniter\Email\Email``. Receives an array of the ``Email`` class's properties as a parameter. * **DBQuery** Called after a database query whether successful or not. Receives the ``Query`` object. * **migrate** Called after a successful migration call to ``latest()`` or ``regress()``. Receives the current properties of ``MigrationRunner`` as well as the name of the method. From 50e78670fd0a9f537b7fb3f43d772abc1941d2d8 Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 18 Oct 2023 10:09:10 +0900 Subject: [PATCH 05/11] docs: add changelog --- user_guide_src/source/changelogs/v4.4.2.rst | 2 ++ user_guide_src/source/extending/events.rst | 2 ++ 2 files changed, 4 insertions(+) diff --git a/user_guide_src/source/changelogs/v4.4.2.rst b/user_guide_src/source/changelogs/v4.4.2.rst index bacfdf2a2e97..9394525b5367 100644 --- a/user_guide_src/source/changelogs/v4.4.2.rst +++ b/user_guide_src/source/changelogs/v4.4.2.rst @@ -47,6 +47,8 @@ Bugs Fixed - **Forge:** Fixed a bug where adding a Primary Key to an existing table was ignored if there were no other Keys added too. - **Routing:** Fixed a bug that ``spark routes`` may show incorrect route names. +- **UserGuide:** Fixed the descriptions for ``pre_system`` and ``post_system`` + in :ref:`event-points`. See the repo's `CHANGELOG.md `_ diff --git a/user_guide_src/source/extending/events.rst b/user_guide_src/source/extending/events.rst index 0221657f8ff1..7891249cdcf6 100644 --- a/user_guide_src/source/extending/events.rst +++ b/user_guide_src/source/extending/events.rst @@ -82,6 +82,8 @@ You can stop simulation by passing false: .. literalinclude:: events/008.php +.. _event-points: + Event Points ============ From 82ccf15f03e4ae3a31dbf01aadee3cf51eb3110f Mon Sep 17 00:00:00 2001 From: kenjis Date: Thu, 19 Oct 2023 17:36:55 +0900 Subject: [PATCH 06/11] docs: add descriptions to upgrade_4xx Hooks --- user_guide_src/source/installation/upgrade_4xx.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/user_guide_src/source/installation/upgrade_4xx.rst b/user_guide_src/source/installation/upgrade_4xx.rst index ae645d26c1a9..bf7ba85fece6 100644 --- a/user_guide_src/source/installation/upgrade_4xx.rst +++ b/user_guide_src/source/installation/upgrade_4xx.rst @@ -153,6 +153,12 @@ Hooks - Instead of CI3's ``$hook['post_controller_constructor']`` you now use ``Events::on('post_controller_constructor', ['MyClass', 'MyFunction']);``, with the namespace ``CodeIgniter\Events\Events;``. - Events are always enabled, and are available globally. +- The hook point ``pre_controller`` and ``post_controller`` have been removed. + Use :doc:`../incoming/filters` instead. +- The hook point ``display_override`` and ``cache_override`` have been removed. + Because the base methods have been removed. +- The hook point ``post_system`` has moved just before sending the final rendered + page. Extending the Framework ======================= From 5d5487c112439c2b89570379a8f47a6363dbec39 Mon Sep 17 00:00:00 2001 From: kenjis Date: Mon, 23 Oct 2023 06:44:26 +0900 Subject: [PATCH 07/11] Revert "docs: fix event points descriptions" --- user_guide_src/source/changelogs/v4.4.2.rst | 2 -- user_guide_src/source/extending/events.rst | 9 ++------- user_guide_src/source/installation/upgrade_4xx.rst | 6 ------ 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/user_guide_src/source/changelogs/v4.4.2.rst b/user_guide_src/source/changelogs/v4.4.2.rst index 12fad5ed55df..eb146ef07c0c 100644 --- a/user_guide_src/source/changelogs/v4.4.2.rst +++ b/user_guide_src/source/changelogs/v4.4.2.rst @@ -44,8 +44,6 @@ Bugs Fixed - **Forge:** Fixed a bug where adding a Primary Key to an existing table was ignored if there were no other Keys added too. - **Routing:** Fixed a bug that ``spark routes`` may show incorrect route names. -- **UserGuide:** Fixed the descriptions for ``pre_system`` and ``post_system`` - in :ref:`event-points`. See the repo's `CHANGELOG.md `_ diff --git a/user_guide_src/source/extending/events.rst b/user_guide_src/source/extending/events.rst index 7891249cdcf6..74fe34b4fe70 100644 --- a/user_guide_src/source/extending/events.rst +++ b/user_guide_src/source/extending/events.rst @@ -82,19 +82,14 @@ You can stop simulation by passing false: .. literalinclude:: events/008.php -.. _event-points: - Event Points ============ The following is a list of available event points within the CodeIgniter core code: -* **pre_system** Called early during system execution. The URI, Request, and - Response have been instantiated, but page cache checking, routing, and execution - of "before" controller filters have not yet occurred. +* **pre_system** Called very early during system execution. Only the benchmark and events class have been loaded at this point. No routing or other processes have happened. * **post_controller_constructor** Called immediately after your controller is instantiated, but prior to any method calls happening. -* **post_system** Called right before the final rendered page is sent to the browser, - at the end of system execution, after the execution of "after" controller filters. +* **post_system** Called after the final rendered page is sent to the browser, at the end of system execution after the finalized data is sent to the browser. * **email** Called after an email sent successfully from ``CodeIgniter\Email\Email``. Receives an array of the ``Email`` class's properties as a parameter. * **DBQuery** Called after a database query whether successful or not. Receives the ``Query`` object. * **migrate** Called after a successful migration call to ``latest()`` or ``regress()``. Receives the current properties of ``MigrationRunner`` as well as the name of the method. diff --git a/user_guide_src/source/installation/upgrade_4xx.rst b/user_guide_src/source/installation/upgrade_4xx.rst index bf7ba85fece6..ae645d26c1a9 100644 --- a/user_guide_src/source/installation/upgrade_4xx.rst +++ b/user_guide_src/source/installation/upgrade_4xx.rst @@ -153,12 +153,6 @@ Hooks - Instead of CI3's ``$hook['post_controller_constructor']`` you now use ``Events::on('post_controller_constructor', ['MyClass', 'MyFunction']);``, with the namespace ``CodeIgniter\Events\Events;``. - Events are always enabled, and are available globally. -- The hook point ``pre_controller`` and ``post_controller`` have been removed. - Use :doc:`../incoming/filters` instead. -- The hook point ``display_override`` and ``cache_override`` have been removed. - Because the base methods have been removed. -- The hook point ``post_system`` has moved just before sending the final rendered - page. Extending the Framework ======================= From e09cfec12dc37b017ffddc8934c647395a611923 Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 18 Oct 2023 10:05:28 +0900 Subject: [PATCH 08/11] docs: fix incorrect descriptions for pre_system and post_system --- user_guide_src/source/extending/events.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/user_guide_src/source/extending/events.rst b/user_guide_src/source/extending/events.rst index 74fe34b4fe70..0221657f8ff1 100644 --- a/user_guide_src/source/extending/events.rst +++ b/user_guide_src/source/extending/events.rst @@ -87,9 +87,12 @@ Event Points The following is a list of available event points within the CodeIgniter core code: -* **pre_system** Called very early during system execution. Only the benchmark and events class have been loaded at this point. No routing or other processes have happened. +* **pre_system** Called early during system execution. The URI, Request, and + Response have been instantiated, but page cache checking, routing, and execution + of "before" controller filters have not yet occurred. * **post_controller_constructor** Called immediately after your controller is instantiated, but prior to any method calls happening. -* **post_system** Called after the final rendered page is sent to the browser, at the end of system execution after the finalized data is sent to the browser. +* **post_system** Called right before the final rendered page is sent to the browser, + at the end of system execution, after the execution of "after" controller filters. * **email** Called after an email sent successfully from ``CodeIgniter\Email\Email``. Receives an array of the ``Email`` class's properties as a parameter. * **DBQuery** Called after a database query whether successful or not. Receives the ``Query`` object. * **migrate** Called after a successful migration call to ``latest()`` or ``regress()``. Receives the current properties of ``MigrationRunner`` as well as the name of the method. From bc6229ba6e7ff0f1e82fd44f83f1732a803b8749 Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 18 Oct 2023 10:09:10 +0900 Subject: [PATCH 09/11] docs: add changelog --- user_guide_src/source/changelogs/v4.4.3.rst | 3 +++ user_guide_src/source/extending/events.rst | 2 ++ 2 files changed, 5 insertions(+) diff --git a/user_guide_src/source/changelogs/v4.4.3.rst b/user_guide_src/source/changelogs/v4.4.3.rst index 248b71790c05..9a70f3e17a9a 100644 --- a/user_guide_src/source/changelogs/v4.4.3.rst +++ b/user_guide_src/source/changelogs/v4.4.3.rst @@ -24,6 +24,9 @@ Deprecations Bugs Fixed ********** +- **UserGuide:** Fixed the descriptions for ``pre_system`` and ``post_system`` + in :ref:`event-points`. + See the repo's `CHANGELOG.md `_ for a complete list of bugs fixed. diff --git a/user_guide_src/source/extending/events.rst b/user_guide_src/source/extending/events.rst index 0221657f8ff1..7891249cdcf6 100644 --- a/user_guide_src/source/extending/events.rst +++ b/user_guide_src/source/extending/events.rst @@ -82,6 +82,8 @@ You can stop simulation by passing false: .. literalinclude:: events/008.php +.. _event-points: + Event Points ============ From f0f5713f84f14d7f9d4a254bf839371a6912beb1 Mon Sep 17 00:00:00 2001 From: kenjis Date: Thu, 19 Oct 2023 17:36:55 +0900 Subject: [PATCH 10/11] docs: add descriptions to upgrade_4xx Hooks --- user_guide_src/source/installation/upgrade_4xx.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/user_guide_src/source/installation/upgrade_4xx.rst b/user_guide_src/source/installation/upgrade_4xx.rst index ae645d26c1a9..bf7ba85fece6 100644 --- a/user_guide_src/source/installation/upgrade_4xx.rst +++ b/user_guide_src/source/installation/upgrade_4xx.rst @@ -153,6 +153,12 @@ Hooks - Instead of CI3's ``$hook['post_controller_constructor']`` you now use ``Events::on('post_controller_constructor', ['MyClass', 'MyFunction']);``, with the namespace ``CodeIgniter\Events\Events;``. - Events are always enabled, and are available globally. +- The hook point ``pre_controller`` and ``post_controller`` have been removed. + Use :doc:`../incoming/filters` instead. +- The hook point ``display_override`` and ``cache_override`` have been removed. + Because the base methods have been removed. +- The hook point ``post_system`` has moved just before sending the final rendered + page. Extending the Framework ======================= From fde934ee87485d0b0e47b074690d99fcc0040bec Mon Sep 17 00:00:00 2001 From: kenjis Date: Tue, 24 Oct 2023 11:06:51 +0900 Subject: [PATCH 11/11] docs: fix typo --- user_guide_src/source/libraries/validation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide_src/source/libraries/validation.rst b/user_guide_src/source/libraries/validation.rst index 7a26a41d49fc..739d51b3fe6a 100644 --- a/user_guide_src/source/libraries/validation.rst +++ b/user_guide_src/source/libraries/validation.rst @@ -997,5 +997,5 @@ is_image Yes Fails if the file cannot be determined to be The file validation rules apply for both single and multiple file uploads. .. note:: Only rules specifically created for file validation (like the ones listed in the table above) can be used to validate files. - Therefore, adding any general rules, like ``permit_empy``, to file validation rules array or string, the file validation will not + Therefore, adding any general rules, like ``permit_empty``, to file validation rules array or string, the file validation will not work correctly.