! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Thunar fails to scan for file templates if the Templates directory is a symbo...
Status:
RESOLVED: FIXED

Comments

Description enpheebled.git 2015-06-30 07:27:11 CEST
Thunar fails to scan for template files in ~/Templates if ~/Templates is a symbolic link to another directory, resulting in Thunar's 'Create Document' menu displaying 'No templates installed'.

The 'Create Document' command in the XFCE desktop's context menu permits ~/Templates to be a symbolic link to a directory, and documents can be created from template files contained in such a symlinked directory. This also works in PCManFM.
Comment 1 enpheebled.git 2015-06-30 08:16:24 CEST
Created attachment 6350 
git diff showing line to be replaced

    Fixes failure to detect file templates if ~/Templates is a symlink
    
    The XFCE desktop permits ~/Templates to be a symbolic link to a
    directory but Thunar's scan for template files fails if ~/Templates
    is a symbolic link.
    
    The problem is caused by _thunar_misc_jobs_load_templates() calling
    thunar_io_scan_directory() with the 'flags' parameter set to
    G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS. Changing the flags parameter to
    G_FILE_QUERY_INFO_NONE results in the eventual call to GIO function
    g_file_query_file_type() returning the GFileType value of the target
    of a symlink instead of the value of the symlink itself. This prevents
    thunar_io_scan_directory() from failing, and the scan for file templates
    proceeds as if ~/Templates was a directory.
Comment 2 enpheebled.git 2015-06-30 11:27:20 CEST
Patched version available at https://github.com/Enpheebled/thunar/tree/Pheeble_20150630_171841
Comment 3 Mathias Brodala 2015-06-30 20:27:40 CEST
Is there a specific reason why you made ~/Template a symlink? Just asking in case you where searching for a configuration option to change it to a different directory. (In which case setting XDG_TEMPLATES_DIR in ~/.config/user-dirs.dirs would do the trick.)
Comment 4 enpheebled.git 2015-06-30 23:06:07 CEST
(In reply to Mathias Brodala from comment #3)
> Is there a specific reason why you made ~/Template a symlink? Just asking in
> case you where searching for a configuration option to change it to a
> different directory. (In which case setting XDG_TEMPLATES_DIR in
> ~/.config/user-dirs.dirs would do the trick.)

The reasons for using a symlink are outlined in my post to the XFCE forum at http://forum.xfce.org/viewtopic.php?id=9672, but basically a symlink is the easiest method, and it should work. (As I mentioned in the post, I have tried changing the XDG_TEMPLATES_DIR value as a workaround, but this exposes another minor bug in which Thunar fails to assign the correct icon to the folder. Changing the XDG_TEMPLATES_DIR value, however, shouldn't be necessary.)
Comment 5 Harald Judt editbugs 2015-08-04 22:54:32 CEST
Thanks for the patch. After a quick test, this seems to work fine and not cause any troubles, but I'll need to invest more time in testing. Unfortunately, I don't have much time available at the moment, so you will have to wait another month or two until I can get to it. I just wanted to report back to affirm I have not ignored this.
Comment 6 Git Bot editbugs 2018-01-28 23:00:48 CET
enpheebled.git@gmail.com referenced this bugreport in commit eeb012d81aec28bde0e25bc2d9fc2cfd03abc99d

Thunar fails to scan for file templates if the Templates directory is a symbolic link ( bug #12032 )

https://git.xfce.org/xfce/thunar/commit?id=eeb012d81aec28bde0e25bc2d9fc2cfd03abc99d
Comment 7 alexxcons editbugs 2018-01-28 23:03:51 CET
Sorry for letting you wait that long !

Harald Judt went inactive and thunar was not maintained until now.

Your patch just got submitted and will be released in thunar 1.8.0.

Bug #12032

Reported by:
enpheebled.git
Reported on: 2015-06-30
Last modified on: 2018-01-28

People

Assignee:
Xfce Bug Triage
CC List:
5 users

Version

Version:
unspecified

Attachments

git diff showing line to be replaced (578 bytes, patch)
2015-06-30 08:16 CEST , enpheebled.git
no flags

Additional information