Skip to content

Commit

Permalink
fix: 空タグがあると内部エラーになるのを修正 Refs researchmap/RmNetCommons3#1780
Browse files Browse the repository at this point in the history
  • Loading branch information
RyujiAMANO committed Jun 5, 2020
1 parent d130c99 commit 7be68f9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Model/Tag.php
Expand Up @@ -159,6 +159,11 @@ public function saveTags($blockId, $modelName, $contentId, $tags) {
$tagNameList[] = $tag['name'];
}
}

// trimして空のタグを除去
$tagNameList = array_map('trim', $tagNameList);
$tagNameList = array_filter($tagNameList);

foreach ($tagNameList as $tagName) {
//
$savedTag = $this->findByBlockIdAndModelAndName($blockId, $modelName, $tagName);
Expand Down

0 comments on commit 7be68f9

Please sign in to comment.