Skip to content

[BUGFIX] Make kitodo:databaseDocsGenerate work and improve its output - #2173

Merged
sebastian-meyer merged 2 commits into
kitodo:mainfrom
stweil:fix-database-docs-command
Oct 19, 2026
Merged

sebastian-meyer merged 2 commits into
kitodo:mainfrom
stweil:fix-database-docs-command

Conversation

@stweil

@stweil stweil commented Sep 27, 2026

Copy link
Copy Markdown
Member
  • The command failed with "The requested database connection named 'Default' has not been configured" even though it never uses a database: injecting the DataMapper forced the DI container to build the PageRepository, whose constructor opens a connection. Read the extbase class configuration from the extension's Classes.php instead, and derive the column names from the property names (the domain models do not use explicit column names), removing the DataMapper and the unused ConfigurationManager dependency.
  • Fix a TypeError with DBAL 4, which TYPO3 v13 uses, because Type::getName() no longer exists; use Type::lookupName() instead.
  • The @var parser dropped everything after a generic part of the type, e.g. "@var int<1, max>|null The uid of the record" became "max>|null The uid of the record". Strip the whole type, including generics and unions, from the @var line.
  • Do not leave trailing whitespace on empty description lines.
  • Abort with a clear error message if the dlf TCA is not loaded, i.e. if the command is run from the extension source directory instead of a TYPO3 site, because the generated page would be missing all TCA labels and titles.
  • Regenerate the database documentation page, which also updates the command name in the tip and adds TCA labels that were added since it was last generated.

Assisted-by: OpenCode / Qwen3.8-27b-thinking (Alibaba Cloud)

@sebastian-meyer sebastian-meyer added the ☇ bug A non-security related bug. label Sep 28, 2026
@codecov

codecov Bot commented Sep 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (875b458) to head (9dcf080).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@     Coverage Diff      @@
##   main   #2173   +/-   ##
============================
============================

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sebastian-meyer

Copy link
Copy Markdown
Member
  • Fix a TypeError with DBAL 4, which TYPO3 v13 uses, because Type::getName() no longer exists; use Type::lookupName() instead.

Is this still backwards-compatible with TYPO3 v12? Otherwise we should wait for Kitodo.Presentation v8.

@stweil

stweil commented Sep 28, 2026 •

Copy link
Copy Markdown
Member Author

Type::lookupName() was added in DBAL 3.7.0. So: compatible with T12 as long as the installed DBAL is ≥ 3.7, but strictly speaking the code no longer works on the oldest DBAL (3.6.2–3.6.7) that T12 still allows.

CI with T12 reports "Downgrading doctrine/dbal (4.4.3 => 3.10.6)" and therefore works fine.

Maybe add a hint in the release notes for users with T12.

- The command failed with "The requested database connection named
  'Default' has not been configured" even though it never uses a
  database: injecting the DataMapper forced the DI container to build
  the PageRepository, whose constructor opens a connection. Read the
  extbase class configuration from the extension's Classes.php instead,
  and derive the column names from the property names (the domain
  models do not use explicit column names), removing the DataMapper
  and the unused ConfigurationManager dependency.
- Fix a TypeError with DBAL 4, which TYPO3 v13 uses, because
  Type::getName() no longer exists; use Type::lookupName() instead.
- The @var parser dropped everything after a generic part of the type,
  e.g. "@var int<1, max>|null The uid of the record" became
  "max>|null The uid of the record". Strip the whole type, including
  generics and unions, from the @var line.
- Do not leave trailing whitespace on empty description lines.
- Abort with a clear error message if the dlf TCA is not loaded, i.e.
  if the command is run from the extension source directory instead of
  a TYPO3 site, because the generated page would be missing all TCA
  labels and titles.
- Regenerate the database documentation page, which also updates the
  command name in the tip and adds TCA labels that were added since it
  was last generated.

Assisted-by: OpenCode / Qwen3.8-27b-thinking (Alibaba Cloud)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
@stweil
stweil force-pushed the fix-database-docs-command branch from 9dcf080 to 0e2d989 Compare September 28, 2026 11:51
@sebastian-meyer
sebastian-meyer merged commit 3b41b69 into kitodo:main Oct 19, 2026
10 checks passed
@stweil
stweil deleted the fix-database-docs-command branch October 19, 2026 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

☇ bug A non-security related bug.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants