Skip to content

Commit 7668494

Browse files
committed
【カスタムコンテンツ】エントリーにスラッグを指定すると、IDとスラッグの2種類のURLが発生する問題を改善 fix #4142
1 parent 6e6951a commit 7668494

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

plugins/bc-custom-content/src/Service/CustomEntriesService.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -397,10 +397,14 @@ public function get($id, array $options = [])
397397
}
398398

399399
if (is_numeric($id)) {
400-
$conditions = array_merge_recursive(
401-
$conditions,
402-
['CustomEntries.id' => $id]
403-
);
400+
$conditions = array_merge_recursive($conditions, [
401+
'CustomEntries.id' => $id,
402+
]);
403+
if($options['status'] === 'publish') {
404+
$conditions = array_merge_recursive($conditions, [
405+
'CustomEntries.name' => ''
406+
]);
407+
}
404408
} else {
405409
$conditions = array_merge_recursive(
406410
$conditions,

0 commit comments

Comments
 (0)