Bug 156599 - Error message when load a form. System works correct after confirming the message
Summary: Error message when load a form. System works correct after confirming the mes...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
7.4.7.2 release
Hardware: All Windows (All)
: medium normal
Assignee: Jean-Pierre Ledure
URL:
Whiteboard: target:24.2.0 target:7.6.3
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-03 21:34 UTC by r.kleinschmidt
Modified: 2023-12-14 18:50 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
my solution to avoid the exception (240 bytes, text/plain)
2023-09-13 08:36 UTC, r.kleinschmidt
Details
Test case raising up the error (10.76 MB, application/x-zip-compressed)
2023-09-27 10:15 UTC, r.kleinschmidt
Details

Note You need to log in before you can comment on or make changes to this bug.
Description r.kleinschmidt 2023-08-03 21:34:46 UTC
receive error message

Library :   ScriptForge
Service :   SF_Services
Method :    CreateScriptService


The ScriptForge library has crashed. The reason is unknown.
Maybe a bug that could be reported on
    https://bugs.documentfoundation.org/

More details : 

Location : SFDocuments.Base.IsLoaded/422
Objektvariable nicht belegt.


THE EXECUTION IS CANCELLED.
Comment 1 Rafael Lima 2023-08-21 11:27:59 UTC
Hi! Can you please provide a sample script to reproduce the error?
Comment 2 r.kleinschmidt 2023-09-13 08:36:46 UTC
Created attachment 189542 [details]
my solution to avoid the exception
Comment 3 Buovjaga 2023-09-27 06:26:12 UTC
(In reply to r.kleinschmidt from comment #2)
> Created attachment 189542 [details]
> my solution to avoid the exception

Attachment is just a text file with:

"As the exception raised randomly and not when i debug the macro, I expected a time issue based on execution performance on my laptop. 

Since I add a wait command "Wait 2000" in the loading trigger, the exception didn't raised again."

Back to needinfo while we wait for the sample script.
Comment 4 r.kleinschmidt 2023-09-27 10:15:35 UTC
Created attachment 189845 [details]
Test case raising up the error

Testcase: Set of Pictures (jpg)
          Libre office application

up-zip die Attachment in one folder
load application
load Formulare "frmBettinasBilder"
Formular showm with error message

May bugfix:
I Added  Sub FormLaden
             Wait 2000
executed in trigger "laden"
Comment 5 Rafael Lima 2023-09-27 14:42:37 UTC
(In reply to r.kleinschmidt from comment #4)
> Created attachment 189845 [details]
> Test case raising up the error

With LO 7.6.1 I cannot reproduce the error. Here's what I did:

1) Unzip the test file
2) Open the file "DB-BettinasBilder.odb"
3) Double-click the "frmBettinasBilder" form
4) The form opens as expected

Tested with:

Version: 7.6.1.2 (X86_64) / LibreOffice Community
Build ID: f5defcebd022c5bc36bbb79be232cb6926d8f674
CPU threads: 12; OS: Linux 6.2; UI render: default; VCL: kf5 (cairo+wayland)
Locale: pt-BR (pt_BR.UTF-8); UI: en-US
Calc: threaded

Can you double-check if you can reproduce the error in the latest LO version?
Comment 6 r.kleinschmidt 2023-09-27 15:40:31 UTC
I still can reproduce the error with version 7.6.1.2

I'm working on Windows 11 (x86 64) intel(R) Core (TM) i5, your test is on Linux  6.2 
regards 
Richard Kleinschmidt
Comment 7 Rafael Lima 2023-09-27 15:56:13 UTC
@JPL can you try to reproduce this problem?
Comment 8 r.kleinschmidt 2023-09-27 17:58:44 UTC
I installed 7.6.1.2
an the error is still there, using the example i send in the attachment
Comment 9 QA Administrators 2023-09-28 03:18:07 UTC Comment hidden (obsolete)
Comment 10 Jean-Pierre Ledure 2023-09-28 11:31:35 UTC
I could reproduce the issue on

Version: 7.6.2.1 (X86_64) / LibreOffice Community
Build ID: 56f7684011345957bbf33a7ee678afaf4d2ba333
CPU threads: 6; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: fr-BE (en_US.UTF-8); UI: en-US
Calc: threaded

and could simulate a correction. It is due to a stack of calls to IsLoaded().
A patch will be issued soon (master and 7.6).

However other errors appear when going further: apparently SQL syntax errors in the user scripts, but I didn't debug them.

Also, a few recommendations in the use of ScriptForge:
- it is useless to run base.IsLoaded(form) repeatedly inside scripts triggered by events set in the form. It can only return True.
- the given scripts can probably be simplified and lightened by creating form instances like in the example in the help:
   In Form events, to invoke the Form service when a form event takes place:
   Sub OnEvent(ByRef poEvent As Object)
       Dim myForm As Object
       Set myForm = CreateScriptService("SFDocuments.FormEvent", poEvent)
       '(...)
   End sub
   (read https://help.libreoffice.org/master/en-US/text/sbasic/shared/03/sf_form.html?DbPAR=BASIC)
Comment 11 Commit Notification 2023-09-28 14:17:34 UTC
Jean-Pierre Ledure committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/bbe4d3498c2f994342b4d213f0ae874e7b0b7775

ScriptForge (SF_Base) tdf#156599 Error message when loading a form

It will be available in 24.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 12 Commit Notification 2023-09-28 15:21:45 UTC
Jean-Pierre Ledure committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/b352ce86679d8ee751f57dc34ca808a62712e3b1

ScriptForge (SF_Base) tdf#156599 Error message when loading a form

It will be available in 7.6.3.

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 13 Rafael Lima 2023-12-14 18:50:42 UTC
Closing this as FIXED. Feel free to reopen if the problem happens again.