# HG changeset patch # User Matti Hamalainen # Date 1564661472 -10800 # Node ID 418f932763f246da90d60f93534d448dac6378dc # Parent 13a23b120e72814fee9fc777ca1fc9878b10be02 Backed out changeset 13a23b120e72 diff -r 13a23b120e72 -r 418f932763f2 mgtool.php --- a/mgtool.php Thu Aug 01 14:42:06 2019 +0300 +++ b/mgtool.php Thu Aug 01 15:11:12 2019 +0300 @@ -673,7 +673,7 @@ } -function mgWriteGalleryCache($cacheFilename, &$album, &$entries, &$parentEntry) +function mgWriteGalleryCache($cacheFilename, &$gallery, &$entries, &$parentEntry) { global $galBackend, $db, $galExifConversions, $flagSQL; @@ -705,10 +705,10 @@ // Choose gallery album image if (count($images) > 0) { - if (isset($album["albumpic"]) && - isset($images[$album["albumpic"]])) + if (isset($gallery["albumpic"]) && + isset($images[$gallery["albumpic"]])) { - $parentEntry["image"] = $album["albumpic"]; + $parentEntry["image"] = $gallery["albumpic"]; } else { @@ -735,8 +735,8 @@ mgDBBeginTransaction(); - if (($path_id = mgFetchSQLColumn(mgPrepareSQL("SELECT id FROM paths WHERE path=%s", $album["path"]))) === FALSE && - ($path_id = mgExecSQLInsert(mgPrepareSQL("INSERT INTO paths (path) VALUES (%s)", $album["path"]))) === FALSE) + if (($path_id = mgFetchSQLColumn(mgPrepareSQL("SELECT id FROM paths WHERE path=%s", $gallery["path"]))) === FALSE && + ($path_id = mgExecSQLInsert(mgPrepareSQL("INSERT INTO paths (path) VALUES (%s)", $gallery["path"]))) === FALSE) mgFatal("Failed.\n"); @@ -816,7 +816,7 @@ $str = "