danestves / danestves/strapi-plugin-preview-content
Admin URL assumed to be /admin which breaks clone button when using a custom admin URL
- Dominant language
- JavaScript
- Stars
- 63
- Forks
- 26
- PR merge metrics
- No merged PRs in 30d
Description
I'm using custom admin URLs in production to [make it harder to find the admin panel without knowing the URL](https://docs-v3.strapi.io/developer-docs/latest/development/admin-customization.html#change-access-url). Doing so breaks the clone button on an entity's admin page (it's not an issue when clicking the icon on the collection type listing page.
I found the issue to be an hardcoded path in src/admin/main/preview-context/index.js
https://github.com/danestves/strapi-plugin-preview-content/blob/c0d5d2416452bd74a6837d097c85ee4492b89720/src/admin/main/preview-context/index.js#L290
The correct admin URL should be used instead. It could be retrieved via window.location.
Contributor guide
Assessment
This issue has not been assessed yet.