Bug 28954 - LO Writer unable to use template when opening a new file
Summary: LO Writer unable to use template when opening a new file
Status: RESOLVED INVALID
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 8
Hardware: x86_64 Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Mageia Bug Squad
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-21 12:10 CEST by Maurice Batey
Modified: 2021-05-25 21:13 CEST (History)
3 users (show)

See Also:
Source RPM: libreoffice-7.0.4.2-5.mga8.src.rpm
CVE:
Status comment:


Attachments
Screen shot at LO Writer/options/Path (155.38 KB, image/png)
2021-05-23 10:19 CEST, Maurice Batey
Details

Description Maurice Batey 2021-05-21 12:10:21 CEST
Description of problem:

When using "libreoffice --writer", see following error message:

    /home/mabTemplates/morningside1.ott does not exist

when there is no such folder "mabTemplates".

(Templates are in /home/mab/Templates)

Version-Release number of selected component (if applicable):

   libreoffice-7.0.4.2-5.mga8.src.rpm

How reproducible:

Steps to Reproduce:
1. Call "libreoffice --writer"

2. See: "/home/mabTemplates/morningside1.ott does not exist"

3. Escape from error message results in new blank document displayed, when should have been initialised with 'letterhead' template /home/mab/Templates/morningside1.ott

N.B. This occurs also on Mga8 on laptop, but NOT on Mga7 on laptop or desktop, where LO is version 6.4.7.2
Comment 1 Lewis Smith 2021-05-21 20:25:12 CEST
Thank you for reporting this, but I cannot reproduce the fault with the same version of LibreOffice 7.0.4.2-5.mga8. This is not to deny the fault, but we prefer to confirm reproduceable bad behaviour.

My ~/Templates directory is empty, but exists.
 $ libreoffice --writer
shows no such error message (but one for Gtk). And it starts OK with a blank new document.

In your example, where does the '.../morningside1.ott' come from? Is it defined somewhere (if so, how; so I can try it) as a default template to open with?

CC: (none) => lewyssmith
Status: NEW => NEEDINFO

Comment 2 Dave Hodgins 2021-05-21 20:59:58 CEST
The ~/Templates directory exists in my Mageia 8 (upgraded from 7) install. Not
sure whether I created it or libreoffice did.

Saving a new template as ~/Templates/Mytemplate.ott and then using
File/Templates/Open Template... is working for me.

Selecting Tools/Options/LibreOffice/Paths shows the directories searched
for templates (other then those included by default).

Maurice, somehow the the path to search in the options has been messed up
in that install, and will need to be manually fixed.

Doesn't look like a libreoffice problem, just a directory in /home that is in
the search path no longer existing.

CC: (none) => davidwhodgins

Comment 3 Dave Hodgins 2021-05-21 21:10:28 CEST
Also, in my install I definitely never altered the search options for templates.
It has two directories listed
/home/dave/.config/libreoffice/4/user/template
/home/dave/Templates

The first one does not exist. In the options, the second one was selected by
default.

And in my install ...
$ env|grep HOME
HOME=/home/dave
Comment 4 Maurice Batey 2021-05-22 15:20:45 CEST
(In reply to Dave Hodgins from comment #3)
> Also, in my install I definitely never altered the search options for
> templates.
> It has two directories listed
> /home/dave/.config/libreoffice/4/user/template
> /home/dave/Templates
> 
> The first one does not exist. In the options, the second one was selected by
> default.
> 
> And in my install ...
> $ env|grep HOME
> HOME=/home/dave

$ ls /home/mab/Templates
57kf.ott  morningside1.ott

$  env|grep HOME
HOME=/home/mab
Comment 5 Maurice Batey 2021-05-22 15:36:42 CEST
(In reply to Dave Hodgins from comment #2)
> The ~/Templates directory exists in my Mageia 8 (upgraded from 7) install.
> Not sure whether I created it or libreoffice did.

  Same here.
 
> Selecting Tools/Options/LibreOffice/Paths shows the directories searched
> for templates (other then those included by default).
> 
> Maurice, somehow the the path to search in the options has been messed up
> in that install, and will need to be manually fixed.

 That's it in a nutshell!

> Doesn't look like a libreoffice problem, just a directory in /home that is in
> the search path no longer existing.

  No, it is clearly not 'just a directory in /home.

The bizarre error notification  when opening LO Writer:

   "/home/mabTemplates/morningside1.ott does not exist"

illustrates 2 things:

   The construct "/home/mabTemplates/" is saying that there is a USER called
"mabTemplates", but that is not so:

 ls -n /home
total 40
drwxr-x---  21 1501 1501  4096 May 21 17:01 lin/
drwx------   2    0    0 16384 Apr 13  2018 lost+found/
drwxr-xr-x 128 1500 1500 20480 May 22 14:16 mab/

Compare the error message with what LO Writer was presumably trying to do:

"/home/mabTemplates/morningside1.ott"
"/home/mab/Templates/morningside1.ott"

There is a '/' missing between "mab" and "templates"...

The idiotic message "/home/mabTemplates/morningside1.ott does not exist" can surely only have been issued from within LO WRiter, which act this bug report sought to home prevent.

Checking templates:

$ ls ~/Templates
57kf.ott  morningside1.ott
Comment 6 Maurice Batey 2021-05-22 15:47:09 CEST
P.S. As a workaround to my LO Writer templates hiccup, I have found what has turned out to be a neater way of opening a Text document with one or other of my two templates:

(1) On desktop place a link for each of the 2 templates.

(2) Whenever need to open a new text document, just click on one or other of those desktop icons.

(3) LO Writer comes up with the template's text in situ, ready for action!


No need to start the Writer first, thus avoiding the kludgy error notification.
Comment 7 Maurice Batey 2021-05-22 15:49:09 CEST
P.S. I had earlier re-installed LO Writer from repository, but glitch persisted.
Comment 8 Maurice Batey 2021-05-22 15:54:42 CEST
(In reply to Lewis Smith from comment #1)
 
> In your example, where does the '.../morningside1.ott' come from? Is it
> defined somewhere (if so, how; so I can try it) as a default template to
> open with?

$ ls ~/Templates
57kf.ott  morningside1.ott

(Each initialises a new text document in a certain way with my personal contact details, which I need to avoid broadcasting..).

Regards,
/\/\aurice
Comment 9 Thomas Backlund 2021-05-22 16:05:41 CEST
@Maurice:

did you check the:

Tools/Options/LibreOffice/Paths

what is listed there ?
Comment 10 Maurice Batey 2021-05-22 17:44:13 CEST
(In reply to Thomas Backlund from comment #9)
> @Maurice:
> 
> did you check the:
> 
> Tools/Options/LibreOffice/Paths
> 
> what is listed there ?

Now has ~/Templates as default.
Comment 11 Dave Hodgins 2021-05-22 22:40:37 CEST
(In reply to Maurice Batey from comment #10)
> (In reply to Thomas Backlund from comment #9)
> > @Maurice:
> > 
> > did you check the:
> > 
> > Tools/Options/LibreOffice/Paths
> > 
> > what is listed there ?
> 
> Now has ~/Templates as default.

Does that fix the issue? If not, please go to Tools/Options/LibreOffice/Paths,
double click on Templates. Use print screen to capture what it shows and
attach that image.
Comment 12 Maurice Batey 2021-05-23 10:19:48 CEST
Created attachment 12719 [details]
Screen shot at LO Writer/options/Path

Herewith as requested.
Comment 13 Aurelien Oudelet 2021-05-23 20:15:48 CEST
Does this still an issue since you modify the template directory in 
Tools/Options/LibreOffice/Paths
?

CC: (none) => ouaurelien

Comment 14 Dave Hodgins 2021-05-23 20:18:44 CEST
If the problem is still present, then when the
"/home/mabTemplates/morningside1.ott does not exist" message does show,
how are you starting libreoffice writer?
Comment 15 Lewis Smith 2021-05-23 21:04:31 CEST
(In reply to Maurice Batey from comment #5)
> Compare the error message with what LO Writer was presumably trying to do:
> "/home/mabTemplates/morningside1.ott"
> "/home/mab/Templates/morningside1.ott"
> There is a '/' missing between "mab" and "templates"...
This was clear from the start.

> Steps to Reproduce:
> 1. Call "libreoffice --writer"
> 2. See: "/home/mabTemplates/morningside1.ott does not exist"
I am unsure about this, since it implies that merely starting Writer as you show pops the error message. This is not so. Unless in your case you have somehow defined morningside1.ott to be invoked as the default template for any new document. This is what I was fishing for; or: it looks from later comments that you have to do a bit more to raise the error, like choosing it to start a new document (your desktop shortcuts), or choosing it after starting a new document.
From comment 2:
"Saving a new template as ~/Templates/Mytemplate.ott and then using
File/Templates/Open Template... is working for me."
makes sense. But not how you describe raising the error - merely launching Writer.
Can you clarify this - from the command line?
Comment 16 Maurice Batey 2021-05-24 14:05:54 CEST
I am pleased to say that I have been able to clear my problem by re-setting the default template by following these steps found on internet:

"From the main menu, choose: File > Templates > Organize. 
In the box on the left, click any folder. Click the Commands button. 
From the drop-down menu, choose Reset Default Template > Text Document."

Starting LO Writer by e.g. "$ libreoffice --writer" now opens new writer document with selected template text in place.
   [N.B. As I mentioned  in Comment 6 above, there is a much simpler way of opening a document with a dynamically-selected template, and I now use that.]

But is seems somehow Writer's mechanism had concocted a mangled command to apply the current template to a new text document, as shown in 'Description above:

    /home/mabTemplates/morningside1.ott does not exist

when it clearly intended to execute:

    /home/mab/Templates/morningside1.ott

So the remaining question is: Why on earth did it generate a command containing the obviously mangled reference:  "/home/mabTemplates/", unless somewhere back in time its records had been compromised?

Whether that is a matter worth spending time on is a question I leave to the QA management, but I would understand if this bug report now gets closed.
  (Who does the closing?!)
Comment 17 Dave Hodgins 2021-05-24 20:00:29 CEST
Closing as invalid for now. It can be reopened if anyone figures out how to
recreate the problem.

Resolution: (none) => INVALID
Status: NEEDINFO => RESOLVED

Comment 18 Lewis Smith 2021-05-25 21:13:49 CEST
(In reply to Lewis Smith from comment #15)
> > Steps to Reproduce:
> > 1. Call "libreoffice --writer"
> > 2. See: "/home/mabTemplates/morningside1.ott does not exist"
> I am unsure about this, since it implies that merely starting Writer as you
> show pops the error message. This is not so. Unless in your case you have
> somehow defined morningside1.ott to be invoked as the default template for
> any new document. This is what I was fishing for;
At last you say:
(In reply to Maurice Batey from comment #16)
> I am pleased to say that I have been able to clear my problem by re-setting
> the default template by following these steps found on internet:
> "From the main menu, choose: File > Templates > Organize. 
> In the box on the left, click any folder. Click the Commands button. 
> From the drop-down menu, choose Reset Default Template > Text Document."
> Starting LO Writer by e.g. "$ libreoffice --writer" now opens new writer
> document with selected template text in place.
Thank you for this explanation, which is the sort of thing I suspected.
This can be put down to one of those isolated glitches which everybody suffers from time to time. Unless it pops up again... Your conclusion is sensible:
> somewhere back in time its records had been compromised

Note You need to log in before you can comment on or make changes to this bug.