Skip to content

Commit

Permalink
fix: support Craft 5.3+
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcuzz authored Dec 4, 2024
1 parent e4937b9 commit 62524d9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "everyday/craft-incremental-static-regeneration",
"version": "1.3.0",
"version": "1.3.1",
"description": "A plugin that watches your entry changes and pings a URL of your choice",
"type": "craft-plugin",
"keywords": ["incremental", "static", "regeneration", "nextjs"],
Expand Down
13 changes: 10 additions & 3 deletions src/helpers/TriggerHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use craft\helpers\ElementHelper;
use everyday\IncrementalStaticRegeneration\models\Settings;
use yii\base\Event;
use yii\base\InvalidConfigException;

class TriggerHelper
{
Expand All @@ -24,8 +25,14 @@ private static function getRelatedUris(Element $element, Settings $settings): ar

private static function entryEntryTypeDisabled(Entry $entry, Settings $settings): bool
{
foreach ($entry->section->entryTypes as $entryType) {
if (in_array($entryType->handle, $settings->excludedSections[$entry->section->handle] ?? [],
$section = $entry->getSection();

if(!$section) {
return true;
}

foreach ($section->getEntryTypes() as $entryType) {
if (in_array($entryType->handle, $settings->excludedSections[$section->handle] ?? [],
true)) {
return true;
}
Expand Down Expand Up @@ -84,4 +91,4 @@ public static function globalSetAfterSaveTrigger(ModelEvent $event, Settings $se

return self::getAllUris($settings);
}
}
}

0 comments on commit 62524d9

Please sign in to comment.