Skip to content

Commit

Permalink
fix: missing license id issue fix
Browse files Browse the repository at this point in the history
  • Loading branch information
CS76 committed May 2, 2024
1 parent 2a833f6 commit 702b205
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
10 changes: 9 additions & 1 deletion app/Models/HasDOI.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ public function getMetadata()
$users = [];
$keywords = [];
$citations = [];
$license = License::where([['id', $this->license_id]])->firstOrFail();
$dates = [
[
'date' => $this->release_date,
Expand Down Expand Up @@ -182,6 +181,15 @@ public function getMetadata()
array_push($relatedIdentifiers, $relatedIdentifier);
}

if (! $this->license_id) {
if ($this instanceof Study || $this instanceof Dataset) {
$this->license_id = $this->project->license_id;
$this->save();
}
}

$license = License::where([['id', $this->license_id]])->firstOrFail();

$rights = [
[
'rights' => $license->title,
Expand Down
2 changes: 1 addition & 1 deletion public/vendor/horizon/app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/vendor/horizon/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"/app.js": "/app.js?id=79bae40dcb18de9ca1b5d0008c577471",
"/app.js": "/app.js?id=b4f3f08e60211bd6948ec35e5e9de9a1",
"/app-dark.css": "/app-dark.css?id=15c72df05e2b1147fa3e4b0670cfb435",
"/app.css": "/app.css?id=4d6a1a7fe095eedc2cb2a4ce822ea8a5",
"/img/favicon.png": "/img/favicon.png?id=1542bfe8a0010dcbee710da13cce367f",
Expand Down

0 comments on commit 702b205

Please sign in to comment.