map: fix cluster on deletion
parent
efea8369bd
commit
f7b7fa2ac8
|
@ -233,6 +233,15 @@ class TimelineWrite
|
||||||
*/
|
*/
|
||||||
public function deleteFile(File &$file)
|
public function deleteFile(File &$file)
|
||||||
{
|
{
|
||||||
|
// Get full record
|
||||||
|
$query = $this->connection->getQueryBuilder();
|
||||||
|
$query->select('*')
|
||||||
|
->from('memories')
|
||||||
|
->where($query->expr()->eq('fileid', $query->createNamedParameter($file->getId(), IQueryBuilder::PARAM_INT)))
|
||||||
|
;
|
||||||
|
$record = $query->executeQuery()->fetch();
|
||||||
|
|
||||||
|
// Delete all records regardless of existence
|
||||||
foreach (DELETE_TABLES as $table) {
|
foreach (DELETE_TABLES as $table) {
|
||||||
$query = $this->connection->getQueryBuilder();
|
$query = $this->connection->getQueryBuilder();
|
||||||
$query->delete($table)
|
$query->delete($table)
|
||||||
|
@ -240,6 +249,11 @@ class TimelineWrite
|
||||||
;
|
;
|
||||||
$query->executeStatement();
|
$query->executeStatement();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Delete from map cluster
|
||||||
|
if ($record && ($cid = (int) $record['mapcluster']) > 0) {
|
||||||
|
$this->removeFromCluster($cid, (float) $record['lat'], (float) $record['lon']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue