Skip to content

Commit

Permalink
prevent 500 error on parentItem=false in item creation
Browse files Browse the repository at this point in the history
Only set parentItem if it is a truth-y value.
Fixes zotero#109
  • Loading branch information
abaevbog committed Jun 14, 2023
1 parent 2cf66c3 commit cb613bb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion model/Items.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -1697,7 +1697,9 @@ public static function updateFromJSON(Zotero_Item $item,
continue 2;

case 'parentItem':
$item->setSourceKey($val);
if ($val) {
$item->setSourceKey($val);
}
break;

case 'creators':
Expand Down

0 comments on commit cb613bb

Please sign in to comment.