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

JS likely trying to mount the app for foreign model admins based on URL pattern #155

Open
michalkleiner opened this issue Jan 28, 2020 · 3 comments

Comments

@michalkleiner
Copy link
Contributor

It seems that if a model admin's URL segment starts with campaigns, it looks like the JS is trying to mount the campaigns admin app over the model admin (that is not the correct one, e.g. when using admin/campaigns-scheduling/).

@michalkleiner
Copy link
Contributor Author

I didn't have time to dig deep and couldn't find it during the 5 minutes I had spare. Changing the custom model admin's $url_segment to not start with 'campaigns', e.g. just removing the trailing s, makes the issue not appear.

@kinglozzer
Copy link
Member

I’ve not tested this, but I’d guess it’s related to trimming the trailing slash here as I believe this is where the client side routing data comes from: https://github.com/silverstripe/silverstripe-admin/blob/0faee38d2c905d3d4baef8e9f340f566f6ecef99/code/LeftAndMain.php#L342.

@michalkleiner
Copy link
Contributor Author

It's not just the trailing slash, there can be another whole word, as long as it starts with the same 'campaigns', then it's doomed.

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

4 participants