Skip to content

Problem: CSV Export Missing Columns - update

Current Behavior

For some reason I can't reopen the issue as melanie asked me to, so I am just opening a new one.

The old issue is Here #2200 (closed)

And here now, as requested are the steps to reproduce this bug.

It's niche, but may very well apply to those seeking to upgrade from lower versions.

Environment:

AtoM version: 2.8.1
OS: Ubuntu 24.04
Upgraded from: AtoM 2.6

Issue: CSV exports produce only 20 columns instead of the expected 97 when certain ISAD visibility areas are set to hidden (value = 0) in the database.

Root Cause: The csvExportInformationObjectsTask.class.php file never calls setParams() on the CSV writer object. When ISAD visibility areas are hidden, the export code attempts to access $this->params['nonVisibleElementsIncluded'] before the params array is initialized, causing silent failure and filtering out 77 columns.

Reproduction Steps:

Set ISAD visibility areas to hidden via Admin → Settings → Visible elements, OR manually via database:
UPDATE setting s
JOIN setting_i18n si ON s.id = si.id
SET si.value = '0'
WHERE s.name IN ('isad_access_points_area', 'isad_identity_area');

Run CSV export:
php symfony csv:export --single-slug= /tmp/test.csv

Check column count:
head -1 /tmp/test.csv | tr ',' '\n' | wc -l

Expected: 97 columnsActual: 20 columns

Fix: Add the following line in /usr/share/nginx/atom/lib/task/export/csvExportInformationObjectsTask.class.php at approximately line 70, immediately after creating the $writer object:

$writer->setParams(["nonVisibleElementsIncluded" => true, "objectType" => "informationObject"]);

Workaround: Set all ISAD visibility settings to 1 (visible) in the database: UPDATE setting s JOIN setting_i18n si ON s.id = si.id SET si.value = '1' WHERE s.name LIKE 'isad_%';

Why you couldn't reproduce: Fresh AtoM installations have all ISAD visibility areas set to 1 (visible) by default. The bug only manifests when visibility areas are customized to 0 (hidden), which commonly occurs after upgrades from older AtoM versions (2.6 → 2.8) where users had customized their visible elements.

Affected code:

/lib/task/export/csvExportInformationObjectsTask.class.php (missing setParams call)
/lib/flatfile/QubitFlatfileExport.class.php line 248 (accesses undefined $this->params)

Expected Behavior

.

Possible Solution

No response

Context and Notes

No response

Version used

No response

Operating System and version

No response

Default installation culture

No response

PHP version

No response

Contact details

No response