mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-03-28 17:42:57 +01:00
fixes #2110 avoid insert errors in the lounge table
If you upload several times the same photo, Piwigo detects the photo already exists and re-use its existing id. If the lounge is active, Piwigo tries to insert the same image_id/category_id. Let's simply acknowledge it may happen and tell MySQL to act accordingly (ignore).
This commit is contained in:
@@ -1914,7 +1914,8 @@ function fill_lounge($images, $categories)
|
||||
mass_inserts(
|
||||
LOUNGE_TABLE,
|
||||
array_keys($inserts[0]),
|
||||
$inserts
|
||||
$inserts,
|
||||
array('ignore'=>true)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1941,7 +1942,7 @@ function empty_lounge($invalidate_user_cache=true)
|
||||
}
|
||||
|
||||
$exec_id = generate_key(4);
|
||||
$logger->debug(__FUNCTION__.', exec='.$exec_id.', begins');
|
||||
$logger->debug(__FUNCTION__.(isset($_REQUEST['method']) ? ' (API:'.$_REQUEST['method'].')' : '').', exec='.$exec_id.', begins');
|
||||
|
||||
// if lounge is already being emptied, skip
|
||||
$query = '
|
||||
|
||||
Reference in New Issue
Block a user