From 93a1b40b895782f6db399cd0dd028d4acdecb3b1 Mon Sep 17 00:00:00 2001 From: Alex Cabal Date: Mon, 16 Dec 2024 00:14:51 -0600 Subject: [PATCH] Link to discussion if project producer has no email --- templates/ProjectsTable.php | 2 ++ www/ebook-placeholders/post.php | 18 +++++++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/templates/ProjectsTable.php b/templates/ProjectsTable.php index 4ee7bbeb..26855ec8 100644 --- a/templates/ProjectsTable.php +++ b/templates/ProjectsTable.php @@ -36,6 +36,8 @@ $includeStatus = $includeStatus ?? true; ProducerEmail !== null){ ?> ProducerName) ?> + DiscussionUrl !== null){ ?> + ProducerName) ?> ProducerName) ?> diff --git a/www/ebook-placeholders/post.php b/www/ebook-placeholders/post.php index f60347dd..d9bff187 100644 --- a/www/ebook-placeholders/post.php +++ b/www/ebook-placeholders/post.php @@ -73,15 +73,6 @@ try{ $ebookPlaceholder->FillFromHttpPost(); $ebook->EbookPlaceholder = $ebookPlaceholder; - $ebook->FillIdentifierFromTitleAndContributors(); - try{ - $existingEbook = Ebook::GetByIdentifier($ebook->Identifier); - throw new Exceptions\DuplicateEbookException($ebook->Identifier); - } - catch(Exceptions\EbookNotFoundException){ - // Pass and create the placeholder. There is no existing ebook with this identifier. - } - // Do we have a `Project` to create at the same time? $project = null; if($ebookPlaceholder->IsInProgress){ @@ -92,6 +83,15 @@ try{ $project->Validate(); } + $ebook->FillIdentifierFromTitleAndContributors(); + try{ + $existingEbook = Ebook::GetByIdentifier($ebook->Identifier); + throw new Exceptions\DuplicateEbookException($ebook->Identifier); + } + catch(Exceptions\EbookNotFoundException){ + // Pass and create the placeholder. There is no existing ebook with this identifier. + } + // These properties must be set before calling `Ebook::Create()` to prevent the getters from triggering DB queries or accessing `Ebook::$EbookId` before it is set. $ebook->Tags = []; $ebook->LocSubjects = [];