Hello,
modules like menu_item extras build bundle names for menu link content entities in this format: 'header-top'. So, we need to create yml files whose name is like 'menu_link_content.header-top.yml' or similar.
That leads to bugs and errors when building the migration ID, that would be something like 'mdc_menu_link_content_header-top'. That value is invalid and throws an error when trying to import:
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '-top (
`source_ids_hash` VARCHAR(64) NOT NULL COMMENT 'Hash of s' at line 1
Here I'm proposing a way to normalize migration names to avoid this kind of issues.
Best,
Pablo
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | normalize_name-3157417-2.patch | 2.72 KB | plopesc |
Comments
Comment #2
plopescPatch attached
Comment #4
rvilarIt sounds good to me. Do you think it could have any impact wit our previous migrations or with any other characters? I don't think so, but I prefer to ask before push it to the repository.
Comment #5
plopescHey Ramon.
I don't think so. We have a big battery of default content in our current site and everything is still working.
This is a very specific use case where machine names are not following the usual rule, lowercase letters, numbers and underscores.
Thank you for your quick response!
Comment #6
rodrigoaguileraI don't see any conflict with this change as bundle names can already have underscores and the patch just forces to have all in underscores.
The ability to get the bundle name from the migration id is lost but this module is not doing that anywhere.
My only nitpick is to change the method name from migrationName to buildMigrationName but I won't block the patch for that.
Comment #9
rodrigoaguileraI changed the method name in a subsequent commit.