Answers.Body: <p>We had one client inform us that they could not save Batch Data - everything we tried to replicate the issue failed. In the end we concluded that it was due to browser caching which the client was able to confirm by testing with a different browser.</p>
  
  <p>Refreshing the chrome caching (<a href="https://support.google.com/accounts/answer/32050?co=GENIE.Platform%3DDesktop&amp;hl=en" rel="nofollow noreferrer">https://support.google.com/accounts/answer/32050?co=GENIE.Platform%3DDesktop&amp;hl=en</a>) sorted it for them.</p>
  
  <p>May not relate to your situation at all.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-07T13:41:59.040Z
Answers.Text: Thanks for the suggestion, I'm pretty sure it's to do with the form not being valid though rather than a browser issue
Answers.UserDisplayName: DenisH
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-06T18:08:33.447Z
Answers.LastActivityDate: 2019-02-06T18:08:33.447Z
Answers.UserDisplayName: petednz - fuzion
Body: <p>we've been using CiviCRM for several years and we've just recently version 4.7 to 5.8.2, but now we can't use the Batch Data Entry any more. We can create new batches, add entries and save them, but when I press Validate and Process the batch it just displays the batch again.</p>
  
  <p>I guessed that it might be a validation problem and eventually put a log statement to get any errors on form validation. In my test batch there are two entries and this is the error I get:</p>
  
  <pre><code>Form Errors: Array
  (
    [field[1][payment_instrument]] =&gt; Payment Method is a required field.
    [field[2][payment_instrument]] =&gt; Payment Method is a required field.
  )
  </code></pre>
  
  <p>Nothing is displayed on the screen because there isn't a Payment Method--or Payment Instrument--field in the form, so that explains what is going wrong, but not why.</p>
  
  <p>Looking at the DB for past batches, we've never had to specify the Payment Method before, I notice that there is a <code>payment_instrument_id</code> field on civicrm_batch, but it's optional and null for all our past batches.</p>
  
  <p>How can I make it optional so I don't need to add a field to the form?</p>
  
  <p>Thanks!</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-07T13:41:02.813Z
Comments.Text: So, I've found that if I go in to Administer -> Custom Data and Screens -> Profiles, then choose Reserved Profiles and add a Payment Method ID field to the fields for Contribution Bulk Entry, and then make sure I set the field value to 4 for example, then the batch is processed successfully. But this isn't much good for my non-techy administrators.
  
  Is there at least a way to make this a drop down?
Comments.UserDisplayName: DenisH
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-07T15:23:38.557Z
Comments.Text: I spoke too soon :-(
  
  I've now got it working on my local test version and I can remove Payment Method ID field and it still processes the batches (I tried several). 
  
  But if I go to the live system and try the same steps there, it doesn't process the batch. No error message, just returns to the same batch entry page again.
  
  I wonder if there's something cached and I accidentally cleared it on the test system? I've tried &directoryCleanup=3 but that didn't make any difference.
Comments.UserDisplayName: DenisH
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-17T19:00:41.683Z
Comments.Text: I found a work around: In the file civicrm/civicrm/CRM/Batch/Form/Entry.php, in the static function formRule(), I commented out this line:
  
  // 'payment_instrument' => ts('Payment Method'),
  
  and that does the trick. I can't see any other way to fix it. Can anyone else tell me a better way?
Comments.UserDisplayName: DenisH
Tags: <wordpress><batches><validation>
Title: Batch Data Entry payment_instrument is now required?
ThreadText: # Batch Data Entry payment_instrument is now required?
  
  (Asked by: username_0 on 2019-02-06)
  
  we've been using CiviCRM for several years and we've just recently version 4.7 to 5.8.2, but now we can't use the Batch Data Entry any more. We can create new batches, add entries and save them, but when I press Validate and Process the batch it just displays the batch again.
  I guessed that it might be a validation problem and eventually put a log statement to get any errors on form validation. In my test batch there are two entries and this is the error I get:
  Form Errors: Array
  (
    [field[1][payment_instrument]] => Payment Method is a required field.
    [field[2][payment_instrument]] => Payment Method is a required field.
  )
  
  Nothing is displayed on the screen because there isn't a Payment Method--or Payment Instrument--field in the form, so that explains what is going wrong, but not why.
  Looking at the DB for past batches, we've never had to specify the Payment Method before, I notice that there is a payment_instrument_id field on civicrm_batch, but it's optional and null for all our past batches.
  How can I make it optional so I don't need to add a field to the form?
  Thanks!
  
  **Tags:** wordpress, batches, validation
  
  > **Comments:**
  > **username_0**: So, I've found that if I go in to Administer -> Custom Data and Screens -> Profiles, then choose Reserved Profiles and add a Payment Method ID field to the fields for Contribution Bulk Entry, and then make sure I set the field value to 4 for example, then the batch is processed successfully. But this isn't much good for my non-techy administrators.  Is there at least a way to make this a drop down?  
  > **username_0**: I spoke too soon :-(  I've now got it working on my local test version and I can remove Payment Method ID field and it still processes the batches (I tried several).   But if I go to the live system and try the same steps there, it doesn't process the batch. No error message, just returns to the same batch entry page again.  I wonder if there's something cached and I accidentally cleared it on the test system? I've tried &directoryCleanup=3 but that didn't make any difference.  
  > **username_0**: I found a work around: In the file civicrm/civicrm/CRM/Batch/Form/Entry.php, in the static function formRule(), I commented out this line:  // 'payment_instrument' => ts('Payment Method'),  and that does the trick. I can't see any other way to fix it. Can anyone else tell me a better way?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-02-06. Score: 0
  
  We had one client inform us that they could not save Batch Data - everything we tried to replicate the issue failed. In the end we concluded that it was due to browser caching which the client was able to confirm by testing with a different browser.
  
  Refreshing the chrome caching (<https://support.google.com/accounts/answer/32050?co=GENIE.Platform%3DDesktop&hl=en>) sorted it for them.
  
  May not relate to your situation at all.
  
  > **Comments:**
  > **username_0**: Thanks for the suggestion, I'm pretty sure it's to do with the form not being valid though rather than a browser issue  
  
  ---
  
  