Skip to content

Commit

Permalink
Craft 5 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Roel van Hintum committed Mar 21, 2024
1 parent c334a77 commit 524ff5b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ 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.0 - 2024-03-21

### Changed

- Craft 5 support

## 3.3.0 - 2024-01-26

### Fixed
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
}
],
"require": {
"php": "^8.0.2",
"craftcms/cms": "^4.0.0-beta.1"
"php": "^8.2.0",
"craftcms/cms": "^5.0.0-beta.1"
},
"require-dev": {
"squizlabs/php_codesniffer": "3.*"
Expand Down
6 changes: 2 additions & 4 deletions src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
use craft\elements\Asset;
use craft\events\DefineElementEditorHtmlEvent;
use craft\events\RegisterElementTableAttributesEvent;
use craft\events\SetElementTableAttributeHtmlEvent;
use craft\web\View;
use craft\events\DefineAttributeHtmlEvent;
use yii\base\Event;

class Plugin extends CraftPlugin
Expand Down Expand Up @@ -83,8 +82,7 @@ private function registerTableAttributes()
'label' => Craft::t('assetusage', 'Usage'),
];
});

Event::on(Asset::class, Asset::EVENT_SET_TABLE_ATTRIBUTE_HTML, function (SetElementTableAttributeHtmlEvent $event) {
Event::on(Asset::class, Asset::EVENT_DEFINE_ATTRIBUTE_HTML, function (DefineAttributeHtmlEvent $event) {
if ($event->attribute === 'usage') {
/** @var Asset $asset */
$asset = $event->sender;
Expand Down

0 comments on commit 524ff5b

Please sign in to comment.