Bug 159458 - When library is renamed using Basic Macro Organizer, path to library is not updated in dialog.xlc and script.xlc
Summary: When library is renamed using Basic Macro Organizer, path to library is not u...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:24.8.0 target:24.2.1
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-30 15:39 UTC by Ray Culp
Modified: 2024-02-08 12:34 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
screenshots (139.90 KB, application/pdf)
2024-01-30 15:39 UTC, Ray Culp
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ray Culp 2024-01-30 15:39:29 UTC
Created attachment 192265 [details]
screenshots

When you rename a Basic library using the Basic Macro Organizer, the name of the library is updated in dialog.xlc and script.xlc config files, and the path to the library in the actual file system is updated, but the xlink:href attribute of the element in dialog.xlc and script.xlc is not updated. It still points to the old folder.

I performed the following steps:

1. Create new library called Library1 using Basic Macro Organizer

2. Restart LibreOffice to make sure all changes were written to disk

3. Rename Library1 to Library11 using Basic Macro Organizer

4. Exit LibreOffice to make sure all changes were written to disk

5. Open dialog.xlc or script.xlc in code editor

   Result: Path parameter is not updated (see Screenshot 1 in attached PDF)

6. Open LibreOffice

   Result 1: LibreOffice shows error messages (see Screenshot 2 in attached PDF)

   Result 2: LibreOffice creates new empty folder that matches the path parameter that was not updated (see Screenshot 3 in attached PDF)
Comment 1 Mike Kaganski 2024-01-30 17:34:14 UTC
The code pointer for the "library name changed" event in the dialog:
https://opengrok.libreoffice.org/xref/core/basctl/source/basicide/moduldl2.cxx?r=d9d9ec70&mo=11283&fi=308#308

it calls SfxLibraryContainer::renameLibrary (basic/source/uno/namecont.cxx).
And it seems to me, that it doesn't fix the basic::SfxLibrary::maUnexpandedStorageURL, which stays "$(USER)/basic/Library1/script.xlb/" in the end of the function, when it is re-added to the container.
Comment 2 Mike Kaganski 2024-01-30 18:51:26 UTC
https://gerrit.libreoffice.org/c/core/+/162777
Comment 3 Commit Notification 2024-01-31 02:35:36 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/907d4107896234b2e7ebfd42f40cee3bd5b1d01e

tdf#159458: make sure to update unexpanded URL when renaming library

It will be available in 24.8.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 4 Commit Notification 2024-01-31 05:56:53 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/942e9a79f066a26276e299660ba56874874841c6

Related: tdf#159458 Move variable URL re-creation to a central place

It will be available in 24.8.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 5 Commit Notification 2024-02-08 12:34:29 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

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

tdf#159458: make sure to update unexpanded URL when renaming library

It will be available in 24.2.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.