[upstream] Default directory for my documents is not xdg-user-dir DOCUMENTS

Bug #1792017 reported by Daniel Schürmann
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
LibreOffice
Fix Released
Medium
libreoffice (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

The default working dir is hard coded to ~/Documents
I had to redo my saved work, because I have assumed it was lost in ~/Dokumente

I have now fixed this by changing the working directory manually.

The default working dir should be changed to "xdg-user-dir DOCUMENTS" that other users so not suffer the same.

I have updated from Xenial and never experienced these issues. Is it a kind of regression?

libreoffice 1:6.0.3-0ubuntu1

Ubuntu 18.04. LTS

Revision history for this message
Olivier Tilloy (osomon) wrote :

Can you please elaborate by what you mean by "the default working dir"?

A side note (might be related): without any previous libreoffice profile directory (in a clean VM), I changed the locale to Spanish, restarted the session and ran libreoffice, and in the "Options > Paths" settings, the path to "my documents" is set to "/home/username", instead of "/home/username/Documents" when the locale is French (my default, and it happens that "Documents" is the exact same word in English and French).

Changed in libreoffice (Ubuntu):
status: New → Incomplete
Revision history for this message
Daniel Schürmann (daschuer) wrote :

I have a German installation and it is the
Optionen -> Pfade -> Arbeitsverzeichnis -> Standard

In your side note you have described my issue. For some reasons (maybe a faulty app has created it) I have the folder ~/Dokumente and ~/Documents. So unlike in your Spanish example it does not pick "/home/username" as fallback, it picks "/home/username/Documents where I do not have a Natilus shortcut for and so almost hidden.

I had a bief look into the source
https://github.com/LibreOffice/core/blob/b5867945d67dba505d0629e5e41fdc52bc78bfee/shell/source/backends/desktopbe/desktopbackend.cxx#L245

And it looks like using "xdg-user-dir DOCUMENTS" is intended. It is done by accessing directly the "~/.config/user-dirs.dirs" file. Maybe it fails somewhere?

Revision history for this message
Daniel Schürmann (daschuer) wrote :

I have testes with LibreOffice 4.2.8.2. It also fails to read "Dokumente" but this version falls back to the "/home/username" even if "Documents" exists.

Revision history for this message
Olivier Tilloy (osomon) wrote :

Can you share the contents of ~/.config/user-dirs.dirs ?

I can confirm that if I switch to Spanish AND create ~/Documents before ever launching libreoffice, then the default folder for my documents is set to /home/username/Documents, whereas if that folder doesn't exist it is set to /home/username. So there's clearly some buggy behaviour here.

Changed in libreoffice (Ubuntu):
status: Incomplete → Confirmed
summary: - wrong default working dir
+ Default directory for my documents is not localized
Changed in libreoffice (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Olivier Tilloy (osomon) wrote : Re: Default directory for my documents is not localized

@Daniel, would you mind filing an upstream bug at https://bugs.documentfoundation.org/enter_bug.cgi?product=LibreOffice&format=guided and share the link to it here? Thanks!

Revision history for this message
Daniel Schürmann (daschuer) wrote : Re: Default directory for my documents is not xdg-user-dir DOCUMENTS

I have tweak the title again, because it is not a solution to make the directory a translatable string.

This is my ~/.config/user-dirs.dirs

# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
#
XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_TEMPLATES_DIR="$HOME/Vorlagen"
XDG_PUBLICSHARE_DIR="$HOME/Öffentlich"
XDG_DOCUMENTS_DIR="$HOME/Dokumente"
XDG_MUSIC_DIR="$HOME/Musik"
XDG_PICTURES_DIR="$HOME/Bilder"
XDG_VIDEOS_DIR="$HOME/Videos"

summary: - Default directory for my documents is not localized
+ Default directory for my documents is not xdg-user-dir DOCUMENTS
Revision history for this message
In , Daniel Schürmann (daschuer) wrote :

Description:
Original posted and confirmed here: https://bugs.launchpad.net/ubuntu/+source/libreoffice/+bug/1792017
libreoffice 1:6.0.3-0ubuntu1
Ubuntu 18.04. LTS

The default working dir is hard coded to ~/Documents
(Optionen -> Pfade -> Arbeitsverzeichnis -> Standard)

If this folder does not exists, it falls back to ~

This creates odd situations since only the "xdg-user-dir DOCUMENTS" folder, in my case ~/Dokumente is on the Nautilus short cuts list,

I had to redo my saved work, because I have assumed it was lost in ~/Dokumente

I was able to fixed this for my family by changing the working directory in preferences manually.

I had a bief look into the source
https://github.com/LibreOffice/core/blob/b5867945d67dba505d0629e5e41fdc52bc78bfee/shell/source/backends/desktopbe/desktopbackend.cxx#L245

And it looks like using "xdg-user-dir DOCUMENTS" is intended. It is done by accessing directly the "~/.config/user-dirs.dirs" file. Maybe it fails somewhere? The xdg-user-dir DOCUMENTS" call works fine on the command line.

This is my ~/.config/user-dirs.dirs

# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
#
XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_TEMPLATES_DIR="$HOME/Vorlagen"
XDG_PUBLICSHARE_DIR="$HOME/Öffentlich"
XDG_DOCUMENTS_DIR="$HOME/Dokumente"
XDG_MUSIC_DIR="$HOME/Musik"
XDG_PICTURES_DIR="$HOME/Bilder"
XDG_VIDEOS_DIR="$HOME/Videos"

I suggest to change the default working dir to the output of the "xdg-user-dir DOCUMENTS" call.
That is hopeful future proof format changes

Steps to Reproduce:
1. cereate ~/Documents on a German Ubuntu
2. save a file
3. Whatch the folder opened by the file save dialogue

Actual Results:
file is saved at ~/Documents

Expected Results:
file should be saved at ~Dokumente
"call xdg-user-dir DOCUMENTS" to set the default working dir

Reproducible: Always

User Profile Reset: No

Additional Info:
Version: 6.0.3.2
Build-ID: 1:6.0.3-0ubuntu1
CPU-Threads: 4; BS: Linux 4.15; UI-Render: Standard; VCL: gtk3;
Gebietsschema: de-DE (de_DE.UTF-8); Calc: group

Revision history for this message
Daniel Schürmann (daschuer) wrote :
Changed in df-libreoffice:
importance: Unknown → Medium
status: Unknown → New
Revision history for this message
In , Beluga (beluga) wrote :

NEW as already confirmed.

Changed in df-libreoffice:
status: New → Confirmed
Revision history for this message
In , Xiscofauli (xiscofauli) wrote :
Revision history for this message
In , Libreoffice-commits (libreoffice-commits) wrote :

Takeshi Abe committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/91731a8674d764293e2988333027f82f15b2577e%5E%21

tdf#119890 Lookup XDG_(DOCUMENTS|TEMPLATES)_DIR correctly

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

Revision history for this message
In , Libreoffice-commits (libreoffice-commits) wrote :

Takeshi Abe committed a patch related to this issue.
It has been pushed to "libreoffice-6-2":

https://git.libreoffice.org/core/+/38707435918b250d8a722f7ae324c29f00622a0b%5E%21

tdf#119890 Lookup XDG_(DOCUMENTS|TEMPLATES)_DIR correctly

It will be available in 6.2.2.

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.

Changed in df-libreoffice:
status: Confirmed → Fix Released
Revision history for this message
In , Libreoffice-commits (libreoffice-commits) wrote :

Takeshi Abe committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/88d46ba32e4a03d848d82210071c42208e0d6eca%5E%21

tdf#119890 followup: Forbid HOME to be the default dir

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

Revision history for this message
In , Libreoffice-commits (libreoffice-commits) wrote :

Takeshi Abe committed a patch related to this issue.
It has been pushed to "libreoffice-6-2":

https://git.libreoffice.org/core/+/64381dad01132f74e513c347db87f304d0e704ff%5E%21

tdf#119890 followup: Forbid HOME to be the default dir

It will be available in 6.2.4.

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.

Changed in libreoffice (Ubuntu):
status: Confirmed → Fix Released
summary: - Default directory for my documents is not xdg-user-dir DOCUMENTS
+ [upstream] Default directory for my documents is not xdg-user-dir
+ DOCUMENTS
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.