Merge pull request #750 from purplespider/fix-publish-profile-image-2

This commit is contained in:
Michal Kleiner 2024-03-20 23:00:47 +13:00 committed by GitHub
commit 031545737d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -35,6 +35,10 @@ class BlogMemberExtension extends DataExtension
'BlogProfileImage' => Image::class 'BlogProfileImage' => Image::class
]; ];
private static array $owns = [
'BlogProfileImage',
];
/** /**
* @var array * @var array
*/ */
@ -59,11 +63,6 @@ class BlogMemberExtension extends DataExtension
$this->owner->URLSegment = preg_replace('/-[0-9]+$/', '', $this->owner->URLSegment ?? '') . '-' . $count; $this->owner->URLSegment = preg_replace('/-[0-9]+$/', '', $this->owner->URLSegment ?? '') . '-' . $count;
$count++; $count++;
} }
// Auto publish profile images
if ($this->owner->BlogProfileImage() && $this->owner->BlogProfileImage()->exists()) {
$this->owner->BlogProfileImage()->publishSingle();
}
} }
/** /**