Skip to content

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

@Stufo76

Description

@Stufo76

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions