Skip to content

[FIX] 0047627: UpdateSteps werfen Fehler (Database flatten broke getDeclaration)#11472

Open
chfsx wants to merge 1 commit intoILIAS-eLearning:trunkfrom
srsolutionsag:fix/47627/12/database-flatten-missing-getdeclaration
Open

[FIX] 0047627: UpdateSteps werfen Fehler (Database flatten broke getDeclaration)#11472
chfsx wants to merge 1 commit intoILIAS-eLearning:trunkfrom
srsolutionsag:fix/47627/12/database-flatten-missing-getdeclaration

Conversation

@chfsx
Copy link
Copy Markdown
Member

@chfsx chfsx commented Apr 24, 2026

Summary

  • The commit acdcd2ff7b3 ("Database: Flatten field definition") removed all individual get{Type}Declaration methods and the getDeclarationOptions / getInternalDeclaration helpers from ilDBPdoFieldDefinition when merging into ilDBPdoMySQLFieldDefinition.
  • getDeclaration() was copied verbatim and still used dynamic dispatch via $this->{"get{$type}Declaration"}($name, $field), which no longer exists — causing ilDatabaseException: type not defined: text on any modifyTableColumn() call for text columns.
  • This broke Test11DBUpdateSteps::step_6() (and potentially other DB update steps).

Fix

  • Replace the broken dynamic dispatch in getDeclaration() with direct logic.
  • Restore getDeclarationOptions() as a private helper handling DEFAULT, NOT NULL, and collation — matching the original logic from ilDBPdoFieldDefinition.
  • CLOB/BLOB columns retain their special handling (no DEFAULT clause, only NOT NULL).

Test plan

  • Run php cli/setup.php update -yTest11DBUpdateSteps::step_6() and step_7() complete without exception.
  • All 49 Database unit tests pass (phpunit components/ILIAS/Database/tests/).
  • All 863 Test component unit tests pass (phpunit components/ILIAS/Test/tests/).

Fixes: https://mantis.ilias.de/view.php?id=47627

The "Database: Flatten field definition" refactoring removed the individual
get{Type}Declaration() methods (getTextDeclaration, getCLOBDeclaration, etc.)
and the getDeclarationOptions() / getInternalDeclaration() helpers from
ilDBPdoFieldDefinition when merging everything into ilDBPdoMySQLFieldDefinition.

getDeclaration() was kept unchanged and still dispatched dynamically to
"get{$type}Declaration()" — methods that no longer exist — causing

  ilDatabaseException: type not defined: text

on any modifyTableColumn() call for text columns, including
ILIAS\Test\Setup\Test11DBUpdateSteps::step_6() and step_7().

Replace the broken dynamic dispatch in getDeclaration() with direct logic and
restore getDeclarationOptions() as a private helper that handles DEFAULT,
NOT NULL and collation. CLOB/BLOB columns retain their special handling:
no DEFAULT clause, only NOT NULL.
@chfsx chfsx force-pushed the fix/47627/12/database-flatten-missing-getdeclaration branch from 416117a to 66fd639 Compare April 24, 2026 12:16
@chfsx chfsx assigned fwolf-ilias and lscharmer and unassigned fwolf-ilias Apr 24, 2026
@chfsx chfsx added the bugfix label Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants