Skip to content

Commit

Permalink
Swap UrlHelper::baseUrl() for UrlHelper::siteUrl() for better URL…
Browse files Browse the repository at this point in the history
… compatibility (#34)
  • Loading branch information
aaronbushnell authored Jul 13, 2023
1 parent c2faa7d commit a7efd92
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Release Notes for Palette

## 3.2.2 - 2023-07-12

### Fixed
- Swap `UrlHelper::baseUrl()` for `UrlHelper::siteUrl()` for better URL compatibility ([Discussion](https://github.com/trendyminds/craft-palette/discussions/27))

## 3.2.1 - 2023-07-12

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "trendyminds/craft-palette",
"description": "A command palette to easily jump to specific areas within Craft",
"type": "craft-plugin",
"version": "3.2.1",
"version": "3.2.2",
"keywords": ["palette", "craft", "craft cms", "cmdk", "spotlight", "craft plugin"],
"license": "MIT",
"authors": [
Expand Down
6 changes: 3 additions & 3 deletions src/controllers/ActionsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ private function _navigationActions(): array
$actions = collect((new Cp())->nav())
->map(function ($i) {
$url = str_replace(
UrlHelper::baseUrl(),
UrlHelper::siteUrl(),
'',
$i['url']
);
Expand Down Expand Up @@ -201,7 +201,7 @@ private function _getContextActions(): array

// Normalize the referrer and the Craft base URL
$referrer = rtrim($referrer, '/').'/';
$url = rtrim(UrlHelper::baseUrl(), '/').'/';
$url = rtrim(UrlHelper::siteUrl(), '/').'/';

// Pluck out the URI using the referrer and the Craft base URL
$uri = str_replace($url, '', $referrer);
Expand Down Expand Up @@ -245,7 +245,7 @@ private function _isCpRequest(): bool
$referrer = Craft::$app->getRequest()->referrer;

$uri = str_replace(
UrlHelper::baseUrl(),
UrlHelper::siteUrl(),
'',
$referrer
);
Expand Down

0 comments on commit a7efd92

Please sign in to comment.