diff --git a/src/DonationFundEditor.php b/src/DonationFundEditor.php index 80918a5c79..c62b6f04db 100644 --- a/src/DonationFundEditor.php +++ b/src/DonationFundEditor.php @@ -69,8 +69,8 @@ } else { // Check if we're adding a fund if (isset($_POST['AddField'])) { - $checkExisting = DonationFundQuery::create()->filterByName($_POST['newFieldName'])->findOne(); - if (count($checkExisting) > 0) { + $checkExisting = DonationFundQuery::create()->findOneByName($_POST['newFieldName']); + if ($checkExisting !== null) { $bNewNameError = true; } else { $donation = new DonationFund(); diff --git a/src/ManageEnvelopes.php b/src/ManageEnvelopes.php index 7150aa8c38..6c1f905be5 100644 --- a/src/ManageEnvelopes.php +++ b/src/ManageEnvelopes.php @@ -16,7 +16,7 @@ // Security: User must have finance permission to use this form AuthenticationManager::redirectHomeIfFalse(AuthenticationManager::getCurrentUser()->isFinanceEnabled()); -$iClassification = null; +$iClassification = 0; if (isset($_POST['Classification'])) { $iClassification = (int) InputUtils::legacyFilterInput($_POST['Classification'], 'int'); $_SESSION['classification'] = $iClassification;