Skip to content

feat(migration): add type renaming to resolve native asset name conflicts#479

Open
Rom1-B wants to merge 14 commits into
mainfrom
ticket42658
Open

feat(migration): add type renaming to resolve native asset name conflicts#479
Rom1-B wants to merge 14 commits into
mainfrom
ticket42658

Conversation

@Rom1-B

@Rom1-B Rom1-B commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

  • I have performed a self-review of my code.
  • I have added tests (when available) that prove my fix is effective or that my feature works.
  • This change requires a documentation update.

Description

  • It fixes !42658
  • It is not possible to migrate an asset from the genericobject plugin if its name is similar to an asset in the GLPI core. This fix allows users to rename an asset so they can continue the migration.

Screenshots (if appropriate):

Conflict:
image

Migrate
image

@Rom1-B Rom1-B requested a review from stonebuzz July 6, 2026 12:27
@Rom1-B Rom1-B changed the title Ticket42658 feat(migration): add type renaming to resolve native asset name conflicts Jul 6, 2026
Comment thread inc/type.class.php Outdated
Co-authored-by: Stanislas <skita@teclib.com>
@Rom1-B Rom1-B requested a review from stonebuzz July 13, 2026 11:36

@stonebuzz stonebuzz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something doesn't seem to be working correctly in the renaming process.

Let's take the KCM object as an example:

Image

I want to rename it to KVM.

After saving the change, GLPI displays a success message indicating that the operation completed successfully:

Image

However, after refreshing the page, I can see that the object has not actually been renamed and is still displayed as KCM.

I then retry the exact same operation, and this time it succeeds:

Image

The object is now correctly renamed to KVM:

Image

It looks like the first attempt returns a success message even though the rename is not actually applied. The change only takes effect after performing the exact same operation a second time.

@stonebuzz

Copy link
Copy Markdown
Contributor

If a plugin (in this case, Fields) references these objects, it breaks the migration process.

Traitement du plugin « fields »...
Installation des tables MySQL

In DBmysql.php line 417:
                                                                                                                                                                 
  MySQL query error: Table 'sopra.glpi_plugin_genericobject_kcms' doesn't exist (1146) in SQL query "SHOW COLUMNS FROM `glpi_plugin_genericobject_kcms`". 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants