Review main Merged

62154[BUGFIX] DefaultTcaSchema must not create SQL for tables not requested

Markus Klein CR +2 V +2 Normal +93 −88 updated 01/12/20, 13:00

Commit message

The DefaultTcaSchema::enrich() function dynamically adds TCA-defined
ctrl-fields to the SQL schema definition for a provided set of tables.

The function used to add these definition for any table that is defined
in TCA, independent whether the table actually exists in any
ext_tables.sql file.
While this behaviour is no problem under the assumption that the
function is always called with the content of all ext_tables.sql files,
this is a problem if the function is called with only a subset of those
ext_tables.sql files. One example is the "extension manager tables"
upgrade in the Install Tool.

Despite the fact that the function was documented that it needs to be
called with the full set of tables, it actually is not strictly
necessary to do so.

This patch changes the requirement for the enrich() function and
changes the behaviour to not dynamically create tables if those are
found in TCA.

Technical detail to the reported bug:
The table definitions created by this class are usually overruled by
whatever might be defined in an ext_tables.sql file. In case of the
upgrade wizard (where only extension manager tables are requested) the
table definitions for all TCA tables were created based on the best
practice suggestions from the core. If the present DB schema (created by
the real ext_tables.sql files) mismatched those suggested definitions a
DB schema change was proposed, hence the wizard kept popping up.

Review

  • Code review CR +2

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 1

Files 3