sehmaschine / django-filebrowser

Media-Management with Grappelli
http://twitter.com/sehmaschine
Other
976 stars 408 forks source link

Broken edit link in filelisting when searching in sub-folders #329

Closed marco-primiceri closed 6 years ago

marco-primiceri commented 7 years ago

The Change link in the filelisting template populates the dir parameter using query_string, this works fine when the search result is in the current folder but creates an invalid URL when the result is in a sub-folder.

Example

Given this tree structure:

brands
  - all_brands_logo.jpg
  - acura
     - logo.jpg
  - alfa_romeo
     - logo.jpg
  - aston_martin
  - ...

Searching for logo within the brands folder will return the following: Current URL: /admin/filebrowser/browse/?q=logo&dir=brands

Filename: logo_brands_diagram.jpg Folder: brands Change link: /admin/filebrowser/detail/?q=logo&dir=brands&filename=all_brands_logo.jpg ==> OK

Filename: logo.jpg Folder: brands/acura Change link: /admin/filebrowser/detail/?q=logo&dir=brands&filename=logo.jpg ==> BROKEN

sehmaschine commented 6 years ago

fixed with stable/3.10.x