I got this error when I try to export the submissions to cvs

Notice: Undefined index: exporter in webform_results_download() (line 1129 of C:\wamp\www\aaap\sites\all\modules\webform\includes\webform.report.inc).

it was happening because this function webform_results_export its not returning a correct array , is missing 1 index: $export_info['exporter']

this index contain a object that is going to be used in the function webform_results_download() in line 1129 ;

my solution was add this code in the line 832 of webform.report.inc file

$export_info['exporter'] = $exporter;

that works for me.

I appreciate any comment, and sorry for my English.

Comments

meickol’s picture

Issue tags: -webform webform_results_download Undefined index: exporter +webform_results_download
meickol’s picture

Version: 7.x-4.0 » 7.x-4.4
Issue tags: +webform, +undefined index
danchadwick’s picture

Priority: Critical » Normal
Status: Fixed » Closed (works as designed)
Issue tags: -webform_results_download, -webform, -undefined index

Please read the issue queue guidebook for issue priority, tags, and issue status.

I just tried this in version 7.x-4.4 and it worked fine for me.

webform_results_export() is no longer called from within webform. It does not need to set 'exporter' because is has already done the export. webform_results_download is called via browser ajax to download the file which was created by the batch export.

Perhaps I have misunderstood you, but I don't think that you are reporting a bug in the current version. If this isn't the case, please retest with at least 7.x-4.4 and provide detailed instructions to reproduce the issue. Thanks.

meickol’s picture

I create my own code to made a custom export for my submissions,


function export_submissions_to_csv($node) {
    $submissions = webform_get_submissions($node->nid);
    if (isset($_GET['filter']) ) {
        _do_filter_report($_GET['filter'], $submissions);
    }
    $options = array(
        'delimiter' => ',',
        'components' => array('time', '1','2','3','4','5','6','7','8','9','10','11','12','13', '21', '25', '14', '16', '63', '15', '19','27'),
        'select_keys' => 0,
        'select_format' => 'separate',
        'range_type' => 'range',
        'download' => TRUE,
    );

    // Retrieve the list of required SIDs.
    $options['sids'] = _extract_sids($submissions);
    $export_info = webform_results_export($node, 'delimited', $options);
    //dsm($export_info);
    webform_results_download($node, $export_info);
}

how you see I am using the variable $export_info returned by webform_results_export to use like param of the function webform_results_download, I am doing that because if you look in the documentation of webform_results_download it said:

**
 * Send a generated webform results file to the user's browser.
 *
 * @param $node
 *   The webform node.
 * @param $export_info
 *   Export information array retrieved from webform_results_export().
 */

I dont know if is a error of the documentation or I am dont understand whats that mean.

meickol’s picture

Status: Closed (works as designed) » Active
danchadwick’s picture

Status: Active » Fixed

Thanks.

Committed to 7.x-4.x and 8.x.

Not yet pushed because I'm waiting for feedback on unrelated issue #1815996: Multiple target components for each conditional which is queued up before this patch. This will be in 7.x-4.7.

  • DanChadwick committed 818958e on 8.x-4.x
    Issue #2453393 by meickol: Notice: Undefined index: exporter in...

  • DanChadwick committed 10f79f8 on 7.x-4.x
    Issue #2453393 by meickol: Notice: Undefined index: exporter in...
danchadwick’s picture

Pushed to 7.x-4.x.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.