Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • @winball

    Would it be okay if my group was allowed to support the project and push an update for this?

    Julie,

    Here is the work around I am using until the patch is loaded out:

    instead of of:

    // ********** delete temp excel file after sending notifications **********
    function wp4o_delete_excel($entry, $form){
    // read plugin settings for this form
    if (array_key_exists('gf2excel-addon', $form)) {
    $settings = $form['gf2excel-addon'];
    } else {
    exit();// no addons settings found so exit
    }
    // read active notifications for this form
    $dips_notifications = array();
    foreach ($form['notifications'] as $key => $value){
    if ($value['isActive']==1 && $settings[$key]==1){
    $dips_notifications[] = $key;
    }
    }
    // check if we have something to do for this form or we may exit
    if (empty($dips_notifications))
    exit();
    // delete file
    $excel_file_name = pathinfo ( $settings['excel_template_path'] , PATHINFO_FILENAME );// no extension, no .xlsx
    $filename = $excel_file_name.'_wp4o_'.$entry['id'].'.xlsx';
    try {
    unlink( __DIR__.'/tmp/'.$filename );
    }
    catch (Exception $e) {
    exit(); //file does not exist or cannot be deleted
    }
    }
    add_action( 'gform_after_submission', 'wp4o_delete_excel', 10, 2 );
    }

    use

    // ********** delete temp excel file after sending notifications **********
    function wp4o_delete_excel($entry, $form){
    // read plugin settings for this form
    if (array_key_exists('gf2excel-addon', $form)) {
    $settings = $form['gf2excel-addon'];
    } else {
    return;// no addons settings found so exit
    }
    // read active notifications for this form
    $dips_notifications = array();
    foreach ($form['notifications'] as $key => $value){
    if ($value['isActive']==1 && $settings[$key]==1){
    $dips_notifications[] = $key;
    }
    }
    // check if we have something to do for this form or we may exit
    if (empty($dips_notifications))
    return;
    // delete file
    $excel_file_name = pathinfo ( $settings['excel_template_path'] , PATHINFO_FILENAME );// no extension, no .xlsx
    $filename = $excel_file_name.'_wp4o_'.$entry['id'].'.xlsx';
    try {
    unlink( __DIR__.'/tmp/'.$filename );
    }
    catch (Exception $e) {
    return; //file does not exist or cannot be deleted
    }
    }
    add_action( 'gform_after_submission', 'wp4o_delete_excel', 10, 2 );
    }

    Dieter,

    It looks like this patch never got pushed T_T

    Willing to donate to have it pushed out. Client is super excited but we’re getting blank pages everywhere.

    -Adam

Viewing 3 replies - 1 through 3 (of 3 total)