Bug 148996 - Repeated "Save As" to /tmp does not default to /tmp
Summary: Repeated "Save As" to /tmp does not default to /tmp
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.4.0.0 alpha0+
Hardware: All All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-09 10:06 UTC by Eyal Rozenberg
Modified: 2022-05-10 05:11 UTC (History)
3 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 Eyal Rozenberg 2022-05-09 10:06:04 UTC
Suppose I open some document in directory P1, then Save-As it to directory P2, then edit it some, then Save-As again. The directory the second Save-As dialog should be observing/suggesting should be P2, not P1; but - I get P1.

Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: d9b33ed6644203141fdb0776c291425c2bc9f5ac
CPU threads: 4; OS: Linux 5.10; UI render: default; VCL: gtk3
Locale: en-IL (en_IL); UI: en-US


PS - Not sure if this issue is specific to the Writer module.
Comment 1 Mike Kaganski 2022-05-09 10:42:31 UTC
No repro using Version: 7.3.3.2 (x64) / LibreOffice Community
Build ID: d1d0ea68f081ee2800a922cac8f79445e4603348
CPU threads: 12; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: CL

gtk3-specific?
Caolan: maybe this is one for you?
Comment 2 Mike Kaganski 2022-05-09 10:45:46 UTC
(In reply to Eyal Rozenberg from comment #0)

By the way: do you use system dialogs, or LibreOffice's? Please check at Options->LibreOffice->General->Use LibreOffice dialogs (should be off by default), or at Options->LibreOffice->Advanced->Expert Configuration (search for UseSystemFileDialog).
Comment 3 Rainer Bielefeld Retired 2022-05-09 10:46:42 UTC
NOT reproducible with Server Installation of Version: 7.4.0.0.alpha0+ (x64)  Build ID b000d964fcc8849d10576bf3539bde7729db2eb1 (March 2022)
CPU threads: 12; OS: Windows 10.0 Build 19044; UI render: default; VCL: win
Locale: de-DE (de_DE); UI: en-US  |  Calc: CL  |  Auto Colibre Theme  |  Special devUserProfile

Depends on OS or proceeding details or Version?

My STR:
0. Create an empty new folder P2 and new Empty Writer Document in 
   new empty folder P1 (parallel to P2) using "Create New
   Document" function of WIN10
1. Launch LibO4
2. From LibO file dialog(!) Open new document
3. Type some nonsense strings
4. Menu ˋFile → Save as → Browse for existing empty folder P2  → Saveˊ 
3. Type some more nonsense strings
4. Menu ˋFile → Save asˊ
   » As expected and hoped suggested folder is P2   👍
Comment 4 Rainer Bielefeld Retired 2022-05-09 10:47:38 UTC
(In reply to Mike Kaganski from comment #2)
Indeed, more precise details are required to find the roots
Comment 5 Caolán McNamara 2022-05-09 14:55:27 UTC
For me with the gtk version with or without Options->LibreOffice->General->Use LibreOffice dialogs toggled off or on I get the expected result of the previously saved to dir as the default on resave.
Comment 6 LeroyG 2022-05-09 19:05:11 UTC
Not reproducible with 
Version: 7.1.8.1 (x86) / LibreOffice Community
Build ID: e1f30c802c3269a1d052614453f260e49458c82c
CPU threads: 4; OS: Windows 6.1 Service Pack 1 Build 7601; UI render: Skia/Raster; VCL: win
Locale: es-MX (es_MX); UI: en-US
Calc: threaded

Except OP, the three other tests were on Windows.
Comment 7 Rainer Bielefeld Retired 2022-05-09 19:40:42 UTC
@reporter
Additional to More precise details concerning your tests your result with newly created user profile or at least in safe mode would be useful.
Comment 8 Eyal Rozenberg 2022-05-09 21:42:09 UTC
(In reply to Mike Kaganski from comment #2)
> By the way: do you use system dialogs, or LibreOffice's?

Using system dialogs.
Comment 9 Eyal Rozenberg 2022-05-09 21:47:24 UTC
Upon further scrutiny of the issue, and checking in safe mode: It turns out this happens to me when I "Save As" to the /tmp directory (on Linux), but not when I save to some other directories. i.e., somehow LO thinks that if I Save-As'ed to /tmp, I don't really want to Save-As there again.
Comment 10 Mike Kaganski 2022-05-10 05:11:22 UTC
(In reply to Eyal Rozenberg from comment #9)

Indeed, temp directories are explicitly treated specially. See ModelData_Impl::GetRecommendedDir [1].

The problem is that temporary directory often gets cleared automatically, and users unaware of that may be sure they saved their documents (e.g., opened from email attachments saved to /tmp by mailer), but then would loose hours of their edits.

See e.g. tdf#80807 and tdf#109537.

This is not a bug; this should not be changed, because infrequent inconvenience of advanced users knowing what they do is much milder than very likely dataloss from old behavior before fixing those mentioned bugs.

[1] https://opengrok.libreoffice.org/xref/core/sfx2/source/doc/guisaveas.cxx?r=0bfa6a18&mo=47973&fi=1172#1172