Compare commits

..

14 Commits
3.12.3 ... 3

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
github-actions
ca0624cc25 Merge branch '3.12' into 3 2024-02-10 12:28:11 +00:00
Guy Sartorelli
95a2808c04
TLN Update translations (#742) 2024-02-07 16:01:34 +13:00
github-actions
3b6a519b39 Merge branch '3.12' into 3 2023-09-30 12:28:23 +00:00
Sabina Talipova
4ca99d07f3
Merge pull request #727 from nathanbrauer/feature/update-for-versioned-1.12
Bugfix: Updating BlogPostFilter::augmentSQL to make use of modern Versioned methods.
2023-09-26 08:51:37 +13:00
Nathan J. Brauer
712812332d Bugfix: Updating BlogPostFilter::augmentSQL to make use of modern Versioned methods.
This resolves an issue with some modules that rely upon get_draft_site_secured, like Elemental and sharedraftcontent
2023-09-19 21:18:06 -07:00
github-actions
eb108b8e83 Merge branch '3.12' into 3 2023-08-26 12:28:25 +00:00
Steve Boyd
941c2c7b11 Merge branch '3.12' into 3 2023-06-16 11:37:28 +12:00
Steve Boyd
84c93b1c2f Merge branch '3.12' into 3 2023-05-31 14:41:45 +12:00
Guy Sartorelli
ba49047d94
Merge branch '3.12' into 3 2023-04-26 12:45:55 +12:00
Maxime Rainville
587379b8b3
Merge pull request #703 from creative-commoners/pulls/3/dispatch-ci
MNT Use gha-dispatch-ci
2023-03-23 12:16:37 +13:00
Steve Boyd
0b231cb2a5 MNT Use gha-dispatch-ci 2023-03-21 12:20:48 +13:00
6 changed files with 44 additions and 12 deletions

View File

@ -4,13 +4,8 @@ on:
push: push:
pull_request: pull_request:
workflow_dispatch: workflow_dispatch:
# Every Tuesday at 12:20pm UTC
schedule:
- cron: '20 12 * * 2'
jobs: jobs:
ci: ci:
name: CI name: CI
# Only run cron on the silverstripe account
if: (github.event_name == 'schedule' && github.repository_owner == 'silverstripe') || (github.event_name != 'schedule')
uses: silverstripe/gha-ci/.github/workflows/ci.yml@v1 uses: silverstripe/gha-ci/.github/workflows/ci.yml@v1

16
.github/workflows/dispatch-ci.yml vendored Normal file
View File

@ -0,0 +1,16 @@
name: Dispatch CI
on:
# At 12:20 PM UTC, only on Tuesday and Wednesday
schedule:
- cron: '20 12 * * 2,3'
jobs:
dispatch-ci:
name: Dispatch CI
# Only run cron on the silverstripe account
if: (github.event_name == 'schedule' && github.repository_owner == 'silverstripe') || (github.event_name != 'schedule')
runs-on: ubuntu-latest
steps:
- name: Dispatch CI
uses: silverstripe/gha-dispatch-ci@v1

View File

@ -45,11 +45,17 @@ sk:
PLURALNAME: 'Kategórie blogu' PLURALNAME: 'Kategórie blogu'
SINGULARNAME: 'Kategória blogu' SINGULARNAME: 'Kategória blogu'
Title: Názov Title: Názov
belongs_many_many_BlogPosts: 'Príspevky v blogu'
db_Title: Názov db_Title: Názov
db_URLSegment: 'Časť URL'
has_one_Blog: Blog has_one_Blog: Blog
SilverStripe\Blog\Model\BlogMemberExtension: SilverStripe\Blog\Model\BlogMemberExtension:
BLOGPOSTS: 'Základné stránky' BLOGPOSTS: 'Základné stránky'
TABBLOGPOSTS: '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: SilverStripe\Blog\Model\BlogObject:
Title: Názov Title: Názov
SilverStripe\Blog\Model\BlogPost: SilverStripe\Blog\Model\BlogPost:
@ -75,7 +81,9 @@ sk:
PLURALNAME: 'Štítky blogu' PLURALNAME: 'Štítky blogu'
SINGULARNAME: 'Štítok blogu' SINGULARNAME: 'Štítok blogu'
Title: Názov Title: Názov
belongs_many_many_BlogPosts: 'Príspevky v blogu'
db_Title: Názov db_Title: Názov
db_URLSegment: 'Časť URL'
has_one_Blog: Blog has_one_Blog: Blog
SilverStripe\Blog\Widgets\BlogArchiveWidget: SilverStripe\Blog\Widgets\BlogArchiveWidget:
ArchiveType: 'Typ archívu' ArchiveType: 'Typ archívu'

View File

@ -11,17 +11,27 @@ sl:
AND: in AND: in
Archive: Arhiv Archive: Arhiv
Comments: Komentarji Comments: Komentarji
FILTERDESCRIPTION_PAGE: 'Stran {page}'
PLURALNAME: 'Izvorna stran' PLURALNAME: 'Izvorna stran'
SilverStripe\Blog\Model\BlogCategory: SilverStripe\Blog\Model\BlogCategory:
belongs_many_many_BlogPosts: 'Zapisi na blogu'
db_Title: Naziv db_Title: Naziv
db_URLSegment: 'Naslov URL' db_URLSegment: 'Naslov URL'
SilverStripe\Blog\Model\BlogMemberExtension: SilverStripe\Blog\Model\BlogMemberExtension:
belongs_many_many_BlogPosts: 'Zapisi na blogu'
db_BlogProfileSummary: 'Povzetek blogerskega profila'
db_URLSegment: 'Naslov URL' db_URLSegment: 'Naslov URL'
has_one_BlogProfileImage: 'Osebna podoba'
SilverStripe\Blog\Model\BlogObject: SilverStripe\Blog\Model\BlogObject:
Title: Naziv Title: Naziv
SilverStripe\Blog\Model\BlogPost: SilverStripe\Blog\Model\BlogPost:
AUTHOR: Avtor AUTHOR: Avtor
PLURALNAME: 'Izvorna stran' PLURALNAME: 'Izvorna stran'
SilverStripe\Blog\Model\BlogTag: SilverStripe\Blog\Model\BlogTag:
belongs_many_many_BlogPosts: 'Zapisi na blogu'
db_Title: Naziv db_Title: Naziv
db_URLSegment: 'Naslov URL' db_URLSegment: 'Naslov URL'
SilverStripe\Blog\Widgets\BlogCategoriesWidget:
Sort: Razvrščanje
SilverStripe\Blog\Widgets\BlogTagsWidget:
Sort: Razvrščanje

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

View File

@ -28,13 +28,17 @@ class BlogPostFilter extends DataExtension
*/ */
public function augmentSQL(SQLSelect $query, DataQuery $dataQuery = null) public function augmentSQL(SQLSelect $query, DataQuery $dataQuery = null)
{ {
$stage = Versioned::get_stage();
if (Controller::has_curr() && Controller::curr() instanceof LeftAndMain) { if (Controller::has_curr() && Controller::curr() instanceof LeftAndMain) {
return; return;
} }
if ($stage == 'Live' || !Permission::check('VIEW_DRAFT_CONTENT')) { if (Versioned::get_stage() === Versioned::LIVE ||
(
Versioned::get_draft_site_secured() &&
!Permission::check('VIEW_DRAFT_CONTENT')
)
) {
$query->addWhere(sprintf( $query->addWhere(sprintf(
'"PublishDate" < \'%s\'', '"PublishDate" < \'%s\'',
Convert::raw2sql(DBDatetime::now()) Convert::raw2sql(DBDatetime::now())