[MAINTENANCE] Add query debugging to repositories#1942
Open
beatrycze-volk wants to merge 7 commits intokitodo:mainfrom
Open
[MAINTENANCE] Add query debugging to repositories#1942beatrycze-volk wants to merge 7 commits intokitodo:mainfrom
beatrycze-volk wants to merge 7 commits intokitodo:mainfrom
Conversation
Centralizes the logic for setting storage page IDs for Extbase repositories. All repositories now extend this new abstract class, gaining access to a unified `setStoragePid` method to configure query settings, reducing code duplication and improving maintainability.
Explicitly sets the 'storagePid' from plugin settings on various repositories within controller actions. This ensures consistent data retrieval and manipulation by correctly scoping repository queries to the configured storage page, leveraging the `setStoragePid` method introduced with `AbstractRepository`.
This change ensures that functional tests correctly pass the `storagePid` setting to controller actions. This aligns the tests with the updated repository logic, which now expects the `storagePid` for scoping queries, as introduced by the `AbstractRepository` and applied in recent controller changes.
Relocates the `setStoragePid` call from `initializeAction` to `initializeDocumentRepository`. This ensures that the `storagePid` setting is processed by `sanitizeSettings()` before being passed to the document repository, improving initialization order and robustness.
Aligns the `initializeRepository` helper with the `AbstractRepository` by using its `setStoragePid` method. This removes the need for explicit `Typo3QuerySettings` setup in functional tests, streamlining repository instantiation.
All repositories now extend `AbstractRepository`, which in turn extends `TYPO3\CMS\Extbase\Persistence\Repository`. This makes the direct `use` statement in individual repository classes redundant and can be removed for cleaner code.
Introduces a debug mode in the AbstractRepository that allows developers to inspect the generated SQL queries and their parameters. This functionality supports both Extbase QueryInterface and Doctrine QueryBuilder queries, making it easier to understand and troubleshoot database interactions.
0436a1d to
0b0d6cc
Compare
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.
Depends on #1941