Body: <p>I'm getting this error, when I tried to update an existing membership. I checked the logs and noticed that <code>$formValues = $this-&gt;_params;</code> doesn't contain the <code>financial_type_id</code> key used by the method <code>setPriceSetParameters()</code></p>
  <p>Just for context: I'm using a CiviCRM database originally created on a Drupal site. On WordPress, the CiviCRM version is 5.64.3 but the Drupal site was using version 5.63.3.</p>
  <blockquote>
  <p>ErrorException: &quot;Undefined index: financial_type_id&quot;</p>
  <p>#0 /app/vendor/roots/acorn/src/Roots/Acorn/Bootstrap/HandleExceptions.php(54):
  Illuminate\Foundation\Bootstrap\HandleExceptions-&gt;handleError(8,
  &quot;Undefined index: financial_type_id&quot;,
  &quot;/app/public_html/wp-content/plugins/civicrm/civicrm/CRM/Member/Form.php&quot;,
  488, (Array:2))
  #1 /app/public_html/wp-content/plugins/civicrm/civicrm/CRM/Member/Form.php(488):
  Roots\Acorn\Bootstrap\HandleExceptions-&gt;handleError(8, &quot;Undefined
  index: financial_type_id&quot;,
  &quot;/app/public_html/wp-content/plugins/civicrm/civicrm/CRM/Member/Form.php&quot;,
  488, (Array:2))
  #2 /app/public_html/wp-content/plugins/civicrm/civicrm/CRM/Member/Form/Membership.php(1010): CRM_Member_Form-&gt;setPriceSetParameters((Array:22))
  #3 /app/public_html/wp-content/plugins/civicrm/civicrm/CRM/Member/Form/Membership.php(879):
  CRM_Member_Form_Membership-&gt;submit()
  #4 /app/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(617):
  CRM_Member_Form_Membership-&gt;postProcess()
  #5 /app/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Upload.php(153):
  CRM_Core_Form-&gt;mainProcess()
  #6 /app/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Upload.php(120):
  CRM_Core_QuickForm_Action_Upload-&gt;realPerform(Object(CRM_Member_Form_Membership),
  &quot;upload&quot;)
  #7 /app/public_html/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203):
  CRM_Core_QuickForm_Action_Upload-&gt;perform(Object(CRM_Member_Form_Membership),
  &quot;upload&quot;)
  #8 /app/public_html/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php(103):
  HTML_QuickForm_Controller-&gt;handle(Object(CRM_Member_Form_Membership),
  &quot;upload&quot;)
  #9 /app/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(355): HTML_QuickForm_Page-&gt;handle(&quot;upload&quot;)
  #10 /app/public_html/wp-content/plugins/civicrm/civicrm/CRM/Member/Page/Tab.php(324): CRM_Core_Controller-&gt;run()
  #11 /app/public_html/wp-content/plugins/civicrm/civicrm/CRM/Member/Page/Tab.php(395): CRM_Member_Page_Tab-&gt;edit()
  #12 /app/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(319):
  CRM_Member_Page_Tab-&gt;run((Array:4), NULL)
  #13 /app/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(69):
  CRM_Core_Invoke::runItem((Array:18))
  #14 /app/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(36):
  CRM_Core_Invoke::_invoke((Array:4))
  #15 /app/public_html/wp-content/plugins/civicrm/civicrm.php(1199): CRM_Core_Invoke::invoke((Array:4))
  #16 /app/public_html/wp/wp-includes/class-wp-hook.php(310): CiviCRM_For_WordPress-&gt;invoke(&quot;&quot;)
  #17 /app/public_html/wp/wp-includes/class-wp-hook.php(334): WP_Hook-&gt;apply_filters(&quot;&quot;, (Array:1))
  #18 /app/public_html/wp/wp-includes/plugin.php(517): WP_Hook-&gt;do_action((Array:1))
  #19 /app/public_html/wp/wp-admin/admin.php(259): do_action(&quot;toplevel_page_CiviCRM&quot;)
  #20 {main}  Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or
  service provider with more details about what action you were
  performing when this occurred. Undefined index: financial_type_id</p>
  </blockquote>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-09-13T14:18:47.843Z
Comments.Text: Can you add the full error to your question, as well as which version of CiviCRM you are using?
Comments.UserDisplayName: Lars SG
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-09-13T14:23:14.940Z
Comments.Text: I updated the question @LarsSG
Comments.UserDisplayName: marcelo2605
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-09-13T14:34:31.747Z
Comments.Text: Paid membership or free?
Comments.UserDisplayName: Lars SG
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-09-13T14:37:28.433Z
Comments.Text: @LarsSG it's a paid membership.
Comments.UserDisplayName: marcelo2605
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-09-13T16:02:57.747Z
Comments.Text: I don't think it's even possible for there to not be a financial_type_id, but just in case, you've verified that there is a financial_type_id for the membership type?
Comments.UserDisplayName: Lars SG
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-09-13T16:50:20.373Z
Comments.Text: @LarsSG The membership has two `membership_type_id`. One of them exists and has a `financial_type_id`. The other does not exist in the database. Do you think this can be the problem? The strange is on Drupal site, I can update the same membership without any error.
Comments.UserDisplayName: marcelo2605
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-09-13T16:53:01.817Z
Comments.Text: @LarsSG my mistake: the first ID inside `membership_type_id` is the organization contact ID.
Comments.UserDisplayName: marcelo2605
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-09-13T17:59:30.150Z
Comments.Text: Sounds like maybe something went wrong in the transfer you did, hard to say anything about it here.
Comments.UserDisplayName: Lars SG
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-09-17T19:08:55.047Z
Comments.Text: It's not clear from your question if you've done this or not, but when you transfer the CiviCRM database from Drupal to WordPress you should make sure that it is the same version of CiviCRM. Probably easiest to upgrade the Drupal site to the latest version of CiviCRM before you transfer to WordPress. See https://docs.civicrm.org/sysadmin/en/latest/misc/switching-cms/drupal-to-wordpress/
Comments.UserDisplayName: William Mortada
Tags: <wordpress><civimember>
Title: Undefined index: financial_type_id error when update a membership
ThreadText: # Undefined index: financial_type_id error when update a membership
  
  (Asked by: username_0 on 2023-09-13)
  
  I'm getting this error, when I tried to update an existing membership. I checked the logs and noticed that `$formValues = $this->_params;` doesn't contain the `financial_type_id` key used by the method `setPriceSetParameters()`
  
  Just for context: I'm using a CiviCRM database originally created on a Drupal site. On WordPress, the CiviCRM version is 5.64.3 but the Drupal site was using version 5.63.3.
  
  > ErrorException: "Undefined index: financial\_type\_id"
  >
  > #0 /app/vendor/roots/acorn/src/Roots/Acorn/Bootstrap/HandleExceptions.php(54):
  > Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8,
  > "Undefined index: financial\_type\_id",
  > "/app/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Member/Form.php",
  > 488, (Array:2))
  > #1 /app/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Member/Form.php(488):
  > Roots\Acorn\Bootstrap\HandleExceptions->handleError(8, "Undefined
  > index: financial\_type\_id",
  > "/app/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Member/Form.php",
  > 488, (Array:2))
  > #2 /app/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Member/Form/Membership.php(1010): CRM\_Member\_Form->setPriceSetParameters((Array:22))
  > #3 /app/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Member/Form/Membership.php(879):
  > CRM\_Member\_Form\_Membership->submit()
  > #4 /app/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(617):
  > CRM\_Member\_Form\_Membership->postProcess()
  > #5 /app/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Upload.php(153):
  > CRM\_Core\_Form->mainProcess()
  > #6 /app/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Upload.php(120):
  > CRM\_Core\_QuickForm\_Action\_Upload->realPerform(Object(CRM\_Member\_Form\_Membership),
  > "upload")
  > #7 /app/public\_html/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203):
  > CRM\_Core\_QuickForm\_Action\_Upload->perform(Object(CRM\_Member\_Form\_Membership),
  > "upload")
  > #8 /app/public\_html/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php(103):
  > HTML\_QuickForm\_Controller->handle(Object(CRM\_Member\_Form\_Membership),
  > "upload")
  > #9 /app/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(355): HTML\_QuickForm\_Page->handle("upload")
  > #10 /app/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Member/Page/Tab.php(324): CRM\_Core\_Controller->run()
  > #11 /app/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Member/Page/Tab.php(395): CRM\_Member\_Page\_Tab->edit()
  > #12 /app/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(319):
  > CRM\_Member\_Page\_Tab->run((Array:4), NULL)
  > #13 /app/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(69):
  > CRM\_Core\_Invoke::runItem((Array:18))
  > #14 /app/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(36):
  > CRM\_Core\_Invoke::\_invoke((Array:4))
  > #15 /app/public\_html/wp-content/plugins/civicrm/civicrm.php(1199): CRM\_Core\_Invoke::invoke((Array:4))
  > #16 /app/public\_html/wp/wp-includes/class-wp-hook.php(310): CiviCRM\_For\_WordPress->invoke("")
  > #17 /app/public\_html/wp/wp-includes/class-wp-hook.php(334): WP\_Hook->apply\_filters("", (Array:1))
  > #18 /app/public\_html/wp/wp-includes/plugin.php(517): WP\_Hook->do\_action((Array:1))
  > #19 /app/public\_html/wp/wp-admin/admin.php(259): do\_action("toplevel\_page\_CiviCRM")
  > #20 {main} Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or
  > service provider with more details about what action you were
  > performing when this occurred. Undefined index: financial\_type\_id
  
  **Tags:** wordpress, civimember
  
  > **Comments:**
  > **username_1**: Can you add the full error to your question, as well as which version of CiviCRM you are using?  
  > **username_0**: I updated the question @username_1  
  > **username_1**: Paid membership or free?  
  > **username_0**: @username_1 it's a paid membership.  
  > **username_1**: I don't think it's even possible for there to not be a financial_type_id, but just in case, you've verified that there is a financial_type_id for the membership type?  
  > **username_0**: @username_1 The membership has two `membership_type_id`. One of them exists and has a `financial_type_id`. The other does not exist in the database. Do you think this can be the problem? The strange is on Drupal site, I can update the same membership without any error.  
  > **username_0**: @username_1 my mistake: the first ID inside `membership_type_id` is the organization contact ID.  
  > **username_1**: Sounds like maybe something went wrong in the transfer you did, hard to say anything about it here.  
  > **username_2**: It's not clear from your question if you've done this or not, but when you transfer the CiviCRM database from Drupal to WordPress you should make sure that it is the same version of CiviCRM. Probably easiest to upgrade the Drupal site to the latest version of CiviCRM before you transfer to WordPress. See https://docs.civicrm.org/sysadmin/en/latest/misc/switching-cms/drupal-to-wordpress/  
  
  ---
  
  ## 0 answers
  
  