Skip to content

Migrate GenericObject fields to Asset model fields#992

Closed
MyvTsv wants to merge 26 commits into
pluginsGLPI:feature/glpi-11.0from
MyvTsv:migration_genericobject_fields_to_core
Closed

Migrate GenericObject fields to Asset model fields#992
MyvTsv wants to merge 26 commits into
pluginsGLPI:feature/glpi-11.0from
MyvTsv:migration_genericobject_fields_to_core

Conversation

@MyvTsv
Copy link
Copy Markdown
Contributor

@MyvTsv MyvTsv commented Aug 11, 2025

Checklist before requesting a review

Please delete options that are not relevant.

  • 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.
  • I have updated the CHANGELOG with a short functional description of the fix or new feature.
  • This change requires a documentation update.

Description

Since the genericobject plugin has been replaced natively by Assets in glpi11, this PR migrates the fields for assets.

@MyvTsv MyvTsv requested review from Lainow and Rom1-B August 11, 2025 13:15
@MyvTsv MyvTsv self-assigned this Aug 11, 2025
@MyvTsv
Copy link
Copy Markdown
Contributor Author

MyvTsv commented Aug 14, 2025

Missing element in the PR:

  • Check that the plugin is up to date (latest version).
  • Check the existence and integrity of the glpi_plugin_genericobject_types table.
  • Fix the escape bug with itemtypes. For example, the itemtype Glpi\CustomAsset\telephoneAsset becomes Glpi\CustomAsset\ elephoneAsset because the \t sequence is not correctly escaped and is interpreted as a tab.
  • Test with large tables.

Comment thread inc/container.class.php Outdated
Comment thread inc/container.class.php
Comment on lines +187 to +190
$query = "RENAME TABLE `$old_table` TO `$new_table`";
if (!$DB->doQuery($query)) {
throw new \RuntimeException('Error renaming table: ' . $DB->error());
}
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.

You can use $migration->renameTable($oldtable, $newtable)

@Rom1-B Rom1-B requested a review from stonebuzz August 18, 2025 13:15
@Rom1-B
Copy link
Copy Markdown
Contributor

Rom1-B commented Aug 19, 2025

Replaced by #996

@Rom1-B Rom1-B closed this Aug 19, 2025
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