Minor conditional logic error causes PHP warnings that break CSV export in some Node entity configurations

Created on 13 May 2025, 4 months ago

Problem/Motivation

We have a fairly complex node entity that we are trying to export. However, our configuration, which has a lot of entity references to taxonomies etc, was generating PHP warnings which made it impossible to export the CSV in Firefox.

We would see a significant number of Warning: Undefined array key "langcode" in modules/contrib/content_export_csv/src/ContentExport.php on line 269 warnings, eventually resulting in:

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/web/modules/contrib/content_export_csv/src/ContentExport.php:269) in /var/www/html/web/modules/contrib/content_export_csv/src/Form/ContentExportForm.php on line 183

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/web/modules/contrib/content_export_csv/src/ContentExport.php:269) in /var/www/html/web/modules/contrib/content_export_csv/src/Form/ContentExportForm.php on line 184

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/web/modules/contrib/content_export_csv/src/ContentExport.php:269) in /var/www/html/web/modules/contrib/content_export_csv/src/Form/ContentExportForm.php on line 185

I believe we IDed a small conditional logic issue that resolves the issue for us.

πŸ› Bug report
Status

Active

Version

4.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States kmonty San Francisco, CA & Berlin, DE

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024