[TYPO3-english] Could not rename fields in Install Tool

Boris Gulay boris at boressoft.ru
Fri Dec 9 17:13:28 CET 2011


09.12.2011 17:28, Boris Gulay пишет:
> I'm using Postgres as database backend. I've upgraded from 4.4 to 4.5.
> In database analyser I found some unused column from removed extensions.
> When I try to run renames for that columns I see the error:
> 
> Oops, an error occured!
> ERROR: Query could not be parsed: "SQL engine parse ERROR: Field type
> unknown in parseFieldDef()!: near "(255) default '' "". Query: "ALTER
> TABLE be_groups CHANGE tx_dam_mountpoints zzz_deleted_tx_dam_mountpoints
> (255) default '';"

I have traced the calls down till admin_get_fields function. I found
that it returns incorrect field type in "Type" key, but "type" key (from
lover case letter) contains correct value.
This function calls MetaType function for each field in a table passing
value from "type" array member and table name.
MetaType function, in case ADODB is used, performs SQL query "SELECT *
FROM <table> LIMIT 1" and calls MetaType function from returned object.
BUT ONLY if table name exists in cache_fieldType class variable.
Existence is checked by in_array($table, $this->cache_fieldType).

BUT!!! $this->cache_fieldType is not an array, it's a dictionary! So,
in_array will always return false. array_key_exists must be used instead!

I have made a patch (http://forge.typo3.org/issues/32427). It works OK
for me.



More information about the TYPO3-english mailing list