From f38630c89488895f5aee42fd6d421dea8d6ff225 Mon Sep 17 00:00:00 2001 From: Raissa North Date: Wed, 24 Jan 2018 16:54:54 +1300 Subject: [PATCH] FIX Auto publish a Member's profile image when saving --- src/Model/BlogMemberExtension.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Model/BlogMemberExtension.php b/src/Model/BlogMemberExtension.php index 0b9ce60..45da9e7 100644 --- a/src/Model/BlogMemberExtension.php +++ b/src/Model/BlogMemberExtension.php @@ -59,6 +59,11 @@ class BlogMemberExtension extends DataExtension $this->owner->URLSegment = preg_replace('/-[0-9]+$/', null, $this->owner->URLSegment) . '-' . $count; $count++; } + + // Auto publish profile images + if ($this->owner->BlogProfileImage() && $this->owner->BlogProfileImage()->exists()) { + $this->owner->BlogProfileImage()->publishSingle(); + } } /**