Edit Web Content link is broken (needs to be a relative path)

In 6.0 the Edit Web Content link points to /home/domain/public_html, but File Manager defaults to dumping the user into their home directory directly. So, the link doesn't work...it becomes /home/domain/home/domain/public_html.

Exact error is:

Error opening directory /home/swelljoe/home/swelljoe/public_html No such file or directory

The fix is to just make the directory path relative (e.g. probably '/public_html' instead of including the /home/domain/ part). Though I guess in the unlikely case of a user not being confined to their home this would break, as it would need the full path. But, that's not the default for Virtualmin domain owners.

I'm trying to do that now, but my changes just aren't working, and I'm not sure why. It may be something happening in the theme to override the link (which I'd rather not be a thing that happens). So, I'm not sure if I need to assign this to Ilia or Jamie...gonna guess Ilia, since changing backend isn't working and it's mysteriously being changed.

Status: 
Closed (fixed)

Comments

Ilia's picture
Submitted by Ilia on Fri, 08/18/2017 - 16:53

Joe, hi.

I managed to fix this on my end to support new link to open domain properly.

At the same time, I can't reproduce an issue with doubled paths? Can you open left frame source (navigation menu) and see what it's printed in the raw? Mine is printed as it's supposed to be, without double home directory.

I will release tomorrow a small bug-fix to support Virtualmin 6.

Ilia's picture
Submitted by Ilia on Sat, 08/19/2017 - 04:03

Let's rename Edit Web Content to List Files and Directories or something more explicit/appropriate for File Manager?

Ilia's picture
Submitted by Ilia on Sat, 08/19/2017 - 06:06

Status: Active ยป Closed (fixed)

BUMP. and that fix in the link did't help...

reproduction: Clean ubuntu 16.04, install GPL version. create site. all defaults... link in menu shows data-href="/filemin/index.cgi?path=%2Fhome%2Fdomain%2Fpublic%5Fhtml and function is now:

if (&domain_has_website($d) && $d->{'dir'} && !$d->{'alias'} && !$d->{'proxy_pass_mode'} && &foreign_available("filemin")) { # Link to file manager for HTML directory my $phd = &public_html_dir($d); my %faccess = &get_module_acl(undef, 'filemin'); my @ap = split(/\s+/, $faccess{'allowed_paths'}); if (@ap == 1) { $phd =~ s/^\Q$ap[0]\E//; } push(@rv, { 'page' => 'index.cgi?path='.&urlize($phd), 'mod' => 'filemin', 'title' => $text{'edit_filemin'}, 'desc' => $text{'edit_filemindesc'}, 'cat' => 'objects', 'icon' => 'page_edit', }); }

Still same bug...

Ilia's picture
Submitted by Ilia on Sat, 09/02/2017 - 02:28

Yes, it won't work unless you update to the latest patch release of the theme.

Go to theme settings and hit Upgrade Theme.

The link should work after all.