Error #58

Upgrade failes whem template directory is same as module or language directory

Added by Ruud over 4 years ago. Updated over 4 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:
Operating System:


When doing upgrades...

The install_struct.sql will rebuild the addons table, but it uses a unique constraint on the 'directory' column.
It is perfectly fine to have a module in a directory 'abc' and a template in a directory 'abc'.

The line:

ALTER TABLE `{TABLE_PREFIX}addons` ADD UNIQUE `ident` ( `directory` );

will fail in this case, breaking the import of install_struct.sql.
Because of this other tables are not upgraded with this issue as result (failed upgrade):,30477.msg212348.html#msg212348

A unique index should be done on both fields `type` and `directory` to make it really unique.
Unfortunatly trying this solution generates the error:

ALTER TABLE `addons` ADD UNIQUE INDEX `ident` (`type`, `directory`);
/* SQL error (1071): Specified key was too long; max key length is 1000 bytes */

Both fields are set to VARCHAR (255). Using utf8 these fields can have 765 bytes per field (using utf8mb4 > 1020 bytes)

The fix would be make the fields shorter ( VARCHAR (125) to enable future utfmb4 ) or not to create a unique index on this table.


#1 Updated by Dietmar over 4 years ago

  • Due date set to 2017-10-31
  • Status changed from New to In Progress
  • Assignee changed from Manuela to Dietmar
  • % Done changed from 0 to 100

#2 Updated by Manuela over 4 years ago

  • Status changed from In Progress to Feedback

#3 Updated by Dietmar over 4 years ago

  • Status changed from Feedback to Done

Also available in: Atom PDF