-
Notifications
You must be signed in to change notification settings - Fork 638
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
Multi-site getCpEditUrl not scoping for site #3089
Comments
What do you mean by “site handle” ? Can you post the URL you’re getting and the URL you expected to get? |
Ah sure, an actual URL example would have been helpful, sorry about that... We have an Applications Index single that is available across multiple sites. If I visit that entry on the front-end of two different sites:
the
Where I would expect them to be:
|
There was some logic to omit the site handle when creating the entry edit URL, if the entry’s site was the same as the current site, which is fine in the CP, but didn’t take into account that it might be a front-end request, where the entry will almost always be queried for the current site, which may not be the same site that the CP gets. Fixed for the next release. |
Description
On a multi-site install, if you are using
getCpEditUrl
on the front-end to link to the edit entry screen, the site handle is not added to the url. Presumably, it's because of this line$this->siteId != Craft::$app->getSites()->getCurrentSite()->id
Steps to reproduce
getCpEditUrl
on the front-end for that entry templateAdditional info
The text was updated successfully, but these errors were encountered: