ocsinventoryng icon indicating copy to clipboard operation
ocsinventoryng copied to clipboard

PHP warnings and SQL Error "Column 'item_disks_id' cannot be null" with BitlockerStatus plugin

Open Stufo76 opened this issue 10 months ago • 0 comments

Description: After installing and configuring the BitlockerStatus plugin with OCS Inventory integration on GLPI, I encountered the following warnings and errors in the cron execution:

PHP Warning: Undefined array key "id" in /var/www/glpi/marketplace/ocsinventoryng/inc/bitlockerstatus.class.php on line 78
PHP Warning: Undefined array key "id" in /var/www/glpi/marketplace/ocsinventoryng/inc/bitlockerstatus.class.php on line 99
SQL Error "1048": Column 'item_disks_id' cannot be null in query "UPDATE `glpi_plugin_ocsinventoryng_bitlockerstatuses` SET `item_disks_id` = NULL, `volume_type` = 'OperatingSystem', `protection_status` = 'Off', `init_project` = '' WHERE `id` = '25199'"

Steps to reproduce:

  1. Install the latest GLPI and OCSInventoryNG plugin.
  2. Activate BitlockerStatus data collection and synchronization in OCS Inventory.
  3. Run the scheduled cron task for OCSInventory synchronization.

Expected behavior: The synchronization should complete without warnings or errors, and all Bitlocker data should correctly populate in GLPI.

Actual behavior: PHP warnings and SQL errors occur because the code attempts to update the GLPI database with NULL values for the item_disks_id column.

Environment:

  • GLPI version: 10.0.18
  • OCSInventoryNG plugin version: 2.0.4
  • PHP version: 8.2.26
  • OS: Debian 12

Additional context: The issue seems related to missing or incomplete disk information coming from OCS Inventory, causing GLPI to fail updating records.

Stufo76 avatar Mar 14 '25 11:03 Stufo76