Repository navigation
fix(query): a _related or _referenced block on a schema with no table matches nothing - #4682
Merged
Merged
Conversation
… matches nothing A schema that has never stored an object has no magic table yet, and the EXISTS subquery against it answered HTTP 500 (relation does not exist). The block now narrows to the empty set, the same answer the list path gives for a missing table, using MagicTableHandler::existsTableForRegisterSchema. Assisted-by: ClaudeCode:claude-opus-5-5
Contributor
Quality Report — ConductionNL/openregister @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ✅ | ||||
| phpmd | ❌ | ||||
| psalm | ✅ | ||||
| phpstan | ✅ | ||||
| phpmetrics | ✅ | ||||
| eslint | ✅ | ||||
| stylelint | ✅ | ||||
| build | ✅ | ||||
| check-specs | ✅ | ||||
| test-l10n | ✅ | ||||
| test-l10n-parity | ✅ | ||||
| format | ✅ | ||||
| check-schema-l10n | ✅ | ||||
| composer | ✅ | ✅ 173/173 | |||
| npm | ✅ | ✅ 648/648 | |||
| app:check-code | ⏭️ | ||||
| info.xml | ✅ | ||||
| REUSE | ✅ | ||||
| lockfile sync | ✅ | ||||
| PHPUnit | ✅ 26287/26287 · 25 skipped | ||||
| Newman | ✅ 714/714 | ||||
| Playwright | ⏭️ deferred: E2E runs locally and on the promotion path only. This pull request targets development, so the suite is asked once per promotion into beta and main rather than once per push per open pull request. Run it locally with npx playwright test, or from the Actions tab on a branch with no open pull request into development. |
||||
| Hydra gates | ✅ |
Quality workflow — 2026-10-18 08:26 UTC
Download the full PDF report from the workflow artifacts.
WilcoLouwerse
added a commit
that referenced
this pull request
Oct 19, 2026
…-fixes-r2 Conflicts: - OrganisationController: development's OrganisationUsageService (#4683 usage report) and this branch's optional GrantChangeAuditor both join the constructor; the required service comes before the optional auditor. - RelatedRowQueryApplier: development's missing-table guard and `*PREFIX*` table (#4682, #4684) kept; the bare table name still feeds the RBAC predicate's tableName (data-f3). - OrganisationGrantManageGuardTest: both new constructor arguments. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What
A
_relatedor_referencedblock that looks through a schema with no stored objects now matches nothing. Before this fix the request failed with HTTP 500.That schema has no magic table yet (
openregister_table_<register>_<schema>is created on first write). TheEXISTS (SELECT 1 FROM <table> ...)subquery from #4678 ran against it anyway, and Postgres answeredSQLSTATE[42P01] relation "openregister_table_23_281" does not exist. You can reproduce it on :8080 withGET /api/objects/dossiq/subsidieBeschikking?_referenced[subsidieAanvraag][subsidieaanvraag][case]=<uuid>(reqId RaFzCXqkY0sieghtIz3s).How
RelatedRowQueryApplier::apply()now asksMagicTableHandler::existsTableForRegisterSchema()before rendering each block. The list and count paths already use this check (MagicMapperreturns an empty result for a missing table), and it caches its answer. When the table is missing, the block adds1 = 0, so the query answers the empty set. The block is never dropped, because a dropped block would answer the unfiltered set. The schema lookup still runs first, so an unknown or ambiguous schema is still refused.Verified locally
RelatedRowQueryApplierTest::testAReferencedSchemaWithoutATableMatchesNothing. It fails on development and passes here.ReferencedRowFilterTestnow stubs the table as present.tests/Unit/Service/Query/(40 tests) andMagicSearchHandlerTestpass.composer check:strictrun: lint, phpcs, phpmd, psalm and phpstan pass.test:allran 26,312 tests with 15 errors. These are the same AuditTrail and DraftRemovalAuditRow database tests that fail on development, because they need the full Nextcloud server.AI-assisted: written with Claude Code.