Bug 118755 - Save as template does not overwrite as required
Summary: Save as template does not overwrite as required
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.2.0.0.alpha0+
Hardware: All Linux (All)
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 120390 (view as bug list)
Depends on:
Blocks: Templates
  Show dependency treegraph
 
Reported: 2018-07-14 05:06 UTC by Elmar
Modified: 2023-07-18 04:47 UTC (History)
4 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 Elmar 2018-07-14 05:06:34 UTC
Description:
I have a default template. It is wrong. I fix it I use the Save as template dialog to overwrite it. LO Writer saves it to a new name.

Steps to Reproduce:
1. open writer - wrong template (e.g. 0Doc.ott) 
2. fix template
3. save as template

Actual Results:
has created a new template 0Doc1.ott


Expected Results:
it should have overwritten 0Doc.ott
If this is a safety feature, then it should rather rename the original (wrong) template. However, that would be inconsistent with the way Calc and Impress work.


Reproducible: Always


User Profile Reset: No



Additional Info:
[Information automatically included from LibreOffice]
Locale: en-US
Module: TextDocument
[Information guessed from browser]
OS: Linux (All)
OS is 64bit: yes
Version: 6.2.0.0.alpha0+
Build ID: 8e9d43546c8e46ea635472ddf07f5c183dc13360
CPU threads: 4; OS: Linux 4.10; UI render: default; VCL: gtk2; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2018-07-12_01:06:03
Locale: en-GB (en_ZA.UTF-8); Calc: group threaded
Comment 1 Dieter 2018-07-14 06:21:32 UTC
Can't confirm it in Windows

Version: 6.2.0.0.alpha0+ (x64)
Build ID: b0e291a7efcd3af2a72d0b622b1f1b84723f011f
CPU threads: 4; OS: Windows 10.0; UI render: GL; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2018-06-30_23:43:40
Locale: en-US (de_DE); Calc: CL
Comment 2 Buovjaga 2018-08-30 17:20:49 UTC
It asks me "A template named test already exist in My Templates. Do you want to overwrite it?", but then the resulting file indeed gets "1" stuck at the end.

Elmar: to clarify, is this how it happens with you as well? The original file disappears?

Arch Linux 64-bit
Version: 6.2.0.0.alpha0+
Build ID: b0e74b65a86eb965c3e93da2fb77972cc5445f3c
CPU threads: 8; OS: Linux 4.18; UI render: default; VCL: gtk3_kde5; 
Locale: fi-FI (fi_FI.UTF-8); Calc: threaded
Built on August 29th 2018
Comment 3 Elmar 2018-08-31 06:25:40 UTC
 Buovjaga, yes, that is what happens. The document is renamed to the same name with a 1 added.

Thus, 0Doc.ott is now called 0Doc1.ott in the default templates folder.

What is strange is that when I open Writer, in Properties it still refers to the original name (excluding the suffix). I assume the the file name must be stored "correctly" somewhere in the settings? 

Yet, when I repeat the exercise, saving again as template to 0Doc, it still tells me that a template named 0Doc already exists (it does not, in the default templates folder - it is called 0Doc1).

Now, when I view the default templates folder, the name is 0Doc.ott again.

Save it again as template, and the name has been changed back to 0Doc1.ott again.
Comment 4 Buovjaga 2018-10-25 19:09:34 UTC
*** Bug 120390 has been marked as a duplicate of this bug. ***
Comment 5 chris 2020-01-15 09:38:46 UTC
I can also reproduce this issue under (K)ubuntu 19.04. Should this not be a higher important than 'minor'. Consider increase to 'normal'?

Version: 6.2.8.2
Build ID: 1:6.2.8-0ubuntu0.19.04.1
CPU threads: 2; OS: Linux 5.0; UI render: default; VCL: kde5; 
Locale: en-GB (en_GB.UTF-8); UI-Language: en-GB
Comment 6 Elmar 2021-09-03 12:30:50 UTC
I do not believe this is a problem anymore
Comment 7 Buovjaga 2021-09-03 13:00:21 UTC
Still repro

Arch Linux 64-bit
Version: 7.3.0.0.alpha0+ / LibreOffice Community
Build ID: 104847ed014e95a915d314de7091c7d572eade67
CPU threads: 8; OS: Linux 5.13; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Built on 3 September 2021
Comment 8 ajlittoz 2022-08-04 11:45:36 UTC
Still present in
Version: 7.3.4.2
Build ID: 30(Build:2)
CPU threads: 4; OS: Linux 5.18; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fr-FR (fr_FR.UTF-8); UI: en-US
Calc: threaded

Behaviour is strange. If I save again the template with initial intended name (without the 1-suffix), overwrite warning still appears. On Yes answer, template is overwritten but the 1-suffix is erased, reverted to the original name!

Repeating the operation, the template names alternates between original and original + 1-suffix.

If I erase manually the 1-suffix in the template directory without closing Writer, trying to create a new file based on the template leads to a non-empty document. Writer detects that some operation on the template directory has been done outside LO because the template icon turns blue. But we can still create a new document based on the now-absent template. The create file has a couple of pages looking apparently compliant with the template but pages coming from the last open document are added at the end.

Of course, my procedure is faulty because I insisted on creating a document from a "damaged" template. But as LO was able to detect that something happened to the template, it should not proceed with document creation, letting user believe that everything went good.
Comment 9 Buovjaga 2023-07-13 12:12:11 UTC
Still repro.

NixOS
Version: 7.5.4.1 (X86_64) / LibreOffice Community
Build ID: 50(Build:1)
CPU threads: 16; OS: Linux 6.4; UI render: default; VCL: gtk3
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Comment 10 Buovjaga 2023-07-18 04:47:35 UTC
Elmar: please stop incorrectly marking this as worksforme.