Topic: BUG: Email Notifications

I have been aware for some time that email notifications do not appear to be reported accurately, or I do not understand what they are meant to report and I find the messages confusing, but I haven't been able to put my finger on it as my calendar has only recently been started, with over a dozen people authorised to post and because as administrator I have both:
# made many minor adjustment to the events others post and
# entered many posts on behalf of another user and then immediately assigning ownship to that person
In this way I hoped to ensure that all events had a common style to their Title and Description fields.

From the emails I could never be certain that my edits were recorded as my edits nor could I tell if an event had been properly re-assigned to the new owner.

Now I realise the problem is more fundamental The "Edited" line is not reliably reported or has multiple functions depending on the nature of the change - but it goes further than email notifications. As for the first time this morning I happened to chose to use the "Changes" display before I looked at my emails

Here's what I saw on the Changes display:

(Not sure why but the forum seems to be refusing to post my full message, so it will appear in parts)

Re: BUG: Email Notifications

==================
Deleted
13/07/2019 @ 9:30 - 12:00MP's Surgery Venue: The School Room
Category: Premises User
Norman Lamb, our local MP, holds his constituency surgery sessions at our church. To book an appointment call his office on 01692 403752.
Added: 17/12/2018 @ 16:59 (RonS)
Edited: 24/01/2019 @ 9:49 (Webmaster)
==================

However, it was not "Webmaster" that made the deletion which is what the Edited line appears to be reporting. It was RonS

Here's what I saw on the email associated with the deletion sent at 9:49:

==================
Deleted event:

Title:    MP's Surgery
Date / time:    13/07/2019 @ 9:30 - 12:00
Venue:    The School Room
Category:    Premises User
Description:    Norman Lamb, our local MP, holds his constituency surgery sessions at our church. To book an appointment call his office on 01692 403752.
Added:    17/12/2018 @ 16:59 (RonS)
Edited:    24/12/2018 @ 10:55 (RonS)
==================

In the email report the edited line appears to show the last time RonS worked on the item, but it does not tell me who made the deletion, and I need to know that in case it is someone different - and in this case all of the MP's future events had been deleted and I needed to know if that meant I needed to update the page on the web site that lists all users of the church.

Can you investigate the apparent bugs what is displayed on the Edit line in various places, and perhaps consider adding a "Deleted" line indicating who made a deletion, if that was the action taken.

If it helps I am running 4.7.3M

Re: BUG: Email Notifications

Hi Greg,

The current logic is the following:
1. When an event is added, the "added" date, time and user are stored in the event record (if the event was added by an "admin" for Mr. X, then Mr. X will be stored as the one who added the event.
2. When the event is modified within 10 minutes from the moment of adding the event, the edit action will not be recorded. (When you add an event, and directly (within 10 minutes) correct a typo, this will be considered part of the "adding").
3. When the event is edited at least 10 minutes later than it was added, the date, time and user will be recorded.
4. When you delete an event, the date and time are recorded, but not the user who deleted the event.

Number 4 could be called a 'bug', although it was done like this on purpose because we thought it was not worthwhile to add two special fields (name and date/time) just for a deleted event .

It is an easy change to save the user who deletes the event in the "edited by" field, so that on the Changes" page you can see who deleted the event, but then a possible "editor" will not be known any more.

If there is more demand for this, adding two additional fields "deleted by" and "date and time of deletion" is of course also possible, but this requires a database schema change which has more implications.

Roel

Re: BUG: Email Notifications

Hi Roel,

Thanks for the full explanation. I hadn't considered the "wait 10 mins to treat as a fresh edit" possibility. I can see that would be very convenient for a large majority of users of LuxCal.

I think the "10 minute rule" also explains some of my confusion as in the first week of the running the diary I was entering a lot of events and it only emerged later who should be assigned as owner of them. In other cases although I knew who would be responsible at the start, I entered them myself to establish a "house style" for the way events should be recorded.

Roel wrote:

4. When you delete an event, the date and time are recorded, but not the user who deleted the event.

Number 4 could be called a 'bug', although it was done like this on purpose because we thought it was not worthwhile to add two special fields (name and date/time) just for a deleted event .

In my head I considered a "delete" to be an edit so, as the top of the email report explains whether it is for an add, change or delete, I expected that the username of the person who made the delete should appear in the existing Edit field (rather than require a special Delete field to be added to the report).

As you'll see I discovered that "Changes" display obtained from the Options menu, delivers the information in exactly the way I would have expected, accurately showing who deleted the entry (labelled as an Edit not a Delete) and does not show the completely false information that the webmaster interacted with the record of the event at the time given.

So I do consider #4 a bug in the email report.

Re: BUG: Email Notifications

Hi Greg,

Yes, I see the point. The Changes page shows something else than the email report, which is not correct and should be avoided.
So fair enough, for the next calendar version I will change the delete script and at the moment of deletion set the "edited by" field to the current user.
If you want to implement this change also in v4.7.4, then you should edit the file "pages/event.php" and make the following changes:

just below line 423 ( if ($mode == "del") { ) add . . .

$_SESSION['evt']['edr'] = $usr['name'];

and change lines 425 and 426 from . . .

$stH = stPrep("UPDATE `events` SET `status` = -1, `mDateTime` = ? WHERE `ID` = ?"); //delete
tExec($stH,array($todayDT,$eid));

to . . .

$stH = stPrep("UPDATE `events` SET `status` = -1, `editor` = ?, `mDateTime` = ? WHERE `ID` = ?"); //delete
stExec($stH,array($usr['name'],$todayDT,$eid));

and change lines 429 and 430 from . . .

$stH = stPrep("UPDATE `events` SET `xDates`=? WHERE `ID` = ?"); //exclude date
stExec($stH,array($_SESSION['evt']['xda'],$eid));

to . . .

$stH = stPrep("UPDATE `events` SET `xDates` = ?, `editor` = ?, `mDateTime` = ? WHERE `ID` = ?"); //exclude date
stExec($stH,array($_SESSION['evt']['xda'],$usr['name'],$todayDT,$eid));

After these changes, deleting an event will be treated similar to editing an event as far as the "edited by" and the "date/time edited" fields are concerned.
Roel

Re: BUG: Email Notifications

Thanks for these fixes Roel.

Unfortunately, I'm still running 4.7.3 because I need to find a time slot to install Linux Mint 19.1, as 17.3 my current platform, is dropping out of support soon. I've also got a new printer to install that won't talk to 17.3 properly. Once those tasks are out of the way I will set up a duplicate copy of my calendar for you to play with to check out those other bugs discussed at: http://www.luxsoft.eu/lcforum/viewtopic.php?id=123