0

wordpress 4.9 civi5.22 civirules 2.1

Add an action "add activity to contact" Then try to add condition (ie activity type) produces error ""CiviCRM_API3_Exception: "Expected one OptionValue but found 2" no choice but to return to home page.

A popup then confirms that activity parameter is saved (and it is added to civirule_rule_action table)

The rule does actually work but can no longer be accessed - any attempt to edit results in same error message. Also can't be deleted.

backtrace and full error as follows:

CiviCRM_API3_Exception: "Expected one OptionValue but found 2"

#0 /home/domain/public_html/wp-content/uploads/civicrm/ext/org.civicoop.civirules/CRM/CivirulesActions/Activity/Add.php(103): civicrm_api3("OptionValue", "getvalue", (Array:3))
#1 /home/domain/public_html/wp-content/uploads/civicrm/ext/org.civicoop.civirules/CRM/Civirules/Form/Rule.php(387): CRM_CivirulesActions_Activity_Add->userFriendlyConditionParams()
#2 /home/domain/public_html/wp-content/uploads/civicrm/ext/org.civicoop.civirules/CRM/Civirules/Form/Rule.php(282): CRM_Civirules_Form_Rule->getRuleActions()
#3 /home/domain/public_html/wp-content/uploads/civicrm/ext/org.civicoop.civirules/CRM/Civirules/Form/Rule.php(258): CRM_Civirules_Form_Rule->createUpdateFormElements()
#4 /home/domain/public_html/wp-content/uploads/civicrm/ext/org.civicoop.civirules/CRM/Civirules/Form/Rule.php(34): CRM_Civirules_Form_Rule->createFormElements()
#5 /home/domain/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(570): CRM_Civirules_Form_Rule->buildQuickForm()
#6 /home/domain/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Display.php(92): CRM_Core_Form->buildForm()
#7 /home/domain/public_html/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Display->perform(Object(CRM_Civirules_Form_Rule), "display")
#8 /home/domain/public_html/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Civirules_Form_Rule), "display")
#9 /home/domain/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(351): HTML_QuickForm_Page->handle("display")
#10 /home/domain/public_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/Wrapper.php(113): CRM_Core_Controller->run()
#11 /home/domain/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(283): CRM_Utils_Wrapper->run("CRM_Civirules_Form_Rule", "Rule", NULL)
#12 /home/domain/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:13))
#13 /home/domain/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:4))
#14 /home/domain/public_html/wp-content/plugins/civicrm/civicrm.php(1246): CRM_Core_Invoke::invoke((Array:4))
#15 [internal function](): CiviCRM_For_WordPress->invoke("")
#16 /home/domain/public_html/wp-includes/class-wp-hook.php(286): call_user_func_array((Array:2), (Array:1))
#17 /home/domain/public_html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters("", (Array:1))
#18 /home/domain/public_html/wp-includes/plugin.php(453): WP_Hook->do_action((Array:1))
#19 /home/domain/public_html/wp-admin/admin.php(224): do_action("toplevel_page_CiviCRM")
#20 {main}
1

I have recently (with the latest CiviRules version) succesfully used this rule in combination with the same condition. My first step would be to check your activity types and make sure there is not a double one in there (with the same name rather than label)

| improve this answer | |
  • Hi Erik there are no duplicates names in activity types. I've tried with activity types I created as well as built in civi types eg meeting - always with same error message. I upgraded to 2.1 first. Once I hit this error I also tried manual install (having deleted all civirules tables first. Could it be a wordpress issue or civi 5.22? And thanks for such a brilliant extension! – LesleyJill Jun 28 '18 at 11:05
  • Glad to hear you like it :-) It could be a 5.22 issue, the error seems to suggest a CiviCRM issue rather than a WP issue. The error says that it found 2 activity types where it expected only 1. Is there any way tyou could send me a dump of your civicrm_option_value table? (erik dot hommel at civicoop dot org) – ErikH - CiviCooP Jun 29 '18 at 6:37
  • sure thing - I've just sent as csv and sql. – LesleyJill Jun 29 '18 at 13:44
  • You're on the right track for sure. I just successfully added activity parameter in fresh 5.22 install. But once I stuck my civicrm_option_value table in there I reproduced the error. I can't see any duplicates in activity option group (id-2), but there are heaps through out the table. Hopefully you can spot something. Maybe there's just too many? And again many thanks – LesleyJill Jun 29 '18 at 13:53
  • Got your list, will do a quick check.... – ErikH - CiviCooP Jul 2 '18 at 5:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.