Skip to content

Comments

Add GLPI 11 compatibility (v2.8.0)#141

Open
loulouontop wants to merge 1 commit intoyllen:masterfrom
loulouontop:glpi-11-compatibility
Open

Add GLPI 11 compatibility (v2.8.0)#141
loulouontop wants to merge 1 commit intoyllen:masterfrom
loulouontop:glpi-11-compatibility

Conversation

@loulouontop
Copy link

Summary

This PR adds compatibility with GLPI 11.x while keeping support for GLPI 10.0.5+.

Changes (GLPI 11 / Symfony-related)

  • Version requirements: Extended to GLPI 11.99 in setup.php and behaviors.xml.
  • Method signatures: Added return types for CommonGLPI/CommonDBTM (e.g. canCreate(): bool, getTypeName(): string) to match GLPI 11.
  • No direct SQL: Replaced raw $DB->queryOrDie() with Migration::addPreQuery() / addPostQuery() for table creation and notification updates (GLPI 11 "Executing direct queries is not allowed").
  • Query builder: All $DB->request('table', $criteria) updated to $DB->request(['FROM' => 'table', 'WHERE' => $criteria]); raw SQL converted to array syntax where needed.
  • Input handling: Removed addslashes / Toolbox::addslashes_deep (handled by GLPI 11).
  • Config/init: Safe checks for $CFG_GLPI['asset_types']; optional plugin_behaviors_check_prerequisites(); guarded dropField with fieldExists.
  • Front scripts: Removed deprecated includes.php; replaced Html::displayErrorAndDie() with message + Html::back().
  • Install: Try/catch in install with user-visible error message; __DIR__ for requires; DBConnection fallbacks for charset/collation.

Tested on GLPI 11.x. Original authors: Remi Collet, Nelly Mahu-Lasson.

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.

1 participant