silverstripe / silverstripe-campaign-admin

Campaign and publishing admin interface for Silverstripe
BSD 3-Clause "New" or "Revised" License
2 stars 16 forks source link

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

Open michalkleiner opened 4 years ago

michalkleiner commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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.