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 );
}