Description
When trying to export a Computer to PDF using the PDF plugin, an error occurs:
"Unexpected error occurred"
This only happens when the OCS Inventory NG plugin is enabled.
If the plugin is disabled, PDF export works correctly.
Environment
- GLPI version: 11.0.5
- PDF plugin: 4.1.2
- OCS Inventory NG plugin: (your version here)
- PHP: >= 8.2
Steps to reproduce
- Enable OCS Inventory NG plugin
- Go to Assets → Computers
- Open any computer (even a newly created one)
- Click "Print to PDF"
Expected behavior
PDF should be generated correctly.
Actual behavior
Error message:
"Unexpected error occurred"
Logs
[2026-03-18] glpi.CRITICAL: Uncaught PHP Exception:
Attempted to call an undefined method named "getID"
of class "PluginPdfComputer"
at Ocslink.php line 1015
Backtrace:
./marketplace/ocsinventoryng/src/Ocslink.php:1015
./marketplace/ocsinventoryng/src/Ocslink.php:885
./marketplace/pdf/inc/common.class.php:54
./marketplace/pdf/inc/computer.class.php:44
Additional information
- The issue only affects Computers
- Monitors and Tickets export correctly
- Happens even with newly created computers
- Disabling OCS plugin resolves the issue
Possible cause
OCS plugin assumes that the item object has method getID(), but when exporting PDF, the object is PluginPdfComputer, which does not implement that method.
Description
When trying to export a Computer to PDF using the PDF plugin, an error occurs:
"Unexpected error occurred"
This only happens when the OCS Inventory NG plugin is enabled.
If the plugin is disabled, PDF export works correctly.
Environment
Steps to reproduce
Expected behavior
PDF should be generated correctly.
Actual behavior
Error message:
"Unexpected error occurred"
Logs
[2026-03-18] glpi.CRITICAL: Uncaught PHP Exception:
Attempted to call an undefined method named "getID"
of class "PluginPdfComputer"
at Ocslink.php line 1015
Backtrace:
./marketplace/ocsinventoryng/src/Ocslink.php:1015
./marketplace/ocsinventoryng/src/Ocslink.php:885
./marketplace/pdf/inc/common.class.php:54
./marketplace/pdf/inc/computer.class.php:44
Additional information
Possible cause
OCS plugin assumes that the item object has method getID(), but when exporting PDF, the object is PluginPdfComputer, which does not implement that method.