Skip to content

Commit

Permalink
Fix for #95
Browse files Browse the repository at this point in the history
  • Loading branch information
janhenckens committed Jul 7, 2024
1 parent d405a98 commit d693fd7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ 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/).

## 5.0.1 - 2024-07-07
### Fixed
- Fixed misssing behaviour for categories ([#95](https://github.com/studioespresso/craft-seo-fields/issues/95))

## 5.0.0 - 2024-05-22
### Fixed
- Fixed an error with fields that don't use "seo" as a handle ([#94](https://github.com/studioespresso/craft-seo-fields/issues/94))
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": "5.0.0",
"version": "5.0.1",
"keywords": [
"craft",
"cms",
Expand Down
5 changes: 5 additions & 0 deletions src/SeoFields.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use craft\base\Model;
use craft\base\Plugin;
use craft\commerce\elements\Product;
use craft\elements\Category;
use craft\elements\Entry;
use craft\events\DefineBehaviorsEvent;
use craft\events\ElementEvent;
Expand Down Expand Up @@ -474,6 +475,10 @@ private function _registerElementBehaviors(): void
$event->behaviors[$this->id] = ElementSeoBehavior::class;
});

Event::on(Category::class, Entry::EVENT_DEFINE_BEHAVIORS, function(DefineBehaviorsEvent $event) {
$event->behaviors[$this->id] = ElementSeoBehavior::class;
});

if (Craft::$app->getPlugins()->isPluginEnabled('commerce')) {
/** @phpstan-ignore-next-line */
Event::on(Product::class, Product::EVENT_DEFINE_BEHAVIORS, function(DefineBehaviorsEvent $event) {
Expand Down

0 comments on commit d693fd7

Please sign in to comment.