#100807Analyze Database Structure fails with EnforceableQueryRestriction and constructor dependencies
Description
Given:
- an own class implementing the QueryRestrictionInterface and EnforceableQueryRestrictionInterface using a constructor dependency to another class
- this class is marked as public in settings.yaml
- this class is registered in $GLOBALS[‘TYPO3_CONF_VARS’][‘DB’][‘additionalQueryRestrictions’]
Expectation:
- calling “Analyze Database Structure” in maintenance module should compare the current database structure with expected on
Actual:
- an error occurs as the (constructor) dependency cannot be resolved
- the failsafe container instead of the symfony dependency container is used
Reviews 2
Related issues 2
History 1020
-
Garvin Hicking commented and changed category <span data-processor="relativetime" data-value="2024-07-31T11:15:35+00:00" > 07/31/24, 11:15 </span>
-
Stefan Bürk commented <span data-processor="relativetime" data-value="2024-11-07T16:01:55+00:00" > 11/07/24, 16:01 </span>
Would be nice to know which query / code executes a query using the restricting in that context. I’d say, all queries within db analyzer should omit any restrictin completly in that context.
-
Stefan Bürk changed Related to #84244 <span data-processor="relativetime" data-value="2024-12-17T09:25:33+00:00" > 12/17/24, 09:25 </span>
-
Christian Kuhn commented and changed status
NewNeeds Feedback <span data-processor="relativetime" data-value="2025-02-03T06:51:55+00:00" > 02/03/25, 06:51 </span>Agreed, Stefan. Nicole, would you like to backtrace to see which ext:install related query triggers this?
-
Garvin Hicking commented <span data-processor="relativetime" data-value="2025-06-06T08:58:26+00:00" > 06/06/25, 08:58 </span>
bump?
-
Stefan Bürk commented and changed assigned to Stefan Bürk <span data-processor="relativetime" data-value="2026-04-14T09:23:59+00:00" > 04/14/26, 09:23 </span>
No stack trace until now and further information.
I guess that this is related to #109437 where we had an
issue with restriction DI more generic in case tableMapping
of a table to a secondard connection has been configured
but no “ext_tables.sql/DefaultTcaSchema (TCA)” for that
table exists.One query failed during QueryBuilder creation because of
the general added TcaSchemaFactory as injected services
to all the restriction container.Did not found other queries during DatabaseAnalyzer leading
to that issue and I would connect to this.That was solvable in main because a `EmptyRestrictionContainer`
has been introduced in main along with adding TcaSchemaFactory
as DI dependency to the restriction handling and coould be set
enforced and having some lowlevel fallbacks for connection pool
set.Going to look into this if we can backport the new container
and fix at least to v13, but I fear not to v12 or later.I would really suggest to make the required services `public: true`
and use `GeneralUtility::makeInstance()` instead of constructor
injection for custom restriction enforced meanwhile. -
Stefan Bürk changed Related to #109437 <span data-processor="relativetime" data-value="2026-04-14T09:24:18+00:00" > 04/14/26, 09:24 </span>
-
Helmut Hummel commented <span data-processor="relativetime" data-value="2026-04-14T09:52:25+00:00" > 04/14/26, 09:52 </span>
This would be resolved with a oneliner, when we consistenly change all $this->lateBootService->loadExtLocalconfDatabaseAndExtTables() calls to not reset the container, which was done in installer for v14 to allow import to work.
It is a design decision to boot TYPO3 fully in install tool, but keep the failsafe container in GeneralUtility.
I’m not sure why this decision was taken, but given this bug and the latest change in installer makes me think, that it would be more logical
to expose the full container in GU once TYPO3 is fully booted in general. Full boot means that there is userland code active and this userland code might rely on fully booted DI, which is not possible to receive in all places where TYPO3 code calls makeInstance for user code.
Query restrictions might be only one example -
Gerrit Code Review pushed patch set 1 for main to change 93665 status
Needs FeedbackUnder Review <span data-processor="relativetime" data-value="2026-04-14T12:51:49+00:00" > 04/14/26, 12:51 </span> -
Gerrit Code Review pushed patch set 2 for main to change 93665 <span data-processor="relativetime" data-value="2026-04-14T13:04:09+00:00" > 04/14/26, 13:04 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 93665 <span data-processor="relativetime" data-value="2026-04-15T07:52:16+00:00" > 04/15/26, 07:52 </span>
-
Gerrit Code Review pushed patch set 4 for main to change 93665 <span data-processor="relativetime" data-value="2026-04-15T14:22:00+00:00" > 04/15/26, 14:22 </span>
-
Gerrit Code Review pushed patch set 5 for main to change 93665 <span data-processor="relativetime" data-value="2026-04-15T14:23:05+00:00" > 04/15/26, 14:23 </span>
-
Gerrit Code Review pushed patch set 6 for main to change 93665 <span data-processor="relativetime" data-value="2026-04-15T15:09:03+00:00" > 04/15/26, 15:09 </span>
-
Gerrit Code Review pushed patch set 7 for main to change 93665 <span data-processor="relativetime" data-value="2026-04-15T22:32:49+00:00" > 04/15/26, 22:32 </span>
-
Gerrit Code Review pushed patch set 8 for main to change 93665 <span data-processor="relativetime" data-value="2026-04-16T12:40:07+00:00" > 04/16/26, 12:40 </span>
-
Gerrit Code Review pushed patch set 9 for main to change 93665 <span data-processor="relativetime" data-value="2026-04-16T14:03:59+00:00" > 04/16/26, 14:03 </span>
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 93695 <span data-processor="relativetime" data-value="2026-04-16T16:01:54+00:00" > 04/16/26, 16:01 </span>
-
Stefan Bürk commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-04-16T16:40:11+00:00" > 04/16/26, 16:40 </span>Applied in changeset commit:5d2d23be020178f11264a226827c3369673e0523.
-
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2026-04-21T11:30:29+00:00" > 04/21/26, 11:30 </span>
Probably the fail-safe container can’t be circumvented easily, because all the maintenance section runs with it.
Adjusting category of this issue.