Bug 91879 - EDIT: wrong behaviour of a form's trigger when changing the record
Summary: EDIT: wrong behaviour of a form's trigger when changing the record
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-05 18:50 UTC by christian_kuhn
Modified: 2024-11-19 10:11 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
example for bug (31.02 KB, application/vnd.sun.xml.base)
2015-06-05 18:50 UTC, christian_kuhn
Details
screenshot with marked button to change the record (80.65 KB, image/png)
2015-06-05 23:11 UTC, christian_kuhn
Details
expected behaviour for event (german) (74.19 KB, image/png)
2015-06-07 20:55 UTC, christian_kuhn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description christian_kuhn 2015-06-05 18:50:14 UTC
Created attachment 116315 [details]
example for bug

I want to trigger a macro, before I change the actual record within a form. For this I have select the name of the BASIC procedure for the event trigger 'before changing record', so that the macro will be executed and a message box with "Test" appears, if this event occurs (to see this, open form of the attached example in edit mode, then open form navigator of this form, then right mouse click (context menu) to 'frm_tbl2' > features > events). I would expect, that the macro fires one time, before the record will be changed, because the meaning of the event is 'trigger before changing the record'.

But the macro will be executed, if
 - the form was opened
 - two times before the record will be changed
 - the mouse pointer hovers over the button for changing the record, after the record was changed (one time),

so that the real behaviour of this event trigger differs from the expected behaviour described in the context help.
Comment 1 Robert Großkopf 2015-06-05 20:00:47 UTC
One bug-description for one buggy behavior.

I have downloaded the example-file.
I can't confirm the event occurs while moving the mouse over the any button in the navigationbar. So I can't confirm this bug.

If it is wrong for you the event occurs while opening the form: Open a new bug for this.
If it is wrong for you the event occurs two times for different implementations while saving the content of the form: Open a new bug for this.

My system: OpenSUSE 13.2 64bit rpm Linux.
Comment 2 christian_kuhn 2015-06-05 23:11:13 UTC
Created attachment 116320 [details]
screenshot with marked button to change the record

I have downloaded the uploaded example again and can reproduce the following behaviour:

On 
Win 8.1
LO Version: 4.4.3.2
Build-ID: 88805f81e9fe61362df02b9941de8e38a9b5fd16

(1) I open the example database
(2) I open the form 'Table' --> the message box 'Test' appears
(3) I change to the next record --> the message box 'Test' appears, 
    if I close it, it appears again (two times)
(4) I move the mouse pointer to the button, which changes to the next record 
    (it is red marked in the attached screenshot), 
    but I do not press it --> the message box 'Test' appears, if I close it, it 
    appears again (two times, not one time)
    --> If I move the mouse pointer first to another button (but do not press 
    it), then the message box appears, if I move the mouse pointer over the 
    marked button.

On
OpenOffice.org 3.2.1 
OOO320m19 (Build:9505)
ooo-build 3.2.1.4, Debian package 1:3.2.1-11+squeeze2

(1) I open the example database
(2) I open the form 'Table' --> the message box 'Test' appears
(3) I change to the next record --> the message box 'Test' appears, 
    if I close it, it appears again (two times)
(4) I move the mouse pointer only over the button, which changes to the next 
    record, but I do not press it --> the message box 'Test' appears, if I 
    close it, it appears again (two times)
    --> If I move the mouse pointer first to another button, then no message 
    box appears in any case.
Comment 3 Lionel Elie Mamane 2015-06-06 07:38:06 UTC
Cannot reproduce on GNU/Linux either. Maybe this is Windows-specific?
Comment 4 christian_kuhn 2015-06-06 13:58:35 UTC
Msgbox must be closed each time before continue, and macros must be enabled. 

Before I could open the LO 4.4-created example with OOo 3.2.1 (Debian/Squeeze), I had to start a recovering process.
Comment 5 Robert Großkopf 2015-06-06 16:16:57 UTC
(In reply to christian_kuhn from comment #4)
> Msgbox must be closed each time before continue, and macros must be enabled. 
> 
Do you think we haven't done this?
The messagebox appears when opening the form.
The messagebox appears two times when moving from one row to another.
The messagebox doesn't appear every time when moving the mouse over the navigationbar.

Now I have tried a little bit more and could reproduce the following:
1. Press "Next Record" on the navigationbar. Messagebox appears two times.
2. Move the mouse over navigationbar. If you reach "Next Record" the messagebox appears again two times. The rowcounter changes to next row.
3. Move again over navigationbar, special "Next Record" - nothing happens.

1b,2b,3b. The same with "Previous Record".

This has nothing to do with changing the record, only with moving the record by the buttons in the navigationbar.
Is this the same buggy behavior you detected?
This behavior I could reproduce with OpenSUSE 13.2 64bit rpm Linux and LO 4.4.4.1
Comment 6 christian_kuhn 2015-06-07 20:55:57 UTC
Created attachment 116360 [details]
expected behaviour for event (german)

For
Version: 4.4.3.2
Build-ID: 88805f81e9fe61362df02b9941de8e38a9b5fd16
Gebietsschema: de_DE

> Now I have tried a little bit more and could reproduce the following:
> 1. Press "Next Record" on the navigationbar. Messagebox appears two times.
I agree.


> 2. Move the mouse over navigationbar. If you reach "Next Record" the messagebox appears again two times.
I agree. This is, what I mean. I would expect, that the macro only will be executed, before the record will be changed I have marked the context help with the expected behaviour for this event trigger in the attached screenshot. For this I must press the "Next record" button. 

All other buttons without the "Next Record" button will be not selected, if the mouse pointer moves over them. This seems to be buggy.

> The rowcounter changes to next row.
I cannot confirm. The row counter changes only the row, if I press the "Next Record" button and not, if I move the mouse pointer over it and do not press it.

> 3. Move again over navigationbar, special "Next Record" - nothing happens.
I agree.


For 
OpenOffice.org 3.2.1 
OOO320m19 (Build:9505)
ooo-build 3.2.1.4, Debian package 1:3.2.1-11+squeeze2

> 1. Press "Next Record" on the navigationbar. Messagebox appears two times.
I agree.

> 2. Move the mouse over navigationbar. If you reach "Next Record" the messagebox appears again two times.
I can agree for OpenOffice.org 3.2.1 and Debian / Squeeze. If I start from a side of the navigationbar and move the mouse pointer over other buttons and stop then over the "Next Record" button, then a messagebox appears for two times. All other Buttons without the "Next Record" button will be not selected, if the mouse pointer moves over them. Perhaps this is buggy.

(This is a difference to my last test, where the messagebox only appeared, when I had closed the second messagebox after changing the record (by pressing the "Next Record" button) and had moved then the mouse directly to the "Next Record" button without pressing it.)

> 3. Move again over navigationbar, special "Next Record" - nothing happens.
I agree. The message box appears only one time (for two times) after I have changed the record.

Please look at the attached screenshot. I have red marked, what I would expect, if I use this event trigger: a macro will be executed one time, if this event appears. This is after I have pressed the "Next Record" button, but before the record will be changed.
Comment 7 Robert Großkopf 2015-06-08 13:32:15 UTC
(In reply to christian_kuhn from comment #6)
> 
> > The rowcounter changes to next row.
> I cannot confirm. The row counter changes only the row, if I press the "Next
> Record" button and not, if I move the mouse pointer over it and do not press
> it.

Rowcounter changes to new row only if there appears a messagebox. Not the event itself enters the new row, but the klick on the messagebox - but this is another bug.

Let us first set this bug to new:
Event, which has been chosen one time by "Next Record" or "Previous Record", will be executed after moving the mouse over the button of the navigationbar once more.

I write down 'once', but there are two implementations for the event so the messagebox appears two times for one event.
Comment 8 QA Administrators 2016-09-20 10:00:22 UTC Comment hidden (obsolete)
Comment 9 Alex Thurgood 2017-05-15 07:38:13 UTC
Still present, see bug 107839, which I believe is a duplicate of this report.
Comment 10 Alex Thurgood 2017-05-15 07:45:59 UTC
At least insofar as the firing beforeUpdate event is concerned.
Comment 11 Alex Thurgood 2017-05-15 07:48: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 12 QA Administrators 2018-08-29 02:41:56 UTC Comment hidden (obsolete)
Comment 13 christian_kuhn 2018-09-14 23:16:10 UTC
Still present in:

Version: 6.1.1.2 (x64)
Build-ID: 5d19a1bfa650b796764388cd8b33a5af1f5baa1b
CPU-Threads: 1; BS: Windows 6.1; UI-Render: Standard; 
Gebietsschema: de-DE (de_DE); Calc: group threaded
Comment 14 QA Administrators 2019-09-15 02:46:58 UTC Comment hidden (obsolete)
Comment 15 christian_kuhn 2019-09-20 08:16:10 UTC
Hello, 

I have downloaded the example again and have got the following results:

For:
Version: 5.2.7.2
Build-ID: 1:5.2.7-1+deb9u7
CPU-Threads: 6; BS-Version: Linux 4.9; UI-Render: Standard; VCL: kde4; 
Gebietsschema: de-DE (de_DE.UTF-8); Calc: group

1) If I open the form, then the message box with content "Test" appears, i.e. the subroutine 'Check_rl_term_context' was executed. However, this subroutine was registered for the form event 'Before changing the record', not for 'After loading'.

2) If I press the button to change to the next record, then the message box appears two times (subroutine 'Check_rl_term_context' was called two times per change to the next record), before the record will be changed.

3) If I move the mouse pointer to this button without pressing it after I have changed the record, the message box appears one time. This should not happen.


For
Version: 6.3.0.0.alpha1
Build-ID: 1:6.3.0~alpha1-2
CPU-Threads: 2; BS: Linux 4.19; UI-Render: Standard; VCL: kde5; 
Gebietsschema: de-DE (de_DE.UTF-8); UI-Sprache: de-DE
Calc: threaded

First, I had to migrate to Firebird DB.

1) If I open the form, then the message box with content "Test" appears, too. This is the same behaviour as described above.

2) If I press the button to change to the next record, then the message box appears two times, then the record will be changed as described above. But then, the message box appears two times again, and the record will be changed to the next record for a second time. In summary, per click to the button, the message box appears four times, and the record will be changed two times. I would expect, that the record will be changed one time, not two times.

3) If I move the mouse pointer tho this button without pressing it, nothing happens (no message box appears). This is the expected behaviour.


Best regards,
Christian
Comment 16 QA Administrators 2021-09-20 03:41:44 UTC Comment hidden (obsolete)
Comment 17 christian_kuhn 2021-09-21 15:44:45 UTC
Hello,

the bug is still present, I can confirm the behaviour as described in comment 15 (for Version: 6.3.0.0.alpha1, without migration to Firebird) using

Version: 7.1.5.2 / LibreOffice Community
Build ID: 10(Build:2)
CPU threads: 4; OS: Linux 5.10; UI render: default; VCL: kf5
Locale: de-DE (de_DE.UTF-8); UI: de-DE
Debian package version: 1:7.1.5-2~bpo11+1
Calc: threaded


Regards,
Christian
Comment 18 Robert Großkopf 2022-11-09 07:35:25 UTC
Have opened a new bug for this. Changed the macro a little bit to get only one event when changing record.

Sub Check_rl_term_context(oEvent AS OBJECT)
	oForm = oEvent.Source
	IF hasUnoInterfaces(oForm, "com.sun.star.form.XForm" ) THEN
		MsgBox("Test")
	END IF
End Sub

So we have only one buggy behavior to look for: Moving to next or previous row while moving mouse over navigation bar.
Comment 19 QA Administrators 2024-11-09 03:15:19 UTC Comment hidden (obsolete)
Comment 20 christian_kuhn 2024-11-19 10:11:34 UTC
Hello,

I have tested it with 

Version: 24.8.2.1 (X86_64)
Build:   0f794b6e29741098670a3b95d60478a65d05ef13

and the little modifications as described in comment 18. The bug is still present, if I change to the next record, the message box appears, but the button to change the record is still selected (active), even if I close the message box. If I move the mouse pointer over this button again (after closing the message box), then the message box appears a second time, and the button to change the record is now deselected.

Best regards,
Christian