From 50000144c6d96525b63d8fb62d8492f2cb8f3651 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sat, 11 Jun 2022 09:07:09 +1000 Subject: [PATCH] Fixes for falsey conditions --- app/Services/PdfMaker/Designs/Utilities/DesignHelpers.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Services/PdfMaker/Designs/Utilities/DesignHelpers.php b/app/Services/PdfMaker/Designs/Utilities/DesignHelpers.php index ff449e8f1ae6..8318d2434976 100644 --- a/app/Services/PdfMaker/Designs/Utilities/DesignHelpers.php +++ b/app/Services/PdfMaker/Designs/Utilities/DesignHelpers.php @@ -184,7 +184,7 @@ trait DesignHelpers $key = array_search(sprintf('%s%s.tax', '$', $type), $this->context['pdf_variables']["{$type}_columns"], true); - if ($key) { + if ($key !== false) { array_splice($this->context['pdf_variables']["{$type}_columns"], $key, 1, $taxes); } } @@ -342,7 +342,7 @@ document.addEventListener('DOMContentLoaded', function() { $key = array_search(sprintf('%s%s.description', '$', $type), $this->context['pdf_variables']["{$type}_columns"], true); - if ($key) { + if ($key !== false) { array_splice($this->context['pdf_variables']["{$type}_columns"], $key + 1, 0, $custom_columns); } }