Export to CSV throws an error. Can't download the form responses

Hi All,

Getting an error while trying to download a CSV from the Reports area. Just contact form data. Anyone have any thoughts?

Chrome throws a Page Not Found Error, while Safari downloads a CSV that has the errors listed. There seems to be a form question (Are you an agent) that is listed in the error log.

Whoops\Exception\ErrorException: Undefined array key "are_you_an_agent" in file /home/latoriat/public_html/concrete/src/Express/Export/EntryList/CsvWriter.php on line 103

# Concrete Version
Core Version - 9.1.3
Version Installed - 9.1.3
Database Version - 20220908074900

# Hostname

# Environment

# Database Information
Version: 10.3.37-MariaDB-cll-lve

Bumping this up - Anyone have any ideas on what could be happening?

Hi @juddc - can you tell me more about the “are_you_an_agent” field? Could it maybe be a field you used to have that has since been deleted or something?

No - It’s a live field. And it’s being recorded in the form records. It a little real estate registration form for a project. A text field that just asks for a Yes or a No. The only difference with this field from the rest of them is that it has a prompt of Yes/No in the input.

It’s garnering a lot of attention/registrations so I’m hesitant to change anything.

Was that there from the beginning?

Yes it was. Always threw the error from day one.

@juddc it might be helpful to try to recreate the issue on a demo - that way we can confirm it’s something to do with the core rather than a local issue. You can spin one up here, maybe recreate the form, then do the CSV export and see if the issue reoccurs:

That’s not a bad idea. I didn’t replicate it locally.

Oddly the CSV download now works, but have an error embedded into the spreadsheet at the bottom:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" type="text/css" href="/concrete/themes/concrete/main.css" />
<body class="ccm-ui">

<div id="ccm-toolbar">
    <ul class="ccm-toolbar-item-list">
        <li class="ccm-logo"><span><img id="ccm-logo" src="/concrete/images/logo.svg" alt="Concrete" title="Concrete"></span></li>

<div class="container">
    <div class="row">
        <div class="col-sm-10 col-sm-offset-1">
            <h3>An unexpected error occurred.</h3>
            <div class="alert alert-danger">Undefined array key &quot;are_you_an_agent&quot;</div>


Just to clarify, are you saying you’re generating that CSV with the error in it on the demo site you spun up?

No - The demo site worked fine. I replicated the form there. The live site was throwing a 500 server error when you clicked the download icon for generating a CSV for the form. It now seems to work (I didn’t touch anything), and displays the error in the CSV listed above. It’s weird.

Hrmmm then yeah that does suggest either it’s a server issue or an override / customization causing problems.

Out of curiosity - What version of PHP are you running?

Hey Evan,

It’s 8.1.18.

# Concrete Version
Core Version - 9.1.3
Version Installed - 9.1.3
Database Version - 20220908074900

# Hostname

# Environment

# Database Information
Version: 10.3.38-MariaDB-cll-lve

# Concrete Packages
Responsive Image Map (1.3.3)

# Concrete Overrides
blocks/page_list.zip, blocks/page_list/templates/floorplan_display/view.php, blocks/page_list/templates/floorplan_display/view.css, blocks/page_list/templates/floorplan_display, blocks/page_list/templates, blocks/page_list, blocks/express_form/templates/latoria_terrace_registration/view.php, blocks/express_form/templates/latoria_terrace_registration, blocks/express_form/templates, blocks/express_form, blocks/image/templates/centered-image/view.php, blocks/image/templates/centered-image, blocks/image/templates, blocks/image, themes/latoria_terrace_theme/default.php, themes/latoria_terrace_theme/elements/footer.php, themes/latoria_terrace_theme/elements/header.php, themes/latoria_terrace_theme/elements/header_homepage.php, themes/latoria_terrace_theme/elements, themes/latoria_terrace_theme/homepage.php, themes/latoria_terrace_theme/img/apple-icon.png, themes/latoria_terrace_theme/img/favicon.ico, themes/latoria_terrace_theme/img/ftr-bg.png, themes/latoria_terrace_theme/img/ftr-lt-brand.ai, themes/latoria_terrace_theme/img/ftr-lt-brand.svg, themes/latoria_terrace_theme/img/ftr-lw-brand.svg, themes/latoria_terrace_theme/img/hdr-lt-brand.ai, themes/latoria_terrace_theme/img/hdr-lt-brand.svg, themes/latoria_terrace_theme/img/home-design-tile-bg.jpg, themes/latoria_terrace_theme/img/home-hdr-lt-brand.svg, themes/latoria_terrace_theme/img/home-hero.jpg, themes/latoria_terrace_theme/img/idx-tile-floorplans.jpg, themes/latoria_terrace_theme/img/idx-tile-master.jpg, themes/latoria_terrace_theme/img/idx-tile-phase-one.jpg, themes/latoria_terrace_theme/img/features-hero.jpg, themes/latoria_terrace_theme/img/registration-hero.jpg, themes/latoria_terrace_theme/img/registration-hero-mobile.jpg, themes/latoria_terrace_theme/img/features-hero-mobile.jpg, themes/latoria_terrace_theme/img/testimonials-hero-mobile.jpg, themes/latoria_terrace_theme/img/testimonials-hero.jpg, themes/latoria_terrace_theme/img, themes/latoria_terrace_theme/js/main.js, themes/latoria_terrace_theme/js/plugins.js, themes/latoria_terrace_theme/js/vendor/modernizr-3.11.2.min.js, themes/latoria_terrace_theme/js/vendor, themes/latoria_terrace_theme/js, themes/latoria_terrace_theme/page_theme.php, themes/latoria_terrace_theme/privacy_policy.html, themes/latoria_terrace_theme/thumbnail.png, themes/latoria_terrace_theme/floorplan_detail.php, themes/latoria_terrace_theme/registration_thanks.php, themes/latoria_terrace_theme/community.php, themes/latoria_terrace_theme/features_finishes.php, themes/latoria_terrace_theme/page_not_found.php, themes/latoria_terrace_theme/testimonials.php, themes/latoria_terrace_theme/css.zip, themes/latoria_terrace_theme/css/build/_custom-grids.scss, themes/latoria_terrace_theme/css/build/_floorplans.scss, themes/latoria_terrace_theme/css/build/_footer.scss, themes/latoria_terrace_theme/css/build/_forms.scss, themes/latoria_terrace_theme/css/build/_general.scss, themes/latoria_terrace_theme/css/build/_header.scss, themes/latoria_terrace_theme/css/build/_homepage.scss, themes/latoria_terrace_theme/css/build/_mixins.scss, themes/latoria_terrace_theme/css/build/_reset.scss, themes/latoria_terrace_theme/css/build/_variables.scss, themes/latoria_terrace_theme/css/build/main.scss, themes/latoria_terrace_theme/css/build, themes/latoria_terrace_theme/css/main.css, themes/latoria_terrace_theme/css/main.css.map, themes/latoria_terrace_theme/css/normalize.css, themes/latoria_terrace_theme/css, themes/latoria_terrace_theme

# Concrete Cache Settings
Block Cache - On
Overrides Cache - On
Full Page Caching - On - If blocks on the particular page allow it.
Full Page Cache Lifetime - Every 6 hours (default setting).

# Server Software

# Server API

# PHP Version

# PHP Extensions
bcmath, bz2, calendar, Core, ctype, curl, date, dom, exif, fileinfo, filter, ftp, gd, gettext, hash, i360, iconv, imap, json, libxml, litespeed, mbstring, mysqli, mysqlnd, openssl, pcntl, pcre, PDO, pdo_dblib, PDO_Firebird, pdo_mysql, PDO_OCI, PDO_ODBC, pdo_pgsql, pdo_sqlite, pdo_sqlsrv, Phar, posix, readline, Reflection, session, shmop, SimpleXML, sockets, SPL, sqlite3, standard, tokenizer, xml, xmlreader, xmlwriter, xsl, zip, zlib

# PHP Settings
max_execution_time - 30
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - 60
max_input_vars - 1000
max_multipart_body_parts - -1
memory_limit - 128M
post_max_size - 8M
upload_max_filesize - 2M
zend.exception_string_param_max_len - 15
mbstring.regex_retry_limit - 1000000
mbstring.regex_stack_limit - 100000
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
pdo_sqlsrv.client_buffer_max_kb_size - 10240
session.cache_limiter - no value
session.gc_maxlifetime - 7200
unserialize_max_depth - 4096

Because this is an Express issue, it’s always a good idea to regenerate your entities and see if it resolves the issue. You can do it from your dashboard here: System & Settings > Environment > Database Entities, red button “Refresh Entities” at the bottom