Hi Stefan,
It's not a bug. The code . . .
$stH = stPrep("SELECT last_insert_rowid()");
$row = $stH->fetch(PDO::FETCH_NUM);
$stH = null;
$eid = $row[0]; //set id to new event
has the same effect as . . .
$stH = null;
$eid = dbLastRowId(); //set id to new event
However, since the function dbLastRowId() is already used some 18 lines up, I agree - for consistency reasons - it would be better to use this function. I will change this for LuxCal v4.6.1.
The purpose of the code is the following:
When a user chooses to edit one specific occurrence of a repeating (or multi-day) event, then this occurrence will be removed from the repeating (or multi-day) event and a new event will be created to replace the removed occurrence. The code to get the ID of the last added row makes the newly added event the currently active event.
Thanks for reporting this,
Roel