Skip to content

Commit

Permalink
Merge branch 'release/5.1.7' into v5
Browse files Browse the repository at this point in the history
  • Loading branch information
khalwat committed Nov 20, 2024
2 parents 55df5c4 + f70b39e commit cddd2a5
Show file tree
Hide file tree
Showing 16 changed files with 442 additions and 397 deletions.
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# SEOmatic Changelog

## 5.1.7 - 2024.11.20
### Fixed
* Fixed an issue where sites that are not enabled for a given Section were still showing up in the Sites menu in Content SEO ([#1539](https://github.com/nystudio107/craft-seomatic/issues/1539))
* Fixed an issue where newly created sections would not have Content SEO settings show up for ([#1544](https://github.com/nystudio107/craft-seomatic/issues/1544))

## 5.1.6 - 2024.11.12
### Added
* Added the **Site Alternate Name** property to Site Settings, used in the JSON-LD for the homepage, if the MainEntityOfPage is WebPage or WebSite ([#1482](https://github.com/nystudio107/craft-seomatic/issues/1482))
Expand All @@ -9,8 +14,8 @@
* No longer do a potentially expensive query on page load for sections that have a massive number of entries ([#1526](https://github.com/nystudio107/craft-seomatic/issues/1526))
* Improved the display of the Entry Types menu in Content SEO
* If the current route is the homepage, set the `name` and `alternateName` JSON-LD for the `mainEntityOfPage` to `seomatic.site.siteName` and `seomatic.site.siteAlternateName` respectively, rather than the `seomatic.meta.seoTitle` ([#1482](https://github.com/nystudio107/craft-seomatic/issues/1482))
* The SEO preview display in Content SEO will pull an entry from the specific Entry Type rather than just the first entry ([#1535](https://github.com/nystudio107/craft-seomatic/issues/1535))
* Text and Asset pull sources in Content SEO will now display only fields from the specific Entry Type rather than all fields for that Section ([#1535](https://github.com/nystudio107/craft-seomatic/issues/1535))
* The SEO preview display in Content SEO will pull an entry from the specific Entry Type rather than just the first entry. Note: If you have a custom `SeoElement` PHP class, it will require a very minor method signature change to continue working ([#1535](https://github.com/nystudio107/craft-seomatic/issues/1535))
* Text and Asset pull sources in Content SEO will now display only fields from the specific Entry Type rather than all fields for that Section. Note: If you have a custom `SeoElement` PHP class, it will require a very minor method signature change to continue working ([#1535](https://github.com/nystudio107/craft-seomatic/issues/1535))

### Fixed
* Fixed an issue where an exception would be thrown if the Campaign plugin was installed first, and then you newly installed SEOmatic ([#1530](https://github.com/nystudio107/craft-seomatic/issues/1530))
Expand Down
202 changes: 101 additions & 101 deletions buildchain/package-lock.json

Large diffs are not rendered by default.

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": "nystudio107/craft-seomatic",
"description": "SEOmatic facilitates modern SEO best practices & implementation for Craft CMS 5. It is a turnkey SEO system that is comprehensive, powerful, and flexible.",
"type": "craft-plugin",
"version": "5.1.6",
"version": "5.1.7",
"minimum-stability": "dev",
"prefer-stable": true,
"keywords": [
Expand Down
594 changes: 310 additions & 284 deletions docs/package-lock.json

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions src/controllers/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1178,6 +1178,7 @@ protected function setCrumbVariables(array &$variables)
$crumbSites = Collection::make($sites->getAllSites())
->map(fn(Site $site) => ['site' => $site])
->keyBy(fn(array $site) => $site['site']->id)
->filter(fn(array $site) => in_array($site['site']->id, $variables['enabledSiteIds']))
->all();

foreach ($siteGroups as $siteGroup) {
Expand Down Expand Up @@ -1283,13 +1284,26 @@ protected function setGlobalFieldSourceVariables(array &$variables)
*/
protected function cullDisabledSites(string $sourceBundleType, string $sourceHandle, array &$variables)
{
$entries = Craft::$app->getEntries();
$section = $entries->getSectionByHandle($sourceHandle);
$sectionSiteIds = [];
if ($section) {
$sectionSettings = $entries->getSectionSiteSettings($section->id);
foreach ($sectionSettings as $sectionSetting) {
$sectionSiteIds[] = $sectionSetting->siteId;
}
}
if (isset($variables['enabledSiteIds'])) {
foreach ($variables['enabledSiteIds'] as $key => $value) {
$metaBundle = Seomatic::$plugin->metaBundles->getMetaBundleBySourceHandle(
$sourceBundleType,
$sourceHandle,
$value
);
// Make sure the site exists for this Section
if (!in_array($value, $sectionSiteIds, true)) {
unset($variables['enabledSiteIds'][$key]);
}
if ($metaBundle === null) {
unset($variables['enabledSiteIds'][$key]);
}
Expand Down
4 changes: 2 additions & 2 deletions src/services/MetaBundles.php
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ public function getMetaBundleBySourceHandle(string $sourceBundleType, string $so
if ($seoElement !== null) {
$sourceModel = $seoElement::sourceModelFromHandle($sourceHandle);
if ($sourceModel) {
$metaBundle = $this->createMetaBundleFromSeoElement($seoElement, $sourceModel, $sourceSiteId);
$metaBundle = $this->createMetaBundleFromSeoElement($seoElement, $sourceModel, $sourceSiteId, null, true);
}
}
}
Expand Down Expand Up @@ -610,7 +610,7 @@ public function getMetaBundleBySourceId(string $sourceBundleType, int $sourceId,
if ($seoElement !== null) {
$sourceModel = $seoElement::sourceModelFromId($sourceId);
if ($sourceModel) {
$metaBundle = $this->createMetaBundleFromSeoElement($seoElement, $sourceModel, $sourceSiteId);
$metaBundle = $this->createMetaBundleFromSeoElement($seoElement, $sourceModel, $sourceSiteId, null, true);
}
}
}
Expand Down

Large diffs are not rendered by default.

Binary file not shown.
2 changes: 2 additions & 0 deletions src/web/assets/dist/assets/seomatic-C8AB7bSt.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/web/assets/dist/assets/seomatic-C8AB7bSt.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file removed src/web/assets/dist/assets/seomatic-CR7hXxYp.css.gz
Binary file not shown.
2 changes: 0 additions & 2 deletions src/web/assets/dist/assets/seomatic-pGx7eHQv.js

This file was deleted.

1 change: 0 additions & 1 deletion src/web/assets/dist/assets/seomatic-pGx7eHQv.js.map

This file was deleted.

4 changes: 2 additions & 2 deletions src/web/assets/dist/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@
]
},
"src/js/seomatic.js": {
"file": "assets/seomatic-pGx7eHQv.js",
"file": "assets/seomatic-C8AB7bSt.js",
"name": "seomatic",
"src": "src/js/seomatic.js",
"isEntry": true,
"css": [
"assets/seomatic-CR7hXxYp.css"
"assets/seomatic-9d2V52Sp.css"
]
}
}
Binary file modified src/web/assets/dist/manifest.json.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion src/web/assets/dist/stats.html

Large diffs are not rendered by default.

0 comments on commit cddd2a5

Please sign in to comment.