Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Create a collection
Create entries in collection
Create two locales in statamic lets say default is / and we have /ca/ locale
Entry pages work in default configuration like /store/itemname but does not work in /ca/store/itemname
Expected behavior
A clear and concise description of what you expected to happen.
/store/itemname need to open default locale entry page
/ca/store/itemname need to open CA locale entry page
Solution
I debugged the source and found the problem on StatamicController Line:299-313.
I fixed it with this code. Previously you wrote if ($requested_uri === $content->uri())
but this $content->uri() returns with locale info. $requested_uri does not have this locale so they dont match.
` if ($content = Content::whereUri($uri)) {
$content_uri = $content->uri();
// Place the content in the locale we want.
$content = $content->in(site_locale());
// If the requested URI exists, but also has a localized version, the
// default URI should not be accessible. For example, if /team has
// been localized to /equipe, visiting /about should throw a 404.
if ($requested_uri === $content_uri) {
$content->supplementTaxonomies();
return $content;
}
}`
Screenshots
If applicable, add screenshots to help explain your problem.
Environment details (please complete the following information):
Statamic Version 2.11.9
Fresh Install or Upgrade: Fresh
OS: macOS or Ubuntu same behavior
Browser: Chrome but doesnt matter
Web Server: Php local server and nginx same behaviour
PHP Version: 7.2
Addons installed: Redirect, SeoPro
Additional context
Add any other context about the problem here.
Describe the bug A clear and concise description of what the bug is.
To Reproduce Steps to reproduce the behavior:
Entry pages work in default configuration like /store/itemname but does not work in /ca/store/itemname
Expected behavior A clear and concise description of what you expected to happen. /store/itemname need to open default locale entry page /ca/store/itemname need to open CA locale entry page
Solution I debugged the source and found the problem on StatamicController Line:299-313. I fixed it with this code. Previously you wrote if ($requested_uri === $content->uri()) but this $content->uri() returns with locale info. $requested_uri does not have this locale so they dont match.
` if ($content = Content::whereUri($uri)) { $content_uri = $content->uri(); // Place the content in the locale we want. $content = $content->in(site_locale());
Screenshots If applicable, add screenshots to help explain your problem.
Environment details (please complete the following information):
Additional context Add any other context about the problem here.