1

I've got an error message from my craft (2.6.2990) after adding a German locale:

Resaving all localizable elements: Failed

Resaving matrix blocks: Failed

in the sidebar and here is what I found in craft logs:

2017/09/20 14:52:13 [error] [system.db.CDbCommand] CDbCommand::fetchAll() failed: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'zg_blike.craft_matrixcontent_files' doesn't exist. The SQL statement executed was: SELECT `elements`.`id`, `elements`.`type`, `elements`.`enabled`, `elements`.`archived`, `elements`.`dateCreated`, `elements`.`dateUpdated`, `elements_i18n`.`slug`, `elements_i18n`.`uri`, `elements_i18n`.`enabled` AS `localeEnabled`, `content`.`id` AS `contentId`, `matrixblocks`.`fieldId`, `matrixblocks`.`ownerId`, `matrixblocks`.`ownerLocale`, `matrixblocks`.`typeId`, `matrixblocks`.`sortOrder`

I checked the DB and of course did not find table called craft_matrixcontent_files, instead only craft_matrixcontent_file

Any ideas?

7
  • Forgot to mention: I'm using Craft Pro with Commerce installed
    – anvar
    Sep 20, 2017 at 15:34
  • Sounds like there are some consistency problem in your database. Are all of Craft's foreign keys in place between tables? We've seen it happen semi-frequently where someone restores a database backup to a MySQL box that only supports the MyISAM storage engine and it will silently drop all foreign keys causing data to get really out of sync.
    – Brad Bell
    Sep 20, 2017 at 18:46
  • It's very hard to say for me if ALL of the keys are there, but they seem to be fine: phpmyadmin's designer shows connections between tables, InnoDB is supported (all tables except searchindex).
    – anvar
    Sep 20, 2017 at 20:19
  • Someone manually edited the database maybe? Does the craft_fields table have a row with a "files" that's of type "Matrix"?
    – Brad Bell
    Sep 20, 2017 at 20:42
  • 1
    Thank you all for suggestions. At the end I have no idea what the problem exactly was, but I could solve it by renaming a table called matrxicontent_file to matrixcontent_files. For sure nobody edited the database, since I'm the only one who worked on it (except I do some things unconsciously). I also found something that can be related: There is an entry with a handle files which belongs to global context and another one with a handle file which belongs to matrixBlockType. I also tried to delete all the matrix fields from the CP and these strange ones manually. Did not help.
    – anvar
    Sep 27, 2017 at 16:44

1 Answer 1

1

I had a field called files, it did not belong to matrix. After deleting it (tried also simply renaming), the problem disappeared.

After that I created a field with the same name and that did not cause any problems.

Still do not know the exact reason, but later will have time dig a bit deeper, so if get some results will post them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.