From 0105bfefa40e1c58574e604a765e597ca5b363b8 Mon Sep 17 00:00:00 2001 From: Alex Cabal Date: Mon, 6 Jan 2025 13:25:02 -0600 Subject: [PATCH] Tweak donation banners and some type safety --- templates/DonationProgress.php | 2 +- www/ebooks/index.php | 1 + www/projects/post.php | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/templates/DonationProgress.php b/templates/DonationProgress.php index 4c3a441c..04936cce 100644 --- a/templates/DonationProgress.php +++ b/templates/DonationProgress.php @@ -63,7 +63,7 @@ if($donationDrive->IsStretchEnabled){
-

Help us meet our stretch goal of
TargetDonationCount) ?> new patrons by

+

days <= 1){ ?> left—
Help us meet our stretch goal of
TargetDonationCount) ?> new patronsHelp us meet our stretch goal of
TargetDonationCount) ?> new patrons by

IsStretchEnabled){ ?> style="--stretch-starting-position: %; --stretch-base-counter-position: %"> diff --git a/www/ebooks/index.php b/www/ebooks/index.php index c48ea1e8..17be52cb 100644 --- a/www/ebooks/index.php +++ b/www/ebooks/index.php @@ -1,4 +1,5 @@ Ebook = Ebook::GetByIdentifier($project->Ebook->Identifier); - if(!$project->Ebook->EbookPlaceholder?->IsInProgress){ + if($project->Ebook->EbookPlaceholder !== null && !$project->Ebook->EbookPlaceholder->IsInProgress){ $project->EbookId = $project->Ebook->EbookId; $_SESSION['is-only-ebook-project-created'] = true; // Set the placeholder to in progress. - $project->Ebook->EbookPlaceholder?->IsInProgress = true; - $project->Ebook->EbookPlaceholder?->Save(); + $project->Ebook->EbookPlaceholder->IsInProgress = true; + $project->Ebook->EbookPlaceholder->Save(); } else{ // `Ebook` exists and it's not a placeholder, so really fail.