Answers.Body: <p>The error is happening in the deleteMembership function, and the error says: you're trying to execute the method "delete" on an empty (i.e. null) object. The object that is "null" is expected to be a membership object. </p>
  
  <p>That suggests that the code might have been running two copies in parallel - e.g. perhaps you clicked twice on the delete button (would not be difficult, since you're trying to do a mass delete on a lot of memberships).</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-26T16:39:59.483Z
Answers.Text: Not sure how to test this hypothesis, but it's entirely likely.
Answers.UserDisplayName: LyonsDigital
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-26T21:06:09.130Z
Answers.Text: Try repeating your mass membership delete?
Answers.UserDisplayName: Alan Dixon
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-26T16:32:14.263Z
Answers.LastActivityDate: 2020-02-26T16:32:14.263Z
Answers.UserDisplayName: Alan Dixon
Body: <p>I am running CiviCRM 5.20.1 with WordPress 5.3.2. We have decided to redefine a membership type (actually an annual recertification) and I needed to delete the current members before I upload a sanitized version of the data (error free and more complete data).</p>
  
  <p>I originally posted this question believing the memberships had not be deleted. They were. It would still be nice to fix this appearance of a problem.</p>
  
  <p>Anyway, I am getting the following error when I delete the current members:</p>
  
  <pre><code> Notice: Undefined offset: 1260 in
   **/home/websiteweb/public_html/wp-content/plugins/civicrm/civicrm/CRM/Member/BAO/Membership.php** on line **632**
  
   **Fatal error:** Uncaught Error: Call to a member function delete() on
   null in /home/websiteweb/public_html/wp-content/plugins/civicrm/civicrm/CRM/Member/BAO/Membership.php:664
  
  Stack trace: 
  #0 /home/websiteweb/public_html/wp-content/plugins/civicrm/civicrm/CRM/Member/BAO/Membership.php(613): CRM_Member_BAO_Membership::deleteMembership('1260', false) 
  #1 /home/websiteweb/public_html/wp-content/plugins/civicrm/civicrm/CRM/Member/Form/Task/Delete.php(83): CRM_Member_BAO_Membership::del('1260') 
  #2 /home/websiteweb/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(495): CRM_Member_Form_Task_Delete-&gt;postProcess() 
  #3 /home/websiteweb/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Done.php(75): CRM_Core_Form-&gt;mainProcess() 
  #4 /home/websiteweb/public_html/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Done-&gt;perform(Object(CRM_Member_Form_Task_Delete), 'done') 
  #5 /home/websiteweb/public_html/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Pa 
  
  in **/home/websiteweb/public_html/wp-content/plugins/civicrm/civicrm/CRM/Member/BAO/Membership.php** on line **664** There has been a critical error on your website. Please check your site admin email inbox for instructions. 
  
  
  
   Learn more about debugging in WordPress.
  </code></pre>
  
  <p>I've looked at the lines in question, but I don't see (or understand) the problem. Any suggestions to move this project forward?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-02-24T19:30:39.033Z
Comments.Text: Is there an associated error in your Civicrm ConfigAndLog Log? It sometimes will have more information. https://civicrm.org/extensions/civicrm-log-viewer
Comments.UserDisplayName: Luke Stewart
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-02-24T19:53:37.550Z
Comments.Text: @LyonsDigital This error message is incomplete.  I reformatted it to make it clear that step 5 is missing data, as is the line below.  Could you please check your log and fill in missing parts, especially extra steps?
Comments.UserDisplayName: Jon G - Megaphone Tech
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-02-24T19:55:02.963Z
Comments.Text: Also, confirm that the membership with ID 1260 still exists?
Comments.UserDisplayName: Jon G - Megaphone Tech
Tags: <wordpress><civimember>
Title: Error Deleting memberships
ThreadText: # Error Deleting memberships
  
  (Asked by: username_0 on 2020-02-24)
  
  I am running CiviCRM 5.20.1 with WordPress 5.3.2. We have decided to redefine a membership type (actually an annual recertification) and I needed to delete the current members before I upload a sanitized version of the data (error free and more complete data).
  I originally posted this question believing the memberships had not be deleted. They were. It would still be nice to fix this appearance of a problem.
  Anyway, I am getting the following error when I delete the current members:
   Notice: Undefined offset: 1260 in
   **/home/websiteweb/public_html/wp-content/plugins/civicrm/civicrm/CRM/Member/BAO/Membership.php** on line **632**
  
   **Fatal error:** Uncaught Error: Call to a member function delete() on
   null in /home/websiteweb/public_html/wp-content/plugins/civicrm/civicrm/CRM/Member/BAO/Membership.php:664
  
  Stack trace: 
  #0 /home/websiteweb/public_html/wp-content/plugins/civicrm/civicrm/CRM/Member/BAO/Membership.php(613): CRM_Member_BAO_Membership::deleteMembership('1260', false) 
  #1 /home/websiteweb/public_html/wp-content/plugins/civicrm/civicrm/CRM/Member/Form/Task/Delete.php(83): CRM_Member_BAO_Membership::del('1260') 
  #2 /home/websiteweb/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(495): CRM_Member_Form_Task_Delete->postProcess() 
  #3 /home/websiteweb/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Done.php(75): CRM_Core_Form->mainProcess() 
  #4 /home/websiteweb/public_html/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Done->perform(Object(CRM_Member_Form_Task_Delete), 'done') 
  #5 /home/websiteweb/public_html/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Pa 
  
  in **/home/websiteweb/public_html/wp-content/plugins/civicrm/civicrm/CRM/Member/BAO/Membership.php** on line **664** There has been a critical error on your website. Please check your site admin email inbox for instructions. 
  
  
  
   Learn more about debugging in WordPress.
  
  I've looked at the lines in question, but I don't see (or understand) the problem. Any suggestions to move this project forward?
  
  **Tags:** wordpress, civimember
  
  > **Comments:**
  > **username_1**: Is there an associated error in your Civicrm ConfigAndLog Log? It sometimes will have more information. https://civicrm.org/extensions/civicrm-log-viewer  
  > **username_2**: @username_0 This error message is incomplete.  I reformatted it to make it clear that step 5 is missing data, as is the line below.  Could you please check your log and fill in missing parts, especially extra steps?  
  > **username_2**: Also, confirm that the membership with ID 1260 still exists?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2020-02-26. Score: 1
  
  The error is happening in the deleteMembership function, and the error says: you're trying to execute the method "delete" on an empty (i.e. null) object. The object that is "null" is expected to be a membership object.
  
  That suggests that the code might have been running two copies in parallel - e.g. perhaps you clicked twice on the delete button (would not be difficult, since you're trying to do a mass delete on a lot of memberships).
  
  > **Comments:**
  > **username_0**: Not sure how to test this hypothesis, but it's entirely likely.  
  > **username_3**: Try repeating your mass membership delete?  
  
  ---
  
  