Bug 149064 - Error when running macro accessing WebDAV twice
Summary: Error when running macro accessing WebDAV twice
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: framework (show other bugs)
Version:
(earliest affected)
7.1.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.6.0 target:7.5.3 target:7.4.7
Keywords: implementationError
Depends on:
Blocks: WebDAV
  Show dependency treegraph
 
Reported: 2022-05-13 02:32 UTC by Aron Budea
Modified: 2023-04-09 20:59 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Error message (28.76 KB, image/png)
2022-05-13 02:32 UTC, Aron Budea
Details
ucb info log (227.75 KB, text/plain)
2022-05-13 02:34 UTC, Aron Budea
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aron Budea 2022-05-13 02:32:54 UTC
Created attachment 180087 [details]
Error message

This bug requires a WebDAV server, eg. one can use dave [1].

- In Writer, add the macro below (between "--------") to eg. My Macros & Dialogs / Standard / Module 1,
- Adjust 'FileNameExt' based on your WebDAV setup,
- Run the Main sub (you'll have to authenticate),
- Run the Main sub again.

=> BASIC runtime error with an exception, error code 0x20d (Error Area:Io Class:General Code:13).

In 7.0 and earlier, there's no error.
In 7.1, there's an error, and this regressed with the following commit:

https://cgit.freedesktop.org/libreoffice/core/commit/?id=f3f0d05f72d8dbd9717910b4d6b42c54be3e106f

author		Noel Grandin <noelgrandin@gmail.com>	2020-07-22 14:04:09 +0200
committer	Noel Grandin <noel.grandin@collabora.co.uk>	2020-07-22 15:53:23 +0200

"ucb/neon: create instances with uno constructors"

However, this change was specific to neon, and the bug persists in 7.4 (d6cd44b74cf0b6b0eaeea6f986f749da42d171ac), after the switch to curl-based WebDAV.
Attaching console logs taken with: SAL_LOG="+INFO.ucb"

Macro content:
--------
Sub Main
  Dim oDocument As Object
  Dim status As Boolean
  Dim FileNameExt As String

  oDocument = ThisComponent
  FileNameExt = "webdav://127.0.0.1:8000/test.odt"
  status = SaveDocumentToFile_Simple(oDocument, FileNameExt)
End Sub

Function SaveDocumentToFile_Simple (document As Object, destinationUrl As String) As Boolean
  Dim propFile(1) As New com.sun.star.beans.PropertyValue
  Dim urlTest As String

  propFile(0).Name = "Overwrite"
  propFile(0).Value = True

  document.storeAsURL(ConvertToURL(destinationUrl), propFile())
End Function
--------

Notes on using dave:
A simple setup is to rename config-sample.yaml to config.yaml in the downloaded release archive.
The default user / pw is "user" and "foo", the default port is 8000, and by default it uses /tmp/user as storage.

[1] https://github.com/micromata/dave
Comment 1 Aron Budea 2022-05-13 02:34:15 UTC
Created attachment 180088 [details]
ucb info log
Comment 2 Commit Notification 2023-03-29 15:20:51 UTC
Jaume Pujantell committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/20132d64bbd448950bcbd2b0d31504d5025ac6c7

tdf#149064 ensure interaction handler is present when transfering with webDAV

It will be available in 7.6.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 3 Commit Notification 2023-04-07 16:45:00 UTC
Jaume Pujantell committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/439d8466c10473d1f3859ffa6c87fef6209e93eb

tdf#149064 ensure interaction handler is present when transfering with webDAV

It will be available in 7.5.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 4 Commit Notification 2023-04-09 20:59:26 UTC
Jaume Pujantell committed a patch related to this issue.
It has been pushed to "libreoffice-7-4":

https://git.libreoffice.org/core/commit/4300ea07cfa664a1de9509cb9cd83c7ae46afe87

tdf#149064 ensure interaction handler is present when transfering with webDAV

It will be available in 7.4.7.

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.