Skip to content

Commit 210236a

Browse files
committed
Fixed: Blockly, possible saving of 'ghost' events
1 parent 682edde commit 210236a

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

History.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ Version 2.0.xxxx (xxxx 2015)
8080
- Implemented: Counters in P1 Electra/Gas month reports per day
8181
- Implemented: MySensors, V_RAIN
8282
- Implemented: MySensors, V_WIND/V_GUST/V_DIRECTION
83+
- Fixed: Blockly, possible saving of 'ghost' events
8384

8485
Version 2.0.2284 (February 22th 2015)
8586
- Fixed: Firefox, RGBW/Setpoint popup

main/WebServer.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12953,7 +12953,16 @@ namespace http {
1295312953
_tSortedEventsInt eitem;
1295412954
eitem.ID = ID;
1295512955
eitem.eventstatus = eventStatus;
12956+
if (_levents.find(Name) != _levents.end())
12957+
{
12958+
//Duplicate event name, add the ID
12959+
szQuery.clear();
12960+
szQuery.str("");
12961+
szQuery << Name << " (" << ID << ")";
12962+
Name = szQuery.str();
12963+
}
1295612964
_levents[Name] = eitem;
12965+
1295712966
}
1295812967
//return a sorted event list
1295912968
std::map<std::string, _tSortedEventsInt>::const_iterator itt2;
@@ -13038,7 +13047,7 @@ namespace http {
1303813047
if (!parsingSuccessful)
1303913048
{
1304013049

13041-
_log.Log(LOG_ERROR, "Webserver eventparser: Invalid data received!");
13050+
_log.Log(LOG_ERROR, "Webserver event parser: Invalid data received!");
1304213051

1304313052
}
1304413053
else {

www/eventsframe.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -592,16 +592,16 @@
592592
if (blockName) {
593593
var exists = false;
594594
var doSave = false;
595-
$('#savedEvents option').each(function(){
595+
$('#savedEvents option').each(function(){
596596
if (this.text == blockName) {
597597
exists = true;
598+
id=this.value;
598599
}
599600
});
600601
if (exists) {
601602
var answer = confirm("Overwrite "+blockName+"?")
602603
if (answer){
603604
doSave = true;
604-
id = $("#blockId").html();
605605
}
606606
else{
607607
doSave = false;

www/html5.appcache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CACHE MANIFEST
2-
# ref 870
2+
# ref 872
33

44
CACHE:
55
# CSS

0 commit comments

Comments
 (0)