Skip to content

fix(export): resolve missing data tables in ODT export by using isset() instead of property_exists()#365

Open
bolivarf wants to merge 1 commit into
pluginsGLPI:mainfrom
bolivarf:fix/odt-export-property-exists
Open

fix(export): resolve missing data tables in ODT export by using isset() instead of property_exists()#365
bolivarf wants to merge 1 commit into
pluginsGLPI:mainfrom
bolivarf:fix/odt-export-property-exists

Conversation

@bolivarf

@bolivarf bolivarf commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Description

When exporting native reports to ODT format, the generated document includes the charts but the data tables are completely missing (the templates remain empty).

Cause

In inc/common.class.php, inside the generateOdt() method, the code relies on property_exists() to check if $singledatas->datas and $multipledatas->datas are available.

However, the underlying Odf library uses PHP magic methods (__get()) to dynamically handle its segment properties. Because property_exists() evaluates only static/strict properties, it returns false on these magic properties. This skips the entire loop responsible for injecting the rows into the document.

Solution

Replaced property_exists() with isset() in inc/common.class.php (lines 1294, 1300, and 1313) to properly trigger PHP's magic methods and allow the data table fields to be processed.

Thank you for reviewing this contribution!

@bolivarf bolivarf force-pushed the fix/odt-export-property-exists branch from 55b0a4b to b55f5a3 Compare June 8, 2026 17:10
@stonebuzz

Copy link
Copy Markdown
Contributor

Please fix CI and adapt CHANGELOG.

Best regards

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