Answers.Body: <p>As it turns out, this was related to faulty entries in <code>civicrm_managed</code>. I deleted the entries and reinstalled the related extension (which was SearchKit in my case), the extensions now update correctly and no errors appear when modifying them.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-03-21T14:25:24.447Z
Answers.Text: I had the same problem. I have:
  - deleted all records in the `civicrm_managed` table
  - executed the API `cv api4 managed.reconcile {}`
  and now everything seems okay to me
Answers.UserDisplayName: masetto
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-16T23:15:45.697Z
Answers.LastActivityDate: 2022-12-16T23:15:45.697Z
Answers.UserDisplayName: lapmir
Body: <p>I have multiple issues with my extensions in CiviCRM version 5.53.0 using WordPress. Note that the database was migrated from a previous Drupal installation.</p>
  <p>Whenever I install, enable or disable an extension, I get the following stack trace:</p>
  <pre><code>0   CRM_Core_DAO::composeQuery('UPDATE `civicrm_…', Array, true)    /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php:1619
  1   CRM_Core_DAO::executeQuery('UPDATE `civicrm_…', Array)  /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/CustomOption.php:238
  2   CRM_Core_BAO_CustomOption::updateValue(868, 'table')    /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/OptionValue.php:145
  3   CRM_Core_BAO_OptionValue::add(Array)    /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/OptionValue.php:34
  4   CRM_Core_BAO_OptionValue::create(Array) /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/Civi/Api4/Generic/Traits/DAOActionTrait.php:170
  5   Civi\Api4\Generic\DAOUpdateAction-&gt;write(Array) /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/Civi/Api4/Generic/Traits/DAOActionTrait.php:141
  6   Civi\Api4\Generic\DAOUpdateAction-&gt;writeObjects(Array)  /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/Civi/Api4/Generic/DAOUpdateAction.php:31
  7   Civi\Api4\Generic\DAOUpdateAction-&gt;updateRecords(Array) /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/Civi/Api4/Generic/AbstractUpdateAction.php:93
  8   Civi\Api4\Generic\AbstractUpdateAction-&gt;_run(Object(Civi\Api4\Generic\Result))  /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/Civi/Api4/Provider/ActionObjectProvider.php:69
  9   Civi\Api4\Provider\ActionObjectProvider-&gt;invoke(Object(Civi\Api4\Generic\DAOUpdateAction))  /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php:149
  10  Civi\API\Kernel-&gt;runRequest(Object(Civi\Api4\Generic\DAOUpdateAction))  /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/Civi/Api4/Generic/AbstractAction.php:234
  11  Civi\Api4\Generic\AbstractAction-&gt;execute() /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/api/api.php:85
  12  civicrm_api4('OptionValue', 'update', Array)    /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/ManagedEntities.php:257
  13  CRM_Core_ManagedEntities-&gt;updateExistingEntity(Array)   /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/ManagedEntities.php:144
  14  CRM_Core_ManagedEntities-&gt;reconcileEntities(Array)  /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/ManagedEntities.php:112
  15  CRM_Core_ManagedEntities-&gt;reconcile()   /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:417
  16  CRM_Core_Invoke::rebuildMenuAndCaches(true) /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/CRM/Extension/Manager.php:425
  17  CRM_Extension_Manager-&gt;disable(Array)   /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/CRM/Admin/Form/Extensions.php:197
  18  CRM_Admin_Form_Extensions-&gt;postProcess()    /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php:573
  19  CRM_Core_Form-&gt;mainProcess()    /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/StateMachine.php:144
  20  CRM_Core_StateMachine-&gt;perform(Object(CRM_Admin_Form_Extensions), 'next', 'Next')   /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Next.php:43
  21  CRM_Core_QuickForm_Action_Next-&gt;perform(Object(CRM_Admin_Form_Extensions), 'next')  /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php:203
  22  HTML_QuickForm_Controller-&gt;handle(Object(CRM_Admin_Form_Extensions), 'next')    /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php:103
  23  HTML_QuickForm_Page-&gt;handle('next') /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php:355
  24  CRM_Core_Controller-&gt;run()  /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Page/Basic.php:334
  25  CRM_Core_Page_Basic-&gt;edit(64, null) /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Page/Basic.php:140
  26  CRM_Core_Page_Basic-&gt;run()  /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/CRM/Admin/Page/Extensions.php:105
  27  CRM_Admin_Page_Extensions-&gt;run(Array, null) /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:319
  28  CRM_Core_Invoke::runItem(Array) /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:69
  29  CRM_Core_Invoke::_invoke(Array) /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:36
  30  CRM_Core_Invoke::invoke(Array)  /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm.php:1199
  31  CiviCRM_For_WordPress-&gt;invoke('')   /home/WEBSITE/public_html/wp-includes/class-wp-hook.php:308
  32  WP_Hook-&gt;apply_filters('', Array)   /home/WEBSITE/public_html/wp-includes/class-wp-hook.php:332
  33  WP_Hook-&gt;do_action(Array)   /home/WEBSITE/public_html/wp-includes/plugin.php:517
  34  do_action('toplevel_page_Ci…')  /home/WEBSITE/public_html/wp-admin/admin.php:259
  35  {main}   
  </code></pre>
  <p>The error message below the stack trace is simply &quot;is not of type String&quot;. The extension is installed, activated or disabled correctly, but since I am having other issues with these extensions, I wanted to bring this up and see if there is an underlying issue.</p>
  
Tags: <upgrade>
Title: Installing, enabling and disabling extensions returns "is not of type String"
ThreadText: # Installing, enabling and disabling extensions returns "is not of type String"
  
  (Asked by: username_0 on 2022-12-11)
  
  I have multiple issues with my extensions in CiviCRM version 5.53.0 using WordPress. Note that the database was migrated from a previous Drupal installation.
  Whenever I install, enable or disable an extension, I get the following stack trace:
  0   CRM_Core_DAO::composeQuery('UPDATE `civicrm_…', Array, true)    /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php:1619
  1   CRM_Core_DAO::executeQuery('UPDATE `civicrm_…', Array)  /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/CustomOption.php:238
  2   CRM_Core_BAO_CustomOption::updateValue(868, 'table')    /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/OptionValue.php:145
  3   CRM_Core_BAO_OptionValue::add(Array)    /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/OptionValue.php:34
  4   CRM_Core_BAO_OptionValue::create(Array) /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/Civi/Api4/Generic/Traits/DAOActionTrait.php:170
  5   Civi\Api4\Generic\DAOUpdateAction->write(Array) /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/Civi/Api4/Generic/Traits/DAOActionTrait.php:141
  6   Civi\Api4\Generic\DAOUpdateAction->writeObjects(Array)  /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/Civi/Api4/Generic/DAOUpdateAction.php:31
  7   Civi\Api4\Generic\DAOUpdateAction->updateRecords(Array) /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/Civi/Api4/Generic/AbstractUpdateAction.php:93
  8   Civi\Api4\Generic\AbstractUpdateAction->_run(Object(Civi\Api4\Generic\Result))  /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/Civi/Api4/Provider/ActionObjectProvider.php:69
  9   Civi\Api4\Provider\ActionObjectProvider->invoke(Object(Civi\Api4\Generic\DAOUpdateAction))  /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php:149
  10  Civi\API\Kernel->runRequest(Object(Civi\Api4\Generic\DAOUpdateAction))  /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/Civi/Api4/Generic/AbstractAction.php:234
  11  Civi\Api4\Generic\AbstractAction->execute() /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/api/api.php:85
  12  civicrm_api4('OptionValue', 'update', Array)    /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/ManagedEntities.php:257
  13  CRM_Core_ManagedEntities->updateExistingEntity(Array)   /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/ManagedEntities.php:144
  14  CRM_Core_ManagedEntities->reconcileEntities(Array)  /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/ManagedEntities.php:112
  15  CRM_Core_ManagedEntities->reconcile()   /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:417
  16  CRM_Core_Invoke::rebuildMenuAndCaches(true) /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/CRM/Extension/Manager.php:425
  17  CRM_Extension_Manager->disable(Array)   /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/CRM/Admin/Form/Extensions.php:197
  18  CRM_Admin_Form_Extensions->postProcess()    /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php:573
  19  CRM_Core_Form->mainProcess()    /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/StateMachine.php:144
  20  CRM_Core_StateMachine->perform(Object(CRM_Admin_Form_Extensions), 'next', 'Next')   /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Next.php:43
  21  CRM_Core_QuickForm_Action_Next->perform(Object(CRM_Admin_Form_Extensions), 'next')  /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php:203
  22  HTML_QuickForm_Controller->handle(Object(CRM_Admin_Form_Extensions), 'next')    /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php:103
  23  HTML_QuickForm_Page->handle('next') /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php:355
  24  CRM_Core_Controller->run()  /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Page/Basic.php:334
  25  CRM_Core_Page_Basic->edit(64, null) /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Page/Basic.php:140
  26  CRM_Core_Page_Basic->run()  /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/CRM/Admin/Page/Extensions.php:105
  27  CRM_Admin_Page_Extensions->run(Array, null) /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:319
  28  CRM_Core_Invoke::runItem(Array) /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:69
  29  CRM_Core_Invoke::_invoke(Array) /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:36
  30  CRM_Core_Invoke::invoke(Array)  /home/WEBSITE/public_html/wp-content/plugins/civicrm/civicrm.php:1199
  31  CiviCRM_For_WordPress->invoke('')   /home/WEBSITE/public_html/wp-includes/class-wp-hook.php:308
  32  WP_Hook->apply_filters('', Array)   /home/WEBSITE/public_html/wp-includes/class-wp-hook.php:332
  33  WP_Hook->do_action(Array)   /home/WEBSITE/public_html/wp-includes/plugin.php:517
  34  do_action('toplevel_page_Ci…')  /home/WEBSITE/public_html/wp-admin/admin.php:259
  35  {main}   
  
  The error message below the stack trace is simply "is not of type String". The extension is installed, activated or disabled correctly, but since I am having other issues with these extensions, I wanted to bring this up and see if there is an underlying issue.
  
  **Tags:** upgrade
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2022-12-16. Score: 3
  
  As it turns out, this was related to faulty entries in `civicrm_managed`. I deleted the entries and reinstalled the related extension (which was SearchKit in my case), the extensions now update correctly and no errors appear when modifying them.
  
  > **Comments:**
  > **username_1**: I had the same problem. I have: - deleted all records in the `civicrm_managed` table - executed the API `cv api4 managed.reconcile {}` and now everything seems okay to me  
  
  ---
  
  