Bug 107839 - BeforeUpdating and AfterUpdating events are not firing when records are edited in a Table Control
Summary: BeforeUpdating and AfterUpdating events are not firing when records are edite...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-14 05:08 UTC by Howard Johnson
Modified: 2023-12-08 03:14 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Embedded example to demonstrate this issue (12.20 KB, application/vnd.oasis.opendocument.database)
2017-05-14 05:08 UTC, Howard Johnson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Howard Johnson 2017-05-14 05:08:25 UTC
Created attachment 133306 [details]
Embedded example to demonstrate this issue

In a Table Control, in a Base Form, when a record is edited and then any record motion occurs (i.e. the cursor is moved up or down a line which saves the record to the database), I would expect that the BeforeUpdating event would fire.  

Instead BeforeUpdating fires only when the form is closed which isn't right either.


This is an important event that can be used to ensure records are entered correctly.  (In my case I want to fill an entry with a computed value if it happens to be null, before the record is saved.)


In the example database provide, the attached .odb will beep the speaker when the event fires using this Basic code:

Private Sub BeforeUpdating(oEvent As Object)
	Beep
End Sub


I can also confirm that the record actually does get changed in a similar form, in which the form is connected to a MariaDB database.  The record gets updated but no event fires.


The AfterUpdating has a similar issue.
Comment 1 Buovjaga 2017-05-14 12:25:05 UTC
Beep makes no sound for me (tested), so I changed it to MsgBox "Hello World"

I don't get the message boxes when editing, but I do get them all when I close the form window. Is this incorrect?

Arch Linux 64-bit, KDE Plasma 5
Version: 5.4.0.0.alpha1+
Build ID: c0968aa4673a8ac9a8a09a0e291b58b94bdbb35e
CPU threads: 8; OS: Linux 4.10; UI render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Built on May 13th 2016
Comment 2 Howard Johnson 2017-05-14 14:41:15 UTC
Hi,

"Beep makes no sound for me (tested)" Correct.  But it should beep when record is updated.

And you should not get an event when the window closes, unless it needs to save the record before doing so.
Comment 3 Alex Thurgood 2017-05-15 07:31:55 UTC
Not a new problem though, I can reproduce this with OOo 320m18 (OOo321) on OSX 10.12.4.

The sound is only activated when the form is closed.
Comment 4 Alex Thurgood 2017-05-15 07:33:15 UTC
Might even be a duplicate of an already known bug given that it is inherited from OOo.
Comment 5 Alex Thurgood 2017-05-15 07:39:18 UTC
This bug ties in with the synchronisation of events bug in bug 91879, which would appear to be the first report of this behaviour. I would be inclined to mark this bug as a duplicate of bug 91879.
Comment 6 Alex Thurgood 2017-05-15 07:42:41 UTC
Reproduced with

Version: 5.3.2.2
Build ID: 6cd4f1ef626f15116896b1d8e1398b56da0d0ee1
Threads CPU : 8; Version de l'OS :Mac OS X 10.12.4; UI Render : par défaut; Moteur de mise en page : nouveau; 
Locale : fr-FR (fr_FR.UTF-8); Calc: group
Comment 7 Alex Thurgood 2017-05-15 07:47:12 UTC
Hmm, given that bug 91879 has several problems, probably best to keep this separate and just reference it instead under "see also".
Comment 8 Howard Johnson 2017-12-05 18:32:52 UTC
WORKAROUND: To detect record edits use `After Record Action` in the form's underlying record.  This workaround comes from Jim K. here: 

https://ask.libreoffice.org/en/question/139867/base-any-workarounds-for-tables-broken-afterupdating-beforeupdating-events/

`After Record Action` fires when any record addition, deletion, or update is made. 

`After Record Change`, fires when any record *motion* occurs, i.e. moving from one record to another.

NOTE: This does not answer the original question here as to why or what the `After Updating` event does, or does not do.
Comment 9 QA Administrators 2018-12-06 03:57:42 UTC Comment hidden (obsolete)
Comment 10 Alex Thurgood 2018-12-06 11:31:15 UTC
Still present with

Version: 6.2.0.0.alpha1+
Build ID: 740b99783b5480fcd1e5fce7c1beb5967d015041
CPU threads: 8; OS: Mac OS X 10.14; UI render: default; VCL: osx; 
Locale: fr-FR (fr_FR.UTF-8); Calc: threaded
Comment 11 QA Administrators 2019-12-07 03:43:48 UTC Comment hidden (obsolete)
Comment 12 Robert Großkopf 2019-12-07 07:59:13 UTC
Bug still exists with LO 6.4.0.0beta1 on OpenSUSE 15.1 64bit rpm Linux
Comment 13 QA Administrators 2021-12-07 04:56:05 UTC Comment hidden (obsolete)
Comment 14 QA Administrators 2023-12-08 03:14:51 UTC
Dear Howard Johnson,

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
 
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword


Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team

MassPing-UntouchedBug