Skip to content

Commit

Permalink
Update BlogController.php
Browse files Browse the repository at this point in the history
fix BlogTagモデルは関連モデルをごっそり持ってきて不要なメモリを消費する問題を解決
  • Loading branch information
katokaisya authored Jun 29, 2023
1 parent d8c8acf commit e5a0214
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Baser/Plugin/Blog/Controller/BlogController.php
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ public function tags($name = null)
$this->notFound();
}
// /tags/{存在しないタグ名} がステータス200として戻される問題の解決
$tag = $this->BlogTag->findByName($name);
$tag = $this->BlogTag->find('first', ['conditions' => ['BlogTag.name' => $name], 'recursive' => -1]);
if (empty($tag)) {
$this->notFound();
}
Expand Down

0 comments on commit e5a0214

Please sign in to comment.