# Question
Title: CiviCRM Entity Tags does not appear in Rules
I am trying to follow the procedure outlined in How can I create a Drupal user when someone submits a CiviCRM-Webform?... but when I try to add the Event to the Rule described, 'CiviCRM Entity Tag' does not appear in the list of possible triggers. I must be missing some module or configuration option, but can't see it. Any help welcome, Thanks, Tony

# Answer
> 1 votes
Try this:

```
{ "rules_self_create_user_account_and_login" : {
"LABEL" : "Create User Account",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [ "civicrm", "rules" ],
"ON" : { "civicrm_entity_tag_create" : [] },
"IF" : [
  { "NOT civicrm_entity_user_exists" : { "civicrm_contact" : [ "civicrm-entity-tag:entity-id-contact" ] } },
  { "data_is" : {
      "data" : [ "civicrm-entity-tag:entity-table" ],
      "value" : "civicrm_contact"
    }
  },
  { "data_is" : { "data" : [ "civicrm-entity-tag:tag-id" ], "value" : "XXXX" } }
],
"DO" : [
  { "civicrm_entity_action_create_user" : {
      "USING" : {
        "civicrm_contact" : [ "civicrm-entity-tag:entity-id-contact" ],
        "is_active" : "1",
        "notify" : "1",
        "signin" : "1",
        "username_format" : "email"
      },
      "PROVIDE" : { "civicrm_user" : { "civicrm_user" : "Created Drupal User" } }
    }
  },
  { "redirect" : { "url" : "civicrm\/user?reset=1" } }
]

```

} }

set XXX to be your Tag ID

EDIT (thx to jackrabbithanna) Make sure Entity Tag is enabled here: admin/structure/civicrm-entity/settings

---
Tags: civicrm-entity, drupal-rules
---


title: Drupal OG creation on Membership

text:
# Question
Title: Drupal OG creation on Membership
trying to implement the following workflow - New Organisation Membership approval in CiviMember creates OG in Drupal called after Org, with Org drupal account as OG admin. I'm looking at maybe using Rules, but I'm a bit new to the module, any tips appreciated.

CiviCRM 5.3.0 Drupal 7.59

# Answer
Unfortunately Drupal rules module is not triggered on CiviCRM membership CRUD function and CiviRules does but doesn't provide option to perform any CMS changes like creating OG groups in your case. I would recommend to create an extension or drupal module and use CiviCRM post hook to create OG group. eg:

```
function extensions_civicrm_post($op, $objectName, $objectId, &$objectRef) {
  if ($objectName == 'Membership' && $op == 'create') {
    try {
      $orgName = civicrm_api3('Contact', 'getvalue', [
        'return' => "organization_name",
        'id' => 1,
        'contact_type' => "Organization",
      ]);
    }
    catch (CiviCRM_API3_Exception $e) {
      // Not a organization contact
      return;
    }
    // get the user id who will controll this group either Employee of relationship?
    $userId = 1;

    //create OG
    $node = new stdClass();
    $node->type = "og_node"; // use the machine name of OG group node type
    node_object_prepare($node);
    $node->title = $orgName;
    $node->language = LANGUAGE_NONE;
    $node->uid = $userId;
    $node->group_group[LANGUAGE_NONE][0]['value'] = TRUE;
    node_save($node);

    $roles = array_flip(og_roles('node', 'og_node', $node->nid));
    og_role_grant('node', $node->nid, $user->uid, $roles[OG_ADMINISTRATOR_ROLE]);
    $values = [
      'entity_type' => 'user',
      'entity' => $userId,
    ];
    og_group('node', $node->nid, $values);
  }
}

```

HTH

Pradeep
> 2 votes

---
Tags: civimember, drupal-rules
---


# Question
Title: How can I easily identify recurring contributions that failed to be recorded or failed to occur
Anyone have a good recipe or a report for finding folk who had a recurring payment due in say the last 2 weeks but for whom no contribution was received?

I can see ways to do this with Smart Groups and Include/Exclude or via Drupal Views - but thought there might already be a better solution - looks like iATS have an email notification (nice)

# Answer
Here is a View (well a pair of them actually)
> 2 votes

# Answer
I would think the answer might be somewhat payment-processor dependent, i.e. how it handles failures. With iATS, we record failures as failed contributions, but an IPN-oriented/processor-managed-schedule would not work the same. Similarly, the next-scheduled-contribution-date field and the number of consecutive failures fields are also potentially useful, if used by the processor.

When those fields are used, then it's relatively simple to generate all kinds of reports, e.g. a monthly report of all the currently failing recurring cc payments.

Even if you're not using those fields, you could generate a report of all contacts with an active recurring contribution for which there is no contribution in the past month, but that's not entirely reliable.

In general, handling failing recurring contributions is tricky because I often see abandoned recurring contribution series beside new ones and you don't want to harangue an existing monthly donor if they have an old expired one sitting there ...

The email-to-an-administrator is a simple feature that we implemented in the iATS recurring-payment job, it could get bundled into the corresponding api job if you think it's a generally useful feature. On the other hand, my experience of trying to control emails sent by CiviCRM core relating to recurring emails has been spotty, so I'm not quite convinced that's a good route ...

My last point would be to encourage us to express these issues as stories/use-cases, because there are different times you'd want to keep track of failures and how you want to do it might depend, e.g. if it's an automated feature vs. an admin followup.
> 0 votes

---
Tags: recurring-contributions, reports
---


# Question
Title: Fix For "Incorrect Resource URL" Not Working
I am getting the error "Incorrect Resource URL" and seeing 404 for URLs that go to "undefinedjs/jquery/jquery.crmAjaxTable.js" and many instances of the error "Unable to reach the server. Please refresh this page in your browser and try again."

I have tried resetting the URL (/admin/setting/updateConfigBackend?reset=1), adding a static path (civicrm/admin/setting/url?reset=1) and doing an override (https://docs.civicrm.org/sysadmin/en/latest/customize/settings/).

I am seeing the error in the UI and viewing the 404 using the browser console. I am also using the CV command from the command line and see that the generated path from (/admin/setting/updateConfigBackend?reset=1) does not match what I would expect.

\[root@domain default\]# cv path -c userFrameworkResourceURL https://crm.domian.org//home/user/public\_html/sites/all/modules/civicrm

I think the URL should be https://crm.domian.org/sites/all/modules/civicrm.

This started when upgrading a Drupal 7 site to 4.7.28.

Help with this is greatly appreciated. I am out of ideas.

Thanks!

# Answer
> 4 votes
We've had basic authentication active on the installation which broke the check. After adding the server IP to the whitelist the error disappeared.

# Answer
> 1 votes
Just fixed this on my site by setting allow\_url\_fopen to "on" in php settings.

# Answer
> 1 votes
I had this issue, which came down to the `l10n.js` file not being created correctly. To troubleshoot this, I:

* Opened my browser's Developer Tools (by pressing F12);
* Went to the "Network" tab and filtered by "JS";
* Found the file that had my current language in the name (see screenshot - in this case, "en\_US").
* Right-clicked the name and selected "Open in New Tab".

I saw an error message, which I was able to troubleshoot more directly.

For folks upgrading to Civi 5.3.x using multilingual, you're likely to encounter the same problem. The trick is to rebuild the multilingual schema. I did this with `drush cvapi system.rebuildmultilingualschema`, comparable commands exist for WordPress etc.

I figured this out because my images weren't loading, which I saw used the value `CRM.config.resourceBase` which this forum post told me was set in the `l10njs/<language>` file.

---
Tags: civicrm.settings.php, settings
---


# Question
Title: What to do with "mcrypt" message after upgrading to PHP 7.2
What should I do about the following message in my CiviCRM status page, after upgrading to CiviCRM 5.3.0, PHP 7.2 from 5.6, and also upgrading my OS from Debian 8 to Debian 9:

> PHP Missing Extension "mcrypt". Your PHP does not include the recommended encryption functions. Some passwords will not be stored encrypted, and if you have recently upgraded from a PHP that does include these functions, your encrypted passwords will not be decrypted correctly. If you are using PHP 7.0 or earlier, you probably want to include the "mcrypt" extension.

Rather than downgrade to PHP 7.0, how do I know if I need this extension, if I was using it before, and what I can do to make sure I'm taken care of with regard to encryption? If I am on PHP 7.2, can I just ignore this message? Can I use something else since it was deprecated in 7.1 and removed in 7.2?

Upon trying to install it with the PECL library, I get:

> php-mcrypt : Depends: php7.2-mcrypt but it is not installable E: Unable to correct problems, you have held broken packages.

What is throwing me off is that part that says,

> "If you are using PHP 7.0 or earlier"

And if I'm not on PHP 7.0 or earlier, what should I do, install it anyway? Thanks!

# Answer
After further investigation I'm extending my answer and splitting it in two. First addressing the mcrypt and php 7.2 issue and then the drupal/civicrm and php 7.2 compatibility.

## Php 7.2 and mcrypt

As stated above, and citing the link with the install instructions for mcrypt:

> Because of the end of the mcrypt extension’s development, the extention was also removed from PHP 7.2 and moved to an unofficial PECL repository. However, you can still find the mcrypt extention in PHP 5.4 through PHP 7.1. The arrival of PHP 7.2 has been announced but it won’t contain mcrypt extention. For PHP 7.2+, PHP instead uses libsodium as a cryptography library.

There is a reason why mcrypt was removed from php 7.2, installing it on your own is not a good idea.

> If libmcrypt were still being maintained, we could work with the libmcrypt team to improve it. Unfortunately, it was abandoned in 2007, and contains unfixed bugs and patches that will never be merged.

Also, ***libsodium*** was used to replace ***mcrypt*** in the latest php release (7.2). In the case of Drupal, you can read the following comment in this issue, where you also have the option of using ***phpseclib***:

> For 7.x-1.x version default option changed to use PHPSecLib. So to avoid using mcrypt within larger profiles/bundles like Commerce one should add the Libraries module and download PHPSecLib into proper location. This can be easily achieved using Drupal Profiles.

So, with php 7.2 you could use libsodium, phpseclib or openssl if you care about the security of your application and take the time to implement it.

## Drupal / Civicrm and php 7.2

Drupal 7 doesn't support php 7. 2 in its current 7.59 release, it will from version 7.60 onwards.

CiviCRM 5.x supports up to php 7.1

As you can see, they both support php 7.1,so I would advise you to install that version instead of 7.2 and everything should work as expected.
> 4 votes

# Answer
As the author of that message, let me try and clarify ...

The mcrypt extension is (only) used to encrypt selected passwords, and "selected" as far as I know usually only includes the smtp password, (which you may not even be using).

The message is there that so that if you upgrade your php version and the new one doesn't include mcrypt, you are aware that your encrypted passwd(s) won't be unencryptable, and you'll have to re-input them.

Civi doesn't encrypt all passwds, and it's not a terrible thing not to encrypt them (these aren't user passwds, btw!), so the warning is just a convenience to avoid confusion and delay.

Now that mcrypt is no longer included in php, the message should get updated.

Conclusion: I'd stay on 7.2 if it's working otherwise.
> 8 votes

# Answer
I believe you can install php mcrypt extension for 7.2

https://lukasmestan.com/install-mcrypt-extension-in-php7-2/

https://www.techrepublic.com/article/how-to-install-mcrypt-for-php-7-2/

Install using PECL:

```
sudo apt-get -y install gcc make autoconf libc-dev pkg-config
sudo apt-get -y install php7.2-dev
sudo apt-get -y install libmcrypt-dev
sudo pecl install mcrypt-1.0.1

```

HTH

Pradeep
> 2 votes

---
Tags: drupal, php
---


# Question
Title: Any way to allow non validated (public visitors) to search the PCP pages available for an event?
Still evaluating CIVICRM for use by my organisation and I love most of the functionality.

One thing I need, and I'm surprised it's not core functionality - or perhaps it is and I haven't found it yet.....

Having created an event (a sponsored cycle ride in my case) and having participants register and create PCP pages, is there any way to allow a member of the public (i.e. not a logged in registered user) to search the PCP pages available for the event in order to find a particular participant they want to sponsor?

I've extended this somewhat by adding the PCP for Teams extension from uk.co.vedaconsulting.pcpteams so would need to integrate with that and search for individuals or teams.....

# Answer
> 2 votes
Here’s a working example of a PCP site using that specific Veda Extension as a basis. I’ve made some small edits thus far and have committed them back upstream;

https://secure.thewellspringfoundation.org

We decided to organIze the View (list of Team and Individual PCP pages) as a Leaderboard (based on funds raised thus far) but that could easily be an Exposed Search Term in the View.

# Answer
> 0 votes
If you are using Drupal and CiviCRM Entity and Views then you can build Views that would function as your PCP search/results feature

---
Tags: civievent, drupal, extension, search, pcp
---


# Question
Title: Failed contribution does not re-run if reject code is REJ:25 Capture card. Reported lost or stolen
We have our iATS Payment Settings failure count settings set to 3. In general this causes a failed donation to run for 2 consecutive days after the initial failed attempt. This would be 3 failed attempts in total. After the third failed attempt, Civi sets the next scheduled date to the following month.

However, if the transaction fails with a REJ:25 Card lost or stolen code, the transaction does not attempt to re-run the transaction at all set the next scheduled date to the following month.

Is this a core feature of civi or is this a bug in our set up?

# Answer
> 2 votes
That's intentional. If the Card is lost or stolen REJ: 25 - you don't want to be transacting it as it can result in charge backs (and even fines). So the idea is we push the next\_scheduled\_date one month into the future and give you a chance to connect with the donor to update their card details. A REJ:15 is often a temporary problem so that one we would try again tomorrow \[as you indicated in your iATS Payments Settings\].

---
Tags: civicontribute, iats
---


# Question
Title: Automatically create recurring donations from bank statements
I'm using the wonderful civibanking extension to import the bank statments, including creating the contributions from the donors that directly wire money to our bank account

for the "normal" bank transfers (one off) it works great, we lookup the donor, create a new contribution and all is well

However, we have some donors that sends the same amount every month. They have a different transfer type (one of the column in the bank statement), so we can identify them.

Instead of "simply" creating a contribution, we'd like to 1) check if there is an active recurring contribution of type "bank transfer", if not, create it 2) add the contribution as one linked with that recurring contribution

Is this possible to do out of the box? Any guidance on how to code it?

# Answer
> 1 votes
I am not sure if Civirules does it(pretty sure it doesn't). Through an extension i would use pre hook to check and create contribution recur when a contribution is created. Here is small snippet

```
function extension_civicrm_pre($op, $objectName, $id, &$params) {
  if ($objectName == 'Contribution' && $op == 'create') {
    $bankTransferFinancialTypeId = civicrm_api3('FinancialType', 'getvalue', [
      'return' => "id",
      'name' => "Bank Transfer",
    ]);
    if ($bankTransferFinancialTypeId == $params['financial_type_id']) {
      // perform checks if contribution recur exists
      try {
        $recurringcontributionId = civicrm_api3('ContributionRecur', 'getvalue', [
          'return' => "id",
          'contact_id' => $params['contact_id'],
          'amount' => $params['total_amount'],
          'contribution_status_id' => ['IN' => ["Pending", "In Progress"]],
          'options' => ['limit' => 1],
        ]);
      }
      catch (CiviCRM_API3_Exception $e) {
        $recurringcontribution = civicrm_api3('ContributionRecur', 'create', [
          'contact_id' => $params['contact_id'],
          'installments' => '12',
          'frequency_interval' => '1',
          'amount' => $params['total_amount'],
          'contribution_status_id' => 'In Progress',
          'start_date' => date('YmdHis'),
          'currency' => 'USD',
          'frequency_unit' => 'month',
        ]);
        $recurringcontributionId = $recurringcontribution['id'];
      }
      $params['contribution_recur_id'] = $recurringcontributionId;
    }
  }
}

```

> Note: This snippet is not tested since i have just created it and is pure blind coding.

HTH

Pradeep

---
Tags: civicontribute, recurring-contributions, civibanking
---


# Question
Title: How to find out the URL of my search results and edit the columns in the results?
Using CiviCRM 5.x and Drupal 7 on localhost.

2 Questions:

1- How to fetch URL that has a full lists of contacts. Right now I can copy they URL, but when I flush the cache the URL changes, so I would need something like Path Auto for this?

2- How to modify the fields the table list view of contact

I'm attaching the screen capture for demonstration purposes:

# Answer
1. You can configure profile to use as contact search. You can also control the result columns in profile search. To display contact result by default you can append force=1 in url.

Ref: https://docs.civicrm.org/user/en/latest/the-user-interface/searching/#views-for-display-contacts

2. You can create smart group which holds all the contacts and use the contacts link from Manage group page to use as a url.
3. Use contact search url and apend force=1 to display contact by default.

HTH

Pradeep
> 4 votes

# Answer
Answer part of your Question.

You can create a Profile - and then from Adv Search you can specify which 'Views For Display Contacts' to use

> If you are displaying the search results as contacts, you can modify the columns displayed by creating a Profile containing a different set of contact fields and then selecting that Profile here. For example you may want to include columns for Gender and Date of Birth, while eliminating Country. (learn more...)
> 1 votes

---
Tags: profile, search-results
---


# Question
Title: System Status Page Error after 5.3.1 Upgrade
I was simply updating from 5.3 to 5.3.1 and got the following error on System Status Page -

> Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or service provider with more details about what action you were performing when this occurred. You have requested a non-existent service "civi\_flexmailer\_required\_tokens".

This error replaces the entire System Status page. I resolved it somehow by disabling flexmailer and mosaico and then re-enabling them. Quite odd.

Update: This error also occurred when updating from 5.3.1 to 5.6

# Answer
I resolved it by disabling Mosaico, then Flexmailer; and then re-enabling them in the opposite order: Flexmailer then Mosaico (the order is important!).

I used the Administration screen to manage CiviCRM extensions; but you could also use Drush if your Civi is on Drupal.
> 4 votes

---
Tags: flexmailer, system-status
---


title: E-mail body blank to some recipients

text:
# Question
Title: E-mail body blank to some recipients
I'm having an issue similar to that described in Blank emails to some specific addresses

When I send an e-mail to myself (using SMTP through Civi) it is fine. However, some recipients do not see the body text of e-mails. This occurs with both html and plaintext. It does not appear to be dependent upon the e-mail provider of the recipient, as Gmail (which works for me) does not show the e-mail body for others. One recipient who also has system access sent the test SMTP settings e-mail to themself and it worked, body text included, but sending a regular e-mail through the system did not. I'd greatly appreciate help with this issue as I'm having trouble identifying the cause.

Using 5.3.1, but the issue was present prior to upgrade as well.

# Answer
Check the permissions on the site's civicrm directory. Make sure it belongs to the site.
> 1 votes

---
Tags: civimail, email, smtp
---


# Question
Title: problems with upgrade on multilingual site (in this case 4.7.31 to 5.3.1)
When upgrading a multilingual site, after the database upgrade ran the site would not correctly load the status page (or any page that loads via javascript), for one example, the url used in the html calling the arrow image for the admin menu contains the string (for example) /en/civicrm/a/undefinedpackages/jquery/css/images/arrow.png or /es/civicrm/a/undefinedpackages/jquery/css/images/arrow.png

# Answer
> 2 votes
There is some issue in rebuilding schema for multilingual instance when upgraded to 5.x version. For the moment you will need to manually rebuild the schema using drush or civi api.

Details to rebuild schema can be found at Multilingual instances show 'no such field' errors after update

HTH

Pradeep

# Answer
> 0 votes
this might be specific to this one site, but in case it's not here's what worked for me. after any upgrade to civicrm for a multilingual site, after the civicrm database upgrade, run

```
drush php-eval 'civicrm_initialize(); CRM_Core_I18n_Schema::rebuildMultilingualSchema(["en_US","es_MX"], NULL);'

```

replacing the language codes with whichever languages you are using

---
Tags: drupal, upgrade, multilingual
---


title: Donation Method - Suggested use?

text:
# Question
Title: Donation Method - Suggested use?
Payment method is pretty clear, however, we would like to be able to differentiate between donations that come via Online, Mail, in person, etc. It seems like source would make the most sense, but since it is an open field - its not our best option. Do most orgs simply use a custom field, that is our plan, but I wanted to know if there is a better approach before I do.

# Answer
> 1 votes
You can create your own payment method to differentiate type of payments. If you have a fixed set of options than you can go for custom field against contribution and want to keep payment method consistent.

HTH

Pradeep

# Answer
> 1 votes
Yes for large orgs we do track this by custom select field on the Contribution entity.

Eg

* DM Fall 2017
* DM Spring 2018
* PhoneBank etc

That way the appropriate Dept can be credited with the new / increase in PAC; etc

---
Tags: civicontribute, contributions
---


# Question
Title: Child groups with all parents disabled shows in group list
I'am currently using Civicrm version 5.3.1 with drupal 7.59.
Steps to replicate:

1. Create one group, parent A.
2. Create a one group, child A and assign parent A group created above as parent.
3. Disable parent A group.
4. Go to contacts-\>manage groups. You are unable to see both parent and child groups.
5. Click on any search criteria. Unclick it. You can see the `child A` group with title as `Child A Child of:`. With null value for parent

**How it works currently:** If a child group has multiple parent groups and one of them is disabled, the child group should to show up on group selector lists. This has been fixed here https://issues.civicrm.org/jira/browse/CRM-20934.

If all parent group(s) are disabled the child group still shows up in search mode.

Is this the expected behaviour?

Shouldn't the child group be removed from the selector lists if all parent group(s) are disabled?

# Answer
> 0 votes
Well, you could still have contacts assigned to a (enabled) child group, so I don't find it very surprising you can use it on search.

More generally, what enabled/disabled means in the context of group hierarchy is probably not fully clear, and it's likely that different users expect different things, and it's especially true with multiple hierarchical relationships.

Wouldn't it be easier you disable the child groups when you disable the parent (assuming it's not happening too often)?

---
Tags: contacts, groups
---


# Question
Title: cv error: "Call to undefined function Civi\Cv\Command\posix_getuid()"
When I run `cv` on a server, I get the following error:

```
[Symfony\Component\Debug\Exception\FatalThrowableError]
Call to undefined function Civi\Cv\Command\posix_getuid()

```

Furthermore, I noticed that usually when I run `cv --help` the output is in color - on this server the output is in black and white.

# Answer
> 5 votes
`cv` has a PHP dependency that CiviCRM doesn't - the `posix` plugin. It's installed by default on many systems with PHP (e.g. Debian/Ubuntu) but with the Red Hat/CentOS "remi" repository, it isn't. You can install the php-process package to resolve this.

---
Tags: cv
---


title: saving mapping fields

text:
# Question
Title: saving mapping fields
I have just saved fields for exporting to a new saved mapping field, but it is not coming up as an option when I go back into the database and try to export the same details for another group. I'm clicking "done" after chosing to save the mapping field so I don't know why it doesn't then appear as an option.

# Answer
> 1 votes
1.Check if the actual mapping is saved - /civicrm/admin/mapping?reset=1

(Tip – Mappings only get saved/updated once you physically hit the export button)

2.The use a saved field mapping, the drop down will only appear if you select the “Select fields for export"

---
Tags: database
---


title: CiviCRM upgrade paths

text:
# Question
Title: CiviCRM upgrade paths
I have Civicrm 5.3.0 on Wordpress. - It says need to upgrade a security patch. Should it be 5.3.1 or 4.6.38 first? Want to end up with 5.3.2

# Answer
> 3 votes
You can upgrade to 5.3.2 (and that will then automatically include 5.3.1 - the security release)

---
Tags: wordpress, upgrade
---


# Question
Title: endless spinner when selecting event location
When selecting a different location for an event where this event is the only one using the current location, upon save you'll see an endless spinner.

Everything seems to get deleted just fine in the d/b (the previous location gets deleted as it's no longer needed as it was only used by one event ... that's how Civi does it, anyway), but the endless spinner in the UI is annoying and our staff get worried. ('coz, you know, we saw the recent bug where creating a new location inserted this location to all events that shared the previous location ... anyway, our staff are a little gun shy as you can imagine).

In the error log, I see the following:

```
[code] => -3
[message] => DB Error: constraint violation
[mode] => 16
[debug_info] => UPDATE  civicrm_loc_block  SET address_id = 29774 , email_id = NULL , phone_id = NULL , im_id = NULL , address_2_id = NULL , email_2_id = NULL , phone_2_id = NULL , im_2_id = NULL   WHERE (  civicrm_loc_block.id = 61 )   [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`evergr55_test`.`civicrm_loc_block`, CONSTRAINT `FK_civicrm_loc_block_address_id` FOREIGN KEY (`address_id`) REFERENCES `civicrm_address` (`id`) ON DELETE SET NULL)]
[type] => DB_Error
[user_info] => UPDATE  civicrm_loc_block  SET address_id = 29774 , email_id = NULL , phone_id = NULL , im_id = NULL , address_2_id = NULL , email_2_id = NULL , phone_2_id = NULL , im_2_id = NULL   WHERE (  civicrm_loc_block.id = 61 )   [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`evergr55_test`.`civicrm_loc_block`, CONSTRAINT `FK_civicrm_loc_block_address_id` FOREIGN KEY (`address_id`) REFERENCES `civicrm_address` (`id`) ON DELETE SET NULL)]
[to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="" info="UPDATE  civicrm_loc_block  SET address_id = 29774 , email_id = NULL , phone_id = NULL , im_id = NULL , address_2_id = NULL , email_2_id = NULL , phone_2_id = NULL , im_2_id = NULL   WHERE (  civicrm_loc_block.id = 61 )   [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`evergr55_test`.`civicrm_loc_block`, CONSTRAINT `FK_civicrm_loc_block_address_id` FOREIGN KEY (`address_id`) REFERENCES `civicrm_address` (`id`) ON DELETE SET NULL)]"]

```

I was able to reproduce this on one of the demo sites (which uses Drupal; I'm seeing it on Joomla on my end).

Anyone else seen this issue? Wanted to check here before submitting an issue on Github.

Thx

# Answer
> 2 votes
This got solved on our site on CiviCRM 5.3.1 and Joomla 3.8.10 by creating and entering a Google Geocoding API key

---
Tags: civievent, location
---


# Question
Title: Setting up non-Admin user account in Drupal / CiviCRM - Menu bar not visible
When I create a user account with authenticated user permissions + some additional create/edit permissions, the Drupal Menu-bar or the CiviCRM menu-bar doesn't show. Only when I add the admin privileges to the user account, do I see the menu bar. So how is a non-admin person supposed to navigate between the various modules (contact/ membership/ event/ contribution etc.) without having full admin rights? Am I missing something? Thank you for your help.

# Answer
> 1 votes
One option would be to create a Menu Block or just a Block with some links and set it in to a region with settings so it only shows for Authenticated

But also, am unclear if you really want a non-admin person getting to those 'modules'.

If a non-admin person is making donations, registering for events they do not need access to CiviCRM itself.

Perhaps update your Q with more detail about what the non-admin person needs to access perhaps by providing the paths you want them to get to so you avoid saying 'member page' which could be construed in many ways. HTH

---
Tags: user-account
---


# Question
Title: View and subscribe to Public Smart Mailing groups using {action.subscribeUrl}?
I'd like to use {action.subscribeUrl} so email recipients can view and subscribe to public mailing lists. However, it does not show public Smart group mailing lists.

Is there a way to show Smart group public mailing lists using {action.subscribeUrl}?

Using CiviCRM 5.3.1 with WordPress.

# Answer
> 0 votes
Your email could link back with checksum to a Profile that has 'Groups' field on it which should therefore show only the Public Mailing Lists (iirc)

---
Tags: smartgroups, mailing, subscribe
---


title: Cannot save Mosaico Templates

text:
# Question
Title: Cannot save Mosaico Templates
We are on the latest version of civicrm 5.3.1 and the lastest version of Masaico and now i am getting this error message when I try to edit and save a template:

> API permission check failed for MosaicoTemplate/create call; insufficient permission: require edit message templates and edit user-driven message templates and edit system workflow message templates

Thanks Karin!

# Answer
> 3 votes
There are some new permisssions to review/set: navigate to your where set permissions in your CMS. In Drupal: People -\> Permissions - and look for these:

---
Tags: civimail, mosaico
---


# Question
Title: How do I enable or disable Ajax Deduping?
A recent bug report mentions that it affects users only when Ajax deduping is enabled. How do I find this option to review it? Both Google and code grepping are failing me.

https://github.com/civicrm/civicrm-core/pull/12550

# Answer
You can disable/enable Ajax Deduping in Display preference.

Navigate to CiviCRM \>\> Administer \>\> Customize Data and Screens \>\> Display Preferences.

HTH

Pradeep
> 3 votes

---
Tags: duplicate-contacts
---


# Question
Title: CKEditor WYSIWYG - Can't use link dialogue to create links (OK button doesn't work)
When trying to create a link using CKEditor, the OK button will not work, and the dialogue box will not close ('cancel' works).

Is anyone else seeing this?

We are on CiviCRM 5.3.1 on Apache, Drupal 7 using jquery 1.7 on our admin theme. We have tested this and seen the same behaviour in CiviMail and CiviEvent.

The fault appears in Chrome on Mac & PC, though it is fine on Edge (where the OK & Cancel buttons appear the other way round to the screenshot below)

# Answer
> 2 votes
Try this:

JQuery update settings: Set alternate jQuery version for admin pages to: 1.5

Make sure CiviCRM theme module is installed

In Appearance -\> set CiviCRM Administration theme to Adminimal (or some other Admin theme)

You’ll want admin jquery 1.5 for many admin pages on your drupal site to work well. Here’s a reference: https://www.drupal.org/project/views/issues/1965674

---
Tags: ckeditor, wysiwyg
---


# Question
Title: Thinking of Creating MobileAPP for CiviCRM
I am thinking of creating a MobileAPP for CiviCRM using IONIC Framework

Before I start just need to ask. Do we have any MobileAPP that works for CiviCRM? (I know we can view on mobile phone using themes)

Also Need some help for my first Phase- (everything will only be read only)

I am thinking of displaying - Contact, membership and contribution details

What are the details we can display?

I am thinking of releasing the Mobile APP to community

Any suggestion / comment will be much appreciated

Thanks

# Answer
Per Demerit's comment - there has been a new App developed as described in this blog
> 1 votes

# Answer
Ramesh,

Webaccess has developed an extension CiviMobile with limited actions like contact search Participant search etc.

HTH Pradeep
> 0 votes

---
Tags: mobile
---


# Question
Title: CiviEvent backing out of contact change from dedupe rule
Is there a way to "back out" a change caused by a dedupe rule on an event administratively?

* I see two records with the same name, Person A.
* I have had a dedupe rule on an Event that was incorrect. I have changed the rule back to a reserved rule that is working OK. The custom dedupe rule was supposed to use Name, Email, and Phone but obviously isn't working. The reserved rule just uses Name and Email.
* One person (Person A) registered for an event and it inadvertently edited someone else's contact record (Person B).
* Somehow this also changed Person B's WordPress User email.
* Person B got an email that their WordPress email was changed to Person A's email, and to contact an administrator if this was not correct. Person B contacted me.

If there is any method to avoid having to ask both contacts for all their information again to confirm, that would be great.

I am not familiar on how to view the logs for the activities, so if the information would be there it would be great to know how to view the logs.

Thanks, Michele

# Answer
If you have logging on then via the ChangeLog tab on the Contact you should be able to garner some of the required info

If that doesn't help enough then go to the log\_civicrm\_contact/event/contribution etc tables and fire in the relevant ID and see what it has to offer

Key thing with dedupe rules is to make sure your Weights and Thresholds make mathematical sense - esp when fields like Phone and Email will be 'scored' for every match it finds - so if a contact has the same email three times, then dedupe will score 3 x email weight.

Hence it is important to have a rule like First 10 Last 10 Email 2 = Threshold 22 (ie it would have to the same email on the contact 11 times for it to count as a dedupe while ignoring First and Last) - whereas eg First 5 Last 5 Email 5 = Threshold 15 means it could match on a record that has the email 3 times (which is quite possible) even though the First and Last do NOT match.
> 1 votes

---
Tags: wordpress, civievent, duplicate-contacts, rules
---


title: crm.ckeditor.js not found

text:
# Question
Title: crm.ckeditor.js not found
Inside /sites/all/modules/civicrm/CRM/Core/Resources.php Line 738 and for civicrm version 5.3.1

```
 $editor = Civi::settings()->get('editor_id');
    if ($editor == "CKEditor") {
      CRM_Admin_Page_CKEditorConfig::setConfigDefault();
      $items[] = array(
        'config' => array(
          'wysisygScriptLocation' => Civi::paths()->getUrl("[civicrm.root]/js/wysiwyg/crm.ckeditor.js"),
          'CKEditorCustomConfig' => CRM_Admin_Page_CKEditorConfig::getConfigUrl(),
        ),
      );
    }

```

I get error event configuration page which is as follows: Failed to load resource: net::ERR\_NAME\_NOT\_RESOLVED and url which is not loaded is as shown below https://newspace/prestige/public\_html/sites/all/modules/civicrm/js/wysiwyg/crm.ckeditor.js So link is incorrect which seems to be due to incorrect \[civicrm.root\],

Can I set $civicrm\_root in civicrm.settings.php and can that help fix it? When I place directly the url it works but it is in the code below which is Core part of civicrm

# Answer
> 3 votes
You can write the below code in `civicrm.settings.php` file to override the current value of `[civicrm.root]` token.

```
global $civicrm_paths;
$civicrm_paths['civicrm.root'] = array(
  'url' => 'https://website_url.com/.../civicrm',
  'path' => '/path/to/civicrm/folder/',
);

```

Similarly, it can be used to set `[civicrm.files]` and `[cms.root]`.

---
Tags: drupal, ckeditor
---


# Question
Title: Add Menu Item not displaying for all Admins
We are using civi 5.3 on Wordpress 4.9

recently we created some custom menus items to go on the top navigation menu They are the parent tab. Some Administrators report that they can see them, while others report that they cannot see them. I checked, and all of us are in the same groups and have the same permissions.
I tested it in Google Chrome and saw the new menu items. I tested it in Explorer and saw the new menu items Then I tested on on my ipad with Safari with the same admin account as the other two tests and I do NOT see the new menu items, even after clearing Civi's cache and my Ipads cache. This does not make sense to me. Does anyone know what is going on?

# Answer
I found the problem. Civi's top menu is not responsive. If you have a high screen resolution, menu items on the right side will disappear. Try for experimental reasons, log into civi, hold down your Ctrl key and press the + key a few times and watch as menu tabs on the right side disappear.
> 1 votes

---
Tags: wordpress, menu
---


# Question
Title: CiviReport's and CiviContribute Charts not displaying
We are using civi 5.3 on Wordpress 4.9. Using CiviReports or CiviContribute, I am selecting Charts, and clicking the view button. The chart is not loading. I saw the other answers suggesting that I enable flash in chrome for this site, but this is happening on Chrome, Explorer and Safari. Could the paths for these graphs be wrong? Where would I check that? The charts have never worked for us, even before upgrading to 5.3.

# Answer
> 3 votes
Some browsers don't show up flash chart by default, you will need allow flash for certain urls or make it allow for all sites. This answer might be useful to fix your problem.

HTH

Pradeep

---
Tags: wordpress, civireport, chart
---


title: Can't edit or make new Mosaico Template

text:
# Question
Title: Can't edit or make new Mosaico Template
When I try to edit a Mosaico template in FireFox or in Chrome, it acts as if I am trying to print a "Welcome to your Home Dashboard" page. The URL looks like this: https://yobc.org/wp-admin/admin.php?page=CiviCRM&q=civicrm/mosaico/editor&snippet=2&ip-geo-block-auth-nonce=5234197d0a#ivfia57 . If I cancel that "print," I get a Configure Your Dashboard message. The URL looks like this: https://yobc.org/wp-admin/admin.php?page=CiviCRM&q=civicrm/mosaico/editor&snippet=2&ip-geo-block-auth-nonce=5234197d0a#ivfia57

It appears that this plugin is up-to-date, and we have used it for some time. Updated CiviCrm last week with the security update.

Pictures attached.

# Answer
> 1 votes
Can you try to clean CiviCRM cache and do a menu rebuild? You can do this by navigating to CiviCRM \>\> Administer \>\> System Settings \>\> Cleanup Caches and Update paths. Once you on the page click on Cleanup cache button.

HTH

Pradeep

---
Tags: mosaico
---


# Question
Title: Upgraded to 5.3.2 from 5.3.1, now warning Cron not running - log shows it is at 10 minute intervals - Ignore?
Running on Wordpress 4.8.7. No problem with Cron on 5.3.1, but right after upgrading we're getting warning that cron is not running.
"Cron Not Running- Last cron run at July 28th, 2018 3:20 PM."

```
Here is crontab entry, sanitized:

```

\*/10 * * * * /usr/local/bin/php /home2/xxxxxx/newarksymphony.org/wp-content/plugins/civicrm/civicrm/bin/cli.php -s www.newarksymphony.org -u xxxxxx -p xxxxxxxxx -e Job -a execute

```
Scheduled jobs log shows that jobs are indeed running every 10 minutes.

```

==================================

2018-07-29 15:40:02 Civirules cron
Entity: Civirules Action: Cron

Summary Starting execution of Civirules cron Details Parameters parsed (and passed to API method): a:1:{s:7:"version";i:3;} Full message:

Starting execution of Civirules cron

==================================

2018-07-29 15:30:02 Civirules cron
Entity: Civirules Action: Cron

Summary Finished execution of Civirules cron with result: Success (a:0:{}) Details Parameters parsed (and passed to API method): a:1:{s:7:"version";i:3;} Full message:

Finished execution of Civirules cron with result: Success (a:0:{})

=================================

# Answer
Can you please check MYSQL and PHP are using the same timezone? This sometimes happens when both are running on different timezones.

You can find a solution for similar sorts of issues here.
> 3 votes

---
Tags: wordpress, upgrade, cron
---


# Question
Title: Cannot read unrecognized property CRM_Core_Config::$mapGeoCoding
Has anyone encountered this error on a CiviCRM Event:

Sorry but we are not able to provide this at the moment. Cannot read unrecognized property CRM\_Core\_Config::$mapGeoCoding

I'm using civi version 4.7.13. I changed the Mapping and Geocoding Providers Settings. Google is the Geocoding Provider and I added a Geo Provider Key. When I save the settings the error disappears but the map does not display on the page and eventually the error returns

# Answer
> -1 votes
Removing $config-\>mapGeoCoding from the core EventInfo.tpl and then clearing the directories out of the \*/templates\_c/En\_us directory fixed the error message. I am now able to get the map to work correctly if I enter the longitude/latitude but I think there is an issue with the key.

---
Tags: civievent, geocoding, google
---


# Question
Title: Membership doesn't expire for short periods of membership
We have standard membership that lasts one year and a trial membership that lasts one week. The standard membership works fine, but we have found that the trial membership doesn't expire after a week but remains as 'New' for three months.

Looking at the membership status rules, I think I can see why. 'New' membership is set to start on the 'Member Since' date and ends three months after the 'Member Since' date. Because this rule is listed first the membership remains on the 'New' status for three months even if we have moved past the 'End Date'.

We are using CiviCRM 4.6 on WordPress, but I have also tested this in the demo site running CiviCRM 5.5 on WordPress so I don't think this is version specific.

Has anyone else had this issue? How did you resolve it?

I am considering changing the order of the status rules as follows:

1. Grace - from End Date to End Date + 1 month
2. Expiry - from End Date
3. New - from Member Since to Member Since + 3 months
4. Current - from Start Date to End Date

Does that sound sensible?

# Answer
Your revised order would give them a month of Grace after the one week trial which may not be what you want either.

As per petednz's comment, one set of status rules shared between multiple membership types is limiting.

You could use Status Override to force Expired at the end of the one week membership, possibly with the 'Override until Selected Date' option.
> 1 votes

---
Tags: civimember
---


# Question
Title: Card Printing Systems compatible with CiviCRM
Can anybody recommend a membership card printing system which will enable printing of standard credit card sized plastic membership cards which will draw data from CiviCRM and add a photo to the card using a camera, in real time. The photo may optionally be then stored in CiviCRM if we so choose.

# Answer
The other option to print Membercard is using an extension developed by Webaccess Global which generates card in pdf format.

https://github.com/kurund/com.webaccessglobal.membershipcard
> 4 votes

# Answer
I have a client that uses CardExchange Producer to print their membership cards using real-time CiviCRM data.

Note that compatible systems will most likely want to connect to your database via a MySQL connection - and since CiviCRM is most often hosted on a web server outside the office, that presents a technical challenge. You should be prepared to do some sort of VPN or tunneling between your web server and CiviCRM for real-time connections. My client uses Windows, so I configured Plink to connect to the server with an SSH tunnel.
> 3 votes

---
Tags: civimember, printing
---


title: Drupal Installation Error on Centos

text:
# Question
Title: Drupal Installation Error on Centos
I am getting this error during installation. Has anyone else seen this?

You don't have permission to access this page The installer can only be run by a user with the permission to administer site configuration. Refer to the online documentation for more information: Installation Guide

# Answer
Sometimes even i face similar problem when i try to install CiviCRM. But i make it work by commenting the line that throws this error.

You can find quick solution here.
> 1 votes

---
Tags: drupal, installation
---


# Question
Title: How to add multiple individual in civicrm profile fields section in civicrm contribution page?
I need to create a Household with Individual Members in a Contribution Page.

So an Individual will have **First Name, Last Name and Email Id<br>** & Household will have
**Household Name** I need to add this in a profile and when a user adds the above, it will create a Household with individual members (multiple) listed in a profile. How can I add fields such that we have an option to add multiple individual members by clicking on **Add More button** which will place the First Name, Last Name and Email Id fields?

# Answer
> 2 votes
Unfortunately this cannot be achieved with CiviCRM profiles. CiviCRM only offers an option to sign up as an individual or on behalf of an organisation. A household cannot be linked via a contribution page.

You best option with WordPress would be to attempt building a form using CiviCRM caldera forms - https://github.com/mecachisenros/caldera-forms-civicrm

---
Tags: wordpress, civicontribute, profile
---


# Question
Title: Fatal error: Call to undefined function ctype_space()
Has anybody else seen this fatal error after upgrading to CiviCRM 5.3.2? It appears when trying to manage groups or create a new group in "Contacts" and I don't think we had this under 5.3.0.

The full error is:

`Fatal error: Call to undefined function ctype_space() in /usr/local/www/wordpress/wp-content/plugins/civicrm/civicrm/packages/IDS/vendors/htmlpurifier/HTMLPurifier/Token/Text.php on line 26`

We are running Wordpress 4.9.7 and PHP 5.6.37.

Any ideas and help is highly appreciated! Thank you!

**EDIT1:**

Thanks to @Demerit I have run a couple of tests, and here are the results:

`# pkg info php56-ctype
php56-ctype-5.6.37
Name : php56-ctype
Version : 5.6.37
Installed on : Fri Jul 27 16:42:39 2018 UTC
Origin : textproc/php56-ctype
Architecture : FreeBSD:11:amd64
(...)`

So the ctype extension is installed.

`# php --ini
Configuration File (php.ini) Path: /usr/local/etc
Loaded Configuration File: /usr/local/etc/php.ini
Scan for additional .ini files in: /usr/local/etc/php
Additional .ini files parsed: /usr/local/etc/php/ext-18-session.ini,
/usr/local/etc/php/ext-20-ctype.ini,
/usr/local/etc/php/ext-20-curl.ini,
/usr/local/etc/php/ext-20-filter.ini,
(...)`

So the ctype extension seems to be activated. But now: when I use `print_r(get_loaded_extensions());` I get

`Array ( [0] => Core [1] => date [2] => ereg [3] => libxml [4] => pcre [5] => Reflection [6] => SPL [7] => hash [8] => session [9] => cgi-fcgi [10] => standard [11] => curl [12] => filter [13] => ftp [14] => gd [15] => mysqlnd [16] => json [17] => mbstring [18] => mysql [19] => mysqli [20] => openssl [21] => PDO [22] => SimpleXML [23] => tokenizer [24] => xml [25] => zip [26] => zlib [27] => pdo_mysql [28] => mhash )`

So here it doesn't seem activated at all. And when I do `phpinfo();` ext-20-ctype.ini doesn't appear in the list of parsed .ini files either. So again, it doesn't seem activated.

How is it possible that PHP provides contradictory info on the command line and via web browser? May this be linked to the fact that my CiviCRM and PHP is running in a FreeBSD jail?

Thank you for any ideas you might have!

# Answer
I solved this thanks to the friendly help above. There were indeed php.ini's inside and outside of the jail, but they weren't really the problem (ctype was activated there). Instead, I had to restart `php-fpm` to make PHP notice them. Not sure why but it did the trick.
> 2 votes

# Answer
If it's the same hosting provider it would be odd to change all of a sudden but this error happens when the ctype php extension is not enabled. Ask your hosting provider.
> 1 votes

---
Tags: wordpress, php
---


# Question
Title: Error on recurring payment with one installment
I recently launched a new donation page that allows recurring payments via PayPal Standard. I noticed a couple of recurring contributions had a status of "Pending (Incomplete Transaction)". It turns out both donors had entered "1" in the Installments field. I expect that would either be considered an input error or perhaps it would simply process it like a single payment. I tried it myself and found that the donation page will submit, but PayPal then displays an error:

> The link you have used to enter the PayPal system is invalid. Please review the link and try again

I assume the donors simply gave up at that point. I've reached out to both to find out. I suspect they thought the option for a recurring payment was actually a directive, and they entered "1" to ensure they were making a one-time donation.

Is there an option to force the Installments field to accept only values greater than 1?

While I was at it, I decided to try entering a zero in the Installments field. This makes no sense, but you never know what people will try. It actually processed the transaction with a payment. When I look at the transaction on "Find Contributions", it shows it as "Installments: (ongoing)". When I follow the link that is provided in the receipt to update the recurring contribution, it shows "Number of Installments 0".

# Answer
To make it even more confusing -\> installments = 0 actually means unlimited/open-ended recurring contributions in CiviCRM.

**Your options:**

* Do not expose the installments field (that will then be = 0 or NULL by default \> so open-ended).
* Add some jQuery to check the value of that field give the user a notice that it can not be = 1. How to add jQuery - there are a number of ways to do this - depending on the CMS that you use.
> 1 votes

---
Tags: civicontribute, paypal, recurring-contributions
---


# Question
Title: DreamHost is dropping support for Catch-All mailboxes
I use CiviMail in conjunction with a **catch-all** mailbox. The bounce processing updates the database when there’s bad email addresses and reports bounces on the mail report. It also handles user opt-outs. We use **DreamHost**, and they’re dropping support for catch-all mailboxes as of 10/1/18. Ugh. DreamHost doesn’t support VERP either. I found this documentation: https://docs.civicrm.org/sysadmin/en/latest/setup/civimail/inbound/ which has this section:

> **Variable Envelope Return Path (VERP)** CiviCRM Bounce handling depends on using Variable Envelope Return Path (VERP). If your email server doesn't support VERP you will only be able to properly support bounce requests if you can set up a catch all email. If you cannot setup a catch all email and your server does not support VERP you will need to edit packages/Mail/smtp.php as follows near line 275: //if (!empty($headers\['Return-Path'\])) { // $from = $headers\['Return-Path'\]; //}

So, I set up a new mailbox bounce@domain.org and marked it in Administer | CiviMail | Mail Accounts as the account for bounce processing. I commented out the three lines of code shown above. I did a test mailing with a bad email address, but the delivery failure went back to the sending email address (wisconsin@domain.org) instead of bounce@domain.org. **What am I doing wrong???** Thanks for your help!

**UPDATE**: I don't want my email blasts to come from bounce@domain.org. CiviMail lets you specify the bounce email address in Administer | CiviMail | Mail Accounts. **It just doesn't work!** One clue I found was in my own question posted in 2015 (Problem using CiviMail with Bluehost), where Xavier points out that the lines of code I commented out are the one's needed to be able to identify who was the recipient, so if it bounces, Civi can identify it properly. So, I reinstated those lines of code. But the bounce went to the old Catch-All account, instead of the new bounce account. Then I disabled the Catch-All account. Now I can't find the delivery failure email anywhere?!? **Please help!!!** I'm using CiviCRM 4.7.20 and the current version of WordPress.

# Answer
> 0 votes
Demerit's comments probably constitute the best answer available. It's a loss in flexibility and functionality compared to being able to use a catch-all mailbox, but it's probably as good as it gets, given the situation. I may experiment with SendGrid, but I'm not impressed with them so far. It's a public company that makes it difficult to ask a question. I could only ask a question after I signed up with them. It was answered by someone who just googled *SendGrid CiviCRM* and came up with a few fairly worthless links.

---
Tags: civimail, bounce
---


title: CiviCASE - edit / report on 'Detail'?

text:
# Question
Title: CiviCASE - edit / report on 'Detail'?
When creating a case, one of the fields is 'Detail'. It's a very useful description area for the case. However, can anyone point me to where it is then displayed or is editable? I can't find it on any reports or any screens. Could of course be an operator head-space error on my part. Many thanks.

# Answer
It's in the Open Case activity that gets created on the case. When you create a case it's the same as creating the Open Case activity.
> 2 votes

---
Tags: civicase
---


title: MySQL Query to return all custom values

text:
# Question
Title: MySQL Query to return all custom values
Any MySQL Civi Gurus out there that know how I can create a query to return all custom value fields with their value per contact id?

I know how to get the occasional custom value, but i need the values not the key field numbers.

My problem is the custom values pick lists are all stored in the same table and so "1" maybe 5 different values and you have to pick the qualifier of each custom custom pick list so that throws off my SQL.

Thank you very much!

# Answer
> 2 votes
This would be difficult to do in pure SQL in a generic way. I assume this is for some type of reporting system you are connecting to CiviCRM and any scripting is not an option.

For each field where it needs a lookup you'd have to do a join, something like:

`SELECT c.id,
cf1.label AS field1_title,
ov1.label AS field1_label,
cf2.label AS field2_title,
ov2.label AS field2_label
FROM civicrm_contact c
LEFT JOIN civicrm_value_XXX cv1 ON cv1.entity_id = c.id
LEFT JOIN civicrm_custom_field cf1 ON cf1.name = 'the field you want #1'
LEFT JOIN civicrm_option_group og1 ON cf1.option_group_id = og1.id
LEFT JOIN civicrm_option_value ov1 ON (ov1.option_group_id = og1.id AND ov1.value = cv1._the_database_field_name)
LEFT JOIN civicrm_value_YYY cv2 ON cv2.entity_id = c.id
LEFT JOIN civicrm_custom_field cf2 ON cf2.name = 'the field you want #2'
LEFT JOIN civicrm_option_group og2 ON cf2.option_group_id = og2.id
LEFT JOIN civicrm_option_value ov2 ON (ov2.option_group_id = og2.id AND ov2.value = cv2._the_database_field_name)
... more joins for each field...`

`XXX depends on the actual table name where the custom field is stored,
_the_database_field_name is the fieldname as it appears in that table.`

I use left joins because depending on how contacts get into the system sometimes they are missing stuff, but you'd still want the contact to be output.

---
Tags: custom-fields
---


# Question
Title: Proximity search doesn't always work for towns
I'm noticing that the proximity search doesn't seem to work quite as well on towns as it does for postcodes.

I've seen this behaviour sporadically. For some contacts it's not an issue, for others it is.

For instance, if I do a search for 30km around Chester it won't find a person who's in Chester, but will find them if I search for postcode CH2.

In this case, the contact's address is simply 'Chester, Cheshire, UK', with no postcode supplied. Nevertheless, the Map icon in their contact record is successfully placing them in the middle of Chester.

The same occurs for other contacts with the same non-specific Chester address.

However, it doesn't occur for other contacts with similar address formats if they are in nearby towns. For instance, people with addresses such as 'Liverpool, Merseyside, UK' are found by the above search.

Having said that, if I then do a search for 30 km around Liverpool, I do get correct results!

We are using Google as our Geocode provider, Civi 5.3.1, Drupal 7.58.

Could it be that the Proximity search fails if the distance from certain towns is zero? And works for other towns? Or something else?

Does anyone have a suggestion where I should look to fix this? Or is it a known issue with the proximity search?

Thanks!

# Answer
> 2 votes
I've had something like this come up and so when I looked at what CiviCRM was doing I noticed it doesn't use all the available fields. For example it uses City but not County. It also only uses the first line of the street address, so depending on what you have there it may actually return nothing even though city, postal code, etc without the street address would work.

You can see what fields it's combining here: https://github.com/civicrm/civicrm-core/blob/master/CRM/Utils/Geocode/Google.php

You can also put the contact's address into maps.google.com directly and see what it returns, to help troubleshoot.

---
Tags: custom-search
---


# Question
Title: 500 Errors on CiviCRM 5.1.2 with Varnish on WordPress
I'm brand-new to CiviCRM and really appreciate all the amazing work that's been done on this project!

I've been working on our implementation on a test server for a while now, but when I started implementing things on our production server, which is managed WordPress on Dreamhost (DreamPress), I'm running into issue related to modsecurity and Varnish cache I was hoping someone could help with.

For one example of the issue, I created a new contribution page and the test drive link works fine, but when I try to go to the live page () I get this error (throwing Xs in for a couple of values):

```
[Tue Jun 05 16:24:46 2018] [error] [client XXX.XXX.XXX.XXX] ModSecurity: Error reading request body: Partial results are valid but processing is incomplete [hostname "kptz.org"] [uri "/wp-admin/admin-ajax.php"] [unique_id "XXXXXXXXXXXXXXXXXX"]

```

I emailed Dreamhost support and their response was "... the plugin is using PHP sessions and setting session cookies that are conflicting with the Varnish cache. The cookies are setting 'no-cache' parameters, which are preventing Varnish from caching the site successfully. Previously, the plugin developers had posted in the forums regarding fixing the use of cookies for previous versions of the civicrm plugin. You can contact the developers and ask if the use of cookies can be adjusted for version 5.1.2 of the plugin."

They also said that they can add Varnish rules to my setup if they know what to add.

I suppose my first question is would I be better off using CiviCRM 4.6.36, i.e. is this something that is not an issue in the older version? If using the older version won't help, is there any guidance as to how to address this issue, or any sample Varnish rules available?

Thanks in advance for any assistance anyone can provide, and thanks again for CiviCRM!

# Answer
You can certainly try to set up rules to bypass the reverse proxy, but at the same time, I think it will be more cost-effective to change hosting. Varnish problems aren't going to be the only issue you have when you have managed hosting that is specially tuned for WordPress hosting.

CiviCRM and WordPress work nicely together because they rely on the same LAMP stack and it's valuable to have your CRM and website tightly integrated. However, from another perspective, a CRM and a website have opposite performance needs. A website needs to serve *the same few dozen pages* to thousands of visitors. A CRM needs to pull from among *thousands of contacts' information* for a handful of users.

Managed WordPress hosting (whether through Dreamhost, WP Engine, or others) attempts to maximize website performance by caching as much as possible so that the most commonly-visited pages can be delivered whole without querying the database. This tilts the process completely towards the handful of content, lots of visitors use case for a website.

For a CRM, there's the issue you're facing where you have to tell the reverse proxy to skip various pages and widgets that are driven by CiviCRM. But when you fix that, at least for certain pages *you've defeated the performance tricks* that you're paying your host to implement.

The entire business model of this kind of hosting is to rely on these tools to get maximum performance out of minimal hardware. Without the caching, you're just left with cheap hosting. That's not going to serve you well as you try to use CiviCRM.

Your better bet is to host with something a little more substantial. What my colleagues and I have recommended for years is a virtual private server (VPS or cloud server) with at least 4GB of RAM and a dual-core processor. You can get these for around $20 per month at Linode, AWS, DigitalOcean, and elsewhere. They require setting up the whole LAMP stack, but that's something lots of us who support CiviCRM can do.

Once you've done this, you'll have better performance, a stack that is more broadly supported and used, and the ability to set up a practically unlimited number of development sites, extra domains, and so forth.
> 1 votes

# Answer
Just thought I'd follow up on this and let folks know where I wound up -- after a lot of research and some outside assistance it turns out that it was actually the photo slider plugin (Slider Revolution) I was using on our homepage that was causing CiviCRM to break, and switching to Meta Slider fixed that issue. We also discovered that Varnish might have taken some tweaking as well to make sure everything worked correctly, so I wound up moving the site from DreamPress over to Amazon Lightsail, and I'm really happy with Lightsail.

Thanks to everyone for all the help thinking through this!
> 1 votes

# Answer
I don't think using an older version makes sense but I would give serious consideration to changing your hosting. In general using a host that does not support CiviCRM well can be quite expensive and there are several providers that do specialise in CiviCRM hosting
> 0 votes

---
Tags: wordpress, error, cache
---


title: CiviCRM with Contact form 7

text:
# Question
Title: CiviCRM with Contact form 7
I have contact form 7 with CiviCRM integration. How can I get API settings? https://prnt.sc/kdqylc

# Answer
the Contact Form 7 with CiviCRM extension is meant as a basis for developers, it does not DO anything in itself. It enables sending data from a Contact Form to CiviCRM if you enter the data in the Contact Form in the correct way. But then something needs to happen on the CiviCRM side to. If you have developer skills, there is an example here: https://github.com/CiviCooP/be.werkmetzin.wpcivi

The API settings required are the site key and the API key required for CiviCRM API access. You can find more information here: https://docs.civicrm.org/dev/en/latest/api/interfaces/#rest.
> 3 votes

---
Tags: wordpress
---


title: db error reinstalling CiviCRM

text:
# Question
Title: db error reinstalling CiviCRM
I'm just getting started with CiviCRM and trying to install on our WordPress site.

I completed the initial install once, but accidentally used the existing WordPress database - I would prefer to install on separate database.

So I have deleted the plugin, via WPadmin. Removed CiviCRM tables from the database using the drop sql file. Uploaded the CiviCRM files to server again and tried to activate the plugin.

The plugin is activated, but clicking the CiviCRM button in the lhs menu gives me error message below. Seems like CiviCRM is looking to the old install in the WordPress database?

How to correct this please and reinstall in separate db?

```
Initialization Error

Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => simpleHandler
        )

    [code] => -18
    [message] => DB Error: no such table
    [mode] => 16
    [debug_info] => SELECT id, name, value, domain_id, contact_id, is_domain, component_id, created_date, created_id
FROM civicrm_setting
WHERE (domain_id = 1) AND (is_domain = 1)
 [nativecode=1146 ** Table 'huWP_db.civicrm_setting' doesn't exist]

```

# Answer
If you planning to reinstall CiviCRM on separate database than you will need to delete the civicrm.settings.php file which holds all the db settings.

Since you are using wordpress you can locate the file in one of the place below

```
wp-content/plugins/civicrm/civicrm.settings.php

```

or

```
wp-content/uploads/civicrm/civicrm.settings.php

```

HTH

Pradeep
> 1 votes

---
Tags: database
---


# Question
Title: How set Tags And Groups field set to NOT "collapsed on display"
Using Drupal 7 and CIVI CRM 5.x on windows 10 and Xampp

I can set this up in custom fields sets, but how do I set the native "tags and groups" field to expanded on initial display?

# Answer
To add on to @oskylark answer I would use an extra template instead of a duplicate. Easier to manage when upgrading. https://civicrm.org/blog/dave-greenberg/now-its-easier-add-custom-behaviors-templates

In the extra template (TagsAndGroups.extra.tpl) and you could throw some javascript in a {literal} tag along the lines of

```
cj('.crm-tagGroup-accordion').collapse('toggle');

```

NOTE: I did not test this js line, just a first guess.
> 4 votes

# Answer
In your custom Civi templates folder (probably default/civicrm/templates) place a copy of the following file from the civicrm module: /civicrm/templates/CRM/Contact/Form/Edit/TagsAndGroups.tpl

Edit that file, look for the following line and remove the "collapsed" class:

```
<div class="crm-accordion-wrapper crm-tagGroup-accordion collapsed">

```

No doubt it could also be done without the need of a custom version of this template file by using a couple of lines of jQuery, as long as they run after the initial page load scripts have run. I'll leave that option for a separate answer. Update: see @RayWright's answer, that's how to do it.
> 2 votes

---
Tags: fields
---


# Question
Title: Unable to use ckeditor after upgrade to 5.3.1
After an upgrade from 4.7.28 to 5.3.1:

1. Text areas (e.g. editing an event description) have a blank part of the screen in place of the normal editing box.
2. The configure page of the ckeditor is also broken.
3. Both of those pages show a console error: `Uncaught TypeError: Cannot read property '17' of undefined
 at Object.keystrokeToArray (ckeditor.js:36)
 at Object.keystrokeToString (ckeditor.js:35)
 at CKEDITOR.ui.button.render (ckeditor.js:636)
 at G (ckeditor.js:647)
 at a. (ckeditor.js:649)
 at a.h (ckeditor.js:10)
 at a. (ckeditor.js:11)
 at a.window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.editor.CKEDITOR.editor.fire (ckeditor.js:13)
 at b (ckeditor.js:326)
 at a. (ckeditor.js:325)`
4. They also show console errors of missing css files, which appear to be missing from the monoo-lisa skin directory of the ckeditor directory of my drupal libraries, i.e. not the one civicrm has bundled or should use. I presume this is just a side effect of the above error.

I have a very similar site that went through the same upgrade that does not have this issue (and both sites use Drupal's ckeditor via the wysiwyg module). This site notably has a very large CRM variable defined in javascript, but it doesn't show any other errors.

# Answer
Do you have the Boxes contrib module enabled on your Drupal site? If so, your problem may be this:

Issue #2175471: Incompatible with CiviCRM - CKEditor WYSIWYG does not load

There is a patch available from the above link that resolves the issue.
> 4 votes

# Answer
As Pradeep is intimating, a lot of folks have seen this because of a multilingual schema needing rebuilding. `drush cvapi system.rebuildmultilingualschema` could fix that. Otherwise you end up with "undefined" as the base URL of your Resource URL, similar to this.
> 1 votes

---
Tags: upgrade, ckeditor
---


# Question
Title: Why does the price set field title change the CSS class?
For instance, if my price field is called Main Conference (Before 7/31), the CSS class it gets is: "main\_conference\_before\_7\_31\_-content"

If I change the title of the price set, the CSS class changes.

When modifying the form with jQuery, we rely on the CSS class to make adjustments like .prependTo (etc.). Perhaps this is not the most ideal way to do it, but it's worked in a pinch.

How difficult would it be to make an extension to make the price set field class fixed, or even user-adjustable? Or, to set a class and ID for each one?

Civi 4.7 or 5.x

# Answer
> 2 votes
CiviCRM uses civicrm\_price\_set.name to generate class. I believe this field in never updated on Update mode. It is updated when we explicitly set them using api or mysql query.

# Answer
> 1 votes
I'm not sure how much the price fields name will change but perhaps you can use some 'wildcard' attribute selectors? (contains, starts with etc.)

http://api.jquery.com/category/selectors/attribute-selectors/

---
Tags: price-sets
---


# Question
Title: How can I add PHP as content with HTML editor?
Using Drupal 7 with CIVI crm 5.x

I'm doing some testing with this:

Hello World'; ?\>

Paste it in source code, but then it strips it out like this:

```
  <!--?php echo '<p-->
  <p>Hello World</p>

```

With Drupal I can tweak things so this can work, but how do I do it with CIVI CRM or it is even possible?

# Answer
I believe its not possible to add php code in CiviCRM text area or ckeditor fields. I guess for security reasons it doesn't allow you to add any code snippets. Alternate solution is to use hook to alter the content of the field by using tokens.
> 3 votes

---
Tags: php
---


title: ACL Permissions

text:
# Question
Title: ACL Permissions
I need to limit the access to a group of individuals for certain users. This is what I have done.

1. Created a user role called Student Interactions
2. Created a group called student Interactions Access and added the users that should have access to this role.
3. Assigned the student interactions access group to the Student Interactions ACL Role.
4. Added an ACL For the student interactions role to view a new group I created called current students.

When I log in as one of the users assigned to the student interactions access group I can still see all users, not just the ones in the current student group. What am I doing wrong?

# Answer
> 2 votes
Make sure you have turned off 'View all Contacts' permission for the user role. This permission over-rides all ACL rule. You can check permissions by navigating to CiviCRM \>\> Administer \>\> Users and permissions \>\> Permissions (Access Control) \>\> Drupal/Wordpress/Joomla Access Control.

HTH

Pradeep

---
Tags: permissions
---


# Question
Title: Templates_c permissions differ when rebuilt on command line or by apache
This is related to, but not a duplicate of, CiviCRM rebuilding templates\_c with permissions.

I am using civicrm 5.1.2 / Drupal 7 / Apache / Linux.

It is best practice not to let `www-data` own files in the Drupal tree. By the principle of least privilege, the web server should not be allowed to write to directories that it does not need to write to. And obviously someone needs to be able to write to them so that you can log on and upgrade and so on.

So I set up the permissions as suggested here . User `jane` has ownership of all the files and directories apart from the `files` directory, which is owned by `www-data`.

This does not work with CiviCRM and drush.

When you do a `drush cc` or `drush cvupdb` in the command line, as `jane`, the `templates_c` and `ConfigAndLog` directories get files added to them with owner `jane` and group `www-data` (I have set the setgid bit in order to ensure that the group remains `www-data`) and they get created with group write permissions. That is all well and good - the web server has write permissions via the group, and then is able to update the files when it needs to.

But when the web server creates the files itself, it creates them with `www-data` as both the group and the user. This is of course all it can do. However, it does not set group write permissions. That means that the next time `jane` logs on to do something from the command line that writes to those directories, she can't.

What do you suggest?

# Answer
civibuild shows a few ways to tackle this problem.

File Permission ACL's work well if they are available on your system.

Edit: You will need to set the ACLs to cover future files created in the directory as well as existing ones. For this, use the **-d** flag as shown here https://serverfault.com/a/445096.

Further edit: Set the ACLs on the **civicrm** directory above the **templates\_c** directory. Sometimes the whole **templates\_c** directory gets deleted and rebuilt.
> 0 votes

# Answer
Our rule is run everything drush that touches files owned by apache as apache:

```
sudo -u apache drush cc all

```
> 0 votes

---
Tags: drupal, filesystem
---


# Question
Title: Solved: CiviRules 2.1 and CiviVolunteer 4.7.31-2.3.1 not working with CiviCRM 5.4.0
I'm using WordPress 4.9.8 and I've upgraded our CiviCRM to 5.4.0. After that CiviRules 2.1 and CiviVolunteer 4.7.31-2.3.1 seem not working.

**1. CiviRules 2.1**, when click **New rule**, it backs to CiviCRM homepage

CiviRules\> **Find Rules**\> could find Rules but can not edit existed Rules. It only shows empty windows like this:

CiviRules\> CiviRle Tags work ok

**2. CiviVolunteer** 4.7.31-2.3.1

Volunteers\> New Volunteer Project: Go back to CiviCRM homepage

Volunteers\> Manage Volunteer Project: Go back to CiviCRM homepage

Volunteers\> Configure Roles\> work ok

Volunteers\> Configure Project Relationship work ok

Volunteers\> Configure Volunteer Settings: Go back to CiviCRM homepage

Volunteers\> Volunteer Interest Form: Go back to CiviCRM homepage

Volunteers\> Search for... Go back to CiviCRM homepage

Please check and help to fix

---

**Solution**: I've follow Aidan's comment: Clearing the caches by go to Administer \> System Settings \> Cleanup Caches and Update Paths \> Cleanup Caches And all works ok now

# Answer
> 2 votes
Many post-upgrade issues like this can be resolved by clearing the caches. It should be taken care of by the upgrade process, but it's worth trying it again.

You can clear the caches in various ways including: `Administer > System Settings > Cleanup Caches and Update Paths > Cleanup Caches`

---
Tags: wordpress, civivolunteer, civirules
---


# Question
Title: Change Event Report fee level filter so operator offers 'contains' rather than 'is one of'
In the Participant Report there is a filter for Fee Level. The operator for this is either 'Is one of' or 'Is not one of'.

Is it possible to provide users with the option to search with the operator: 'contains'?

The behaviour appears to be the same in the normal participant report as well as in the Extended Report Extension's participant report.

The reason we want to do this is because we want to make participant lists for each of the various options in our price set.

We're on Civi 5.3.1 and Drupal 7.58. Thanks

# Answer
> 1 votes
Yes, Its possible to do it using hook\_civicrm\_alterReportVar hook. You can create your own filters using this hook.

---
Tags: civireport, participants
---


# Question
Title: Backdrop authentication function missing
I am using Backdrop CMS 1.10.1 with CiviCRM 5.2.2 and I am having trouble with the kcfinder, when uploading and inserting images, both into CiviMail and CiviContribute.

The initial problem was a 500 error. Based on this bit of the log,

`[Thu Jul 05 16:53:47.624995 2018] [fcgid:warn] [pid 6591] [client ] mod_fcgid: stderr: PHP Fatal error: Uncaught Error: Function name must be a string in [site]/public_html/modules/civicrm/packages/kcfinder/integration/civicrm.php:67`

I traced it down to this switch statement in /kcfinder/integration/civicrm.php

`switch ($config->userFramework) {
 case 'Drupal':
 case 'Drupal6':
 $auth_function = 'authenticate_drupal';
 break;
 case 'Joomla':
 $auth_function = 'authenticate_joomla';
 break;
 case 'WordPress':
 $auth_function = 'authenticate_wordpress';
 break;
 }`

This is missing the case for Backdrop, so $authfunction never got assigned to a string. I tried to add a case for Backdrop, as well as the authenticate\_backdrop function, but I don't know how to make it work. First, I tried making the authenticate\_backdrop function the same as authenticate\_drupal, but it gives me the error:

`You must be logged in with proper permissions to edit, add, or delete uploaded images.`

I removed everything except the permission check from the function, so that it just looks like this:

`function authenticate_backdrop($config) {
 // check if user has access permission...
 if (CRM_Core_Permission::check('access CiviCRM')) {
 error_log("There is permission.")
 return true;
 }
}` It gives me permission, and allows me to upload an image and insert it. Here is the original file with the authenticate functions for drupal, joomla and wordpress. https://github.com/civicrm/civicrm-packages/blob/master/kcfinder/integration/civicrm.php

What is the correct way to implement `authenticate_backdrop`? It is okay to just have the CRM\_Core\_Permission::check?

# Answer
> 1 votes
Per comments above, this bug was fixed by @herb in https://github.com/civicrm/civicrm-packages/pull/216

---
Tags: civicontribute, civimail, kcfinder, backdrop
---


# Question
Title: Personal Campaign Page image is not showing
Drupal: 7.59 CiviCRM 5.3.2

Using PCP for the first time. When the user uploads an image it is showing only when the user is logged in to CiviCRM. The image is not showing for the invitees for support for the PCP. If I try to access the image from the developer tools in IE, I get access denied. Any help would be appreciated as my event goes live in a few weeks

Thanks

# Answer
> 1 votes
Probably you will need to give 'CiviCRM: access uploaded files' for anonymous user. But this is dangerous to provide access to files for anonymous user.

---
Tags: personal-campaign-pages, images, pcp
---


# Question
Title: Cannot edit CiviCase Activity Status from list view
From the List view of CiviCase Activities of a case, I cannot edit the "Status" of an activity; the drop down flashes and then goes back to current status. To edit, I have to click "edit" and go into every single Activity one by one. Is this a bug or a set-up problem?

# Answer
As a clue to lead to possible answer, I am seeing the same kind of issue when I try to edit an activity. Drop-down boxes (e.g., status) and search-for-match fields (e.g.,assignees) are hidden behind the activity screen and, even if the screen is minimized, do not allow editing when clicked. We are WordPress 4.97, CiviCRM 5.3.2. This is the first we've encountered this.
> 0 votes

---
Tags: civicase, activity, status
---


title: Upgrade URL not working. Drupal7

text:
# Question
Title: Upgrade URL not working. Drupal7
I have civicrm on a local server using Drupal7. I have had the same issue with every recent upgrade.
The SysAdmin manual contains the following url to update the database following an upgrade: http://example.org/civicrm/upgrade?reset=1

In my case I am using a local fileserver so this becomes: http://myserver/drupal/civicrm/upgrade?reset=1 This has not worked for me on a number of upgrades which resulted in me finding a different method by mistake. (honesty). The url I have now used successfully is : http://myserver/drupal/index.php?q=civicrm/upgrade?reset=1

suggesting the following generic url http://example.org/index.php?q=civicrm/upgrade?reset=1

So my question is whether there is an error in my original install which is causing the documented url not to work?

# Answer
Your local server probably isn't configured in a way to allow for "clean urls". See https://www.drupal.org/docs/7/configuring-clean-urls/enable-clean-urls
> 3 votes

---
Tags: drupal, upgrade
---


title: CiviDesk's Google Apps Sync Extension

text:
# Question
Title: CiviDesk's Google Apps Sync Extension
I'm considering using CiviDesk's Google Apps Sync extension with CiviCRM 4.7 to update my domain's Directory. Since the information page (https://civicrm.org/extensions/google-apps-sync) is a bit old and light on details, I'd like to ask this community a few questions:

1. It was compatible as of civicrm 4.3. Is anyone using it with later versions?
2. On initial use, does it empty and replace your existing Google Apps Directory, add to it, or synchronize both databases.

I've also asked CiviDesk these questions and will update this post if I hear from them.

# Answer
I haven't heard back from CiviDesk, but I did go on github and find version 1.1 which claims compatibility with CiviCRM 4.5. I felt like that was close enough to my 4.7.3 for me to take the leap. I initially got a bunch of errors (see list below the break), but they are not persistent.

**My Results**

Success. The only errors I've spotted were due to my contacts data having undesirable unicode characters. Once corrected (By editing the table `civicdesk_sync_googleaps`) the next cron run or forced execution puts it back to work.

**What to expect in your Google Apps Directory when the sync happens:**

1. Wait 24-48 hours for the first results to appear. You can blame Google for that.
2. Pre-existing contacts are not updated or deleted. New contacts will be ADDED to the Google Apps Directory. On subsequent runs, these newly-added contacts should update as CiviCRM does (I base this on the fact that the extension records Google's own contact ID for what I can only assume will be future use).
3. Added contacts will be populated with Name, Organization, Job Title, Email, and a link to their CiviCRM profile. As far as I can tell, mailing addresses are NOT synced.
4. The default sync speed it 50 contacts per cron run. I cranked mine up to 100 with no ill effects.

That's about it. I'm including error messages below for searchability reasons for the community--I'm not expecting anyone to offer fixes especially since they were just one-time errors.

-- Just error messages below. Avoid reading further if they make you sleepy. --

Notice: Undefined index: child in \_cividesk\_insert\_navigationMenu() (line 58 of /home/mysite/public\_html/sites/default/files/civicrm/upload/com.cividesk.sync.googleapps-1.0/cividesk.ext.php).

Notice: Undefined index: oauth\_email in CRM\_Admin\_Form\_Setting\_GoogleApps-\>\_checkOAuth() (line 142 of /home/mysite/public\_html/sites/default/files/civicrm/upload/com.cividesk.sync.googleapps-1.0/CRM/Admin/Form/Setting/GoogleApps.php). Notice: Undefined index: oauth\_key in CRM\_Admin\_Form\_Setting\_GoogleApps-\>\_checkOAuth() (line 142 of /home/mysite/public\_html/sites/default/files/civicrm/upload/com.cividesk.sync.googleapps-1.0/CRM/Admin/Form/Setting/GoogleApps.php). Notice: Undefined index: oauth\_secret in CRM\_Admin\_Form\_Setting\_GoogleApps-\>\_checkOAuth() (line 142 of /home/mysite/public\_html/sites/default/files/civicrm/upload/com.cividesk.sync.googleapps-1.0/CRM/Admin/Form/Setting/GoogleApps.php). Notice: Undefined index: domain in CRM\_Admin\_Form\_Setting\_GoogleApps-\>\_checkOAuth() (line 144 of /home/mysite/public\_html/sites/default/files/civicrm/upload/com.cividesk.sync.googleapps-1.0/CRM/Admin/Form/Setting/GoogleApps.php). Notice: Undefined index: domain in CRM\_Admin\_Form\_Setting\_GoogleApps-\>buildQuickForm() (line 44 of /home/mysite/public\_html/sites/default/files/civicrm/upload/com.cividesk.sync.googleapps-1.0/CRM/Admin/Form/Setting/GoogleApps.php). Notice: Undefined index: oauth\_key in CRM\_Admin\_Form\_Setting\_GoogleApps-\>buildQuickForm() (line 58 of /home/mysite/public\_html/sites/default/files/civicrm/upload/com.cividesk.sync.googleapps-1.0/CRM/Admin/Form/Setting/GoogleApps.php). Notice: Undefined index: oauth\_secret in CRM\_Admin\_Form\_Setting\_GoogleApps-\>buildQuickForm() (line 63 of /home/mysite/public\_html/sites/default/files/civicrm/upload/com.cividesk.sync.googleapps-1.0/CRM/Admin/Form/Setting/GoogleApps.php). Notice: Undefined index: last\_sync in CRM\_Admin\_Form\_Setting\_GoogleApps-\>buildQuickForm() (line 74 of /home/mysite/public\_html/sites/default/files/civicrm/upload/com.cividesk.sync.googleapps-1.0/CRM/Admin/Form/Setting/GoogleApps.php). Notice: Undefined index: processed in CRM\_Admin\_Form\_Setting\_GoogleApps-\>buildQuickForm() (line 75 of /home/mysite/public\_html/sites/default/files/civicrm/upload/com.cividesk.sync.googleapps-1.0/CRM/Admin/Form/Setting/GoogleApps.php).

Notice: Undefined index: oauth\_email in CRM\_Admin\_Form\_Setting\_GoogleApps-\>\_checkOAuth() (line 142 of /home/mysite/public\_html/sites/default/files/civicrm/upload/com.cividesk.sync.googleapps-1.0/CRM/Admin/Form/Setting/GoogleApps.php). Notice: Undefined index: oauth\_key in CRM\_Admin\_Form\_Setting\_GoogleApps-\>\_checkOAuth() (line 142 of /home/mysite/public\_html/sites/default/files/civicrm/upload/com.cividesk.sync.googleapps-1.0/CRM/Admin/Form/Setting/GoogleApps.php). Notice: Undefined index: oauth\_secret in CRM\_Admin\_Form\_Setting\_GoogleApps-\>\_checkOAuth() (line 142 of /home/mysite/public\_html/sites/default/files/civicrm/upload/com.cividesk.sync.googleapps-1.0/CRM/Admin/Form/Setting/GoogleApps.php). Notice: Undefined index: domain in CRM\_Admin\_Form\_Setting\_GoogleApps-\>\_checkOAuth() (line 144 of /home/mysite/public\_html/sites/default/files/civicrm/upload/com.cividesk.sync.googleapps-1.0/CRM/Admin/Form/Setting/GoogleApps.php). Notice: Undefined index: domain in CRM\_Admin\_Form\_Setting\_GoogleApps-\>buildQuickForm() (line 44 of /home/mysite/public\_html/sites/default/files/civicrm/upload/com.cividesk.sync.googleapps-1.0/CRM/Admin/Form/Setting/GoogleApps.php). Notice: Undefined index: oauth\_key in CRM\_Admin\_Form\_Setting\_GoogleApps-\>buildQuickForm() (line 58 of /home/mysite/public\_html/sites/default/files/civicrm/upload/com.cividesk.sync.googleapps-1.0/CRM/Admin/Form/Setting/GoogleApps.php). Notice: Undefined index: oauth\_secret in CRM\_Admin\_Form\_Setting\_GoogleApps-\>buildQuickForm() (line 63 of /home/mysite/public\_html/sites/default/files/civicrm/upload/com.cividesk.sync.googleapps-1.0/CRM/Admin/Form/Setting/GoogleApps.php). Notice: Undefined index: processed in CRM\_Admin\_Form\_Setting\_GoogleApps-\>buildQuickForm() (line 75 of /home/mysite/public\_html/sites/default/files/civicrm/upload/com.cividesk.sync.googleapps-1.0/CRM/Admin/Form/Setting/GoogleApps.php). Notice: Undefined variable: resetStr in CRM\_Admin\_Form\_Setting\_GoogleApps-\>postProcess() (line 124 of /home/mysite/public\_html/sites/default/files/civicrm/upload/com.cividesk.sync.googleapps-1.0/CRM/Admin/Form/Setting/GoogleApps.php). Notice: Undefined index: processed in civicrm\_api3\_job\_googleapps\_sync() (line 184 of /home/mysite/public\_html/sites/default/files/civicrm/upload/com.cividesk.sync.googleapps-1.0/api/v3/Job/GoogleappsSync.php).
> 1 votes

# Answer
In a sense I don't know, but in my experience few 4.3 extensions work 100% with 4.7, but generally are easy to update.

I know a few people on the CiviDesk team, and I'm sure that they'd love to hear from you if you haven't contacted them directly: https://www.cividesk.com/contact-us

John
> 0 votes

# Answer
I'm trying to install your Civicrm "CiviDesk's Google Apps Sync Extension", but I met some problem to understand the values I need to set in the setup page.

In detail:

* I use the 4.7 Civicrm version
* I created a new OAuth 2.0
* in the "OAuth key" I set the Google "ID Client" (or other values as the "Name")
* in the "OAuth secret" I set the Google "Client secret"

In any case I always obtain the message "*Cannot authenticate to this Google Apps domain. Check OAuth parameters*".
> 0 votes

# Answer
I try to use the power of CiviCRM 5.4.0 with CiviDesk's Google Apps Sync Extension. This is still the version 1.0 of 2013. Then like marcello and Eric H I still obtain the message "Cannot authenticate to this Google Apps domain. Check OAuth parameters". I contacted Google and trying to clarify an issue of trailing "space" at the end of both the ID client and the secret. Can this be the culprit?

I let you informed of the Google answer on the case. Ichi
> 0 votes

---
Tags: extension
---


# Question
Title: System status blank - error message changing resource url
I'm trying to set up two civicrm installs. both on same host but with different domains.

First install seems to be fine so far.

Second install has blank system status page.

I have previously fixed this by changing resource urls to absolute paths so I thought to try this (although I don't know why this should be required as the other install is fine!)

but trying to change the resource urls gives this error:

Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or service provider with more details about what action you were performing when this occurred. We can't load the requested web page. This page requires cookies to be enabled in your browser settings. Please check this setting and enable cookies (if they are not enabled). Then try again. If this error persists, contact the site administrator for assistance.
Site Administrators: This error may indicate that users are accessing this page using a domain or URL other than the configured Base URL. EXAMPLE: Base URL is http://example.org, but some users are accessing the page via http://www.example.org or a domain alias like http://myotherexample.org.
Error type: Could not find a valid session key.

What is wrong with this installation?

# Answer
> 0 votes
The system status page uses ajax requests. Browsers won't let ajax requests access data on a server that has a different hostname from the one where the request started.

So your second install can be accessed by a different domain but thinks it has another name. You can check this in your browser's developer tools -\> network tab to see what url the system status page is trying to access.

For example you are visiting my2ndsite.org but the system status page is trying to access someOtherName.org.

If you state which http server (e.g. apache) and which CMS (e.g. drupal) and maybe some details about your virtual host config it would help give a more specific answer.

---
Tags: system-status
---


title: cividesk google sync error

text:
# Question
Title: cividesk google sync error
I'm attempting to configure Cividesk sync for Google Apps. Running on latest installs of WP and CIVICRM.

The Cividesk screen shows that it is configured correctly.

But the log shows the following error: Finished execution of Cividesk sync for Google Apps with result: Failure, Error message: Google API error - either the extension is not fully configured or there is a database mismatch.

Any suggestions on how to proceed? There is an old forum link but it simply states to re-install. Figure there might be something more current available from the stack-exchange.

Thanks.

# Answer
The extension is configured correctly per your screenshot, so it must be an issue with the sync queue.

You can reset this queue by accessing your database (command line mysql or phpMyAdmin) and issuing the command: TRUNCATE cividesk\_sync\_googleapps;

The queue will be repopulated when the next sync happens.
> 3 votes

# Answer
Are there several versions of the extension? This version here: https://civicrm.org/extensions/google-apps-sync seems obsolete. Is it working with the OAuth2 of Google?

Could you guide us, Nicolas?

Regards.

```
There are obsolete help windows This option will send your registration information to Cividesk. Registering is important since it allows us to judge the level of interest for the developments we are producing, and hence plan for improvements or new developments accordingly.

```
> 0 votes

---
Tags: wordpress, extension
---


# Question
Title: setting path and url for [civicrm.files]
after much digging around I have discovered that \[civcicrm.files\] is set incorrectly for some reason during install.

i'm hoping this will go some way to explaining the odd and inconsistent system status behaviour i am seeing around system status messages

I've found a post here Set \[civicrm.files\] explainig how to set the variable during via the civicrm.settings.php file

still doesn't seem to have fixed my problem though so I am wondering if I have set the values correctly.

Do I need a '/' on the end of either / neither / both path and url?

# Answer
> 1 votes
You can refer the paths by clicking on the question mark at top of page on Settings - Resource URLs which says

> These settings define the URLs used to access CiviCRM resources (CSS files, Javascript files, images, etc.).
>
> You may configure these settings using absolute URLs or URL variables.

as shown in the image below.

---
Tags: system-status
---


# Question
Title: CiviRules - where is the data stored in the database? - backdating
I've got a CiviRule that triggers when a membership is added and is delayed by 3 months, but i want to back date it for existing memberships, ie any membership less than 90 days old (if it was 88 days old, my rule would act in 2 days time)

Assuming there's not a clever way of doing this up front, i'm happy to manipulate things directly in the database, but haven't found anything but the civirule\_rule\_log which actually changes on triggered conditions - where is the part that acts?

thanks!

# Answer
Be really careful of what you are doing. But the delayed actions are stored in the `civicrm_queue_item` database table.

The column `release_time` indicates the date from which the action is going to be executed. The data for the action is stored as a serialized data blob in the column `data`.
> 6 votes

---
Tags: civirules
---


# Question
Title: "Do not email" privacy setting and CiviMail
I sent out a mass e-mail using CiviMail and a recipient who has the "Do not email" privacy setting received it. The help text associated with the "do not email" privacy setting makes it clear that they would receive registration confirmations and contribution receipts, but NOT receive CiviMail emails.

The only thing I can think of is that it might be because I added their "Do not email" setting AFTER I created the mass mailing but before the mailing was sent out. However, I thought that CiviMail adjusted the mail recipients list according to whoever was included in the recipient groups at the time the mail should go out.

Questions:

1. Does anyone know when CiviMail creates the sending list of recipients for a mass mailing? Is it at the time the mail is created, or at the time the mail is sent out? i.e. if I generate a mail that should be sent to group X, then I remove a user from group X, then the mail goes out...will that user get the mail?
2. Can anyone confirm that the "Do not email" privacy setting means that this person SHOULD NOT receive any further mass emails?

I have tested by adding this user to a group and then creating a test mass email. They were not in the list of recipients. But I am paranoid because I do not understand why they received the one that they did.

Thank you

EDIT: I have sent out several more mailings, and the people marked as "Do not email" are now not getting emailed. CiviCRM is specifically flagging that they will not be emailed. So, in conclusion, CiviMail must create the recipient list at the time that the e-mail is scheduled, not at the time it is sent.

# Answer
Your analysis is correct, the list of recipients is build when the email is scheduled, not when it's sent

In practice, it shouldn't differ too much, but they are some edge case, like possibly your "Do not email" contacts that might have changed between the time you scheduled the email and it was sent

Depending on what logging configuration you have, you might have more info and find out the timeline: check on the "log" tab to see when the contacts have been modified and by whom (they are some changes that aren't properly logged, but you might find the information you need to understand these cases)
> 3 votes

---
Tags: civimail, privacy
---


title: wp-cli and job.execute

text:
# Question
Title: wp-cli and job.execute
I'm trying to follow the WP set up instructions for scheduled jobs https://docs.civicrm.org/sysadmin/en/latest/setup/jobs/ using wp-cli

I can't figure out if I have things working correctly or not!

What response am I expecting when I run the wp-cli job.execute command?

I get:

Array ( \[is\_error\] =\> 0 \[version\] =\> 3 \[count\] =\> 1 \[values\] =\> 1 )

In the civicrm wp admin panel the system status shows last cron job run at approx the time when I ran the wp-cli command , so I guesss this means things are working ok?

But the logs in admin/system setting/scheduled jobs don't show any matching logs for the enabled jobs ?

# Answer
figured it out now! the response , I think, is fine. logs only generated if the specific job runs which is determined by the Run Frequency settings
> 1 votes

---
Tags: scheduled-job
---