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 = [];