# Question
Title: Undefined index: start_time in CRM Volunteer BAO NeedSearch.php
Drupal 7.67 Civicrm 5.15.2 CiviVolunteer 4.7.31-2.3.1

I have the following error message on Volunteer Event registration "Volunteer Now" screen:

Notice: Undefined index: start\_time in CRM\_Volunteer\_BAO\_NeedSearch::usortDateAscending() (line 299 of /home/mysite/public\_html/members/drupal/sites/default/files/civicrm/ext/org.civicrm.volunteer/CRM/Volunteer/BAO/NeedSearch.php).

# Answer
> 1 votes
Can you try to apply this PR https://github.com/civicrm/org.civicrm.volunteer/pull/513. I this it should fix the notice error.

Cheers

Pradeep

---
Tags: civivolunteer
---


# Question
Title: Can I show contact photos in a public membership list on a WordPress site?
On a newly built WordPress site for a City livery company, I have created a membership list that members can opt to appear on. This is working perfectly, and the list is showing name, member type, role, email and phone number.

However, if I include the contact image (which works on individual profiles), it just shows as a url.

Is there a solution to this? I know the livery company members will be disappointed if they can't see member photos.

# Answer
I am not sure if its a bug or indented to show url in profile search listing. I have just written a small extension that converts imageurl into image.

HTH

Pradeep
> 3 votes

---
Tags: wordpress
---


# Question
Title: Pay Now on Dashboard - too many redirects
Not sure what the issue is - but if someone tries to pay an unpaid registration for an event or membership - or incomplete contribution - we get the issue of too many redirects. I have posted about this before - the issue was the contribution page was disabled or no longer there - but this time - the contribution page is active.

Here is an example of how a link is being parsed: (### are numbers)

https://org.org/membership/member-dashboard/?page=CiviCRM&q=civicrm%2Fcontribute%2Ftransact&page=CiviCRM&reset=1&id=&ccid=###&cs=&cid=###

Looks like the page ID is missing - but I could be reading this wrong.

# Answer
Can you update the setting to set the contribution page to use for 'Pay now' pending contribution?

Navigate to CiviCRM \>\> Administer \>\> CiviContribute \>\> CiviContribute Component Settings. Select contribution page for 'Default invoice payment page' field and save the form.

Cheers

Pradeep
> 4 votes

---
Tags: user-dashboard
---


# Question
Title: Webform Conditional - 'set to' membership type
Using Drupal 7.56, CiviCRM 4.7.22 and Webform 7.x-4.15.

I have two fields in a webform: one containing gender and the second containing a selection of membership types. If the gender is, for example, female I want to use the webform conditionals to set the membership type to a specific value. What value must I enter in the field displayed when I select 'set to'?

# Answer
Enter the Membership Type ID and that will display the correct value in the webform.
> 1 votes

# Answer
How would I find the ID of the value I want? e.g. in your example, what is the Membership Type ID? Is it some code or just the name of the field?

Thanks,

Sam
> 0 votes

---
Tags: webform-civicrm, condition
---


# Question
Title: Mosaico returns 403 error due to data-bind attribute in template html
We get a 403 error by Wordfence Security on a wordpress site while creating a Mailing using Mosaico.

On little investigation - I see the error is due to the addition of `data-bind` attribute in the HTML. For eg. if the template html is -

```
<p style="color: #aaaaaa; font: 14px/18px Frutiger, 'Frutiger Linotype', 'Helvetica Neue', Helvetica, Arial, sans-serif; ; margin: 0 0 10px 0; padding: 0; text-align: center;" data-bind="virtualAttrStyle: 'color: #AAAAAA; '+'font: '+('14px/18px '+$root.content().sansFace())+'; '+'margin: 0 0 10px 0; '+'padding: 0; '+'text-align: center;'+''">
  Don't want to receive any more email from us?
  <br />
  Simply
  <a style="color: #e0e0e0;"
    href="https://domain_name/wp-content/plugins/files/civicrm/extensions/uk.co.vedaconsulting.mosaico/packages/mosaico/templates/tedc15/*|UNSUB|*"
    target="_blank"
    data-bind="virtualAttrStyle: 'color: #E0E0E0;'+''">
    unsubscribe
  </a> from our list.
</p>

```

The error in the console pops up not letting the template to be saved.

> 403 Forbidden
>
> A potentially unsafe operation has been detected in your request to this site, and has been blocked by Wordfence.

If I remove the `data-bind` attribute from the anchor tag - the mailing is saved without any errors. Also, if the Wordfence plugin is disabled - the 403 error is not shown - but this might not be the solution.

Any thoughts on why this error might be arising and ways to fix it?

# Answer
Wordfence uses knockout.js for data binding. I see Mosaico adds `data-bind` attribute to the HTML input which is considered prone to XSS attack by knockout and 403 error is shown by wordfence.

I've disabled XSS in the Wordfence setting and the mailing is working correctly for now. Happy to look for answer if there is a way to avoid XSS attack in mosaico template builder?
> 2 votes

# Answer
I also had a similar problem - I solved by whitelisting the specific url using Wordfences Live traffic view (Wordfence -\> tools) to locate the blocked connection and then whitelist param from firewall.
> 2 votes

# Answer
I had a similar issue, but just using one of the standard sample mailing templates (not Mosaico). Disabling the XSS option in Wordfence also worked, although I'd like to keep the XSS check.
> 0 votes

---
Tags: wordpress, templates, mosaico
---


# Question
Title: Restrict users to viewing only data in their state?
We are using Civi 5.14 on WordPress 5.1 My client has giving me this request. Can this even be done with Civi? She wants to restrict our volunteers to viewing only contacts within their own state, or reports based on contacts in their own state. Her request is below.

***"create log-ins for almost everyone on the affiliates list (Contact/Advocate/Affiliate leader anyway.) Then, arrange so that their access gives them the ability to view ONLY contacts from their state, and have a simple way to download contact info (perhaps several pre-created reports like email/phone only, full mailing info, and "full info" which would hit a few other things like Y/N donor, member, event participation."***

# Answer
> 2 votes
Seems like CiviCRM ACL might be your answer.

https://docs.civicrm.org/user/en/latest/initial-set-up/permissions-and-access-control/

Native CiviCRM ACLs give more fine grained control, so, for example, you can limit access to view, edit, create, delete and search to :

```
groups of contacts
a profile (this is a collection of existing and/or custom fields, see "Profiles")
a set of custom fields
events (e.g. a user may access one event, but not others)

```

# Answer
> 1 votes
If the standard ACL's are not sufficient, you can add your own using hook\_civicrm\_aclWhereClause. Basically, you add more SQL "where" clauses to restrict which contacts are accessible. See the documentation for an example.

---
Tags: contacts, reports, user-account
---


# Question
Title: CiviCRM 5.12.0 breaks Drupal 8 registration
The upgrade of CiviCRM 5.12.0 version breaks the user registration process on Drupal 8 : `Error type: Could not find a valid session key.` I tried the upgrade on two different D8 sites with same issue. Select another Civi profile doesn't change it neither.

```
Apr 06 22:50:18  [info] $backTrace = #0 /server_path/vendor/civicrm/civicrm-core/CRM/Core/Error.php(381): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /server_path/vendor/civicrm/civicrm-core/CRM/Core/Controller.php(833): CRM_Core_Error::fatal("We can't load the requested web page. This page requires cookies to be enable...")
#2 /server_path/vendor/civicrm/civicrm-core/CRM/Core/Controller.php(828): CRM_Core_Controller->invalidKeyCommon()
#3 /server_path/vendor/civicrm/civicrm-core/CRM/Core/Controller.php(312): CRM_Core_Controller->invalidKey()
#4 /server_path/vendor/civicrm/civicrm-core/CRM/Core/Controller.php(204): CRM_Core_Controller->key("CRM_Profile_Form_Dynamic", TRUE, FALSE)
#5 /server_path/vendor/civicrm/civicrm-core/CRM/Core/Controller/Simple.php(66): CRM_Core_Controller->__construct("Dynamic Form Creator", TRUE, NULL, "CRM_Profile_Form_Dynamic", TRUE, FALSE)
#6 /server_path/vendor/civicrm/civicrm-core/CRM/Core/BAO/UFGroup.php(834): CRM_Core_Controller_Simple->__construct("CRM_Profile_Form_Dynamic", "Dynamic Form Creator", NULL)
#7 /server_path/docroot/modules/contrib/civicrm/civicrm.module(265): CRM_Core_BAO_UFGroup::getEditHTML(NULL, "", NULL, TRUE, TRUE, NULL, FALSE, "Individual")
#8 /server_path/docroot/core/lib/Drupal/Core/Extension/ModuleHandler.php(539): civicrm_form_user_register_form_alter((Array:26), Object(Drupal\Core\Form\FormState), "user_register_form")
#9 /server_path/docroot/core/lib/Drupal/Core/Form/FormBuilder.php(834): Drupal\Core\Extension\ModuleHandler->alter("form", (Array:26), Object(Drupal\Core\Form\FormState), "user_register_form")
#10 /server_path/docroot/core/lib/Drupal/Core/Form/FormBuilder.php(276): Drupal\Core\Form\FormBuilder->prepareForm("user_register_form", (Array:26), Object(Drupal\Core\Form\FormState))
#11 /server_path/docroot/core/lib/Drupal/Core/Controller/FormController.php(93): Drupal\Core\Form\FormBuilder->buildForm("user_register_form", Object(Drupal\Core\Form\FormState))
#12 [internal function](): Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch))
#13 /server_path/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array((Array:2), (Array:2))
#14 /server_path/docroot/core/lib/Drupal/Core/Render/Renderer.php(582): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#15 /server_path/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#16 /server_path/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext((Array:2), (Array:2))
#17 /server_path/vendor/symfony/http-kernel/HttpKernel.php(151): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#18 /server_path/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#19 /server_path/docroot/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)
#20 /server_path/docroot/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)
#21 /server_path/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(99): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)
#22 /server_path/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(78): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)
#23 /server_path/docroot/core/modules/ban/src/BanMiddleware.php(50): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)
#24 /server_path/docroot/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\ban\BanMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)
#25 /server_path/docroot/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)
#26 /server_path/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)
#27 /server_path/docroot/core/lib/Drupal/Core/DrupalKernel.php(693): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)
#28 /server_path/docroot/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#29 {main}

```

# Answer
This issue is solved with the new Drupal 8.6.14 update. So it seems to have a conflict between Drupal 8.6.13 and CiviCRM 5.12.0.
> 2 votes

# Answer
We are using Drupal : 8.7.5

CiviCRM : 5.13.6 ESR

We had same issue when admin try to create new user.

After comparing drupal 7 and drupal 8 module files, i found one the config setting is missing in drupal 8 module.

After applying changes, user get created but logged in user get logged out.

Then i found that in synchronize function we are resting the CiviCRM session. if we comment it, auto logout get stopped.

Here is are the both changes.

```
--- a/modules/contrib/civicrm/civicrm.module
+++ b/modules/contrib/civicrm/civicrm.module
@@ -251,6 +251,7 @@ function _civicrm_get_profiles($contact_id) {
 function civicrm_form_user_register_form_alter(&$form, &$form_state, $form_id) {
   $civicrm = \Drupal::service('civicrm');
   $civicrm->initialize();
+  CRM_Core_Config::singleton()->keyDisable = TRUE; // to skip quickform key validation
   $html = \CRM_Core_BAO_UFGroup::getEditHTML(NULL, '', NULL, TRUE, TRUE, NULL, FALSE, $civicrm->getCtype());

   // Need to disable the page cache.
@@ -273,6 +274,7 @@ function civicrm_form_user_register_form_alter(&$form, &$form_state, $form_id) {
  */
 function _civicrm_user_register_form_validate(&$form, FormStateInterface $form_state) {
   \Drupal::service('civicrm')->initialize();
+  CRM_Core_Config::singleton()->keyDisable = TRUE;
   $errors = CRM_Core_BAO_UFGroup::isValid(NULL, '', TRUE);

   if (is_array($errors)) {
diff --git a/vendor/civicrm/civicrm-core/CRM/Core/BAO/UFMatch.php b/vendor/civicrm/civicrm-core/CRM/Core/BAO/UFMatch.php
index 39731cfa9..c60dbe23d 100644
--- a/vendor/civicrm/civicrm-core/CRM/Core/BAO/UFMatch.php
+++ b/vendor/civicrm/civicrm-core/CRM/Core/BAO/UFMatch.php
@@ -100,7 +100,6 @@ public static function synchronize(&$user, $update, $uf, $ctype, $isLogin = FALS

     // reset the session if we are a different user
     if ($ufID && $ufID != $userSystemID) {
-      $session->reset();

       //get logged in user ids, and set to session.
       if ($isUserLoggedIn) {

```
> 0 votes

---
Tags: drupal-8
---


# Question
Title: Installation problem of civicrm on wordpress
Installation problem of civicrm on wordpress : formulaire d'installation

Check the prerequisites and install Civicrm Reverification of the prerequisites.

Is auto\_increment\_increment set to 1 Unable to query database server variables.

Is the database name valid? okay

Does the value of MySQL stored procedures (thread\_stack) have the required minimum value (192k) Unable to get information about stored procedures in the database.

THANKS FOR YOUR HELP

---

I still have the problem.

Apache 2.4.25 x86 - PHP 7.1.3 x86 Port: 80 MySQL 5.7.17 x86 Port: 3306 WordPress 5.2.2 CiviCRM-5.16.2-wordpress

On my database. Privileges are on GRANT in this asso\_organization database.

---

Mysql server: localhost Username Mysql = root Password = '' Database = asso\_organisation

When I press: check the prerequisites and install CiviCrm: He created me the database "asso\_organisation" but, he always displays two error messages: Is auto\_increment\_increment set to 1 /// Unable to query database server variables. Does the value of MySQL stored procedures (thread\_stack) have the required minimum value (192k)? // Unable to get information about the stored procedures of the database. Thank you for helping me

# Answer
> 3 votes
It looks like the mysql user you use doesn't have enough permissions on the database (or invalid database/password?)

This page lists all the privileges that civicrm mysql account needs:

https://docs.civicrm.org/sysadmin/en/latest/requirements/

```
  GRANT
  SELECT,
  INSERT,
  UPDATE,
  DELETE,
  CREATE,
  DROP,
  INDEX,
  ALTER,
  CREATE TEMPORARY TABLES,
  LOCK TABLES,
  TRIGGER,
  CREATE ROUTINE,
  ALTER ROUTINE,
  REFERENCES,
  CREATE VIEW,
  SHOW VIEW
ON civicrm.*
TO 'civicrm_user'@'localhost'
IDENTIFIED BY 'realpasswordhere';

```

you would obviously need to adjust with the database and user account you have

---
Tags: wordpress, civicontribute
---


# Question
Title: Add dupe check parameter to an API call - Contact Form 7 plugin
I've installed the **Contact Form 7 CiviCRM integration** plugin, and it works fine.

I'm just wondering how to add a dupe\_check parameter.

If I try something like:

`contact_type=Individual&source=SitoWeb`

it works.

But if I add:

```
contact_type=Individual&source=SitoWeb&dupe_check=1

```

it doesen't.

Here's the section where I have to add those parameters:

Without dupe\_check the same contact could be added X times for X times he/she submits the form.

Thank you.

# Answer
Did you try the same functionality in the API Explorer?

Basically the Contact Form 7 integration just calls the CiviCRM API with whatever data is present, so I would expect that if it works in the API Explorer it will work from the Contact Form too.
> 3 votes

# Answer
Thanks to @ErikH - CiviCooP I finally managed to have a duplicate check before creating a new Contact in CiviCRM.

So, first of all, you have to check that you have an Unsupervised dedupe rule for Individuals.

If so, these parameters will work just fine:

```
contact_type=Individual&source=wordpress&dupe_check=1

```

Otherwise, set the rule you want to use as Unsupervised (or create a new one if needed) and use the code above.

Thank you again!
> 3 votes

---
Tags: api, duplicate-contacts
---


# Question
Title: Property of non-object notice after submitting CiviCRM Webform with Contributions
I’m using Webforms for CiviCRM 4.28 for a membership registration and payment form and have Pay Later set as the payment method. When the form is submitted I get the following errors shown on the confirmation screen once the form has been submitted.

```
Notice: Trying to get property 'tax_amount' of non-object in CRM_Contribute_BAO_Contribution::checkTaxAmount() (line 4272 of /xxxxxxxx/sites/all/modules/civicrm/CRM/Contribute/BAO/Contribution.php).
Notice: Trying to get property 'total_amount' of non-object in CRM_Contribute_BAO_Contribution::checkTaxAmount() (line 4278 of /xxxxxxxx/sites/all/modules/civicrm/CRM/Contribute/BAO/Contribution.php).
Notice: Trying to get property 'total_amount' of non-object in CRM_Contribute_BAO_Contribution::checkTaxAmount() (line 4279 of /xxxxxxxx/sites/all/modules/civicrm/CRM/Contribute/BAO/Contribution.php).
Notice: Trying to get property 'fee_amount' of non-object in CRM_Contribute_BAO_Contribution::checkTaxAmount() (line 4278 of /xxxxxxxx/sites/all/modules/civicrm/CRM/Contribute/BAO/Contribution.php).
Notice: Trying to get property 'fee_amount' of non-object in CRM_Contribute_BAO_Contribution::checkTaxAmount() (line 4279 of /xxxxxxxx/sites/all/modules/civicrm/CRM/Contribute/BAO/Contribution.php).

```

I have the Membership and Contribution tabs of the CiviCRM Webform panel set up as follows.  The payment screen looks fine and the message shows after the form has been submitted.   I’m running CiviCRM 5.16.2 against Drupal 7.67.

Any ideas what could be causing this and how to resolve?

# Answer
> 0 votes
A couple of quick thoughts:

1. upgrade to Webform CiviCRM 5.x (we’re no longer supporting 4.x)

Edit: we have now officially disabled support for D7 - 4.x - you will now have a ‘unsupported version’ warning in your Drupal status report.

2. what is your PHP version?
3. always switch off notices on production sites: goto admin/config/developement/logging and set to -\> None
4. open an issue on our drupal.org webform\_civicrm project page and give us exact steps to reproduce

---
Tags: webform-civicrm, contributions, contribution-page
---


# Question
Title: Joomla - Embedding youtube video in CIVI mailing
I am a novice with Joomla and have recently taken the position at an organization managing the CMS.

We are writing a newsletter and I want to embed a youtube video within the mailing. After following the steps for updating Joomla's iframe restrictions (tinyMCE extension), I see the video embedded in the mail, but when it is actually sent, the video is not accessible.

All the articles I am finding are for embedding a youtube video into a Joomla page.

Any advice will be appreciated! And since I am so new to this, Layman's Terms would be appreciated! Thank you kindly. Renee F

# Answer
> 3 votes
You probably won't have much luck embedding the actual video into a mailing due to restrictions in email clients. One workaround could be embedding a screenshot of the video which is then linked to the webpage where the video can be played (so when the screenshot is clicked, they are sent to the website to view).

# Answer
> 0 votes
As Laryn said, email clients don't like iframes. This is because of the potential for malicious content, so if you use iframes in your email not only will they not function but they could flag your entire message as junk and lower your delivery rate.

Laryn's answer is the best answer for basic inclusion of a video in your email (link an screenshot to the video).

However, you might want to use the public archive of the Civi Mailing on your website, i.e. the link for joomla will be something like https://\[yourdomain\]/index.php?option=com\_civicrm&task=civicrm/mailing/view&reset=1&id=\[CIVI Mailing ID\]. (That's also the "read in your browser" link that might show at the top of your emails.) And for that, you may want to embed the video rather than having a link. To do that --after the mailing has been completely sent! --, you would need to edit the code in the database to replace the linked image with the appropriate iframe. A careful layperson who knows something of html can do this:

1. In your webhost's control panel (not Joomla, the host) use the utility phpadmin to access your database.
2. Find the table civicrm\_mailing and Browse
3. Find the line for your mailing and Edit.
4. In the body\_html field, find the ...image here... tag of the linked image. Wrap those tags in the appropriate iframe like so:

`<iframe [details of the embedded content]>
<a>...image here...</a>
</iframe>`

5. Click "Go" to save your changes.

The point of wrapping the iframe around your original content is so that any browsers that don't support iframes will then show the original linked image.

If you do this, be aware that if you then reuse that mailing in Civi, you may have to deal with an inappropriate iframe. Not sure how Civi handles this.

Here's an example from our website. I've not only changed the body\_html of the mailing to include the iframe, but I've embedded the actual mailing in a joomla article so it is better integrated into our website.

---
Tags: civimail
---


title: Is Joomla 4.0 version in the works?

text:
# Question
Title: Is Joomla 4.0 version in the works?
What is the timeframe for supporting Joomla 4.0? Is a compatible Civi version in the works for it, although Joomla 4.0 is still in alpha?

# Answer
Currently, *2019/08/20*, there is no activity with regards to Joomla 4.0 compatibility with CiviCRM - I would imagine that this will be prioritised when Joomla 4.0 enters the Beta phase.

It would be useful for the CiviCRM community if those interested in this would test Joomla 4.0 and CiviCRM Stable and report any issues to the CiviJoomla issue queue.

*Update*

Since the initial revision of this answer (and evidenced at the issue queue link above) there are now patches/issues for CiviCRM on J!4 and there’s definite progress/momentum towards getting a better J!4 + Civi than J!3 + Civi.
> 3 votes

---
Tags: joomla
---


title: Organisation relationship search

text:
# Question
Title: Organisation relationship search
My organisation is primarily (but not solely) a network of other organisations, so on Civi we have lots of "organisation" contact types, and lots of individual contacts. Some of these individuals are representative or contact person of their organisation to *our* organisation. I use the relationship tool to connect individuals to organisations as respresentatives (I made a new relationship type), and that works really well.

Some organisations haven't nominated someone to be a rep, or we haven't got them into CiviCRM properly yet (we're still slowly setting up). What I'm struggling to work out is how to run a search of organisations which don't yet have that relationship type with anyone. Is this possible anyhow?

Thanks.

# Answer
> 2 votes
You can use this SQL if you have access to the database directly. Replace the "5" with the actual id of the relationship type you're interested in. If you don't know the id you can see it if you go to admin - customize - relationship types and hover over the view link then you'll see the id in the url in the browser status bar.

`select c.display_name from civicrm_contact c left join civicrm_relationship r on (r.contact_id_a=c.id AND r.relationship_type_id=5) where c.contact_type='Organization' and r.id IS NULL;`

Depending on which direction you've defined the relationship you may need to replace `contact_id_a` with `contact_id_b` above.

I think there's a bug in the CiviReport - Contact Reports - Relationship Report otherwise you might be able to do it from there, setting contact type A to be Organization and relationship to be "Is Empty", but it doesn't seem to recognize the latter properly.

---
Tags: search, relationships, custom-search
---


# Question
Title: Has anyone mapped the CiviCRM Schema to Classes in SQLAlchemy?
I would like to use Python and SQLalchemy to construct queries and create reports for Civicrm. Has anyone mapped the Classes and Relationships in order to use the ORM capabilities of SQLAlchemy?

# Answer
Directly accessing the SQL tables is certainly possible, but not a recommended approach. Reporting (ie read only) is safer than attempting to write to the tables but there can be many tables to join correctly depending on what you are trying to do.

If the standard reports and the various reports extensions don't provide what you need, try getting your data via the API.
> 1 votes

---
Tags: mysql
---


# Question
Title: Mapping custom fields to CiviCRM's standard fields
I have hired a freelancer to create CiviCRM Sign-Up form featuring Tell-A-Friend and validation email.

Using CiviCRM contact Caldera Processor, he created the form shown below but has an integration problem - is not able to map created custom fields "Province" and "Municipality" into CiviCRM's standard fields "State/Province" and "City".

He is not able to use the standard fields as they do not allow him to have 2 pull-down menus (Province and Municipality – see picture below) and other features (Tell-A-Friend and verification email). Your comments and suggestions would be greatly appreciated.

\[Note: Selecting a Province immediately populates the Municipality field.\]

Environment: WordPress 5.2.2 and CiviCRM 5.15.1 hosted at AWS.

# Answer
> 5 votes
The freelancer wasn't familiar enough with CiviCRM to realize that the municipality field we were looking for was already an integrated part of the CiviCRM through the county field.

---
Tags: caldera-forms, aws
---


# Question
Title: Commas displayed instead of selected responses from a multi-select field on Confirmation page for CiviEvent registration
When viewing the confirmation page of a CiviEvent registration form, the options selected in two different multiselect fields do not appear. Instead, for each field a series of commas equivalent to the number of options available in the field appear. This happens if I select any fewer than the full number of options available for the field.

The responses to other fields on the same form are fine, including those related to a couple of radio-button select fields.

In the attached image, Job Title and Dietary Restriction fields are examples of the issue.

Personal pronoun and several other fields displayed in the image are from fields using radio-button selections.

What could be causing this?

I've seen this Q&A but I think my concern is different and I'm on a later version of CiviCRM (5.13). https://issues.civicrm.org/jira/browse/CRM-17129

# Answer
> 3 votes
This is now fixed in 5.16.2 version. You can either upgrade CiviCRM to 5.16.2 or apply patch from here.

Cheers

Pradeep

---
Tags: civievent
---


# Question
Title: Ways for an extension to determine how (by which form/screen/API) a Contribution was created?
I'm creating an extension. It should:

* intervene when a Contribution is created, and make some changes to the data
* only intervene if the Contribution was created via a public-facing Contribution Page, *or* via the Import Contributions UI
* *not* intervene if the contribution was created through the back-office UI, batch data entry, a public-facing event registration form, or any other method.

My plan was to use `hook_civicrm_pre` or `hook_civicrm_post` to intercept the Contribution at the time of its creation... but I need to know which context the Contribution is being created/updated in, so I can make sure I'm only modifying the data in the desired contexts.

How can I determine, within my hook implementations, what context the Contribution is being created in?

(Bonus points for determining contexts other than the ones I listed above. For example, CLI or REST API.)

# Answer
> 3 votes
In `hook_civicrm_pre`, the params passed to your function include `qfKey` and `entryURL` — at least sometimes. The entry URL is in a format that's pretty obvious, but it seems like depending on URL parsing would make for brittle code. So what about `qfKey`?

`qfKey` is a form key based on form name, the current user session ID, a private key unique to the current user session, and optionally a sequence number to distinguish between multiple instances of the same form in the same session. The form name might give you the context information you need! But it is encrypted, so your extension can't just use a simple comparison operator on it.

To find out whether an entity was created in the context of a given form, you need to use `CRM_Core_Key::validate()`. For example:

```
function myextension_civicrm_pre($op, $objectName, $id, &$params) {
  if (CRM_Core_Key::validate($params['qfKey'], 'CRM_Contribute_Form_Contribution', TRUE)) {
    // This entity is being created in the context of the back-office contribution form.
    // Do stuff.
  }
}

```

---
Tags: civicontribute, extension, contributions, forms, hooks
---


title: Customizing Menu Quirks

text:
# Question
Title: Customizing Menu Quirks
Certain plugins such as CiviMobile and CiviVolunteer create menu items automatically. Unfortunately those menu items aren't managed by Administer \>\>\> Customize Data and Screens \>\>\> Navigation Menu. In order to give non-admin users CiviMobile menu access - I had to add it to the menu manually - which gives non-admin users a menu - but admin users double civimobile menu items. CiviVolunteer on the other hand cannot be managed via the same menu - if I want to nest it under another category - or simply change its position - I have to recreate all the menu items. There has to be a better way - is there?

# Answer
CiviVolunteer is adding menu items in the recommended way for Extensions.

We are looking for guidance on how to support menu customization. I did not find any in the developer docs.

If anyone knows the secret, or can point to an extension that menu customization works for... it would be a help.
> 3 votes

# Answer
**CiviMobile Settings** menu item is available only for users who has **administer CiviCRM** permission.

We are adding this menu item using *hook\_civicrm\_navigationMenu* hook
> 0 votes

---
Tags: civivolunteer, menu, mobile, civimobile
---


# Question
Title: Cant log in with CiviMobile on 5.8.2 with Drupal 8
I am trying to get CiviMobile to run on a D8 with CiviCRM latest version.

But i constantly get an 'unknown error' when attempting to log in.

Already checked that i have the correct Extention installed: CiviMobileApi

Additional info: The site is not on www. but on a subdomain, if that matters.

Any ideas?

# Answer
> 2 votes
Unfortunately we support only Drupal 7, WP and Joomla. Our extension is not working with D8. The only solution is to modify the extension.

---
Tags: mobile, civimobile
---


title: CiviMobile "unknown error" on Wordpress

text:
# Question
Title: CiviMobile "unknown error" on Wordpress
Does the CiviMobile Android app work with Wordpress based CiviCRM? When I enter my username and password and site URL into the login screen of CiviMobile, it just shows "Unknown error". But the demo account works fine.

# Answer
There is the current situation with CiviMobile app and WordPress:

As now, we are still working on quick API patch for WP. I hope it will be available in the next few days. I will let you know as soon as it is ready.

As a long-term solution, we need a permanent fix which will be approved by the Core Team and included into standard CiviCRM code (see the issue above).

Thank you, Sergiy
> 3 votes

# Answer
There is a quick patch for WordPress:

**I. Overview:**

In order to make the API working properly for WordPress you need to change only one file “*wp-content/plugins/civicrm/civicrm/CRM/Utils/REST.php*”. We prepared command line script to automate this change.

**II. Patch:**

1. Before the start, the script will make a backup of REST.php by creating file REST.php.bak. You still may make your own backup copy to be able to restore this file in case of something goes wrong.
2. Run patch:

**If you use MacOS or Linux System**, just run this command from the project root folder:

```
cm_line='=================================';echo'';echo'';echo "$cm_line";cm_ext_path='wp-content/plugins/civicrm/civicrm/CRM/Utils/REST.php';start=$(echo $(grep -on 'buildParamList() {' "$cm_ext_path" | sed "s/:buildParamList() {//"););end=$(echo $(grep -on 'ajaxJson() {' "$cm_ext_path" | sed "s/:ajaxJson() {//"););sed -i.bak "$(echo $start),$(echo $end) s#json_decode(\$requestParams\['json'\]#json_decode(stripslashes(\$requestParams\[\'json\'\])#" "$cm_ext_path";if [[ $(grep -c json_decode\(stripslashes "$cm_ext_path") -eq 1 ]] ; then echo -e '\033[1mWordPress API has been patched successfully.\033[0m';echo -e 'Now you may start using \033[1mCiviMobile\033[0m!'; else echo -e '\033[1mSomething went wrong.\033[0m';echo -e 'Please copy the error message, if any, and contact us at \033[1mcivicrm@agiliway.com\033[0m  so we can help you.';fi;echo "$cm_line";echo'';echo'';

```

**If you use Windows system**, you shall manually change a part of the text in wp-*content/plugins/civicrm/civicrm/CRM/Utils/REST.php* Please find:

```
*$params = json_decode($requestParams['json'], TRUE);*

```

And change it to:

```
*$params = json_decode(stripslashes($requestParams['json']), TRUE);*

```

**III. Rollback:** In case something went wrong, please restore file

*wp-content/plugins/civicrm/civicrm/CRM/Utils/REST.php* from

*wp-content/plugins/civicrm/civicrm/CRM/Utils/REST.php.bak* or from your own copy

This should work. Please let me know if any question.
> 1 votes

# Answer
the patch worked to enable CiviMobile, however we've just discovered it created a problem for CiviMail when using Mosaico template builder extension. See CiviMail error: "Sorry an error occurred and your information was not saved" I resolved it simply by restoring REST.php.

I assume the problem is that Mosaico 'needs' the slashes that 'stripslashes' removes. I wonder if there is some condition that could wrap around the statement to switch between the original and 'stripslashes' version of the statement e.g.

* if CiviMobile is calling REST.api, use 'stripslashes' statement else use normal
* if CiviMail is calling REST.api, use normal else use 'stripslashes' statement

Thanks for your help.
> 1 votes

# Answer
We've updated our extension to work with https://github.com/mecachisenros/civicrm-wp-rest WP plugin. So, now if you are using WP you have to install this plugin and everything should work correctly for you. And don't forget to update our CiviMobileAPI extension to the last version.

Please feel free to write me andriy.stabryn@agiliway.com if you still have any questions.
> 0 votes

---
Tags: mobile
---


title: Access Denied for Login

text:
# Question
Title: Access Denied for Login
On a handover document from a fundraiser to a volunteer, this link was left to access our database. When it is clicked on it takes you to a page which says 'Access Denied'. Why is this? I'm assuming this database is not paid for and we don't owe money. We really need to access this quite urgently. We have record of the login and password. Any help would be greatly appreciated. How can you contact CIVI for help or is this the only way to get feedback? Thanks.

https://spires.civisites.com/civicrm/dashboard?reset=1

# Answer
> 2 votes
Go to https://spires.civisites.com/user and there you can log in.

By the way I would think you actually ARE paying for the hosting. The hosting company is civisites and you can try to contact them (https://www.civisites.com/about-us / http://www.circle-interactive.co.uk/)

---
Tags: drupal, user-account
---


# Question
Title: How do I create default custom data when changing contact subtypes via the API?
If I use the API to give someone a new contact subtype it doesn't create a row in any relevant custom data tables and populate the default values. Does anyone have a good way to handle this? I have smart groups that hang off the default custom data, but new contacts aren't going into them.

I'm trying to dig through for a handy createRelevantCustomDataFromSubtype function but can't see anything yet.

Cheers,

Andrew

# Answer
I think this is how it typically works, but in your same api call just populate one of the fields in each relevant custom data group with a blank '' and that should fill in the rest.
> 1 votes

---
Tags: custom-fields, api, sub-types
---


title: CiviCRM on Azure Not Finding the Server

text:
# Question
Title: CiviCRM on Azure Not Finding the Server
I am trying to install CiviCRM on Azure using the Wordpress for Linux web app and it appears CiviCRM is failing to find the MYSQL server. I've checked many times to see if the database information, including the MYSQL server information, inputted is correct and it's correct. I've even tried variations of the MYSQL server name, including using port numbers at the end, but it's had no impact.

I tried to install previous versions of CiviCRM to see if that would help, but the same error continues to show up. A similar question came up a few months ago, but I did not see a clear answer on how to resolve the problem.

Your database settings don't appear to be correct. All green, but still error!

I am wondering if this is a bug with CiviCRM that is specific to Azure or if it's something on Azure's side of things. I don't think it's on the Azure side of things because I can install Wordpress and use MYSQL bench with no issue using the same database information.

# Answer
> 0 votes
It looks like at the present time you will need to make a small hack to get the installer to be happy. The "does the server exist check" does NOT use the username/password and merely tries to connect as anonymous (https://github.com/civicrm/civicrm-core/blob/5.16.2/install/index.php#L1038). On azure this returns an error 9002, as opposed to the usual 1045 which gets skipped by the next line.

So you should be able to temporarily change that line to

`$conn = $this->connect($server, 'username@com1group-mysqldbserver.mysql.database.azure.com', 'your password');`

and then after install you can change it back. I don't have an azure database to test if that is sufficient, but just doing a command line test it returns the usual error 1045 so should work.

---
Tags: wordpress, error, database, install
---


# Question
Title: How to list upcoming events with pictures and updating registration links?
we would like to be able to have an image be associated with an event so that it could be displayed in the event listings.

Currently, we display our upcoming 4 classes on our WordPress page with links to the Civicrm event sign-up pages. This is working ok, but means we manually have to change things over on the website, also for repeating events. Is there a way to link to the event series rather than just the next repeating event?

We looked into the CiviEvent List Widget but couldn't find an option to have it display at least one picture per event to make it more appealing for potential customers.

Is there an option/extension that can automatically display the next 4 or 5 events with an option to include a picture with automatically updating registration links?

Thank you for your help,

# Answer
You could try CiviCRM Event Organiser, which syncs events between Event Organiser and CiviCRM. If you create your events in WordPress via Event Organiser then each event can be assigned a Feature Image. Here's an example listing where some events have Feature Images. As a bonus for busy sites, you get a nice calendar that comes as standard with Event Organiser.

Sync works with repeating events if they are created in Event Organiser and then synced to CiviCRM - but not the other way round yet. Each event that has been synced to CiviCRM will have a link to the relevant CiviCRM registration page on its standalone page but it's possible to inject this into the archive template too.

It has to be said, however, that this is a fairly heavyweight solution and can take a fair bit of setting up so YMMV, caveat emptor, etc etc. I would strongly recommend installing on a development version of your site (or a test site) first.
> 2 votes

---
Tags: wordpress, civievent
---


# Question
Title: Struggling: Search report for donations by creation date not receive date
I want to send thank you letters and gift aid forms to everyone who 'created' a contribution donation (not membership contribution) within a period of a few months, a one off or recurring donation with us. I can only seem to get results with received date, which might be fine for the one-off donations, but not for recurring ones, as we receive them every month. It seems that neither the Search builder nor Find Contributions can create a report with the 'created date'. Any thoughts? Am I missing something, or is this not available?

# Answer
> 2 votes
You will need to do two searches.

First, use the **Recurring Contributions Report** (/civicrm/report/contribute/recur).

1. Filter by "Start Date".
2. Optionally, filter by Financial Type or any other criteria you want (for example, to exclude membership-related contributions).
3. Refresh the results.
4. Add the found contacts to a "People to Thank" group.

Then, do an **Advanced Search**.

1. Open the Contributions accordion tab.
2. Filter by "Date Received".
3. Check "No" next to "Contribution is Recurring?".
4. Optionally, filter by Financial Type or any other criteria you want (for example, to exclude membership-related contributions).
5. Run the search.
6. Add the found contacts to your "People to Thank" group.

Now, your "People to Thank" group contains everyone who started a recurring contribution *plus* everyone who made a one-time donation in the specified timeframe.

# Answer
> 8 votes
Yes, there is no such field in contribution table that holds when a contribution record was actually created. However an activity is created when a contribution is recorded with status completed. If contribution is created with pending status and updated later after day or 2 then it is very difficult to track via Activity.

I have an extension that uses activity to get created date and display on a Civi Contribution Detail report.

The alternate way of doing this would be create a date custom field for contribution, auto populate the field with now() using buildform or post hook.

HTH

Pradeep

---
Tags: civicontribute, search
---


title: Financial Types

text:
# Question
Title: Financial Types
I added and enabled a new Financial Type (Advertising). When creating a new price set for it...that financial type is not appearing as an option in the price set drop down menu.

Any ideas on why it is not appearing even though it is enabled?

# Answer
I can only think of two reasons why it is not appearing in price set drop is

1. If you have ACL Financial turned ON (CiviCRM \>\> Administer \>\> CiviContribute \>\> CiviContribute Component Settings) and the user doesn't have permission to perform CRUD on the financial type.
2. If the Financial type has missing 'Income account is' with the financial account. CiviCRM \>\> Administer \>\> CiviContribute \>\> Financial Types. Click **Accounts** on besides the Advertising financial types. If the 'Income account is' is missing than add one.

Thanks

Pradeep
> 1 votes

# Answer
I’ve have run into this as well. Try clear caches (possibly twice).
> 0 votes

---
Tags: price-sets, financial-types
---


# Question
Title: Send a contact to CiviCRM only if the user check a specific checkbox in a Contact Form 7?
I am aware that there is a Wordpress plugin to "link" Wordpress plugin Contact Form 7 and CiviCRM.

But I wonder if there is a way to send to CiviCRM the data of a user who filled the form ONLY if he/she checks a specific checkbox or acceptance box.

This is fundamental to comply with the GDPR.

Thank you in advance.

# Answer
> 3 votes
There are different ways to approach this, but none of them is standard as the Contact Form 7 Integration plugin only throws data over the line and lets CiviCRM take care of the api.

* First of all, it is well possible that standard Contact Form 7 lets you specify a box that prevents submission of the data? If that is the case then that is the quickest and easiest solution
    + Insert a form in between where you ask permission and only take them to the next one (that sends data to CiviCRM) once they have ticked the box
* Adapt the plugin in your installation to NOT send the api call if a certain box is ticked. That would not be an option I would take as I would prefer the next alternative, but is possible.
* Send the data, including the "permission" box, to CiviCRM but use a specifically developed API (something like OkContact create). The check to only create the contact if the box is ticked is then solved in this API, and the contact is only added if the box is ticked.

Does that help?

---
Tags: wordpress, contacts, gdpr
---


# Question
Title: Where do I change the due date for event invoices and can I set a fixed date instead of a variable date?
In our case, the invoices are being sent with each "pay later" event registration. The default appears to be 10 days. The client wants to change the date to September 3 of this year. Do I need a new invoice template? Can I do that? Can I do this somewhere in the Event setup for a set due date for all registrations?

# Answer
> 1 votes
There is a setting in Administer \> CiviContribute \> CiviContribute Component Settings that lets you change from the standard 10 days (you will need to tick the "enable tax and invoicing box to see it). But that doesn't get a fixed date. If you aren't using the invoices for something else then you could edit the "Contributions - Invoice" template in the "system workflow messages" tab in Administer \> Communications \> Message Templates. Or if you do use the invoices for other things you could perhaps put some logic in the template to deal with the different cases. Hope that helps.

---
Tags: civievent, civicontribute, invoice, dates
---


# Question
Title: Can't view Exported Batches (DataTables warning)
I just had a report that someone is having trouble seeing the list of exported batches (**civicrm/financial/financialbatches?reset=1&batchStatus=5**) and it seems to have started just recently -- likely after I upgraded to CiviCRM 5.6 (I also recently upgraded from PHP 7.0 to PHP 7.1 but I reverted that as a test and still had the error). The strange part is that there is no error in viewing the list of Open or Closed batches, just the Exported batches. There are a lot of exported batches -- could the volume of batches be an issue here?

The only error I've been able to track down is the popup error:

> DataTables warning: table id=crm-batch-selector-5 - Ajax error. For more information about this error, please see http://datatables.net/tn/7

...and the one in the Drupal watchdog log:

> Notice: Trying to get property of non-object in CRM\_Batch\_BAO\_Batch::getBatchList() (line 335 of /path-to-site/sites/all/modules/civicrm/CRM/Batch/BAO/Batch.php).

---

* Drupal 7
* CiviCRM 5.6.0
* PHP 7.1

# Answer
> 3 votes
Okay, solved. There was something awry with the latest Batch in that it had been exported, but the file didn't exist in the `custom` directory/filesystem. I changed that last batch status directly in the database from `5` (exported) to `2` (closed) and now the screens all load as usual.

I suppose line 335 of `/path-to-site/sites/all/modules/civicrm/CRM/Batch/BAO/Batch.php` is trying to load information about this non-existent file and causes the error somehow, but I don't fully understand how.

**EDIT**: The error recurred when we tried to re-export the problem batch, but I was able to get a more helpful error message this time:

> Error: \[\] operator not supported for strings in CRM\_Financial\_BAO\_ExportFormat\_CSV-\>formatHeaders() (line 166 of /path-to-site/sites/all/modules/civicrm/CRM/Financial/BAO/ExportFormat/CSV.php).

So this is in fact a PHP 7.1 bug. Issue in lab is here. PR is here.

# Answer
> 3 votes
I got a similar DataTables warning recently that prevented me from viewing exported batches. I was also able to change the batch status and see them in the 'closed' list. \[running CiviCRM 5.13.5 and php 7.2 on WordPress\]

The problem turned out to be that I had recently deleted activities, including the export batch activities. Apparently, if so much as one export batch activity has been deleted, the list of exported batches will fail with a DataTables warning.

I was able to fix the problem by manually changing the status of all exported batches to closed, then re-exporting them, thereby recreating activity records for the exported batches (fortunately, only 12 large batches of imported donations as we are still in the setup phase). I deleting the activity record for just one exported batch to verify that the problem is caused by one or more missing activity records for exported batches.

This seems like a bug, since an activity record probably shouldn't be required to view the exported batch list (other type of activity can be safely deleted). I think the export activity record is somehow being used to link to the exported files in the \[civicrm.files\]/custom/ directory (though the exported files themselves can apparently be deleted without trouble if no longer needed).

The actual functionality of the batches did not seem to be impaired (new batches and exports worked and I could search contributions on batch criteria).

---
Tags: batches
---


# Question
Title: CiviCase permissions break My Cases dashlet
CiviCRM 5.14.0 Drupal 7.67

Users with CiviCase permission "access all cases and activities" have no issues, but users with "access my cases and activities" get an error ("DataTables warning: table id=DataTables\_Table\_0 - Ajax error." ) when the My Cases dashlet attempts to load on the main dashboard page.

The backtrace reveals that it's stemming from the getCases() function in /CRM/Case/Page/AJAX.php and the DB is returning an error "1054 \** Unknown column 't\_act.activity\_type\_id' in 'field list'" I checked, and activity\_type\_id does exist in the referenced table.

The CiviCase Dashboard also does not work for users with the restricted permissions. It does not give and error, but it does not return any results (for either upcoming or recent activities) even though it should.

My feeble attempts to trace the error suggest that it has to do with the 'has access to all cases' permission and how that gets validated in /CRM/Case/BAO/Case.php and then passed to getCases().

Any help is much appreciated!

Here is the full text from the error log if it's useful:

```
Aug 23 11:00:53  [info] $Fatal Error Details = Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -19
    [message] => DB Error: no such field
    [mode] => 16
    [debug_info] =>  SELECT COUNT(*) FROM (SELECT ANY_VALUE(civicrm_case.id) as case_id, ANY_VALUE(civicrm_case.subject) as case_subject, ANY_VALUE(civicrm_contact.id) as contact_id, ANY_VALUE(civicrm_contact.sort_name) as sort_name, ANY_VALUE(civicrm_phone.phone) as phone, ANY_VALUE(civicrm_contact.contact_type) as contact_type, ANY_VALUE(civicrm_contact.contact_sub_type) as contact_sub_type, ANY_VALUE(t_act.activity_type_id) as activity_type_id, ANY_VALUE(civicrm_case.case_type_id) as case_type_id, ANY_VALUE(civicrm_case.status_id) as case_status_id, ANY_VALUE(t_act.status_id) as status_id, ANY_VALUE(civicrm_case.start_date) as case_start_date, ANY_VALUE(case_relation_type.label_b_a) as case_role, ANY_VALUE(t_act.activity_date_time) as activity_date_time, ANY_VALUE(t_act.id) as activity_id       FROM civicrm_case
        INNER JOIN civicrm_case_contact ON civicrm_case.id = civicrm_case_contact.case_id
        INNER JOIN civicrm_contact ON civicrm_case_contact.contact_id = civicrm_contact.id        LEFT JOIN civicrm_phone
          ON civicrm_phone.contact_id = civicrm_contact.id
            AND civicrm_phone.is_primary = 1
        LEFT JOIN civicrm_relationship case_relationship
          ON case_relationship.contact_id_a = civicrm_case_contact.contact_id
            AND case_relationship.contact_id_b = 13622
            AND case_relationship.is_active
            AND case_relationship.case_id = civicrm_case.id
        LEFT JOIN civicrm_relationship_type_en_US case_relation_type
          ON case_relation_type.id = case_relationship.relationship_type_id
            AND case_relation_type.id = case_relationship.relationship_type_id WHERE (1) AND civicrm_case.is_deleted = 0 AND civicrm_contact.is_deleted <> 1 AND  case_relationship.contact_id_b = 13622 AND case_relationship.is_active   GROUP BY case_id  ORDER BY activity_date_time ASC) temp  [nativecode=1054 ** Unknown column 't_act.activity_type_id' in 'field list']
    [type] => DB_Error
    [user_info] =>  SELECT COUNT(*) FROM (SELECT ANY_VALUE(civicrm_case.id) as case_id, ANY_VALUE(civicrm_case.subject) as case_subject, ANY_VALUE(civicrm_contact.id) as contact_id, ANY_VALUE(civicrm_contact.sort_name) as sort_name, ANY_VALUE(civicrm_phone.phone) as phone, ANY_VALUE(civicrm_contact.contact_type) as contact_type, ANY_VALUE(civicrm_contact.contact_sub_type) as contact_sub_type, ANY_VALUE(t_act.activity_type_id) as activity_type_id, ANY_VALUE(civicrm_case.case_type_id) as case_type_id, ANY_VALUE(civicrm_case.status_id) as case_status_id, ANY_VALUE(t_act.status_id) as status_id, ANY_VALUE(civicrm_case.start_date) as case_start_date, ANY_VALUE(case_relation_type.label_b_a) as case_role, ANY_VALUE(t_act.activity_date_time) as activity_date_time, ANY_VALUE(t_act.id) as activity_id       FROM civicrm_case
        INNER JOIN civicrm_case_contact ON civicrm_case.id = civicrm_case_contact.case_id
        INNER JOIN civicrm_contact ON civicrm_case_contact.contact_id = civicrm_contact.id        LEFT JOIN civicrm_phone
          ON civicrm_phone.contact_id = civicrm_contact.id
            AND civicrm_phone.is_primary = 1
        LEFT JOIN civicrm_relationship case_relationship
          ON case_relationship.contact_id_a = civicrm_case_contact.contact_id
            AND case_relationship.contact_id_b = 13622
            AND case_relationship.is_active
            AND case_relationship.case_id = civicrm_case.id
        LEFT JOIN civicrm_relationship_type_en_US case_relation_type
          ON case_relation_type.id = case_relationship.relationship_type_id
            AND case_relation_type.id = case_relationship.relationship_type_id WHERE (1) AND civicrm_case.is_deleted = 0 AND civicrm_contact.is_deleted <> 1 AND  case_relationship.contact_id_b = 13622 AND case_relationship.is_active   GROUP BY case_id  ORDER BY activity_date_time ASC) temp  [nativecode=1054 ** Unknown column 't_act.activity_type_id' in 'field list']
    [to_string] => [db_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM_Core_Error::handle prefix="" info=" SELECT COUNT(*) FROM (SELECT ANY_VALUE(civicrm_case.id) as case_id, ANY_VALUE(civicrm_case.subject) as case_subject, ANY_VALUE(civicrm_contact.id) as contact_id, ANY_VALUE(civicrm_contact.sort_name) as sort_name, ANY_VALUE(civicrm_phone.phone) as phone, ANY_VALUE(civicrm_contact.contact_type) as contact_type, ANY_VALUE(civicrm_contact.contact_sub_type) as contact_sub_type, ANY_VALUE(t_act.activity_type_id) as activity_type_id, ANY_VALUE(civicrm_case.case_type_id) as case_type_id, ANY_VALUE(civicrm_case.status_id) as case_status_id, ANY_VALUE(t_act.status_id) as status_id, ANY_VALUE(civicrm_case.start_date) as case_start_date, ANY_VALUE(case_relation_type.label_b_a) as case_role, ANY_VALUE(t_act.activity_date_time) as activity_date_time, ANY_VALUE(t_act.id) as activity_id       FROM civicrm_case
        INNER JOIN civicrm_case_contact ON civicrm_case.id = civicrm_case_contact.case_id
        INNER JOIN civicrm_contact ON civicrm_case_contact.contact_id = civicrm_contact.id        LEFT JOIN civicrm_phone
          ON civicrm_phone.contact_id = civicrm_contact.id
            AND civicrm_phone.is_primary = 1
        LEFT JOIN civicrm_relationship case_relationship
          ON case_relationship.contact_id_a = civicrm_case_contact.contact_id
            AND case_relationship.contact_id_b = 13622
            AND case_relationship.is_active
            AND case_relationship.case_id = civicrm_case.id
        LEFT JOIN civicrm_relationship_type_en_US case_relation_type
          ON case_relation_type.id = case_relationship.relationship_type_id
            AND case_relation_type.id = case_relationship.relationship_type_id WHERE (1) AND civicrm_case.is_deleted = 0 AND civicrm_contact.is_deleted <> 1 AND  case_relationship.contact_id_b = 13622 AND case_relationship.is_active   GROUP BY case_id  ORDER BY activity_date_time ASC) temp  [nativecode=1054 ** Unknown column 't_act.activity_type_id' in 'field list']"]
)

Aug 23 11:00:53  [info] $backTrace = #0 /opt/bitnami/apps/civicrm/htdocs/sites/all/modules/civicrm/CRM/Core/Error.php(236): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /opt/bitnami/apps/civicrm/htdocs/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(922): CRM_Core_Error::handle(Object(DB_Error))
#2 /opt/bitnami/apps/civicrm/htdocs/sites/all/modules/civicrm/packages/DB.php(985): PEAR_Error->__construct("DB Error: no such field", -19, 16, (Array:2), " SELECT COUNT(*) FROM (SELECT ANY_VALUE(civicrm_case.id) as case_id, ANY_VALU...")
#3 /opt/bitnami/apps/civicrm/htdocs/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(575): DB_Error->__construct(-19, 16, (Array:2), " SELECT COUNT(*) FROM (SELECT ANY_VALUE(civicrm_case.id) as case_id, ANY_VALU...")
#4 /opt/bitnami/apps/civicrm/htdocs/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(223): PEAR->_raiseError(Object(DB_mysqli), NULL, -19, 16, (Array:2), " SELECT COUNT(*) FROM (SELECT ANY_VALUE(civicrm_case.id) as case_id, ANY_VALU...", "DB_Error", TRUE)
#5 /opt/bitnami/apps/civicrm/htdocs/sites/all/modules/civicrm/packages/DB/common.php(1907): PEAR->__call("raiseError", (Array:7))
#6 /opt/bitnami/apps/civicrm/htdocs/sites/all/modules/civicrm/packages/DB/mysqli.php(933): DB_common->raiseError(-19, NULL, NULL, " SELECT COUNT(*) FROM (SELECT ANY_VALUE(civicrm_case.id) as case_id, ANY_VALU...", "1054 ** Unknown column 't_act.activity_type_id' in 'field list'")
#7 /opt/bitnami/apps/civicrm/htdocs/sites/all/modules/civicrm/packages/DB/mysqli.php(403): DB_mysqli->mysqliRaiseError()
#8 /opt/bitnami/apps/civicrm/htdocs/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysqli->simpleQuery(" SELECT COUNT(*) FROM (SELECT ANY_VALUE(civicrm_case.id) as case_id, ANY_VALU...")
#9 /opt/bitnami/apps/civicrm/htdocs/sites/all/modules/civicrm/packages/DB/DataObject.php(2415): DB_common->query(" SELECT COUNT(*) FROM (SELECT ANY_VALUE(civicrm_case.id) as case_id, ANY_VALU...")
#10 /opt/bitnami/apps/civicrm/htdocs/sites/all/modules/civicrm/packages/DB/DataObject.php(1607): DB_DataObject->_query(" SELECT COUNT(*) FROM (SELECT ANY_VALUE(civicrm_case.id) as case_id, ANY_VALU...")
#11 /opt/bitnami/apps/civicrm/htdocs/sites/all/modules/civicrm/CRM/Core/DAO.php(439): DB_DataObject->query(" SELECT COUNT(*) FROM (SELECT ANY_VALUE(civicrm_case.id) as case_id, ANY_VALU...")
#12 /opt/bitnami/apps/civicrm/htdocs/sites/all/modules/civicrm/CRM/Core/DAO.php(1491): CRM_Core_DAO->query(" SELECT COUNT(*) FROM (SELECT ANY_VALUE(civicrm_case.id) as case_id, ANY_VALU...", TRUE)
#13 /opt/bitnami/apps/civicrm/htdocs/sites/all/modules/civicrm/CRM/Case/BAO/Case.php(551): CRM_Core_DAO::singleValueQuery(" SELECT COUNT(*) FROM (SELECT ANY_VALUE(civicrm_case.id) as case_id, ANY_VALU...")
#14 /opt/bitnami/apps/civicrm/htdocs/sites/all/modules/civicrm/CRM/Case/Page/AJAX.php(203): CRM_Case_BAO_Case::getCases(FALSE, (Array:5))
#15 /opt/bitnami/apps/civicrm/htdocs/sites/all/modules/civicrm/CRM/Core/Invoke.php(277): CRM_Case_Page_AJAX::getCases()
#16 /opt/bitnami/apps/civicrm/htdocs/sites/all/modules/civicrm/CRM/Core/Invoke.php(85): CRM_Core_Invoke::runItem((Array:12))
#17 /opt/bitnami/apps/civicrm/htdocs/sites/all/modules/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:3))
#18 /opt/bitnami/apps/civicrm/htdocs/sites/all/modules/civicrm/drupal/civicrm.module(444): CRM_Core_Invoke::invoke((Array:3))
#19 /opt/bitnami/apps/civicrm/htdocs/includes/menu.inc(527): civicrm_invoke("ajax", "get-cases")
#20 /opt/bitnami/apps/civicrm/htdocs/index.php(21): menu_execute_active_handler()
#21 {main}

```

# Answer
> 0 votes
UPDATE: Should be fixed in 5.36.0

---

This seems to be a bug - what's happening is the `type` parameter in the url is coming through as `my-cases` instead of the expected `upcoming` or whatever, so the view isn't getting included in the query. A quick fix, but not sure yet if it's the right one long-term, is to change this line at https://github.com/civicrm/civicrm-core/blob/5.14.2/CRM/Case/BAO/Case.php#L463 from

`case 'any':`

to

`case 'any': default:`

UPDATE: I'm seeing this back to version 5.1 at least but it's intermittent and doesn't depend on permissions. I've opened https://lab.civicrm.org/dev/core/issues/1207

---
Tags: civicase, permissions, dashlet
---


# Question
Title: Get a field label instead of value using the api
I would like to retrieve both the value as well as the label from a custom field using the api, but it only seems possible to retrieve the value. I wonder if this is possible, would surely help me a lot!

# Answer
I assume you mean a drop-down field? You then need to do another lookup on the OptionValue to get the label, e.g. from the api explorer:

```
    $result = civicrm_api3('OptionValue', 'get', [
      'return' => ["label"],
      'option_group_id' => "custom_marital_status",
      'value' => "S",
    ]);

```

gives you

```
"is_error": 0,
    "version": 3,
    "count": 1,
    "id": 866,
    "values": [
        {
            "id": "866",
            "label": "Single"
        }
    ]

```
> 2 votes

---
Tags: api
---


# Question
Title: Where do I find Webform CiviCRM module for D8?
I don't see a release under Downloads on the Drupal Project page: https://www.drupal.org/project/webform\_civicrm

# Answer
Two options:

1) look for and download the 8.x-5.x-dev version \[this is updated every couple of months/I will try make that weeks\]:

```
https://www.drupal.org/project/webform_civicrm/releases/8.x-5.x-dev

```

2) or check out the 8.x-5.x branch from the GitHub repo to always be on the latest:

```
git clone https://github.com/colemanw/webform_civicrm.git --branch 8.x-5.x

```

and then:

```
git pull

```
> 2 votes

---
Tags: webform-civicrm
---


# Question
Title: Problem upgrading CiviCRM on Joomla with Flexmailer + Mosaico installed
Today I've been trying to get all of my known CiviCRM on Joomla probelms documented as issues to help improve the CiviCRM Joomla experience. One glitch that I'm trying to investigate is that on my production site since installing Mosaico (and Flexmailer) I've had a problem with each CiviCRM version upgrade. The CiviCRM Database Upgrade Utility fails unless I disable Flexmailer (and Mosaico) first.

Most recently, going from 5.16.1 to 5.16.3, after installing 5.16.3 I didn't click on the CiviCRM Database Upgrade Utility link this time but instead went to Administer \> Administration Console \> System Status, then clicked on the alert for "Database update required". That gave me the following error:

`Class 'Civi\FlexMailer\Services' not found`

After disabling Mosaico and Flexmailer I was able to proceed with the database upgrade and it completed successfully.

On other occasions I have usually clicked the CiviCRM Database Upgrade Utility link. I don't know if that was the difference, but previously the database upgrade started but then stalled part way through. I didn't manage to reproduce it this time and couldn't find anything in the log.

This comment is I think regarding the same problem.

Because I can't reproduce this on a clean installation I haven't raised an issue yet. Can anybody else confirm if this is a problem for them currently?

I have Flexmailer 1.1.0 and Mosaico 2.1.1559427853 installed and Joomla 3.9.11.

# Answer
> 1 votes
I did had similar problem while upgrading mosaico recently. I disabled the extension to proceed with the database upgrade utility.

---
Tags: joomla, mosaico, flexmailer
---


title: Relative date filter possible in api?

text:
# Question
Title: Relative date filter possible in api?
I was wondering if it is possible to use (custom) relative date filters with the api?

For instance to find all participants of events in the current or last fiscal year.

Would save me a lot of trouble :-) Thanks fort thinking along!

# Answer
> 3 votes
Not sure what you mean by "custom" relative date filter, but if you're looking for filtering the results just like we have on the "Find Participant" form, then yes, looks like it is possible.

Eg - To find all participants registered in this fiscal year can be retrieved via -

i.e, select `Other` in the Parameter dropdown and enter `participant_register_date_relative` in the textbox as shown above.

The API that will be formed is -

```
$result = civicrm_api3('Participant', 'get', [
  'sequential' => 1,
  'participant_register_date_relative' => "this.fiscal_year",
]);

```

Similarly, for Previous Fiscal Year, enter `previous.fiscal_year` in the value field.

---
Tags: api
---


# Question
Title: Contacts: can one organisation be a 'child' of another?
Is there any way to make one organisation a part of another through a relationship? For example, we have a few NHS (National Health Service) teams among our contacts which we would like to put under one organisational umbrella.

I tried setting up a relationship the usual way but I couldn't add a relationship between two organisations, only an organisation and an individual.

At the moment we're using different addresses for each team as a workaround but that's not ideal.

# Answer
What I would do is: \- configure a new contact type 'NHS Team' based on organization \- cofigure a relationship type between organization and NHS team The standard relationship type 'Child of' only works between Individuals, as you can see in the configuration of the relationship types.

If this is gobbledygook for you, I'd recommend reading this: https://docs.civicrm.org/user/en/stable/organising-your-data/relationships/
> 4 votes

# Answer
I think Dave Plummer is trained when he refers to the parent company and son company.
> 0 votes

---
Tags: contacts, relationships
---


title: Event Attendance tracking

text:
# Question
Title: Event Attendance tracking
We want to use Events functionality in Civi CRM . As part of our requirement we need to provide attendance for tracking.

Is there a way to track attendance of event participants ?

# Answer
Participant records have a status field, and one of the standard statuses is Attended, so yes. And you can search for participants with a certain status and reports can include the status.

See also https://docs.civicrm.org/user/en/latest/events/keeping-track-of-events-and-participants/#changing-event-registration-selections-for-an-existing-participant

and

https://docs.civicrm.org/user/en/latest/events/reports/#event-and-participant-reports
> 6 votes

# Answer
Check out the new event participant management part of CiviMobile extension: https://civicrm.org/blog/skornien/event-participants-management-in-the-new-version-of-civimobile
> 1 votes

# Answer
Or this other extension that allow attendance tracking via a QRcode

https://github.com/progressivetech/net.ourpowerbase.qrcodecheckin
> 1 votes

---
Tags: civievent
---


title: Adding geocoding

text:
# Question
Title: Adding geocoding
We would like to be able to email people within 20 miles of a zipcode for our events. We are looking at adding geocoding in Civi. I saw there was an option for Google Geocoding and Open Street Maps.

Have you added geocoding? If so, what did you use and why? How has it worked out?

Thank you!

# Answer
> 3 votes
You'll want to install the Geocoder extension. This represents a significant improvement on existing geocoding providers.

Google Maps API is now relatively pricey, and Open Street Maps is free. I find they give roughly comparable quality, but with the Geocoder module you can use multiple geocoders.

# Answer
> 1 votes
Geocoder works well. After you installed and configure it, make sure you turn on the Scheduled Task for geocoding for civicrm to geocode addresses. Google Map does charge, but depending on your volume of geocoding, you could be remaining within their free tier.

---
Tags: geocoding
---


title: Newsletter sign up form on wordpress

text:
# Question
Title: Newsletter sign up form on wordpress
I've installed for the first time civiCRM.. and he is great... I have a wordpress website so I was wonderind what is the correct procedure to set up a newsletter subscription form. Thank you

# Answer
Essentially you want to display a form on your wordpress that takes in the personal details (name, email address) of your subscriber. these details will be fed into the civicrm on your wordpress and where the civimail module will pick up to send the newsletter to.

In quicksteps: 1. Create Profile (under Admin) 2. Select the fields required for this profile, these are fields that will appear in the subscription form 3. Expose the profile in the wordpress page (refer How do I expose CiviCRM forms in WordPress?)

You can refer to this website on setting up the form on wordpress in details: https://docs.civicrm.org/sysadmin/en/latest/integration/wordpress/forms/
> 1 votes

# Answer
The other way is to make the Groups 'public' and then provide navigation to a link to civicrm/?page=CiviCRM&q=civicrm/mailing/subscribe&reset=1
> 1 votes

---
Tags: wordpress, newsletter
---


# Question
Title: Quick and dirty decoupled CiviCRM with cron and export/import?
Working with an architecture of Drupal 8 running Open Social, and Backdrop running CiviCRM. Currently both virtual hosts on the same server, with separate mysql databases. The key issue: after tearing up and throwing out several architectures, I am months behind and need to get a demonstration site up and running yesterday, with a functional 1.0 ready as soon as possible—weeks, not months. The snag: I'm new to nearly every component here, with a background in a dozen CMSes and a few CRMs, but not these.

Have been consuming a firehose of information, and nearly every step has a dozen prerequisites that could take a week each. For example: a new member joining the organization needs a user account in both Drupal and Backdrop, with Backdrop integration to CiviCRM. It seems the "standard" method is to do this with API calls, but I'm new to the API and the three techniques the docs tell me I can use. Would be fine if this were January, but not in August.

Problem 2: whatever I build now is likely to be rapidly obsolesced. When CiviCRM is official for D8, we might decide to consolidate under one roof. Or I might be convinced by the increased security of CiviProxy and segregate the full Civi db behind a VPN. (Skipping it for now, I don't have time to learn what's not available yet.)

My question: are there quick and dirty techniques I can use to bypass the more expert methods? For example: export and import I can learn quickly, so if I write a single abstracted function, I can write data to a local file and use a cron trigger to read it into the other side. Boom, I can move data back and forth without resorting to a custom API script for each function. Nearly everything one site does will need to be reflected in the other; I need the simplest way of doing this.

I'm guessing I'll still need APIs for some activities, i.e., logging into the D8 site should be a single sign-on for both sites. (No idea how to do that. Help requested.) And I'm still totally unclear what UI will live where—that is, do I build members-only content in Backdrop, or do I use D8 views to pull in CiviCRM data and present there only? Again—the fastest and simplest is best, even if ugly; there will be time to retool later.

Suggestions? Many thanks, I'm drowning here.

# Answer
I think I have a partial answer—or at least, a tool that's looking good.

Answering Demerit's comment: both the Backdrop/CiviCRM and D8/Open Social sites are going to have public pages. My original assumption was that D8 would be primary site, with CiviCRM information fed into it—but the last few days of deeper dives into CiviCRM indicates that so much functionality is available there "for free" that I'm likely to make that the primary site, with a secondary community.mydomain.org domain for the social networking aspects. There's just a ton of stuff I thought I would have to custom-build which someone has already included in core.

Still the case that I need a new user/CiviCRM account to create its equivalent on D8, and that single sign-on would be nice. Both domains are subdomains of mydomain.org, so I can tackle that with cookies, but since I have to do account creation anyway, a more elegant approach that allows new domains to be used would be nice (we currently own four). This YouTube video on data integration led me to Pentaho, which looks excellent both for its abstraction capabilities handling any dataset, as well as its scripting interface. Not seeing much point in going through the trouble of learning and implementing SAML if I can do it all in one package. (And for the initial release, there are few methods I could use to avoid all of this—i.e., creating a hash on the primary site that someone has to use to create an account on the second manually, and suggesting they log into both with the "remember me" checkbox turned on.)
> 0 votes

---
Tags: drupal-views, drupal-8, backdrop
---


# Question
Title: Can CiviCRM be managed as a group of companies, where there is a parent company of the group of child companies?
An example of this Group of Financial Companies, which is the Parent company, then below it, are the other daughter companies, but that each one is granted their independent clients and their personalized invoices with their logo of each one, so , that is related to the group but that they handle their data separately within the same CiviCRM structures in a single and single installation.

# Answer
> 1 votes
I do not think this is possible out of the box with CiviCRM, with the customized receipts and invoices being the biggest stumbling block AFAIK.

However I have built integrations with other invoicing software and you might be able to solve your issues that way, but it will require development.

---
Tags: wordpress, profile, groups, smartgroups, settings
---


# Question
Title: Everything In CRM is Slow - Errors With CRM_Contact_BAO_GroupContactCache
After a database was corrupted and reloaded from a backup. Looking at the error log this appears to be where CiviCRM is hanging.

> CRM\_Contact\_BAO\_GroupContactCache::load(Object(CRM\_Core\_DAO))

Here is the debug information.

> \[debug\_info\] =\> CREATE TEMPORARY TABLE civicrm\_temp\_group\_contact\_cache1632 (SELECT 95 as group\_id, contact\_a.id as id FROM civicrm\_contact contact\_a LEFT JOIN civicrm\_email ON (contact\_a.id = civicrm\_email.contact\_id AND civicrm\_email.is\_primary = 1) WHERE ( ( (NULLIF(civicrm\_email.email, '') IS NOT NULL) AND contact\_a.do\_not\_email = AND contact\_a.is\_opt\_out = AND contact\_a.contact\_type = 'Individual' ) ) AND (contact\_a.is\_deleted = 0) AND contact\_a.id NOT IN ( SELECT contact\_id FROM civicrm\_group\_contact WHERE civicrm\_group\_contact.status = 'Removed' AND civicrm\_group\_contact.group\_id = 95 ) ); \[nativecode=1064 \** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND contact\_a.is\_opt\_out = AND contact\_a.contact\_type = 'Individual' ) ) AND ' at line 1\]

Any advice on how to resolve this is appreciated.

Thanks, Josh

# Answer
There's something wrong with your smart group with an ID of 95. However, this is unlikely to be causing a performance problem, since this query simply isn't running. If you can delete and recreate your smart group with an ID of 95, this error should go away.
> 2 votes

---
Tags: mysql, cache
---


# Question
Title: Upgrade Issues - Events links going to home page
I have upgraded from version 4.7 to latest version 5.16

When I click on an event live link, even from the admin, i get taken to the home page. The url is correct xxxx.com//?page=CiviCRM&q=civicrm%2Fevent%2Finfo&reset=1&id=111

I am having other issues, but working on them one by one.

Please helpppppp

Jennifer

# Answer
Plug In AGP Font Awesome Collection was conflicting with CiviCRM, no idea why, but Disabled it and it is now working great.
> 2 votes

---
Tags: civievent
---


# Question
Title: Problems with CF_CiviCRM Registration with Caldera Forms
My registrations are failing miserably and it's making me crazy. I can see that some values are being passed to contact profiles, but the users aren't being registered.

I'm on CentOS 7.x, PHP 7.2 with WP 5.2.2 and Civi 5.13.4.

I'm getting the following error:

```
Mandatory key(s) missing from params array: one of (first_name, last_name, email, display_name)

#0 /home/fpptaweb/public_html/wp-content/plugins/cf-civicrm/processors/contact/class-contact-processor.php(228): civicrm_api3('Contact', 'create', Array)
#1 /home/fpptaweb/public_html/wp-content/plugins/caldera-forms/classes/core.php(3273):    CiviCRM_Caldera_Forms_Contact_Processor->pre_processor(Array, Array, '_cf_process_5d5...')
#2 /home/fpptaweb/public_html/wp-content/plugins/caldera-forms/classes/core.php(5203): Caldera_Forms::process_submission()
#3 /home/fpptaweb/public_html/wp-content/plugins/caldera-forms/classes/core.php(3821): Caldera_Forms::process_form_via_post()
#4 /home/fpptaweb/public_html/wp-includes/class-wp-hook.php(286): Caldera_Forms->cf_init_system('')
#5 /home/fpptaweb/public_html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)
#6 /home/fpptaweb/public_html/wp-includes/plugin.php(465): WP_Hook->do_action(Array)
#7 /home/fpptaweb/public_html/wp-settings.php(546): do_action('wp_loaded')
#8 /home/fpptaweb/public_html/wp-config.php(88): require_once('/home/fpptaweb/...')
#9 /home/fpptaweb/public_html/wp-load.php(37): require_once('/home/fpptaweb/...')
#10 /home/fpptaweb/public_html/wp-blog-header.php(13): require_once('/home/fpptaweb/...')
#11 /home/fpptaweb/public_html/index.php(17): require('/home/fpptaweb/...')
#12 {main}

```

I have collected the first and last names as well as email. I'm not sure where to define the display\_name and where I should be passing it. Any help and guidance is appreciated.

# Answer
This was my own confusion and I had help from the CF-CiviCRM author. Great support there.

The problem was related to conditional statements in the form. I had created conditions for the appearance of all the contacts in a multi-contact form, but I hadn't applied conditions to processors.

I had assumed that the conditions related to the show/hide fields were inherited by processors. That's not the case. Instead, each contact processor had to have its own conditions applied to the group of fields.

For example. Only process the second contact group if First Name 2 is %first\_name\_2%. In other words, if the first name of the 2nd contact is blank, don't process that contact group. This is regardless of whether the conditions allow visibility for that contact. The visibility rules were not applied to the processing of the group.

Lesson learned, and maybe someone else will benefit from my experience.
> 2 votes

# Answer
Not sure what the exact error is, but to explain the backtrace mentioned above, it seems the contact create api is failing for some reason.

> I have collected the first and last names as well as email. I'm not sure where to define the display\_name and where I should be passing it. Any help and guidance is appreciated.

It is not that civi api is expecting a valid value for display\_name. The API is returning an error because it is not able to find any of the value sent from the CF to process and create a contact in civi. If any of the value from `first_name, last_name, email, display_name` is retrieved correctly by the api, the contact will be created without any error.

So make sure user enters a valid value for first name, last name or email field on the form OR make email as a required field, enable "Process email for this contact." in contact config, etc.
> 0 votes

---
Tags: wordpress, civievent, caldera-forms
---


# Question
Title: Why can't I create a new report from a template?
I am trying to create a dynamic event report from an existing standard template. I go to Administer, click Civireports, then Create new report from template, choose Participant Report, then change all the columns and filters and get the results I need. I rename the report from the Title tab. I preview the report, and everything looks how I want it. But then I have no option to save it anywhere. Very frustrating. Help please!

# Answer
Sounds like you may need to ask for (or give yourself - if you can) more permissions.
> 3 votes

---
Tags: reports
---


title: Installing CDN Tax Receipts For Us

text:
# Question
Title: Installing CDN Tax Receipts For Us
we are new to CIVICRM! I am wondering if someone could possibly help us with fully installing and setting us up with the the extension CDN Tax Receipts?

# Answer
> 2 votes
Welcome to CiviCRM! CDN TaxReceipts can be installed through your manage Extensions screen:

https://docs.civicrm.org/user/en/latest/introduction/extensions/#installing-extensions

If you run into config/support issues you can reach out here on SE. Best to ask detailed questions with screenshots.

If you run into a technical issue you can create an issue here: https://github.com/jake-mw/CDNTaxReceipts

A number of Canadian IT companies monitor this GitHub repo (Coop Symbiotic, Mustardseed NonProfit, PeaceWorks and ourselves).

---
Tags: receipts, donations, cdn-tax-receipts
---


# Question
Title: Is there a way to encrypt a single field in Civi database?
To protect sensitive data - such as HIPAA info

# Answer
> 3 votes
You should be able to use the functions in:

CRM/Utils/Crypt.php

to do symmetric encryption/decryption of the fields. Password related fields in the CiviCRM db are encrypted. As Lesley mentions, there are two aspects to this problem. Encrypting data, and restricting access to the data to a certain class of users

# Answer
> 2 votes
Do you want just one field encrypted or a group of fields (if you're dealing w/HIPAA data, probably it is more than one, right?) Create custom fields where the 'Type' is, say, 'HIPAA' (you can create this subtype by subtyping your basic object, whether it is Activities, Campaigns, or Contacts). From there, you'd need to add a hook/code to encrypt fields where the Type == HIPAA.. You'd need to also determine which user type(s) (Admin?) should be able to see unencrypted values and handle that.

# Answer
> 2 votes
We were recently asked to 'Encrypt one CiviCRM custom field' for one of our clients who uses Webform CiviCRM module as a GUI to view/edit/add custom field values to CiviCRM for their clients.

I ended up leveraging Drupal Encrypt module to not just encrypt the values stored on the Drupal side (in the Webform Submission) but also to encrypt the values stored on the CiviCRM side.

Using Webform CiviCRM module to handle view/edit/add custom field values means a variety of Drupal access permissions are available to control which user can see what.

**Example:** a:6:{s:4:"text";s:128:"JA/qWZ50z61GS7hA3mvXSyKSHjoOdxAnr+LttK8/ZIpLNOl1yTBY6+xPN0B9T08wqdat5Rvdbois1EVXrPXYA7OZO6ja08hW8NjNk1Fsn47TBJuWGWKpEC+k0cCjYAiV";s:6:"method";s:14:"mcrypt\_aes\_cbc";s:12:"key\_provider";s:15:"drupal\_variable";s:7:"options";a:1:{s:6:"base64";b:1;}s:15:"method\_settings";s:0:"";s:17:"provider\_settings";a:1:{s:6:"method";s:13:"base64\_decode";}}

If you think this may be useful, feel free to give it a try and let me know what you think. The code lives here -\> https://github.com/KarinG/webform\_deur\_encrypt

---
Tags: sql, security
---


# Question
Title: Errors in functions.php after installing 5.16.2 on Drupal 7
I'm running Drupal 7.67 on PHP 7.1 and am now getting the below error when I invoke Drush commands.

Another gripe is that upon install, Civi blew out my blocks settings, so I needed to reconstruct the site from a window I (thankfully) already had open.

I've not run into either of these issues before. Any suggestions greatly appreciated... thanks!

---

Warning: Unsupported declare 'strict\_types' in /\[site\]/sites/all/modules/civicrm/vendor/league/csv/src/functions.php on line 12

Parse error: syntax error, unexpected ':', expecting '{' in /\[site\]/sites/all/modules/civicrm/vendor/league/csv/src/functions.php on line 33 Drush command terminated abnormally due to an unrecoverable error. \[error\] Error: syntax error, unexpected ':', expecting '{' in /\[site\]/sites/all/modules/civicrm/vendor/league/csv/src/functions.php, line 33

# Answer
You will need to upgrade php version to 7.x. also check your apache/nginx and cli are using 7.x version of php

See https://docs.civicrm.org/sysadmin/en/latest/requirements/#php-version
> 2 votes

# Answer
UPDATE: found the answer

long ago, someone had added alias drush='/usr/bin/php5 /usr/local/bin/drush' to /etc/bash.bashrc I commented that out and all works as expected

I hit this same issue recently.

debian OS, php 7.1 on command line and in apache; same modules enabled; same configuration; can't see any differences between phpinfo() via apache and php -i on command line.

in apache, no errors. When I try to run drush I get the error reported above.

My temp fix is that since I also have php 7.2 installed on the server is to force drush to run with 7.2 -- this works for now. for example: /usr/bin/php7.2 /usr/local/bin/drush cc all

I've been unable to find the source of the error.
> 1 votes

---
Tags: drupal, installation
---


title: CKEditor in core now?

text:
# Question
Title: CKEditor in core now?
I had to symlink the plugins directory: core/modules/ckeditor/plugins -\> /var/www/html/drupal/web/libraries/ckeditor/plugins

to fix the white screen with drupal's kcfinder that happened with the drupal v8.7.4 to v8.7.6 upgrade, which also broke civi

The kcfinder white screens in civi were due to the fact that apparently the developers split the monolithic files into many small files, and they all have to be accessible over http for ckeditor to work, being client side javascript...:

```
  # Allow access to Statistics module's custom front controller.
  # Copy and adapt this rule to directly execute PHP files in contributed or
  # custom modules or to run another PHP application in the same directory.
  RewriteCond %{REQUEST_URI} !/core/modules/statistics/statistics.php$
  # allow access to kcfinder
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/browse.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/index.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/js_localize.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/upload.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/conf/config.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/core/autoload.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/core/bootstrap.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/core/class/browser.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/core/class/minifier.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/core/class/uploader.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/core/types/type_img.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/core/types/type_mime.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/css/index.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/integration/BolmerCMS.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/integration/civicrm.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/integration/drupal.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/js/index.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lang/af.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lang/bg.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lang/ca.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lang/cs.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lang/da.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lang/de.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lang/el.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lang/en.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lang/es.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lang/et.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lang/fa.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lang/fi.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lang/fr.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lang/he.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lang/hu.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lang/id.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lang/it.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lang/ja.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lang/lt.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lang/lv.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lang/nl.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lang/no.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lang/pl.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lang/pt-br.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lang/pt.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lang/ro.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lang/ru.php$

  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lang/sk.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lang/sv.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lang/tr.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lang/uk.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lang/vi.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lang/zh-cn.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lib/class_fastImage.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lib/class_image.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lib/class_image_gd.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lib/class_image_gmagick.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lib/class_image_imagick.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lib/class_zipFolder.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lib/helper_dir.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lib/helper_file.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lib/helper_httpCache.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lib/helper_path.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/lib/helper_text.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/themes/dark/css.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/themes/dark/js.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/themes/default/css.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/themes/default/js.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/tpl/tpl_browser.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/tpl/tpl_css.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/tpl/tpl_javascript.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/cache/base.js$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/cache/theme_dark.js$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/cache/theme_default.js$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/js/000._jquery.js$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/js/002._jqueryui.js$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/js/006.jquery.uniform.js$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/js/010.jquery.fixes.js$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/js/020.jquery.rightClick.js$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/js/021.jquery.taphold.js$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/js/029.jquery.agent.js$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/js/030.jquery.helper.js$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/js/031.jquery.md5.js$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/js/040.object.js$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/js/041.dialogs.js$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/js/050.init.js$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/js/060.toolbar.js$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/js/070.settings.js$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/js/080.files.js$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/js/090.folders.js$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/js/091.menus.js$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/js/091.viewImage.js$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/js/100.clipboard.js$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/js/110.dropUpload.js$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/js/120.misc.js$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/themes/dark/init.js$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/packages/kcfinder/themes/default/init.js$

  RewriteCond %{REQUEST_URI} !/libraries/civicrm/extern/authorizeIPN.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/extern/cxn.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/extern/ipn.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/extern/open.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/extern/pxIPN.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/extern/rest.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/extern/soap.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/extern/url.php$
  RewriteCond %{REQUEST_URI} !/libraries/civicrm/extern/widget.php$

```

inserted at line 149 in web/.htaccess did it for us. your line number might be different.

Just make sure these exclusions come after : \# Allow access to PHP files in /core (like authorize.php or install.php): RewriteCond %{REQUEST\_URI} !/core/\[^/\]\*.php$ \# Allow access to test-specific PHP files: RewriteCond %{REQUEST\_URI} !/core/modules/system/tests/https?.php

/begin rant about drupal.org I'll never understand why people feel the need to rearrange stuff for sake of rearranging it and breaking stuff in the process. At least don't do a half assed job of it. /end rant

technically the rules above could be condensed to directory exclusions, but you never know what they'll end up putting in those directories....

# Answer
see above. the solution is in the question
> 1 votes

---
Tags: ckeditor
---