Skip to content

SQL and PHP errors when exporting a computer asset to PDF in GLPI 11.0.x #86

@Norcarde

Description

@Norcarde

We are experiencing issues with the PDF export plugin on GLPI version 11.0.x. When trying to export a computer's inventory, we encounter several PHP warnings and a fatal SQL error that prevents the PDF from being generated.

Prerequisites

GLPI Version: 11.0.x

Plugin: PDF Export

Steps to Reproduce

Navigate to a computer asset's page (e.g., Assets > Computers > select a computer).

Click on the "PDF Export" option from the available actions or tabs.

The page to select the tables for the PDF report is displayed, but with PHP warnings at the top.

Keep the default selections or choose any tables to include.

Attempt to generate the PDF.

Expected Behavior

A PDF file should be successfully generated and downloaded, containing the selected inventory details for the computer.

Actual Behavior

The process fails. Two types of errors are observed:

On the PDF content selection page, the following PHP warnings are displayed (as seen in the attached screenshot imagen.jpg):

php
PHP Warning: Undefined property: PluginPdfComputer::$fields at /marketplace/glpiinventory/inc/collect.class.php line 71
PHP Warning: Trying to access array offset on value of type null at /marketplace/glpiinventory/inc/collect.class.php line 71

After clicking the button to generate the PDF, an "Unexpected error" page appears with a fatal SQL error (as seen in the attached screenshot Captura-de-pantalla-2025-11-07-083450.jpg):

Error Message:

sql
MySQL error: Unknown column 'COUNT(*)' in 'SELECT list' (1054)

Failing Query:

sql
SELECT COUNT(*) AS 'id', 'DeviceNetworkCards_Id', 'mac', 'serial', 'otherserial', 'locations_id', 'states_id', 'uuid' FROM 'glpi_items_devicecomputers' WHERE 'it...

The stack trace points to the PDF plugin (PluginPdfCommon::generatePDF). It seems the SQL query being generated is syntactically incorrect.

These errors make it impossible to export computer asset data to PDF.

Thank you for your support.

Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions