diff --git a/CRM/Contribute/Form/ManagePremiums.php b/CRM/Contribute/Form/ManagePremiums.php index 2cb9c4fa6c80..5820ff296247 100644 --- a/CRM/Contribute/Form/ManagePremiums.php +++ b/CRM/Contribute/Form/ManagePremiums.php @@ -209,14 +209,14 @@ public function buildQuickForm() { public static function formRule($params, $files) { // If choosing to upload an image, then an image must be provided - if (CRM_Utils_Array::value('imageOption', $params['imageOption']) == 'image' + if (CRM_Utils_Array::value('imageOption', $params) == 'image' && empty($files['uploadFile']['name']) ) { $errors['uploadFile'] = ts('A file must be selected'); } // If choosing to use image URLs, then both URLs must be present - if (CRM_Utils_Array::value('imageOption', $params['imageOption']) == 'thumbnail') { + if (CRM_Utils_Array::value('imageOption', $params) == 'thumbnail') { if (!$params['imageUrl']) { $errors['imageUrl'] = ts('Image URL is Required'); }