Changed BlogProfileImage publish from onBeforeWrite to $owns
This commit is contained in:
parent
ac7ee74f7e
commit
6cf41baab3
|
@ -37,6 +37,13 @@ class BlogMemberExtension extends DataExtension
|
|||
'BlogProfileImage' => Image::class
|
||||
];
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private static $owns = [
|
||||
'BlogProfileImage',
|
||||
];
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
|
@ -51,11 +58,6 @@ class BlogMemberExtension extends DataExtension
|
|||
{
|
||||
$count = 1;
|
||||
|
||||
// Auto publish profile images
|
||||
if ($this->owner->BlogProfileImage() && $this->owner->BlogProfileImage()->exists()) {
|
||||
$this->owner->BlogProfileImage()->publishSingle();
|
||||
}
|
||||
|
||||
if ($this->owner->URLSegment && !$this->owner->isChanged('FirstName') && !$this->owner->isChanged('Surname')) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue