Skip to content

Commit

Permalink
Fix for 4.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
janhenckens committed Feb 5, 2024
1 parent fa6ff2e commit e268177
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).

## 4.0.3 - 2024-02-05
### Fixed
- Fixed a permissions issue on sites with multiple users and user groups


## 4.0.2 - 2024-01-21
### Fixed
- Fixed getting schema data for multi-site setups
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": "studioespresso/craft-seo-fields",
"description": "Fields for your SEO & OG meta data",
"type": "craft-plugin",
"version": "4.0.2",
"version": "4.0.3",
"keywords": [
"craft",
"cms",
Expand Down
13 changes: 6 additions & 7 deletions src/controllers/DefaultsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,23 @@ public function actionIndex()
$params = Craft::$app->getRequest()->getQueryParams();
unset($params['p']);
$currentUser = Craft::$app->getUser()->getIdentity();
$primarySite = Craft::$app->sites->getPrimarySite();
$editableSite = Craft::$app->getSites()->getEditableSites();
if ($currentUser->can('seo-fields:default')) {
$this->redirect(UrlHelper::cpUrl("seo-fields/defaults/$primarySite->handle", $params));
$this->redirect(UrlHelper::cpUrl("seo-fields/defaults/{$editableSite[0]->handle}", $params));
} elseif ($currentUser->can('seo-fields:notfound')) {
$this->redirect(UrlHelper::cpUrl("seo-fields/not-found/$primarySite->handle", $params));
$this->redirect(UrlHelper::cpUrl("seo-fields/not-found/{$editableSite[0]->handle}", $params));
} elseif ($currentUser->can('seo-fields:redirects')) {
$this->redirect(UrlHelper::cpUrl("seo-fields/redirects/$primarySite->handle", $params));
$this->redirect(UrlHelper::cpUrl("seo-fields/redirects/{$editableSite[0]->handle}", $params));
} elseif ($currentUser->can('seo-fields:robots')) {
$this->redirect(UrlHelper::cpUrl("seo-fields/robots/$primarySite->handle", $params));
$this->redirect(UrlHelper::cpUrl("seo-fields/robots/{$editableSite[0]->handle}", $params));
} elseif ($currentUser->can('seo-fields:sitemap')) {
$this->redirect(UrlHelper::cpUrl("seo-fields/sitemap/$primarySite->handle", $params));
$this->redirect(UrlHelper::cpUrl("seo-fields/sitemap/{$editableSite[0]->handle}", $params));
}
}

public function actionSettings($siteHandle = null)
{
$site = Craft::$app->sites->getSiteByHandle($siteHandle);
Craft::$app->sites->setCurrentSite($site);
$data = SeoFields::$plugin->defaultsService->getDataBySite($site);
return $this->renderTemplate('seo-fields/_defaults', [
'data' => $data,
Expand Down
3 changes: 2 additions & 1 deletion src/templates/_defaults.twig
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
{% block content %}
{{ actionInput('seo-fields/defaults/save') }}

<input type="hidden" name="siteId" value="{{ currentSite.id }}">

<input type="hidden" name="siteId" value="{{ selectedSite.id }}">

<style>
.seo-introduction {
Expand Down

0 comments on commit e268177

Please sign in to comment.