Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMSEditlink does not show folder if folder is on second page #1531

Open
2 tasks done
sunnysideup opened this issue Dec 19, 2024 · 1 comment
Open
2 tasks done

CMSEditlink does not show folder if folder is on second page #1531

sunnysideup opened this issue Dec 19, 2024 · 1 comment

Comments

@sunnysideup
Copy link

Module version(s) affected

5+

Description

When I use the CMSEditLink for a Folder, and there are lots of folders (i.e. more than one page worth), and the folder it not in the first page of the list of files / folder then you do not actually see the folder at when you open the CMSEditLink. Altogether, it is also a bit weird that the CMSEditLink shows the folder in the parent folder, rather than showing the contents of the folder.

How to reproduce

CMSEditLink opens like this:

image

Then, going to page 2:
image
you see the folder

(Note, I have hidden some confidential stuff).

Possible Solution

Link to the folder itself and when you click on edit, again, show the content of the folder and the folder in its parent folder.

Additional Context

No response

Validations

  • Check that there isn't already an issue that reports the same bug
  • Double check that your reproduction steps work in a fresh installation of silverstripe/installer (with any code examples you've provided)
@GuySartorelli
Copy link
Member

GuySartorelli commented Dec 19, 2024

When you click "edit" on a folder it stays in the current context, which is always the folder itself - so you end up with http://example.com/admin/assets/show/2/edit/2 as the URL, while getCMSEditLink() does indeed give http://admin-remove-dnd.ddev.site/admin/assets/show/1/edit/2 (i.e. the parent folder's context).

I agree that's not ideal. Not exactly a bug but it is sub-optimal. The solution would be to update AssetAdmin::getFileEditLink() to use the folder's own ID instead of the parent ID.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants