From 32ebe08cd87011fe470260fe488daa304a6da925 Mon Sep 17 00:00:00 2001 From: michalsn Date: Tue, 1 Jul 2025 15:02:19 +0200 Subject: [PATCH] docs: add detailed explanation about paginate() and beforeFind model event --- user_guide_src/source/models/model.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/user_guide_src/source/models/model.rst b/user_guide_src/source/models/model.rst index bfef42f86d32..57fb52a024c3 100644 --- a/user_guide_src/source/models/model.rst +++ b/user_guide_src/source/models/model.rst @@ -1032,6 +1032,15 @@ afterUpdateBatch **data** = the key/value pairs being updated. **result** = the results of the ``updateBatch()`` method used through the Query Builder. ================= ========================================================================================================= +.. note:: When using the ``paginate()`` method in combination with the ``beforeFind`` event to modify the query, + the results may not behave as expected. + + This is because the ``beforeFind`` event only affects the actual retrieval of the results (``findAll()``), + but **not** the query used to count the total number of rows for pagination. + + As a result, the total row count used for generating pagination links may not reflect the modified query conditions, + leading to inconsistencies in pagination. + Modifying Find* Data ====================