Closed tshlos closed 1 month ago
The getSiteUriFromUrl() function should correctly handle URLs with the /intl prefix and include this prefix in the constructed SiteUriModel.
How are you verifying that this is not the case?
Note the the uri
property of the SiteUriModel
class is the URI that follows the base site URL of the site as defined by the siteId
property, meaning that if the site’s base URL is https://example.com/intl/
, the expected value of uri
is page
.
Apologies for the delay in responding. Upon reviewing your clarification, I realize there was a misunderstanding on my part regarding the functionality of the SiteUriModel class. Thanks for clearing that up. Appreciate your assistance.
Ok, sure thing!
Bug Report
When attempting to construct site URIs from URLs containing the /intl prefix, the current implementation of the getSiteUriFromUrl() function in the codebase fails to properly account for this prefix. As a result, the /intl part of the URL is being removed during the construction of the SiteUriModel, leading to incorrect site URIs.
Steps to Reproduce:
Expected Behavior:
The getSiteUriFromUrl() function should correctly handle URLs with the /intl prefix and include this prefix in the constructed SiteUriModel.
Actual Behavior:
The /intl part of the URL is being removed during the construction of the SiteUriModel, resulting in incorrect site URIs.
Plugin Version
4.9.3
Craft CMS Version
4.5.12
PHP Version
8.3.4