[FIX] 0047627: UpdateSteps werfen Fehler (Database flatten broke getDeclaration)#11472
Open
chfsx wants to merge 1 commit intoILIAS-eLearning:trunkfrom
Open
Conversation
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.
416117a to
66fd639
Compare
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.
Summary
acdcd2ff7b3("Database: Flatten field definition") removed all individualget{Type}Declarationmethods and thegetDeclarationOptions/getInternalDeclarationhelpers fromilDBPdoFieldDefinitionwhen merging intoilDBPdoMySQLFieldDefinition.getDeclaration()was copied verbatim and still used dynamic dispatch via$this->{"get{$type}Declaration"}($name, $field), which no longer exists — causingilDatabaseException: type not defined: texton anymodifyTableColumn()call for text columns.Test11DBUpdateSteps::step_6()(and potentially other DB update steps).Fix
getDeclaration()with direct logic.getDeclarationOptions()as aprivatehelper handling DEFAULT, NOT NULL, and collation — matching the original logic fromilDBPdoFieldDefinition.Test plan
php cli/setup.php update -y—Test11DBUpdateSteps::step_6()andstep_7()complete without exception.phpunit components/ILIAS/Database/tests/).phpunit components/ILIAS/Test/tests/).Fixes: https://mantis.ilias.de/view.php?id=47627