mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-09-21 00:45:58 +02:00
Fix: Publish BlogProfileImage even if Name unchanged
This commit is contained in:
parent
85664ce91b
commit
ac7ee74f7e
@ -51,6 +51,11 @@ class BlogMemberExtension extends DataExtension
|
|||||||
{
|
{
|
||||||
$count = 1;
|
$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')) {
|
if ($this->owner->URLSegment && !$this->owner->isChanged('FirstName') && !$this->owner->isChanged('Surname')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -61,11 +66,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();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user