Skip to content

Fix(install): use unsigned integers for primary and foreign key - #60

Merged
stonebuzz merged 2 commits into
mainfrom
fix_int_unsigned
Sep 4, 2025
Merged

Fix(install): use unsigned integers for primary and foreign key#60
stonebuzz merged 2 commits into
mainfrom
fix_int_unsigned

Conversation

@stonebuzz

Copy link
Copy Markdown
Contributor

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

During plugin installation, a PHP warning could occur due to the use of an incorrect SQL field type:

[2025-09-04 12:17:30] glpiphplog.WARNING: *** PHP User Warning (512): Usage of signed integers in primary or foreign keys is discouraged, please use unsigned integers instead in`glpi_plugin_centreon_hosts`.`items_id`. in /home//DEV/GLPI/10bugfixes/src/DBmysql.php at line 2181
Backtrace :
src/DBmysql.php:2181 trigger_error()
src/DBmysql.php:386 DBmysql->checkForDeprecatedTableOptions()
plugins/centreon/hook.php:59 DBmysql->doQuery()
src/Plugin.php:955 plugin_centreon_install()
front/plugin.form.php:51 Plugin->install()
public/index.php:82 require()

The issue was caused by the use of a signed integer in a primary or foreign key, which is discouraged.

A migration script has been added to automatically update the field type.

Screenshots (if appropriate):

@stonebuzz
stonebuzz merged commit bc82288 into mainSep 4, 2025
3 checks passed
@stonebuzz
stonebuzz deleted the fix_int_unsigned branch September 4, 2025 12:47
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugSomething isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue Installing and Displaying the Centreon 1.0.2 Plugin on GLPI 10.0.18

2 participants

@stonebuzz@Mary-Clb