Skip to content

Commit c04bc93

Browse files
committed
Merge branch '5.1.x' into 5.2.x
2 parents 1f3c75e + 90aeab3 commit c04bc93

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

plugins/baser-core/src/BaserCorePlugin.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,11 @@ public function getAvailableThemes(): array
285285
foreach($sites as $site) {
286286
if ($site->theme) {
287287
if (!CorePlugin::isLoaded($site->theme)) {
288-
$pluginPath = CorePlugin::path($site->theme);
288+
try {
289+
$pluginPath = CorePlugin::path($site->theme);
290+
} catch (\Throwable) {
291+
continue;
292+
}
289293
// path() を実行するとプラグインクラスがコレクションに登録されてしまう
290294
// ここで登録されてしまうと、対象プラグインの bootstrap() が正常に実行されないため
291295
// ここでは一旦削除する。

plugins/bc-blog/src/Model/Table/BlogContentsTable.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,11 @@ public function validationDefault(Validator $validator): Validator
8787
$validator->scalar('list_direction')
8888
->notEmptyString('list_direction', __d('baser_core', '一覧に表示する順番を指定してください。'));
8989

90-
$validator->add('eye_catch_size_thumb_width', 'checkEyeCatchSize', [
91-
'provider' => 'blogContent',
92-
'rule' => 'checkEyeCatchSize',
93-
'message' => __d('baser_core', 'アイキャッチ画像のサイズが不正です。')]);
90+
$validator->allowEmptyString('eye_catch_size_thumb_width')
91+
->add('eye_catch_size_thumb_width', 'checkEyeCatchSize', [
92+
'provider' => 'blogContent',
93+
'rule' => 'checkEyeCatchSize',
94+
'message' => __d('baser_core', 'アイキャッチ画像のサイズが不正です。')]);
9495

9596
return $validator;
9697
}

plugins/bc-custom-content/src/View/Helper/CustomContentHelper.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,13 +506,18 @@ public function getEntries(string $contentsName, int $limit = 5, array $options
506506
{
507507
$options = array_merge([
508508
'limit' => $limit,
509+
'status' => 'publish',
510+
'order' => 'created',
511+
'direction' => 'DESC',
509512
], $options);
510513
$contentService = $this->getService(ContentsServiceInterface::class);
511514
$url = $this->parseContentsName($contentsName);
512515
$content = $contentService->Contents->findByUrl($url, ['Contain' => ['CustomContents']]);
513516
if($content->type !== 'CustomContent') {
514517
throw new NotFoundException(__d('baser_core', '指定されたコンテンツは存在しません。'));
515518
}
519+
$request = $this->getView()->getRequest()->withAttribute('currentContent', $content);
520+
$this->getView()->setRequest($request);
516521
$service = $this->getService(CustomContentFrontServiceInterface::class);
517522
$customContent = $service->ContentsService->get($content->entity_id);
518523
$service->EntriesService->setup($customContent->custom_table_id);

0 commit comments

Comments
 (0)