From 6b1020f0c47a4dd84af6afa63b4d1df69549f8a6 Mon Sep 17 00:00:00 2001 From: Diego Najar Date: Mon, 25 Feb 2019 16:32:00 +0100 Subject: [PATCH] check if autosave exists --- bl-kernel/functions.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bl-kernel/functions.php b/bl-kernel/functions.php index 19b94522..43d7bf82 100644 --- a/bl-kernel/functions.php +++ b/bl-kernel/functions.php @@ -325,10 +325,10 @@ function editPage($args) { // Check if the autosave page exists for this new page and delete it if (isset($args['uuid'])) { - $pageKey = $pages->getByUUID('autosave-'.$args['uuid']); - if (!empty($pageKey)) { - Log::set('Function editPage()'.LOG_SEP.'Autosave deleted for '.$args['title'], LOG_TYPE_INFO); - deletePage($pageKey); + $autosaveKey = $pages->getByUUID('autosave-'.$args['uuid']); + if ($autosaveKey) { + Log::set('Function editPage()'.LOG_SEP.'Autosave deleted for '.$autosaveKey, LOG_TYPE_INFO); + deletePage($autosaveKey); } } @@ -355,7 +355,7 @@ function editPage($args) { // Add to syslog $syslog->add(array( 'dictionaryKey'=>'content-edited', - 'notes'=>$args['title'] + 'notes'=>empty($args['title'])?$key:$args['title'] )); return $key;