Bug 145169 - Remote Save: uses "seen in directory" filename instead of existing filename
Summary: Remote Save: uses "seen in directory" filename instead of existing filename
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.4.0.3 release
Hardware: All All
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: target:7.3.0 target:7.2.3
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-16 11:53 UTC by Justin L
Modified: 2021-11-19 07:52 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Justin L 2021-10-16 11:53:15 UTC
Using SSH remote save, my root directory already contains a remote.ODT file. Now, when I am editing a differently named local.ODT, and then chose to "save remote", although the save dialog shows the expected name (local.ODT), it actually saves as remote.ODT. (A warning dialog says that local.ODT already exists [it doesn't] and asks if I want to overwrite. Regardless of saying yes or not, it overwrites remote.ODT, and LO's top banner even updates to show that remote.ODT filename.)

Showing the wrong name started in LO 7.0 with
commit 19116d1061b287eef600ec6b3f46c362a4abd405
Author: Caolán McNamara on Wed Nov 20 10:05:48 2019 +0000
    consistency wrt notification events for treeview cursor change

Prior to that commit, it would show the suggested name remote.ODT (which is bad enough itself, but at least it accurately showed what it was going to save as.)

The overwrite-even-though-I-said-no started in 6.4 with
commit 09e3d45cdc5c739e5246388a83ccfc6d76bf66e9
Author: Caolán McNamara on Mon Oct 21 14:20:12 2019 +0100
    weld fpicker cluster

[Of course, if you modify the filename by hand before saving, then the modified name is used.]

[bibisect-6.3 master shows the correct filename for export (local.ODT). Oldest on bibisect-6.4 shows the wrong filename for export (remote.ODT).]
Comment 1 Justin L 2021-10-16 15:28:50 UTC
IMPL_LINK_NOARG ( RemoteFilesDialog, OkHdl, weld::Button&, void )
bSelected is pretty much always true. But it should be irrelevant, because the filename box is tied to it if a real file is selected. (For example, just browsing through the folders also ends up with strange results when a folder is automatically "selected".)

It looks like this dialog is used for other things? Opening for one, and PATH-ONLY dialog somehow?
Perhaps it needs to be:
    if( !bSelected || (m_eMode == REMOTEDLG_MODE_SAVE && m_eType == REMOTEDLG_TYPE_FILEDLG) )
Comment 2 Caolán McNamara 2021-10-16 18:32:52 UTC
the "non-remote" built-in libreoffice file dialog. (tools, options, general, use LibreOffice dialog) is a similar creation, but without the initially described problem, there the difference is the focus is given to the edit box by default, which unselects the entry in the treeview. So currently its acting a little as if the user had explicitly clicked the first entry in the treeview.
Comment 3 Justin L 2021-10-16 18:38:17 UTC
(In reply to Caolán McNamara from comment #2)
Just "the focus" isn't really good enough though. Make sure you test when a "folder" is selected.
Comment 4 Justin L 2021-10-16 18:57:32 UTC
(In reply to Justin L from comment #0)
> (A warning dialog says that local.ODT
> already exists and asks if I want to overwrite.
> Regardless of saying yes or not, it overwrites remote.ODT
Is fixing this going to require something like
    ucbhelper::cancelCommandExecution(mapGIOError(err), env)  ?
Comment 5 Commit Notification 2021-10-18 09:08:14 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/5acba60cbd97f2f181037cbd3ab049e7ebff5332

Related: tdf#145169 use "sftp" because that's a known Protocol

It will be available in 7.3.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 6 Commit Notification 2021-10-18 10:39:30 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

https://git.libreoffice.org/core/commit/33f3c2abd1cfebaa6e6957a2c189b2e345068788

Related: tdf#145169 use "sftp" because that's a known Protocol

It will be available in 7.2.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 7 Commit Notification 2021-10-18 10:40:40 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

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

Related: tdf#145169 use INetURLObject::getName and removeSegment

It will be available in 7.3.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 8 Commit Notification 2021-10-18 14:09:10 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/15d0eec26be416e77d9b9580cf34d9a1d32a2615

Related: tdf#145169 unwanted dialogs on sftp save to remote to a new document

It will be available in 7.3.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 9 Commit Notification 2021-10-18 15:22:13 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/67fa088be7db1df661188ef4bab490a76fb06b85

tdf#145169 for IsDocument/IsFolder I think we want no interaction

It will be available in 7.3.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 Commit Notification 2021-10-18 18:28:53 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

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

tdf#145169 have one button per response

It will be available in 7.3.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 11 Commit Notification 2021-10-18 18:30:03 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/3c168b1dc876e4fca97f73683572462a29227523

Resolves: tdf#145169 only position treeview cursor at the first entry

It will be available in 7.3.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 2021-10-18 18:30:14 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

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

Related: tdf#145169 change to selected dir on remote "save"

It will be available in 7.3.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 13 Caolán McNamara 2021-10-18 18:31:52 UTC
I think it works correctly now in trunk, assuming I haven't missed anything obvious. Backports for 7-2 in gerrit.
Comment 14 Justin L 2021-10-19 07:05:18 UTC
I tested remote open/save in master. Things look pretty good. No regressions noticed.

There are a few other things (outside of these bug reports / fixes) that could still use some TLC and have never worked AFAICT.
1.) cannot create a new folder properly. Junk characters are added instead of a separator, so new folder is named CUR_DIR??????NEW_FOLDER
     -doesn't work in web share or sftp (the two I am testing)
     [-SAVE-AS can create the folders if already having a remote file open.]
2.) cannot enter into a hidden folder (.test for example)
     -the URL returned is "true" instead of "sftp://.../.test"
     -doesn't work in web share or sftp
     [-DOES work with SAVE-AS if already having a remote file open.]
3.) SAVE-AS overwrites a remote file without asking for confirmation.
     -already true
Comment 15 Commit Notification 2021-10-19 08:10:51 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

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

tdf#145169 have one button per response

It will be available in 7.2.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 16 Commit Notification 2021-10-19 08:12:01 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

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

Related: tdf#145169 unwanted dialogs on sftp save to remote to a new document

It will be available in 7.2.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 17 Commit Notification 2021-10-19 09:17:51 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

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

Related: tdf#145169 change to selected dir on remote "save"

It will be available in 7.2.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 18 Commit Notification 2021-10-19 09:19:02 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

https://git.libreoffice.org/core/commit/8aaeea3c505c59bb2509924b527434ccf4152598

Resolves: tdf#145169 only position treeview cursor at the first entry

It will be available in 7.2.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 19 Caolán McNamara 2021-10-19 09:23:14 UTC
2.) cannot enter into a hidden folder (.test for example)
     -the URL returned is "true" instead of "sftp://.../.test"
     -doesn't work in web share or sftp

What I think is happening here is that gio ucb doesn't support "IsTargetURL" and skipped the property, resulting in the next property of "IsHidden" appearing at that position and the . names are IsHidden of "true" and so "true" is considered the "IsTargetURL", fixing that with https://gerrit.libreoffice.org/c/core/+/123779 results in the . dirs not appearing at all because they are then properly seen as hidden.
Comment 20 Caolán McNamara 2021-10-19 09:35:03 UTC
3.) SAVE-AS overwrites a remote file without asking for confirmation.
     -already true

What I see is that a double click on a file in the save-as remote dialog will not ask for confirmation of the overwrite, while a single click to select it, and then pressing return does ask for confirmation. That would be be fixed with 
https://gerrit.libreoffice.org/c/core/+/123806

I assume there isn't another missing overwrite confirm dialog on any other route ?
Comment 21 Commit Notification 2021-10-19 10:55:10 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/8154131ca8ae47fda4928b56ba622634bae8fe01

Related: tdf#145169 append null on unknown property

It will be available in 7.3.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 22 Commit Notification 2021-10-19 12:49:08 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/3859878f0e8c4dc212d952a156b83d1ba913f7f1

Related: tdf#145169 make double-click call same handler as ok button

It will be available in 7.3.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 23 Commit Notification 2021-10-19 12:50:18 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

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

Related: tdf#145169 make double-click call same handler as ok button

It will be available in 7.2.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 24 Commit Notification 2021-10-19 12:50:28 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

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

Related: tdf#145169 use of freed pointer in gio create folder

It will be available in 7.3.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 25 Commit Notification 2021-10-19 13:27:54 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/67a3ea1852a73a25980250473b0fd43a8392f779

Related: tdf#145169 warn on overwrite from gtk "save as" for remote files

It will be available in 7.3.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 26 Commit Notification 2021-10-19 13:29:05 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

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

Related: tdf#145169 append null on unknown property

It will be available in 7.2.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 27 Commit Notification 2021-10-19 13:29:15 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

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

Related: tdf#145169 missing path separator in gio create folder

It will be available in 7.3.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 28 Commit Notification 2021-10-19 14:48:31 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

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

Related: tdf#145169 use of freed pointer in gio create folder

It will be available in 7.2.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 29 Commit Notification 2021-10-19 18:53:50 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

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

Related: tdf#145169 warn on overwrite from gtk "save as" for remote files

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