feat(migration): add type renaming to resolve native asset name conflicts#472
feat(migration): add type renaming to resolve native asset name conflicts#472MyvTsv wants to merge 4 commits into
Conversation
|
Does this apply to names that are too long? And CLI ? |
|
CLI compatibility would be a plus. |
|
At the time of renaming, it should also be ensured that the total length (PluginGenericObject + New name) does not exceed the maximum allowed size for MySQL table names. |
Rom1-B
left a comment
There was a problem hiding this comment.
It works.
Could you add a check that alerts if the table name exceeds 64 characters?
In the CLI, add at least one check and a message to prompt renaming in the interface.
Rom1-B
left a comment
There was a problem hiding this comment.
We also need to add the case where the Fields plugin adds fields
| <div class="d-flex flex-wrap justify-content-start gap-3"> | ||
| {% for key, genericobject_type in paginated_types %} | ||
| {% set is_conflicting = genericobject_type.name|lower in reserved_names and customassets[genericobject_type.name] is not defined %} | ||
| {% set is_too_long = genericobject_type.name|length > constant('PluginGenericobjectType::MAX_TYPE_NAME_LENGTH') and customassets[genericobject_type.name] is not defined %} |
There was a problem hiding this comment.
The Twig template checks name|length > 25 but renameType() validates strlen(getSystemName($new_name)) > 25. Since getSystemName() expands digits to words, a short name with digits can silently fail server-side without any warning shown on the card. The maxlength="25" on the modal input has the same problem.
| self::applyTypeRename( | ||
| $migration, | ||
| $type_id, | ||
| $old_name, | ||
| $new_name, | ||
| $old_itemtype, | ||
| $new_itemtype, | ||
| ); |
There was a problem hiding this comment.
If applyPluginsTypeRename() catches an exception and returns early, renameType() still displays the success message. The failure needs to propagate so the success flash isn't shown.
Description
Screenshots (if appropriate):
Conflict:

Migrate
