From 2f3ebf478e00cecd7b61f3d19caa037e4913f9b4 Mon Sep 17 00:00:00 2001 From: vnmedeiros Date: Wed, 17 Feb 2021 10:23:23 -0300 Subject: [PATCH 1/2] fix: return on shutdown function --- src/classes/class-tainacan-background-process.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/classes/class-tainacan-background-process.php b/src/classes/class-tainacan-background-process.php index 7382791a6..e076a65c5 100644 --- a/src/classes/class-tainacan-background-process.php +++ b/src/classes/class-tainacan-background-process.php @@ -289,21 +289,21 @@ abstract class Background_Process extends \Tainacan_WP_Background_Process { $this->write_log($batch->key, ['New Request']); $newRequest = false; } - + register_shutdown_function(function() use($batch) { - $this->debug('Shutdown with Fatal error captured'); $error = error_get_last(); + if ( is_null($error) ) + return; - $error_str = "Fatal error"; + $error_str = "Fatal error: " . json_encode($error); if ( is_array($error) ) { $error_str = $error['message'] . ' - ' . $error['file'] . ' - Line: ' . $error['line']; } - + + $this->debug('Shutdown with Fatal error captured'); $this->debug($error_str); - $this->write_error_log($batch->key, ['Fatal Error: ' . $error_str]); $this->write_error_log($batch->key, ['Process aborted']); - $this->close( $batch->key, 'errored' ); $this->debug('Batch closed due to captured error'); $this->unlock_process(); From 6637b6274e3351d3382a150b952d43927751aaf1 Mon Sep 17 00:00:00 2001 From: vnmedeiros Date: Wed, 17 Feb 2021 10:23:34 -0300 Subject: [PATCH 2/2] update version --- src/readme.txt | 2 +- src/tainacan.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/readme.txt b/src/readme.txt index cb598d039..b8cccfaef 100644 --- a/src/readme.txt +++ b/src/readme.txt @@ -4,7 +4,7 @@ Tags: museums, libraries, archives, GLAM, collections, repository Requires at least: 4.8 Tested up to: 5.6 Requires PHP: 5.6 -Stable tag: 0.17.3 +Stable tag: 0.17.4 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-3.0.html diff --git a/src/tainacan.php b/src/tainacan.php index 06d6ed50c..3dd583fad 100644 --- a/src/tainacan.php +++ b/src/tainacan.php @@ -4,13 +4,13 @@ Plugin Name: Tainacan Plugin URI: https://tainacan.org/ Description: Open source, powerfull and flexible repository platform for WordPress. Manage and publish you digital collections as easily as publishing a post to your blog, while having all the tools of a professional respository platform. Author: Tainacan.org -Version: 0.17.3 +Version: 0.17.4 Text Domain: tainacan License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-3.0.html */ -const TAINACAN_VERSION = '0.17.3'; +const TAINACAN_VERSION = '0.17.4'; defined( 'ABSPATH' ) or die( 'No script kiddies please!' ); $TAINACAN_BASE_URL = plugins_url('', __FILE__);