mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-07 09:13:02 +02: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(
|
mass_inserts(
|
||||||
LOUNGE_TABLE,
|
LOUNGE_TABLE,
|
||||||
array_keys($inserts[0]),
|
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);
|
$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
|
// if lounge is already being emptied, skip
|
||||||
$query = '
|
$query = '
|
||||||
|
|||||||
Reference in New Issue
Block a user