Skip to content

Fix PDF export of tabs renamed in GLPI 11 - #82

Merged
Rom1-B merged 2 commits into
pluginsGLPI:mainfrom
TarekRemo:ticket_45654
Aug 5, 2026
Merged

Fix PDF export of tabs renamed in GLPI 11#82
Rom1-B merged 2 commits into
pluginsGLPI:mainfrom
TarekRemo:ticket_45654

Conversation

@TarekRemo

Copy link
Copy Markdown

Checklist before requesting a review

Please delete options that are not relevant.

  • I have performed a self-review of my code.
  • I have updated the CHANGELOG with a short functional description of the fix or new feature.

Description

  • It fixes !45654

  • Several export checkboxes produced nothing in the generated PDF: the tab keys in the plugin's dispatch switches still used pre-GLPI 11 class names, so they never matched. The ticket reported for Tickets on a computer but the same cause affected three more tabs: Glpi\Asset\Asset_PeripheralAsset$1, ItemVirtualMachine$1 and ItemAntivirus$1.

  • Tab keys fixed :

    • Tickets (on assets): Ticket$1 only -> Item_Ticket$1 (Ticket$1 kept for User/Group/SLA)
    • Connections: Computer_Item$1 -> Glpi\Asset\Asset_PeripheralAsset$1
    • Virtual machines: ComputerVirtualMachine$1 -> ItemVirtualMachine$1
    • Antivirus: ComputerAntivirus$1 -> ItemAntivirus$1
  • The handlers behind them were also still querying pre-11 columns, so I did the following column modifications in the queries :

    • glpi_itemantiviruses / glpi_itemvirtualmachines: computers_iditemtype + items_id.
    • glpi_assets_assets_peripheralassets: computers_id/itemtype/items_iditemtype_asset/items_id_asset itemtype_peripheral/items_id_peripheral.
    • The VM "hosts" section was querying glpi_computers instead of the VM table, which listed the exported computer as its own host; its Operating system column read a field removed from glpi_computers and now shows Serial number, matching core.

Renamed the antivirus and VM handlers and moved them to the common switch because they are no longer Computer-only (GLPI registers those tabs on Phone and on custom asset types ).

pdfForComputer() iterates $CFG_GLPI['directconnect_types'] instead of a hardcoded type list to keep the plugin consistent with the core.

@TarekRemo TarekRemo self-assigned this Aug 4, 2026
@TarekRemo
TarekRemo requested a review from Rom1-B August 4, 2026 14:07
@Rom1-B
Rom1-B merged commit cea404c into pluginsGLPI:main Aug 5, 2026
3 checks passed
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.

2 participants