From 95a2808c04656f655dd27a0722ad85b85d140b64 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com> Date: Wed, 7 Feb 2024 16:01:34 +1300 Subject: [PATCH 1/2] TLN Update translations (#742) --- lang/sk.yml | 8 ++++++++ lang/sl.yml | 10 ++++++++++ 2 files changed, 18 insertions(+) diff --git a/lang/sk.yml b/lang/sk.yml index 62f0d92c..34a4ef90 100644 --- a/lang/sk.yml +++ b/lang/sk.yml @@ -45,11 +45,17 @@ sk: PLURALNAME: 'Kategórie blogu' SINGULARNAME: 'Kategória blogu' Title: Názov + belongs_many_many_BlogPosts: 'Príspevky v blogu' db_Title: Názov + db_URLSegment: 'Časť URL' has_one_Blog: Blog SilverStripe\Blog\Model\BlogMemberExtension: BLOGPOSTS: 'Základné stránky' TABBLOGPOSTS: 'Základné stránky' + belongs_many_many_BlogPosts: 'Príspevky v blogu' + db_BlogProfileSummary: 'Prehľad profilu blogu' + db_URLSegment: 'Časť URL' + has_one_BlogProfileImage: 'Profilový obrázok blogu' SilverStripe\Blog\Model\BlogObject: Title: Názov SilverStripe\Blog\Model\BlogPost: @@ -75,7 +81,9 @@ sk: PLURALNAME: 'Štítky blogu' SINGULARNAME: 'Štítok blogu' Title: Názov + belongs_many_many_BlogPosts: 'Príspevky v blogu' db_Title: Názov + db_URLSegment: 'Časť URL' has_one_Blog: Blog SilverStripe\Blog\Widgets\BlogArchiveWidget: ArchiveType: 'Typ archívu' diff --git a/lang/sl.yml b/lang/sl.yml index d1fdd855..d7a54035 100644 --- a/lang/sl.yml +++ b/lang/sl.yml @@ -11,17 +11,27 @@ sl: AND: in Archive: Arhiv Comments: Komentarji + FILTERDESCRIPTION_PAGE: 'Stran {page}' PLURALNAME: 'Izvorna stran' SilverStripe\Blog\Model\BlogCategory: + belongs_many_many_BlogPosts: 'Zapisi na blogu' db_Title: Naziv db_URLSegment: 'Naslov URL' SilverStripe\Blog\Model\BlogMemberExtension: + belongs_many_many_BlogPosts: 'Zapisi na blogu' + db_BlogProfileSummary: 'Povzetek blogerskega profila' db_URLSegment: 'Naslov URL' + has_one_BlogProfileImage: 'Osebna podoba' SilverStripe\Blog\Model\BlogObject: Title: Naziv SilverStripe\Blog\Model\BlogPost: AUTHOR: Avtor PLURALNAME: 'Izvorna stran' SilverStripe\Blog\Model\BlogTag: + belongs_many_many_BlogPosts: 'Zapisi na blogu' db_Title: Naziv db_URLSegment: 'Naslov URL' + SilverStripe\Blog\Widgets\BlogCategoriesWidget: + Sort: Razvrščanje + SilverStripe\Blog\Widgets\BlogTagsWidget: + Sort: Razvrščanje From 9fae326927dc38640f429970f53e86f77fbf9903 Mon Sep 17 00:00:00 2001 From: James Cocker Date: Tue, 19 Mar 2024 10:13:00 +0000 Subject: [PATCH 2/2] FIX Use $owns instead of onBeforeWrite hook to publish profile image --- src/Model/BlogMemberExtension.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Model/BlogMemberExtension.php b/src/Model/BlogMemberExtension.php index 9ea032c2..b3399c71 100644 --- a/src/Model/BlogMemberExtension.php +++ b/src/Model/BlogMemberExtension.php @@ -35,6 +35,10 @@ class BlogMemberExtension extends DataExtension 'BlogProfileImage' => Image::class ]; + private static array $owns = [ + 'BlogProfileImage', + ]; + /** * @var array */ @@ -59,11 +63,6 @@ public function onBeforeWrite() $this->owner->URLSegment = preg_replace('/-[0-9]+$/', '', $this->owner->URLSegment ?? '') . '-' . $count; $count++; } - - // Auto publish profile images - if ($this->owner->BlogProfileImage() && $this->owner->BlogProfileImage()->exists()) { - $this->owner->BlogProfileImage()->publishSingle(); - } } /**