From ca2610081596a1cbf35db89c2c764d55bb9c6985 Mon Sep 17 00:00:00 2001 From: Andrew Welch Date: Mon, 9 Dec 2024 13:29:48 -0500 Subject: [PATCH] fix: fix: Fixed an issue where deprecation errors would occur when an element does not have a `uri` ([#317](https://github.com/nystudio107/craft-retour/issues/317)) --- src/Retour.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Retour.php b/src/Retour.php index e2ba77b4..73da645a 100644 --- a/src/Retour.php +++ b/src/Retour.php @@ -325,7 +325,7 @@ function(Event $event) { if (self::$settings->createUriChangeRedirects && $checkElementSlug) { // Make sure this isn't a transitioning temporary draft/revision and that it's // not propagating to other sites - if (!str_contains($element->uri, '__temp_')) { + if ($element->uri && !str_contains($element->uri, '__temp_')) { Retour::$plugin->events->stashElementUris($element); } }