aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debug.xml2
-rw-r--r--src/org/traccar/database/DataManager.java1
-rw-r--r--web/app/controller/Root.js2
3 files changed, 3 insertions, 2 deletions
diff --git a/debug.xml b/debug.xml
index 19e81db07..346eda292 100644
--- a/debug.xml
+++ b/debug.xml
@@ -324,7 +324,7 @@
</entry>
<entry key='database.clearPositionsHistory'>
- DELETE FROM positions WHERE deviceid = :deviceId and servertime &lt; :serverTime;
+ DELETE FROM positions WHERE id != :positionId and deviceid = :deviceId and servertime &lt; :serverTime;
</entry>
<!-- PROTOCOL CONFIG -->
diff --git a/src/org/traccar/database/DataManager.java b/src/org/traccar/database/DataManager.java
index 691c31643..710eceebb 100644
--- a/src/org/traccar/database/DataManager.java
+++ b/src/org/traccar/database/DataManager.java
@@ -416,6 +416,7 @@ public class DataManager {
Date dateBefore = new Date(lastUpdate.getTime() - histDays * 24 * 3600 * 1000);
QueryBuilder.create(dataSource, sql)
+ .setLong("positionId", device.getPositionId())
.setLong("deviceId", device.getId())
.setDate("serverTime", dateBefore)
.executeUpdate();
diff --git a/web/app/controller/Root.js b/web/app/controller/Root.js
index 90923fe53..fd30fe7c9 100644
--- a/web/app/controller/Root.js
+++ b/web/app/controller/Root.js
@@ -81,7 +81,7 @@ Ext.define('Traccar.controller.Root', {
this.asyncUpdate(true);
}
});
- Ext.get('attribution').remove();
+ if (Ext.get('attribution') !== null) Ext.get('attribution').remove();
if (this.isPhone) {
Ext.create('widget.mainMobile');
} else {