Project

General

Profile

Actions

Bug #86228

closed

Silent upgrade wizard changes field definitions of extensions to wrong structure

Added by Wittkiel Gruppe over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Install Tool
Target version:
Start date:
2018-09-11
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Silent upgrade wizard changes field definitions of extensions to wrong structure. It should only do changes which are different than the defintions in ext_tables.sql.

TYPO3 9.4.0 (non-composer)
PHP 7.2

Steps to reproduce with some example-extensions:
1.) Install current Powermail (6.1.0) and Gridelements (9.0.0-dev)
2.) Execute "Analyze Database Structure": No changes required
3.) Execute "Upgrade Wizard" (all marked as done before!): Silent upgrade wizards are executed
4.) Execute "Analyze Database Structure" again: Multiple changes for tables of extensions, they are different than the definitions in ext_tables.sql of Powermail and Gridelements.

Silent changes:

ALTER TABLE tx_gridelements_backend_layout
CHANGE uid uid INT UNSIGNED AUTO_INCREMENT NOT NULL,
CHANGE tstamp tstamp INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE crdate crdate INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE cruser_id cruser_id INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE t3ver_oid t3ver_oid INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE t3ver_id t3ver_id INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE t3ver_wsid t3ver_wsid INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE t3ver_label t3ver_label VARCHAR(255) DEFAULT '' NOT NULL,
CHANGE t3ver_count t3ver_count INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE t3ver_tstamp t3ver_tstamp INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE t3ver_move_id t3ver_move_id INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE t3_origuid t3_origuid INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE deleted deleted SMALLINT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE hidden hidden SMALLINT UNSIGNED DEFAULT 0 NOT NULL 

Database table and field definitions: https://github.com/TYPO3-extensions/gridelements/blob/master/ext_tables.sql

CREATE TABLE tx_gridelements_backend_layout (
    uid int(11) NOT NULL auto_increment,
    pid int(11) DEFAULT '0' NOT NULL,
    tstamp int(11) DEFAULT '0' NOT NULL,
    crdate int(11) DEFAULT '0' NOT NULL,
    cruser_id int(11) DEFAULT '0' NOT NULL,
    t3ver_oid int(11) DEFAULT '0' NOT NULL,
    t3ver_id int(11) DEFAULT '0' NOT NULL,
    t3ver_wsid int(11) DEFAULT '0' NOT NULL,
    t3ver_label varchar(30) DEFAULT '' NOT NULL,
    t3ver_state tinyint(4) DEFAULT '0' NOT NULL,
    t3ver_stage int(11) DEFAULT '0' NOT NULL,
    t3ver_count int(11) DEFAULT '0' NOT NULL,
    t3ver_tstamp int(11) DEFAULT '0' NOT NULL,
    t3ver_move_id int(11) DEFAULT '0' NOT NULL,
    t3_origuid int(11) DEFAULT '0' NOT NULL,
    sorting int(10) DEFAULT '0' NOT NULL,
    deleted tinyint(4) DEFAULT '0' NOT NULL,
    hidden tinyint(4) DEFAULT '0' NOT NULL,
    title varchar(255) DEFAULT '' NOT NULL,
    alias varchar(255) DEFAULT '' NOT NULL,
    frame int(11) DEFAULT '0' NOT NULL,
    description text,
    horizontal tinyint(4) DEFAULT '0' NOT NULL,
    top_level_layout tinyint(4) DEFAULT '0' NOT NULL,
    config text,
    pi_flexform_ds mediumtext,
    pi_flexform_ds_file text,
    icon text,    

    PRIMARY KEY (uid),
    KEY parent (pid,deleted,hidden,sorting),
    KEY t3ver_oid (t3ver_oid,t3ver_wsid)
);

Silent changes:

ALTER TABLE tx_powermail_domain_model_answer
CHANGE uid uid INT UNSIGNED AUTO_INCREMENT NOT NULL,
CHANGE t3ver_oid t3ver_oid INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE t3ver_id t3ver_id INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE t3ver_wsid t3ver_wsid INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE t3ver_count t3ver_count INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE t3ver_tstamp t3ver_tstamp INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE t3ver_move_id t3ver_move_id INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE t3_origuid t3_origuid INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE l10n_parent l10n_parent INT UNSIGNED DEFAULT 0 NOT NULL

ALTER TABLE tx_powermail_domain_model_field
CHANGE uid uid INT UNSIGNED AUTO_INCREMENT NOT NULL,
CHANGE t3ver_oid t3ver_oid INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE t3ver_id t3ver_id INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE t3ver_wsid t3ver_wsid INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE t3ver_count t3ver_count INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE t3ver_tstamp t3ver_tstamp INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE t3ver_move_id t3ver_move_id INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE t3_origuid t3_origuid INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE l10n_parent l10n_parent INT UNSIGNED DEFAULT 0 NOT NULL

ALTER TABLE tx_powermail_domain_model_form
CHANGE uid uid INT UNSIGNED AUTO_INCREMENT NOT NULL,
CHANGE t3ver_oid t3ver_oid INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE t3ver_id t3ver_id INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE t3ver_wsid t3ver_wsid INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE t3ver_count t3ver_count INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE t3ver_tstamp t3ver_tstamp INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE t3ver_move_id t3ver_move_id INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE t3_origuid t3_origuid INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE l10n_parent l10n_parent INT UNSIGNED DEFAULT 0 NOT NULL

ALTER TABLE tx_powermail_domain_model_mail
CHANGE uid uid INT UNSIGNED AUTO_INCREMENT NOT NULL,
CHANGE t3ver_oid t3ver_oid INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE t3ver_id t3ver_id INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE t3ver_wsid t3ver_wsid INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE t3ver_count t3ver_count INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE t3ver_tstamp t3ver_tstamp INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE t3ver_move_id t3ver_move_id INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE t3_origuid t3_origuid INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE l10n_parent l10n_parent INT UNSIGNED DEFAULT 0 NOT NULL

ALTER TABLE tx_powermail_domain_model_page
CHANGE uid uid INT UNSIGNED AUTO_INCREMENT NOT NULL,
CHANGE t3ver_oid t3ver_oid INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE t3ver_id t3ver_id INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE t3ver_wsid t3ver_wsid INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE t3ver_count t3ver_count INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE t3ver_tstamp t3ver_tstamp INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE t3ver_move_id t3ver_move_id INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE t3_origuid t3_origuid INT UNSIGNED DEFAULT 0 NOT NULL,
CHANGE l10n_parent l10n_parent INT UNSIGNED DEFAULT 0 NOT NULL

Database table and field definitions: https://github.com/einpraegsam/powermail/blob/develop/ext_tables.sql

CREATE TABLE tx_powermail_domain_model_form (
    uid int(11) NOT NULL auto_increment,
    pid int(11) DEFAULT '0' NOT NULL,

    title varchar(255) DEFAULT '' NOT NULL,
    note tinyint(4) unsigned DEFAULT '0' NOT NULL,
    css varchar(255) DEFAULT '' NOT NULL,
    pages varchar(255) DEFAULT '' NOT NULL,

    tstamp int(11) unsigned DEFAULT '0' NOT NULL,
    crdate int(11) unsigned DEFAULT '0' NOT NULL,
    cruser_id int(11) unsigned DEFAULT '0' NOT NULL,
    deleted tinyint(4) unsigned DEFAULT '0' NOT NULL,
    hidden tinyint(4) unsigned DEFAULT '0' NOT NULL,
    starttime int(11) unsigned DEFAULT '0' NOT NULL,
    endtime int(11) unsigned DEFAULT '0' NOT NULL,

    is_dummy_record tinyint(1) DEFAULT '0' NOT NULL,

    t3ver_oid int(11) DEFAULT '0' NOT NULL,
    t3ver_id int(11) DEFAULT '0' NOT NULL,
    t3ver_wsid int(11) DEFAULT '0' NOT NULL,
    t3ver_label varchar(255) DEFAULT '' NOT NULL,
    t3ver_state tinyint(4) DEFAULT '0' NOT NULL,
    t3ver_stage int(11) DEFAULT '0' NOT NULL,
    t3ver_count int(11) DEFAULT '0' NOT NULL,
    t3ver_tstamp int(11) DEFAULT '0' NOT NULL,
    t3ver_move_id int(11) DEFAULT '0' NOT NULL,
    t3_origuid int(11) DEFAULT '0' NOT NULL,

    sys_language_uid int(11) DEFAULT '0' NOT NULL,
    l10n_parent int(11) DEFAULT '0' NOT NULL,
    l10n_diffsource mediumblob,

    PRIMARY KEY (uid),
    KEY parent (pid),
    KEY t3ver_oid (t3ver_oid,t3ver_wsid),
    KEY language (l10n_parent,sys_language_uid)
);

Actions #1

Updated by Jigal van Hemert over 5 years ago

  • Status changed from New to Needs Feedback

The fields that are silently changed are for internal maintenance (created/modified, versioning, translation) and do not contain user data. They are also (normally) not filled or modified directly by the extension code but by the TYPO3 core.
Which fields are present is determined by various settings in the TCA. It's no longer necessary to have these in the ext_tables.sql as they are automatically added by the core.
The modified versions are slightly different from the definition by the extension; integers are unsigned and varchar's are slightly larger.

In what way does this cause any issues for you?

Actions #2

Updated by Wittkiel Gruppe over 5 years ago

Ok, thanks for detailled explanation.
To be honest i find it really anoying that the database analyzer is full of changes everytime after only opening upgrade wizard.
Perhaps the database analyzer also should do this changes silently for this internal fields without listing and asking for it. What do you think?

Actions #3

Updated by Christian Kuhn over 5 years ago

I didn't look at this case in detail yet and did not reproduce it, yet. Usually, the auto-creation of fields should only kick in if the fields are not defined in ext_tables.sql, they should not override settings from ext_tables.sql. I wonder what exactly is missing in case of the upgrade wizards and may have a look at this.

Actions #4

Updated by Susanne Moog over 5 years ago

  • Category set to Install Tool
Actions #5

Updated by Christian Kuhn over 5 years ago

  • Status changed from Needs Feedback to New

confirmed. will push a fix.

Actions #6

Updated by Gerrit Code Review over 5 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58353

Actions #7

Updated by Gerrit Code Review over 5 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58353

Actions #8

Updated by Gerrit Code Review over 5 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58353

Actions #9

Updated by Christian Kuhn over 5 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #10

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF