File manager Issue - invalid path

SYSTEM INFORMATION
OS type and version Ubuntu Linux 24.04.2
Usermin version 2.302
Virtualmin version 7.30.8
Theme version 24.02
Apache version 2.4.58
Package updates All installed packages are up to date

I have a problem with how favourites are stored when you click the star to save them as a favourite


so far so good the favourites link shows [/etc], however if you click the favourite link you get this

as you can see there is some weird path appended to the url. The actual line stored in the favourites file looks like this

can anyone suggest what the correct url should be to just show the favourite as defined ?

the fix is this, for anyone who needs it. edit the favourites file to read like this


which is somewhat different to the path that clicking the star to make the file manager favourite in the first place, so I guess there is a bug in the favourites selection code

This issue was fixed years ago, so if you’re running Webmin 2.302, it shouldn’t happen. I tried to reproduce it, but everything works fine for me.

Can you consistently reproduce it? If so, could you share the steps to do so?

I am running webmin 2.402 and I can reproduce it consistently

  1. Navigate with file manager to a directory
  2. Click the star so it turns yellow/gold
  3. Then click the created link in the favourites menu

Could you try the entire process in a different browser and using an incognito tab?

switched from chrome to firefox & used a private window which it worked ok in that browser window.
this is the entry created

{
        "link": "/filemin/",
        "title": "Tools ⇾ File Manager [/etc/iptables]",
        "icon": "webmin"
    }

while the firefox private window was used the favourite worked as expected but

  1. switching to a standard firefox window & using the favourite link sent me to / rather than /etc/iptables
  2. opening a new firefox private window clicking the favourite had the same out come as 1.
  3. chrome had the same effect as firefox

This is to surprising as the created entry does not have the path appended to it

I double-checked the code, and this behavior is expected. When you open it from Webmin, it defaults to the root directory. When you open File Manager from Virtualmin, it uses a specific user home path, and favorites are saved with that path as a label. Everything works as expected in my tests.

And, your URL with ?path=&path=%2Fetc%2F is most likely from an incorrectly manually edited URL.

No it wasn’t but if you say it was that is the answer, but to be fair I’ve only just started to use the favourites function for this purpose. So recap
If you navigate to a directory within webmin and click the favorite star this will always return the root directory and using virtualmin will always return the users home. If that is the case of appending the directory to the favorite description ?

Well, yes. But I just noticed that the URL with the path parameter can change when going back to File Manager because it tries to return to the last used page. That all seems fine to me, except I’m not sure right now why I chose to update the URL when restoring previously used tabs (paths).

I’ll look into removing that so the URL always stays static and is defined by the server-side code (left menu). Thanks!

the fix for me was to edit the url as shown above

which works as expected, so as long as you don’t code this ‘feature’ out I can cope with editing the favourites data to reflect what directory I want the favourite to display

Thanks, I found a few bugs related to File Manager and favorites. We’ll fix them in the next Webmin release.

And, the issue you originally reported will also be resolved as part of these changes.

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.