action-provider merge requestshttps://lab.civicrm.org/extensions/action-provider/-/merge_requests2023-03-10T12:19:06Zhttps://lab.civicrm.org/extensions/action-provider/-/merge_requests/79New action: Create or update grant2023-03-10T12:19:06ZJonGoldNew action: Create or update grantThis allows creating and updating grants in CiviGrant.
I programmatically grab the fields for the SpecificationBag via API4 metadata, similar to how it's done right now for custom fields. I realize that this is a naive implementation, ...This allows creating and updating grants in CiviGrant.
I programmatically grab the fields for the SpecificationBag via API4 metadata, similar to how it's done right now for custom fields. I realize that this is a naive implementation, because I don't have to specify configuration vs. parameter fields, etc. - but I think it would be great if, in time, this code was generalized to power all the "create/update entity" actions.https://lab.civicrm.org/extensions/action-provider/-/merge_requests/100Sets the CiviCRM default Priceset for the line item, if not already set2023-03-07T08:58:01Zjustinfreeman (Agileware)Sets the CiviCRM default Priceset for the line item, if not already setWe found that the Invoice PDF could not be generated when using the Action Provider, Create Line Item action without also setting a Priceset ID for each Line Item.
This change sets the CiviCRM default Priceset for the line item which is...We found that the Invoice PDF could not be generated when using the Action Provider, Create Line Item action without also setting a Priceset ID for each Line Item.
This change sets the CiviCRM default Priceset for the line item which is ID 1, if not already set for each line item.
Agileware Ref: CIVICRM-2105https://lab.civicrm.org/extensions/action-provider/-/merge_requests/99Fix regression - actions Contact: Get By Email* return email_id as contact_id2023-02-02T03:13:57ZSandor SemseyFix regression - actions Contact: Get By Email* return email_id as contact_idAfter !95 if an existing email address is given as parameter, it will return the email address's ID (`email_id`) as `contact_id` so a totally different contact is returned.
Affected actions:
- Contact: Get By Email or Create By Email an...After !95 if an existing email address is given as parameter, it will return the email address's ID (`email_id`) as `contact_id` so a totally different contact is returned.
Affected actions:
- Contact: Get By Email or Create By Email and Names
- Contact: Get or create contact by e-mail
- Contact: Get or Create By Email and Nameshttps://lab.civicrm.org/extensions/action-provider/-/merge_requests/95Fix for issues/27 - Replace the create contact when exception is raised. Inst...2023-01-24T21:51:19Zjustinfreeman (Agileware)Fix for issues/27 - Replace the create contact when exception is raised. Instead only create contact is no matching email foundFix for issues/27 - Replace the create contact when exception is raised. Instead only create contact is no matching email foundFix for issues/27 - Replace the create contact when exception is raised. Instead only create contact is no matching email foundhttps://lab.civicrm.org/extensions/action-provider/-/merge_requests/98add help text for format individual name, parse raw amount and parse raw date2023-01-20T11:35:14ZErikHommeladd help text for format individual name, parse raw amount and parse raw dateadd help text to format individual name, parse raw date and parse raw amountadd help text to format individual name, parse raw date and parse raw amountErikHommelErikHommelhttps://lab.civicrm.org/extensions/action-provider/-/merge_requests/97fix format individual name with test results aivl and add + as allowed char t...2023-01-18T15:52:25ZErikHommelfix format individual name with test results aivl and add + as allowed char to phone formatErikHommelErikHommelhttps://lab.civicrm.org/extensions/action-provider/-/merge_requests/96version 1.112 fixes #32 and #33 (add format individual name and format phone ...2023-01-10T16:11:56ZErikHommelversion 1.112 fixes #32 and #33 (add format individual name and format phone into numbersErikHommelErikHommelhttps://lab.civicrm.org/extensions/action-provider/-/merge_requests/94Changes the Action: Contact: Get By Email* to search any email address instea...2022-12-13T07:29:55Zjustinfreeman (Agileware)Changes the Action: Contact: Get By Email* to search any email address instead of just primary email and fixes issue causing new duplicate contacts to be created if the contact being searched for returns more than 1 resultChanges the Action: Contact: Get By Email* to search any email address instead of just primary email, relates to https://lab.civicrm.org/extensions/action-provider/-/issues/27
And fixes issue causing new duplicate contacts to be created...Changes the Action: Contact: Get By Email* to search any email address instead of just primary email, relates to https://lab.civicrm.org/extensions/action-provider/-/issues/27
And fixes issue causing new duplicate contacts to be created if the contact being searched for returns more than 1 result.
This code incorrectly assumes that there are no duplicate contacts in the CRM. **D'oh!**
When the action executes, if there is more than 1 contact is returned then an error is raised.
```
{
"count": 2,
"is_error": 1,
"error_message": "Expected one Contact but found 2"
}
```
And in response to the error, a new contact is created, a **duplicate contact**.
```
protected function doAction(ParameterBagInterface $parameters, ParameterBagInterface $output) {
$contactType = ContactActionUtils::getContactType($this->configuration->getParameter('contact_type'));
try {
$params['email'] = $parameters->getParameter('email');
$params['contact_type'] = $contactType['contact_type']['name'];
if ($contactType['contact_sub_type']) {
$params['contact_sub_type'] = $contactType['contact_sub_type']['name'];
}
$params['return'] = 'id';
$contactId = civicrm_api3('Contact', 'getvalue', $params);
} catch (\Exception $e) {
$createParams['email'] = $parameters->getParameter('email');
$createParams['first_name'] = $parameters->getParameter('first_name');
$createParams['last_name'] = $parameters->getParameter('last_name');
$createParams['contact_type'] = $contactType['contact_type']['name'];
if ($contactType['contact_sub_type']) {
$createParams['contact_sub_type'] = $contactType['contact_sub_type']['name'];
}
$result = civicrm_api3('Contact', 'create', $createParams);
$contactId = $result['id'];
}
$output->setParameter('contact_id', $contactId);
}
```
What should happen is that the results should be limited to 1 contact and the oldest (lowest) contact ID used. That way, the oldest contact is always updated if there are duplicates and no new duplicate contacts are created.
This PR includes fixes for the other contact find/create actions which had the same issue.
Also standardised variable names for params and contact id whilst reviewing these actions, minor code clean-up. Makes it easier to find bugs if the code looks the same.
Agileware Ref: CIVICRM-2077 CIVICRM-2078https://lab.civicrm.org/extensions/action-provider/-/merge_requests/93Update info.xml2022-12-12T08:07:20Zlevi.kUpdate info.xmlfix type
Change compatibility 5.20 to 5.50
note 5.2 was already mentioned earlierfix type
Change compatibility 5.20 to 5.50
note 5.2 was already mentioned earlierhttps://lab.civicrm.org/extensions/action-provider/-/merge_requests/92PHP 8.1 compatibility - set return types on iterator methods2022-11-29T07:33:28ZJonGoldPHP 8.1 compatibility - set return types on iterator methodsUnder PHP 8.1 we receive deprecation notices like this:
```
Return type of Civi\FormProcessor\Config\SpecificationBag::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWil...Under PHP 8.1 we receive deprecation notices like this:
```
Return type of Civi\FormProcessor\Config\SpecificationBag::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily
suppress the notice in /home/jon/local/mysite/web/sites/all/civicrm/extensions/form_processor/Civi/FormProcessor/Config/SpecificationBag.php on line 99
```
This fixes those.https://lab.civicrm.org/extensions/action-provider/-/merge_requests/90Custom field using option group returns incorrect values when option values a...2022-11-21T13:03:05Zjustinfreeman (Agileware)Custom field using option group returns incorrect values when option values are non-numericCustom field using option group returns incorrect values when option values are non-numeric.
See org.civicoop.action-provider/Civi/ActionProvider/Action/AbstractGetSingleAction.php
This function returns 0,1,2 for the field when non-num...Custom field using option group returns incorrect values when option values are non-numeric.
See org.civicoop.action-provider/Civi/ActionProvider/Action/AbstractGetSingleAction.php
This function returns 0,1,2 for the field when non-numeric values have been saved as multiple options. For example when a option group has both labels and values like: Option X, Option Y, Option Z
```
protected function convertCustomFieldWithMultipleValues($value) {
foreach($value as $k=>$v) {
if ($k == 0 && $v >= 1) {
return $value;
}
}
return array_keys($value);
}
```
With a small change as shown below, this function then returns the correct values: Option X, Option Y, Option Z for the field.
```
protected function convertCustomFieldWithMultipleValues($value) {
return $value;
}
```
I am not sure why this function was required, perhaps it is/was required to workaround a different issue or CiviCRM API bug.
# Option group - note that Option X, Option Y, Option Z are both the label and the value. Other options have numeric values
![image](/uploads/1195a4e85766e8a72156e2efcbc555f3/image.png)
# Test Activity record with custom field, option values selected
![image](/uploads/75aeaf5af6176475d803457a911d630d/image.png)
# Before this patch the Form processor loads the correct values from the Activity record, Field A but the _incorrect values_ for Field B - eek!
![image](/uploads/cdecd506382a8ea1a398bf2f6cb77adc/image.png)
# With this patch the Form processor now loads the **correct values** from the Activity record, Field A and Field B
![image](/uploads/e59ad07140458b68566520a213be4619/image.png)
Agileware Ref: CIVICRM-2067https://lab.civicrm.org/extensions/action-provider/-/merge_requests/89Fix spelling should be "overridden" and not "overriden".2022-11-04T08:57:46Zjustinfreeman (Agileware)Fix spelling should be "overridden" and not "overriden".Fix spelling should be "overridden" and not "overriden".Fix spelling should be "overridden" and not "overriden".https://lab.civicrm.org/extensions/action-provider/-/merge_requests/88Activity: Create/Update does not expose Duration and Location fields2022-11-04T03:18:39Zjustinfreeman (Agileware)Activity: Create/Update does not expose Duration and Location fieldsActivity: Create/Update does not expose Duration and Location fields
Agileware Ref: CIVICRM-2063Activity: Create/Update does not expose Duration and Location fields
Agileware Ref: CIVICRM-2063https://lab.civicrm.org/extensions/action-provider/-/merge_requests/87PHP 8.1 compatibility - jsonSerialize must have a return type2022-10-31T14:27:12ZJonGoldPHP 8.1 compatibility - jsonSerialize must have a return typeAs it says in the title.As it says in the title.https://lab.civicrm.org/extensions/action-provider/-/merge_requests/85Cleanup ang.php file2022-10-27T11:55:11ZcolemanwCleanup ang.php filehttps://lab.civicrm.org/extensions/action-provider/-/merge_requests/86Add "CiviCase:Get Role Group" and "CiviCase: Get Role Group"2022-10-17T18:16:21ZkainukAdd "CiviCase:Get Role Group" and "CiviCase: Get Role Group"Added action CiviCase: Role Group Sync
Added action CiviCase: Get Role GroupAdded action CiviCase: Role Group Sync
Added action CiviCase: Get Role Grouphttps://lab.civicrm.org/extensions/action-provider/-/merge_requests/84CiviCase Create and CiviCase Update actions provides Case Subject as an input...2022-07-25T07:29:49Zjustinfreeman (Agileware)CiviCase Create and CiviCase Update actions provides Case Subject as an input field, but should be provided as a parameter option fieldCiviCase Create and CiviCase Update actions provides Case Subject as an input field, but should be provided as a parameter option field so that the Case Subject can be set by an Input Field in the Form Processor.
This is required when t...CiviCase Create and CiviCase Update actions provides Case Subject as an input field, but should be provided as a parameter option field so that the Case Subject can be set by an Input Field in the Form Processor.
This is required when the Case Subject needs to be set dynamically based on form input.
Changed the "Subject" configuration to "Default Subject" and left as a required field in the **Configuration** to ensure that the Case can still be created if no option has been selected for the Subject **parameter**.
Agileware Ref: CIVICRM-2016
**CiviCase Create - with change applied**
![image](/uploads/1a9f2d2d79961314d3cf7519e54cc328/image.png)
**CiviCase Update - with change applied**
![image](/uploads/ea20b27f57660b0c6e9c7515b87c5d59/image.png)https://lab.civicrm.org/extensions/action-provider/-/merge_requests/83Added Condition: Contact has Activity2022-07-25T07:27:02ZjmargrafAdded Condition: Contact has ActivityI needed a Condition to check if a Contact has an Activity of a certain type.I needed a Condition to check if a Contact has an Activity of a certain type.https://lab.civicrm.org/extensions/action-provider/-/merge_requests/82Add nick_name support to CreateUpdateIndividual Action Provider.2022-06-29T13:35:15Zjustinfreeman (Agileware)Add nick_name support to CreateUpdateIndividual Action Provider.Add nick_name support to CreateUpdateIndividual Action Provider.
Agileware Ref: WVIC-160Add nick_name support to CreateUpdateIndividual Action Provider.
Agileware Ref: WVIC-160https://lab.civicrm.org/extensions/action-provider/-/merge_requests/81UpdateGroupSubscriptions action fails2022-06-28T09:08:44ZkainukUpdateGroupSubscriptions action failskainukkainuk