From: Banana Date: Sun, 11 Jul 2021 14:22:56 +0000 (+0200) Subject: fixed #11 X-Git-Tag: 1.2~7 X-Git-Url: http://91.132.146.200/gitweb/?a=commitdiff_plain;h=a5ba06726c4b688653d8ae4954221e821a391364;p=bibliotheca-php.git fixed #11 --- diff --git a/CHANGELOG b/CHANGELOG index 2f9f71d..5cbccd2 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,7 @@ * Updated requirements information * Added Musicbrainz grabber * Added new field: artist + * Fixed: #11 Undefined index while adding new entry 1.1 - Vortex Rikers 20210530 * Cleanup and merge to one config file. Read upgrade diff --git a/webclient/lib/manageentry.class.php b/webclient/lib/manageentry.class.php index a16752a..c49426a 100644 --- a/webclient/lib/manageentry.class.php +++ b/webclient/lib/manageentry.class.php @@ -654,6 +654,10 @@ class Manageentry { $_ext = pathinfo($_up['name'][$data['identifier']],PATHINFO_EXTENSION); $newFilename = sha1($_up['name'][$data['identifier']]).".".$_ext; + if(!isset($_up['rebuildUpload'][$data['identifier']])) { + $_up['rebuildUpload'][$data['identifier']] = false; + } + $queryData['after']['upload'][] = array( 'identifier' => $data['identifier'], 'name' => $newFilename, @@ -662,6 +666,7 @@ class Manageentry { 'rebuildUpload' => $_up['rebuildUpload'][$data['identifier']] ); } + return $queryData; } @@ -688,6 +693,10 @@ class Manageentry { $_ext = pathinfo($_up['name'][$data['identifier']][$k],PATHINFO_EXTENSION); $newFilename = sha1($_up['name'][$data['identifier']][$k]).".".$_ext; + if(!isset($_up['rebuildUpload'][$data['identifier']][$k])) { + $_up['rebuildUpload'][$data['identifier']][$k] = false; + } + $queryData['after']['upload'][] = array( 'identifier' => $data['identifier'], 'name' => $newFilename, @@ -707,7 +716,7 @@ class Manageentry { * @param string $queryString * @param string $insertId Number */ - private function _runAfter_query($queryString, $insertId) { + private function _runAfter_query(string $queryString, string $insertId) { if(!empty($queryString) && !empty($insertId)) { // replace only once to avoid replacing actual data $queryStr = Summoner::replaceOnce($queryString,$this->_replaceEntryString, $insertId);