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 9 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
| 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.
There was a problem hiding this comment.
| self::applyTypeRename( | |
| $migration, | |
| $type_id, | |
| $old_name, | |
| $new_name, | |
| $old_itemtype, | |
| $new_itemtype, | |
| ); | |
| try { | |
| self::applyTypeRename( | |
| $migration, | |
| $type_id, | |
| $old_name, | |
| $new_name, | |
| $old_itemtype, | |
| $new_itemtype, | |
| ); | |
| } catch (RuntimeException $e) { | |
| Session::addMessageAfterRedirect($e->getMessage(), false, ERROR); | |
| return false; | |
| } |
…ed in Fields dropdowns
| class="form-control" | ||
| value="{{ genericobject_type.name }}" | ||
| pattern="[a-zA-Z][a-zA-Z0-9]*" | ||
| maxlength="{{ constant('PluginGenericobjectType::MAX_TYPE_NAME_LENGTH') }}" |
There was a problem hiding this comment.
maxlength = MAX_TYPE_NAME_LENGTH (25) limits the raw input, but getSystemName() replaces ALL numbers with words (a5555555 --> afivefivefivefivefivefivefive, 8 --> 29 characters). A name that is valid on the client side may exceed the server limit.

Description
Screenshots (if appropriate):
Conflict:

Migrate
