Skip to content

[MAINTENANCE] Add query debugging to repositories#1942

Open
beatrycze-volk wants to merge 7 commits intokitodo:mainfrom
beatrycze-volk:repository-debug
Open

[MAINTENANCE] Add query debugging to repositories#1942
beatrycze-volk wants to merge 7 commits intokitodo:mainfrom
beatrycze-volk:repository-debug

Conversation

@beatrycze-volk
Copy link
Copy Markdown
Collaborator

Depends on #1941

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.
@beatrycze-volk beatrycze-volk self-assigned this Apr 28, 2026
@beatrycze-volk beatrycze-volk added the ⟳ maintenance A task to keep the code up-to-date and manageable. label Apr 28, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⟳ maintenance A task to keep the code up-to-date and manageable.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant