]> 91.132.146.200 Git - bibliotheca-php.git/commitdiff
fixed #11
authorBanana <mail@bananas-playground.net>
Sun, 11 Jul 2021 14:22:56 +0000 (16:22 +0200)
committerBanana <mail@bananas-playground.net>
Sun, 11 Jul 2021 14:22:56 +0000 (16:22 +0200)
CHANGELOG
webclient/lib/manageentry.class.php

index 2f9f71d2321ca082b5d7071bd83c84de5fd0c278..5cbccd268a7a08c08d01707afdc85975b3d2a319 100644 (file)
--- 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
index a16752acc6d15d5e1926a27d95cfa381e6e98f6f..c49426a420d7b2b11eae45857f1fb4ff53905387 100644 (file)
@@ -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);