Skip to content

Commit

Permalink
Use entity method for title id retrieval
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobSanford committed Aug 13, 2024
1 parent 7387929 commit 699dc4c
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,12 @@ public function getIssueTitleId($issue_id) {
$issue = \Drupal::entityTypeManager()
->getStorage('digital_serial_issue')
->load($issue_id);
$title_id = $issue->parent_title->target_id;

if ($issue == NULL) {
$title_id = NULL;
} else {
$title_id = $issue->getParentTitle();
}

return new JsonResponse(
[
Expand Down

0 comments on commit 699dc4c

Please sign in to comment.