Bug 162279 - Base Forms: Warning for deleting records will show many useless and irritating informations
Summary: Base Forms: Warning for deleting records will show many useless and irritatin...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
24.2.0.3 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Julien Nabet
URL:
Whiteboard: target:25.2.0 target:24.8.1
Keywords: bibisected, regression
Depends on:
Blocks:
 
Reported: 2024-07-31 07:00 UTC by Robert Großkopf
Modified: 2024-08-02 06:59 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Message when trying to delete a record in LO 24.8.0.2 (27.97 KB, image/png)
2024-07-31 07:00 UTC, Robert Großkopf
Details
Message when trying to delete a record in LO 7.4.7.2 (10.51 KB, image/png)
2024-07-31 07:01 UTC, Robert Großkopf
Details
Open the form of the attached database and try deleting a record… (14.52 KB, application/vnd.oasis.opendocument.database)
2024-07-31 07:07 UTC, Robert Großkopf
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Großkopf 2024-07-31 07:00:36 UTC
Created attachment 195615 [details]
Message when trying to delete a record in LO 24.8.0.2

Open any form in a base file.
Try to delete a record.
There will appear a warning:

You intend to delete 1 record. at home/buildslave/source/lib-core/svx/source/form/formcontroller.cxx:3927
If you click Yes you won't be able to undo this operation. 
Do you want to continue anyway? at home/buildslave/source/lib-core/svx/source/form/formcontroller.cxx:3926

This is the message, which appears in LO 24.8.0.2.

When trying the same in LO 7.4.7.2 there will only appear

You intend to delete 1 record.
If you click Yes you won't be able to undo this operation. 
Do you want to continue anyway?

… and the layout is better there because the first line will be shown as a title.
Comment 1 Robert Großkopf 2024-07-31 07:01:10 UTC
Created attachment 195616 [details]
Message when trying to delete a record in LO 7.4.7.2
Comment 2 Robert Großkopf 2024-07-31 07:05:36 UTC
Bug doesn't appear in LO 7.6.4.1, appears first here in 
Version: 24.2.0.3 (X86_64) / LibreOffice Community
Build ID: da48488a73ddd66ea24cf16bbc4f7b9c08e9bea1
CPU threads: 6; OS: Linux 6.4; UI render: default; VCL: kf5 (cairo+xcb)
Locale: de-DE (de_DE.UTF-8); UI: en-US
Calc: threaded
Comment 3 Robert Großkopf 2024-07-31 07:07:19 UTC
Created attachment 195618 [details]
Open the form of the attached database and try deleting a record…
Comment 4 m_a_riosv 2024-07-31 07:28:39 UTC
Reproducible
Version: 24.2.0.0.alpha1 (X86_64) / LibreOffice Community
Build ID: 06946980c858649160c634007e5fac9a5aa81f38
CPU threads: 16; OS: Windows 10.0 Build 22631; UI render: Skia/Vulkan; VCL: win
Locale: es-ES (es_ES); UI: es-ES
Calc: CL threaded

Latest version that works on the ones I have installed.
Version: 7.6.7.2 (X86_64) / LibreOffice Community
Build ID: dd47e4b30cb7dab30588d6c79c651f218165e3c5
CPU threads: 16; OS: Windows 10.0 Build 22631; UI render: Skia/Raster; VCL: win
Locale: es-ES (es_ES); UI: en-US
Calc: CL threaded
Comment 5 Julien Nabet 2024-07-31 12:46:33 UTC
On pc Debian x86-64 with master sources updated today, I could reproduce this.

bt part:
#0  svxform::FormController::confirmDelete(com::sun::star::sdb::RowChangeEvent const&) (this=0x56172af2bda0, aEvent=...) at svx/source/form/formcontroller.cxx:3927
#1  0x00007f7b3d0839b7 in FmGridControl::DeleteSelectedRows() (this=0x56172c843190) at svx/source/fmcomp/fmgridcl.cxx:1197
#2  0x00007f7b3d1865b8 in DbGridControl::OnDelete(void*) (this=0x56172c843190) at svx/source/fmcomp/gridctrl.cxx:2644

Regression from 176e8cf09a527438ec9b2b20ba2df23fa45226bc
Use exception ctors, instead of setting members later
    
Avoids overwriting source location in message

(12/10/2023).

Reverting partly the patch with:
diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx
index fa45f354ed12..2e8340dfdd46 100644
--- a/svx/source/form/formcontroller.cxx
+++ b/svx/source/form/formcontroller.cxx
@@ -3923,8 +3923,11 @@ sal_Bool SAL_CALL FormController::confirmDelete(const RowChangeEvent& aEvent)
         rtl::Reference<OInteractionDisapprove> pDisapprove = new OInteractionDisapprove;
 
         // the request
-        SQLWarning aDetails(SvxResId(RID_STR_DELETECONFIRM), {}, {}, 0, {});
-        SQLWarning aWarning(sTitle, {}, {}, 0, css::uno::Any(aDetails));
+        SQLWarning aWarning;
+        aWarning.Message = sTitle;
+        SQLWarning aDetails;
+        aDetails.Message = SvxResId(RID_STR_DELETECONFIRM);
+        aWarning.NextException <<= aDetails;
 
         rtl::Reference<OInteractionRequest> pRequest = new OInteractionRequest( Any( aWarning ) );
 
seems to fix this.

Mike: thought you might be interested in this one.
Comment 6 Mike Kaganski 2024-07-31 13:28:27 UTC
(In reply to Julien Nabet from comment #5)

Heh, those useless and irritating messages helped me the last weeks, when I fixed a couple of Base issues... :-)

Julien: please go ahead and fix this. My only ask would be: do not revert it as a whole, but instead, in a non-debug build (#ifdef NDEBUG), assign the aWarning.Message and aDetails.Message, to overwrite the debug information.

Thank you!
Comment 7 Robert Großkopf 2024-07-31 14:16:35 UTC
(In reply to Mike Kaganski from comment #6)
> (In reply to Julien Nabet from comment #5)
> 
> Heh, those useless and irritating messages helped me the last weeks, when I
> fixed a couple of Base issues... :-)
> 
> Julien: please go ahead and fix this. My only ask would be: do not revert it
> as a whole, but instead, in a non-debug build (#ifdef NDEBUG), assign the
> aWarning.Message and aDetails.Message, to overwrite the debug information.
> 
> Thank you!

Hey both,

thank you for fixing so much bugs in Base. I saw this meassages, thought it might help a developer, but won't help anybody out there, who will only use Base.

Regards

Robert
Comment 8 Julien Nabet 2024-07-31 21:13:13 UTC
Patch waiting for review here:
https://gerrit.libreoffice.org/c/core/+/171337
Comment 9 Commit Notification 2024-08-01 09:44:41 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/572011827a59e93448745294f3fe3eea3e028ffc

tdf#162279: Base Forms: details of the warning only on debug mode

It will be available in 25.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Julien Nabet 2024-08-01 09:47:03 UTC
Cherry-pick for 24.8 waiting for review here:
https://gerrit.libreoffice.org/c/core/+/171353
Comment 11 Commit Notification 2024-08-02 06:59:32 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

https://git.libreoffice.org/core/commit/99a9c188cc8a95b72e7e8f59e1e48464767ca651

tdf#162279: Base Forms: details of the warning only on debug mode

It will be available in 24.8.1.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.