Compare commits

...

3 Commits

Author SHA1 Message Date
github-actions
ed0f42a509 Merge branch '3.12' into 3 2024-03-23 12:28:32 +00:00
Michal Kleiner
031545737d
Merge pull request #750 from purplespider/fix-publish-profile-image-2 2024-03-20 23:00:47 +13:00
James Cocker
9fae326927 FIX Use $owns instead of onBeforeWrite hook to publish profile image 2024-03-20 22:54:38 +13:00

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();
}
} }
/** /**