title: How to install a not listed Extension?

text:
# Question
Title: How to install a not listed Extension?
I want to install extensions which are not listed in the "Add Neww" directory, such as :

* de.systopia.osm-1.2
* net.ourpowerbase.exportpermission-master

I copied those (from their Git source) to my Site Extension directory, but they don't appear in my Extensions list, so, I cant activate them.

How can I activate them ?

# Answer
Here is the documentation from the administrator guide: https://docs.civicrm.org/sysadmin/en/latest/customize/extensions/#installing-a-new-extension

There are three steps:

* Upload extension package
* Extract (Unzip) the package
* Install and enable the extension, you should refresh your extensions page to show the new extension.

Hope this helps.
> 6 votes

# Answer
The other suggestions are good. If one is a fan of CLI, then cv provides a few easy options.

**Download a published extension from the directory (long name).**

```
cv dl org.example.foobar

```

**Download a published extension from the directory (short name).**

```
cv dl foobar

```

**Download an unpublished extension (long name and zip URL)**

```
cv dl org.example.foobar@http://example.org/files/foobar-1.2.zip

```

**Download a pre-release (alpha/beta) from the directory.**

```
cv dl --dev foobar

```

Note: By default, all these commands will download to the configured extensions folder, use a sensible subfolder (e.g. `sites/default/files/civicrm/ext/org.example.foobar`), and refresh the ext list. You can download to an alternate location ( `--to=<absolute-path>`).
> 2 votes

# Answer
I apologize : I found that I have some jam in my Extension directories : my extensions files are not in the directory specified for (civicrm/ext by default), but in an other (probably to be able to update civicrm without loosing the Extensions).

But, what was unexpected is that refreshing listed this old list while it should have listed an empty list.

I have to put some order in there.
> 1 votes

---
Tags: extension
---


# Question
Title: How to prevent selecting the wrong file format?
When you close an accounting batch, you are asked if you want the exported file in IIF or CSV. We export to CSV every time since we don't use Quickbooks. Just now, however, our office manager accidentally chose IIF. "No worries," I thought, "we'll just re-download it and choose CSV." No dice.

When you go to Exported Batches and click Download, you are not given the choice of format, it just begins downloading another IIF. To fix it, I went to the civicrm\_batch table in the database, found the batch in question and changed its status ID to 2 (Closed). This allowed our office manager to export it again, but in the correct format. (There must be an association somewhere in the database between file format and export batches; I wonder where that is... I digress).

**My actual question: What is the best way to prevent choosing the wrong export file format on the batch export screen?** Disable the IIF option with CSS and/or JS? Can I prevent the IIF option from even systematically appearing since we don't use it? Where would I adjust that?

# Answer
> 2 votes
\[Old question, but may still be relevant\]

A quick but hacky option would be to comment out the IIF line in `$optionTypes` in `CRM_Financial_Form_Export::buildQuickForm()`

A better option would be create a setting and use that to set `$optionTypes` which would be a straightforward enhancement. Since a site probably wants the same type for every batch, a setting under CiviContribute Component Settings seems reasonable.

---
Tags: civicontribute, export, accounting
---


# Question
Title: Compatibility problem with Joomla 3.8.7 and Civicrm 5.0.1 that affects Cron
On my last question How to setup Cron in Civicrm- local server I found out Joomla.php is having problem. i used curl or cli to run cron both does not work, here are the errors:

initial error
`require(C:\Apache24\htdocs\joomla\administrator\components\com_civicrm\civicrm\administrator\includes\defines.php): failed to open stream: No such file or directory in C:\Apache24\htdocs\joomla\administrator\components\com_civicrm\civicrm\CRM\Utils\System\Joomla.php on line 559`

after changing joomla.php and civicrm.settings.php civicrm\_root slashes
`require_once(\libraries/import.legacy.php): failed to open stream: No such file or directory in C:\joomla\administrator\includes\framework.php on line 15`

applied patch Cron Job not working after Joomla 3.8.1 update
`require_once(\libraries/vendor/autoload.php): failed to open stream: No such file or directory in C:\Apache24\htdocs\joomla\administrator\includes\framework.php on line 18`

just wonder if there is a solution for this.

# Answer
I think you are still likely to run into problems on Windows as Aidan mentioned but to give yourself the best chance:

* use CiviCRM 5.1.0, which has additional changes to resolve cli.php problems on Joomla 3.8
* use cli.php not cron.php. cron.php still doesn't work in some environments

My recollection of PHP and Apache on Windows is that paths with `/` work fine so you don't need to replace with `\` if that's what you meant when you said you changed civicrm\_root slashes.

As you saw in the initial error, the path `C:\Apache24\htdocs\joomla\administrator\components\com_civicrm\civicrm\administrator\includes\defines.php` is incorrect. It should be looking in `C:\Apache24\htdocs\joomla\administrator\includes\defines.php`.

In `CRM\Utils\System\Joomla.php`, look in `getBasePath()`, around line 532, for this line:

```
$joomlaPath = explode('/administrator', $civicrm_root);

```

My guess is that the forward slash is not being matched in the Windows path so try changing it to:

```
$joomlaPath = explode(DIRECTORY_SEPARATOR . 'administrator', $civicrm_root);

```

---

UPDATE 22 August 2018: The above change to `getBasePath()` will be in CiviCRM 5.6
> 2 votes

---
Tags: joomla, cron, civicrm.settings.php, compatiblity, version
---


# Question
Title: Show default country and state for public proximity search
I'm trying to figure out how I can set public-facing proximity searches in 4.7.25 to default to civiCRM's default country?

Currently, the user is required to select a country and state, but 99% of our searches happen within the same country.

is there a way to set this?

# Answer
The profile search fields respect the system-wide default country. To set the default country:

* **Administer menu » Localization » Languages, Currency, Location**.
* *Default Country* is located about halfway down the page.

Screenshot:
> 1 votes

# Answer
I recently came across the same problem myself - for country, not for state - so I wrote an extension (com.megaphonetech.defaultcountrysearch) to automatically set the default country on profile search forms when such a field exists. You can download it here. It should be reasonably easy to add support for a default state as well!
> 1 votes

---
Tags: search
---


# Question
Title: Extension Upgrade Failed: Download failed - ZIP file is unavailable or malformed
I'm using CiviCRM 5.0.0 and WordPress 4.9.5, I have CiviRules 1.19 and I have notice that Version 1.21 is available. So I click to update but it has error like picture: **Extension Upgrade Failed Download failed - ZIP file is unavailable or malformed**

Please help me how to fix this.

# Answer
You could do a manual upgrade:

1. download the zipfile from https://civicrm.org/extensions/civirules
2. remove the civirules directory from your extension folder on the server
3. extract the downloaded zip file
4. upload the org.civicoop.civirules folder to your extension folder on the server
5. Go to the extension page in civicrm and see whether any database upgrades are reuired.

ps. It is a good habit to make a backup before step 1.
> 3 votes

---
Tags: wordpress, extension
---


# Question
Title: Email-to-activity processing – create Activity at future date
I would like to be able to set tasks on a Contact using the Email-to-Activity processor. This would allow me to set Scheduled activities on a Contact in CiviCRM, like:

Follow-up with Sally in two weeks about the topic of the email I'm sending right now

Is there a way to do this?

Example:

I'm emailing a Contact from gmail and in the BCC field I add my Email-to-activity address to attach the email to the Contact's record in CiviCRM.

I would also like to add another Email-to-activity processor address like 2-week-follow-up@my-org.com that would:

1. Add an Activity to the Contact with a Type I specify (email, phone, etc)
2. Sets the date to a future date I determine (ie. two weeks from today)
3. Sets the Activity Status to "scheduled"

This would replicate the functionality of Highrise Task Dropboxes: https://help.highrisehq.com/email/task-dropboxes/

# Answer
You could use the CiviRules extension (https://civicrm.org/extensions/civirules) for this. Every time an incoming email activity is created in CiviCRM civirules could create a follow up activity in the future.

You need to configure CiviRules in such a way that the trigger is "activity is added", and that you have a condition on the incoming email activity type. And the the action is "create an activity" which is the "follow up activity".

Also note that civiRules triggers for each contact involved in an activity. The latter could be filtered out by a condition provided by civirules.

Documentation of civirules could be found at: https://docs.civicrm.org/civirules/en/latest/
> 3 votes

---
Tags: civimail, email, activity, scheduled-follow-up
---


title: howto install l10n autofetch

text:
# Question
Title: howto install l10n autofetch
The l10n autofetch extension sounds great but I can't find any hint how to install it. Everybody seems to assume that this is self evident. Where should I put the downloaded folder? It contains only 4 files and I red the readme but it is still a mystery to me.

https://github.com/cividesk/com.cividesk.l10n.update/

Can anyone shed some light on this for me?

# Answer
> 4 votes
The l10n update extension has not been compatible with CiviCRM since version 4.7 of CiviCRM was released in 2016 there does not appear to be any concerted effort underway to bring this extension up-to-date for CiviCRM 4.7+

Source: https://github.com/cividesk/com.cividesk.l10n.update/issues/3

You can still install language packs into CiviCRM as before: https://wiki.civicrm.org/confluence/display/CRMDOC/i18n+Administrator%27s+Guide%3A+Using+CiviCRM+in+your+own+language however the l10n files will need to be updated manually when CiviCRM itself is updated.

---
Tags: drupal, extension, i18n, language
---


# Question
Title: Convert Submitted CiviCrm Membership Form to PDF
Please does anyone know how to generate a pdf document from Membership Forms submitted by members n Civicrm? Is there a way to implement this.

I am using Civicrm/Wordpress

# Answer
> 2 votes
CiviCRM sends a email with PDF attached to it. It has all the data that a membership form has. This email is send to member but you can add CC or BCC in contribution page settings under Thanking-you and receipting.

HTH

Pradeep

# Answer
> 1 votes
It is not really clear from your question what should be in pdf and when it should be generated. It would help if you provide more context to the question.

But I might have a suggestion the CiviRules extension (https://civicrm.org/extensions/civirules) and the PDF Api extension (https://civicrm.org/extensions/pdf-creation-api) could do the job. With CiviRules you could setup a rule which if fired when a membership is added (or updated) to the system and the action could be create PDF. The create PDF action is in the pdf api extension.

Documentation of CiviRules could be found at: https://docs.civicrm.org/civirules/en/latest

---
Tags: wordpress, forms, pdf
---


# Question
Title: bulk email to two addresses - tokens don't work
We have separate records for students and parents in our database. All student records include both their personal emails (if they offer one) and their parent's email. We would like to send emails to both addresses and have recently set up so we can include both in bulk emails. (Before we had a separate group for parents & students and included both groups in emails). However the tokens do not work when sending bulk emails to both addresses. I sent an email to notify students of their audition results, but the field was blank when they received it. When sent to students only (using regular email, not bulk email) or to students w/ a CC to the other email address, it worked. Is there a trick to making the tokens work, or is it just too confusing to use tokens for more than one address in the record? Thanks for any help

Wordpress Version 4.9.5 CiviCRM 4.7.31.

# Answer
You could try this extension for tokens & see if it helps https://github.com/eileenmcnaughton/nz.co.fuzion.civitoken
> 1 votes

---
Tags: civimail, tokens
---


# Question
Title: Is it possible to Contact.get where civicrm_id = external_identifier, using API?
I want to get all contacts who have "CiviCRM Id = External Id"

This API call doesn't work because, id is expecting a numeric value

```
$result = civicrm_api3('Contact', 'get', array(
  'sequential' => 1,
   'id' => "external_identifier",
));

```

Any way to accomplish this using API?

# Answer
> 2 votes
If you want to stay with the API you can filter in php:

```
$result = civicrm_api3('Contact', 'get', array(
  'sequential' => 1,
  'return' => array("id", "external_identifier"),
  'external_identifier' => array('IS NOT NULL' => 1),
  'options' => array('limit' => 0),
));
$ids = array();
foreach ($result['values'] as $contact) {
  if ($contact['id'] == $contact['external_identifier']) {
    $ids[] = $contact['id'];
  }
}
print_r($ids);

```

# Answer
> 0 votes
Will this possible in API? - I am not sure

But

A simple SQL should be quicker - if you have access to Database

**Else:**

you can get a list quicker using CiviCRM Report

**Reports -\> Contact Report -\> Constituent Summary**

select column: contact ID and External ID to be displayed

Export into a CSV and then make a compare in csv

I guess this helps !!!!

# Answer
> 0 votes
It's not directly possible in the manner you indicate.

You would need to get a list of all contact's external IDs then loop through using the API to return contacts who's ID matches their external ID. The direct SQL route or report route given by @Ramesh would be quicker for a one-off task.

# Answer
> 0 votes
If you are familiair with SQL I would use a custom query for that. What exactly do you want to do with the result?

# Answer
> 0 votes
It's very simple and faster to get the result using sql query. You can try using chain api but i am not if it will filter out the result.

```
  $params = [
    'api.contact.get' => ['external_identifier' => '$value.id'],
    'return' => 'api.contact.get'
  ];
  $result = civicrm_api3('Contact', 'get', $params);

```

---
Tags: api
---


title: Civi Error loading homepage

text:
# Question
Title: Civi Error loading homepage
I am getting this message when I load my website. Is this a Civi Issue?

Warning: Cannot modify header information - headers already sent by (output started at /home/aflbs/www/www/wp-content/plugins/civicrm/civicrm.php:305) in /home/aflbs/www/www/wp-includes/pluggable.php on line 1216

# Answer
I changed my cache plugin and that seemed to fix the problem.
> 3 votes

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


title: Using Civi for a signposting service

text:
# Question
Title: Using Civi for a signposting service
I am trying to see if there is a way we can use Civi to help our signposting service.

Workers talk to a client about their lives and as a consequence may want to make a referral to a number of different agencies (max = 5 at one time)

Is there a way the worker could select a number of external organisations and with one click send a referral email with basic name/address information?

Thanks

Graham

# Answer
welcome to civi and SE.

There are a number of ways to address the requirements and partly would depend on your CMS.

For example with Drupal you can use Webform module (with civicrm integration) as a simple way of recording an interaction, then choosing the required 3rd party, pulling in their email and therefore sending an email, from Webform. The text of that email can be tweaked to provide whatever information needs to be passed on to them.

In pure civi this would be handled by creating an Activity and 'assigning' it to the 3rd Party, and this causes CiviCRM to fire off an email (assuming that setting is 'on' for your system) but you don't have much control, out of the box, as to what gets sent.
> 2 votes

---
Tags: civimail, civicase
---


title: How to update Drupal for CiviCRM?

text:
# Question
Title: How to update Drupal for CiviCRM?
Quick question - is there anything in particular to take into consideration when upgrading Drupal, if it is used as a platform for CiviCRM?

Or can I just go ahead with Drupal update as if there was not CiviCRM installed?

# Answer
It depends on the upgrade i.e from 6.x to 7.x to 8.x. If its a simple and internal version i.e 7.12 to 7.29 than you can perform update directly and you won't have problem in CiviCRM but if its from 6 to 7/8 then you will need to replace the CiviCRM files with same version for D7 or D8 and then clear CiviCRM cache(probably delete template\_c).

> **Note: Backup Database and filesystem before performing upgrade.**
> 8 votes

# Answer
You should be able to upgrade within a major version (7.x to 7.x) (6.x to 6.x) (8.x.x to 8.x.x) of Drupal without experiencing any major issues however as with any upgrade it is recommended to take a full backup before you attempt the upgrade.
> 2 votes

---
Tags: drupal, upgrade
---


# Question
Title: Membership Renewal Reminders not Sending for Upgraded Memberships
So we have a situation where someone had Membership A in 2016, and Bought Membership B in 2018 so the Membership type upgraded.

```
Member Since: March 9th, 2016
Start Date: February 26th, 2018
End Date: February 25th, 2022 (they bought 4 terms)

```

We then have a scheduled reminder that is supposed to send 1 day after the Membership Join Date.

What we are observing, is anyone who had a prior membership or an older "Member Since" date is not receiving the email the next day, whereas the completely new Members who are starting their first membership are.

How do we resolve this? Perhaps I midjudged what "Membership Join Date" meant in scheduled reminders?

CiviCRM 4.7.30 / Drupal 7

# Answer
The "join date" is the "Member Since" date; it's a bit odd that there's no option to select "Membership Start Date" in Scheduled Reminders. Perhaps someone else could explain what I'm missing.

You could work around this via CiviRules, or adding the Start Date to the Scheduled Reminders would be simple. It's SO simple that I'm sure there's a case I'm not thinking of why that's not desirable...

Also - you can create a reminder on the "Member Renewal" activity type instead.
> 2 votes

# Answer
As of CiviCRM 5.3.0, "Membership Start Date" is available as an option for basing your Scheduled Reminders off of.
> 2 votes

---
Tags: scheduled-reminders
---


# Question
Title: Where is the civicrm.settings.php file on Wordpress 4.95 with CiviCRM 5.1.x
I'm having trouble with the resource url in a new implementation of wordpress 4.95 and civi 5.1

It is greyed out when listing it via admin/ Settings - Resource URLs

A popup tells me that "Some fields are loaded as 'readonly' as they have been set (overridden) in civicrm.settings.php."

There is no longer a civicrm.settings.php file in /wp-content/plugins/civicrm/civicrm

There is a folder called settings and a lot of stuff under that.

Whats all this about? Documentation doesn't help much with this.. just keeps referring me to the non existent civicrm.settings.php

# Answer
> 4 votes
The /wp-content/plugins/civicrm/civicrm path is for CiviCRM versions older than 4.7. For a new install you should find it under /wp-content/uploads/civicrm

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


# Question
Title: How to fix a login issue on the new CiviCRM gitlab server?
Here's the thing. I've had a user account at civicrm.org for years. Now that the old issues.civicrm.org is shutting down I wanted to check out the new gitlab server at https://lab.civicrm.org

That site tells me that I should login using my credentials from civicrm.org, only that doesn't work.

I'm keen to avoid creating a second user account on civicrm.org unless absolutely necessary as that will most likely just confuse things further. I'm assuming something is broken somewhere.

Can anyone offer a solution?

# Answer
> 3 votes
On https://chat.civicrm.org, mention this on the ~infrastructure channel and a Gitlab administrator will give a hand.

# Answer
> 3 votes
If you can login to civicrm.org, but not lab.civicrm.org, please make sure that your username does not have a space (or other special characters) in it.

I think that Drupal lets you rename your account, but if you have any questions, you can ping @bgm in ~infrastructure.

https://lab.civicrm.org/infrastructure/ops/wikis/login-problems-with-gitlab

---
Tags: gitlab
---


# Question
Title: How to send conditional mail confirmation after completing payment using webform
We have a contribution webform that allows to choose between deferred payment and online payment processor.

We want to send a confirmation mail depending on the payment method choosed. If deferred, mail must contain instructions to complete the payment. If online, mail must contain a thank-you message if the payment is completed satisfactorily.

What is the best approach to achieve this? If we use email webform built in feature, the emails are sent at the time of submiting the form that is good if deferred payment method is choosed but is wrong if online method is choosed because mail is sent before payment process starts instead of when payment is complete.

# Answer
> 2 votes
You could use the CiviRules extension (https://civicrm.org/extensions/civirules) and the E-mail api extension (https://civicrm.org/extensions/e-mail-api).

You could setup a rule which is triggered when a contribution is added and add a condition the payment instrument (and probably also the financial type). You could then add an action which is send e-mail (this action is provided by the e-mail api extension).

Documentation of CiviRules is at: https://docs.civicrm.org/civirules/en/latest

# Answer
> 2 votes
```
<?php

/**
 * Implementation of hook_civicrm_tokens
 */

function callhooks_civicrm_tokens( &$tokens ) {
  $tokens['contribution'] = array('contribution.last_total_amount', 'contribution.last_receive_date', 'contribution.last_financial_type', 'contribution.last_trxn_id');
}

function callhooks_civicrm_tokenValues( &$values, &$contactIDs, $job = null, $tokens = array(), $context = null) {

    // KG NOTES
    // Example from Lobo: https://civicrm.org/node/480
    if ( is_array( $contactIDs ) ) {
      $contactIDString = implode( ',', array_values( $contactIDs ) );
      $single = false;
    } else {
      $contactIDString = "( $contactIDs )";
      $single = true;
    }

  // Contribution tokens
  $query = "
SELECT id, contact_id, financial_type_id, total_amount, receive_date, trxn_id
FROM   civicrm_contribution
WHERE  contact_id IN ( $contactIDString )
AND    is_test = 0
ORDER BY receive_date DESC LIMIT 1
";

  $dao = CRM_Core_DAO::executeQuery( $query );
  while ( $dao->fetch( ) ) {
    if ( $single ) {
      $value =& $values;
    } else {
      if ( ! array_key_exists( $dao->contact_id, $values ) ) {
        $values[$dao->contact_id] = array( );
      }
      $value =& $values[$dao->contact_id];
    }

    $value['contribution.last_total_amount'] = $dao->total_amount;
    $value['contribution.last_receive_date'] = $dao->receive_date;
    $value['contribution.last_financial_type'] = $dao->financial_type_id;
    $value['contribution.last_trxn_id'] = $dao->trxn_id;

    $test = 1;
  }
}

```

---
Tags: webform-civicrm
---


# Question
Title: advanced search - mailing fields not present
I am having a "moment". On one of my civicrms when I use the advanced search I can search mailings. On one of my other civicrm installations the mailings are not available to be searched - the accordian is short of the "mailings" tab. I'm assuming it is somewhere in the configuration but I cannot find it, nor can I find it in the user guide.

Can someone point me in the right direction.

Thank you!

# Answer
> 4 votes
look in civicrm/admin/setting/preferences/display?reset=1

This is a bit counter-intuitive since the first place most would look is under Search Preferences - but it lives under Display Preferences as it is about what displays on the search screen. hth

---
Tags: civimail, advanced-search
---


title: Error When Editing Membership Types

text:
# Question
Title: Error When Editing Membership Types
Running CiviCRM 4.7.31 on WordPress 4.9.5. When attempting to edit an existing membership type, I am receiving an error "Network Error: Unable to reach the server. Please refresh this page in your browser and try again." I refresh and get the same result. All other parts of CiviCRM are working fine. Any help is appreciated.

# Answer
> 1 votes
With such issues it is worth trying a 'right click' on the link to open the Edit screen as you may get to see an error message that you don't see with the pop up. If you find one, the repost in your Q

---
Tags: wordpress, civimember
---


# Question
Title: System Status: Notice 5.1.0 After Upgrade
Need a bit of help just upgraded to the latest version 5.1.0 however now when I click in on the "System Status: Notice" link in the bottom footer I get an error.

Can anyone help me fix this, please?

Error calling get API for UFGroup (aka Profiles)Array ( \[error\_code\] =\> no such field \[sql\] =\> SELECT a.id as `id`, a.is\_active as `is_active`, a.group\_type as `group_type`, a.title as `title`, a.frontend\_title as `frontend_title`, a.description as `description`, a.help\_pre as `help_pre`, a.help\_post as `help_post`, a.limit\_listings\_group\_id as `limit_listings_group_id`, a.post\_URL as `post_URL`, a.add\_to\_group\_id as `add_to_group_id`, a.add\_captcha as `add_captcha`, a.is\_map as `is_map`, a.is\_edit\_link as `is_edit_link`, a.is\_uf\_link as `is_uf_link`, a.is\_update\_dupe as `is_update_dupe`, a.cancel\_URL as `cancel_URL`, a.is\_cms\_user as `is_cms_user`, a.notify as `notify`, a.is\_reserved as `is_reserved`, a.name as `name`, a.created\_id as `created_id`, a.created\_date as `created_date`, a.is\_proximity\_search as `is_proximity_search`, a.cancel\_button\_text as `cancel_button_text`, a.submit\_button\_text as `submit_button_text` FROM civicrm\_uf\_group a WHERE (a.is\_active = "1") LIMIT 100 OFFSET 0 \[nativecode=1054 \** Unknown column 'a.frontend\_title' in 'field list'\] \[tip\] =\> add debug=1 to your API call to have more info about the error \[is\_error\] =\> 1 \[error\_message\] =\> DB Error: no such field \[debug\_information\] =\> SELECT a.id as `id`, a.is\_active as `is_active`, a.group\_type as `group_type`, a.title as `title`, a.frontend\_title as `frontend_title`, a.description as `description`, a.help\_pre as `help_pre`, a.help\_post as `help_post`, a.limit\_listings\_group\_id as `limit_listings_group_id`, a.post\_URL as `post_URL`, a.add\_to\_group\_id as `add_to_group_id`, a.add\_captcha as `add_captcha`, a.is\_map as `is_map`, a.is\_edit\_link as `is_edit_link`, a.is\_uf\_link as `is_uf_link`, a.is\_update\_dupe as `is_update_dupe`, a.cancel\_URL as `cancel_URL`, a.is\_cms\_user as `is_cms_user`, a.notify as `notify`, a.is\_reserved as `is_reserved`, a.name as `name`, a.created\_id as `created_id`, a.created\_date as `created_date`, a.is\_proximity\_search as `is_proximity_search`, a.cancel\_button\_text as `cancel_button_text`, a.submit\_button\_text as `submit_button_text` FROM civicrm\_uf\_group a WHERE (a.is\_active = "1") LIMIT 100 OFFSET 0 \[nativecode=1054 \** Unknown column 'a.frontend\_title' in 'field list'\] )

# Answer
SOOOO, I am a total idiot forgot to run the upgrade URL.... yep so that happened.

Sorry all
> 4 votes

---
Tags: wordpress, upgrade
---


title: Regex search for a list of Contact IDs

text:
# Question
Title: Regex search for a list of Contact IDs
I occasionally have a list of contacts outside of Civi but with CiviIDs that I want to search for in Civi, but aren't grouped in any easily accessible way (no common event, activity, tag, group, etc. to search for). If it were a longer list, I'd do an update import on the contacts (with no actual changes) adding them to a new temporary group. But if I have fewer than say 10, that seems like a lot of steps.

I thought, "A regex search builder would work." But when I put

```
\b(64|5917|5725|5892|5852|5818|5893|5850)\b

```

OR

```
\b64\b

```

OR even

```
[64]

```

into the regex search, I get a "Please enter a valid value" error. I seem to get a valid search when using only numeric text ("64") without any regex operators, which kind of defeats the entire purpose of regex.

I'm not a big regex user, so I could believe I've screwed up the regex. Anything I'm doing wrong here?

# Answer
> 4 votes
Adding to the Suggestion of Jon G there is a simple extension to SearchBuilder that allows to paste ContactIDs into a separate field and converts those to an 'IN' query with comma separated values: https://github.com/bhahumanists/bha.searchbuilder

# Answer
> 7 votes
It's true - looking at the code, I can see that Search Builder expects an integer if you're searching on an integer field. An exception is made for using the `IN` operator, in which case it validates each value separately.

Trying to validate a regex to ensure it's non-malicious is a very difficult task, and I think the appropriate answer is to remove the regex function from the Search Builder on integers. Work is being done on Civi 5.2 to remove operators from Search Builder that aren't appropriate.

However, to solve YOUR problem, you should use `IN`, separating your values by commas like so: `64,5917,5725,5892,5852,5818,5893,5850`

---
Tags: search-builder
---


# Question
Title: OR operator in reports - How to draw a Participants report where A OR B?
How can I use the OR operator in a Participants report? I need a simple A OR B report, and I can only find how to do A AND B.

# Answer
> 2 votes
What you're asking isn't supported with CiviReport, unfortunately.

You have a couple of alternative options:

* You can build a Smart Group that meets your criteria, then filter by the Smart Group. However, I'm not sure what the current state of relative date filters and smart groups is these days, so this may not work.
* You can integrate a more advanced reporting engine like Hitachi Vantara or Tableau.
* If you're using Drupal as your CMS, you can build a View with CiviCRM integration to provide the report you need.

---
Tags: civireport
---


# Question
Title: Translate Custom Profiles not appearing translated in Drupal
When creating a Custom Profile in CiviCRM and attaching that to the Drupal Registration and/or Drupal user account the translations for Portuguese, French, and Spanish are not appearing based on the *Inherit CMS value set*

# Answer
> 5 votes
It took me about a half of a day to debug this thinking it was a bug in Core. In your `civicrm.settings.php` file there is a section that helps properly map Drupal and CiviCRM languages. This is especially important for *Spanish, Portugues, English (Canada), and French (Canadian)*

Edit this file and uncomment the appropriate lines as shown below:

`/**
 * If you have multilingual site and you are using the "inherit CMS language"
 * configuration option, but wish to, for example, use fr_CA instead of the
 * default fr_FR (for French), set one or more of the constants below to an
 * appropriate regional value.
 */
// define('CIVICRM_LANGUAGE_MAPPING_FR', 'fr_CA');
// define('CIVICRM_LANGUAGE_MAPPING_EN', 'en_CA');
// define('CIVICRM_LANGUAGE_MAPPING_ES', 'es_MX');
// define('CIVICRM_LANGUAGE_MAPPING_PT', 'pt_BR');
// define('CIVICRM_LANGUAGE_MAPPING_ZH', 'zh_TW');`

Doing so will immediately map these languages properly in your system and start to render the labels in the languages you have translated.

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


# Question
Title: Event registration fatal error since v5.0.1
When someone registers for an event, it now registers them but crashes on to an error page, stating that "source\_contact\_id is not a valid integer".

I think this has been happening since Civi 5.0.1

I am using Civi 5.0.2 and Drupal 7.59

The Fatal Error Page from the error log is very long, but here's the first bit:

> $Fatal Error Details = array(3) { \["message"\]=\> string(40) "source\_contact\_id is not a valid integer" \["code"\]=\> NULL \["exception"\]=\> object(CiviCRM\_API3\_Exception)#420 (8) { \["extraParams":"CiviCRM\_API3\_Exception":private\]=\> array(3) { \["is\_error"\]=\> int(1) \["error\_message"\]=\> string(40) "source\_contact\_id is not a valid integer" \["error\_code"\]=\> string(9) "undefined" } \["message":protected\]=\> string(40) "source\_contact\_id is not a valid integer" \["string":"Exception":private\]=\> string(0) "" \["code":protected\]=\> int(0) \["file":protected\]=\> string(88)

Anyone else having this problem or have any ideas?

# Answer
The two versions Stuart mentions are different extensions.

https://civicrm.org/extensions/sparkpost-civicrm-integration is the PESC extension from https://github.com/proexchange/com.pesc.sparkpost and the replacement used by Stuart is the Cividesk extension.

I had the same problem experienced by Stuart with the PESC version on a D6 system running CiviCRM 5.0.0. I seem to have fixed it using Stuart's sleuthing - I simply edited the sparkpost.php file and replaced *source\_record\_id* with *source\_contact\_id*

Everything seems to now work. (I'll report back if I find other problems).

UPDATE: The latest version 1.3.7 of com.pesc.sparkpost fixes the problem.
> 2 votes

# Answer
I think I've found the problem, which is to do with mailing and not primarily events. I had upgraded to what I thought was the latest version (v1.3.5) of the Sparkpost extension, which does all the emails for my installation of Civi. (see https://civicrm.org/extensions/sparkpost-civicrm-integration)

However, it seems that there is a bug in the main sparkpost.php file which has source\_record\_id instead of source\_contact\_id. So I think the error was caused because source\_contact\_id was being left undefined.

Anyway, I've now found a more up to date master version of this extension on Github (although it's called v1.1), and I've installed that and it's working fine so far. :-) https://github.com/cividesk/com.cividesk.email.sparkpost
> 1 votes

---
Tags: civievent, registration
---


# Question
Title: GDPR Communication Preferences Compulsory
I am using Civirm 5.1 on Joomla and using the GDPR extension to update Communication preferences. The org has only 1 public facing group with just 1 Mailing list - and the entire purpose of the communication is to ask people if they wish to sign up. If they do not repond they will be removed from Group and if they do respond it is ONLY for the purpose of asking to receive newsletter. Therefore, we need to make the Mailing Group compulsory to sign (as opposed to optional). We do not want form used if you do not want newsletter.

see form here

https://peoples-press.com/index.php?option=com\_civicrm&task=civicrm/gdpr/comms-prefs/update

1 tick box option to MS Newsletter - any ideas how to make compulsory in settings?

# Answer
One route is to do the following:

Modify the section

> Communication Preferences We want to ensure we are only sending you information that is of interest to you, in a way you are happy to receive.

to make it clear that by signing up they are signing up to the Newsletter

then in Comms Pref settings page, untick the "Allow users to opt-in to mailing groups"

then on your MS Newsletter profile - use the Adv Settings to 'add them to group'

i think that makes it really clear what folk are signing up for and removes the extra tickbox for the newsletter from the form
> 1 votes

---
Tags: civimail, gdpr
---


# Question
Title: Is there a way for Memberships to be non-time dependant? educational course progress type?
I am new to CiviCRM, but really impressed so far! However, am currently building out an educational franchise site that along with time based or session based (the rolling & fixed) memberships they also require a more open-ended and non-time based membership type. For instance a membership that is active for as long as the student is moving through the educational course, and once they pass the final of that course and advance to the next level (or the next stage: group of course levels) they would then need to renew their membership for that next section of material (renew for the next course or set of courses). Because the classes are ongoing and students move at their own pace, and also allow open enrollment, this is a critical piece for them. They also have online courses, which also require membership to access that content.

We are using Drupal, and was planning on using drupal commerce module for these purchases prior to getting into Civi, however, we REALLY like the additional features of the Membership components of Civi, and also want to track/manage the users and their memberships through civi.

I have looked around a little, but unable to find reference on this kind of use case.
Any help on or direction would be MUCH APPRECIATED!!! Thanks!

# Answer
Any reason that the following wouldn't suffice:

set them to 'Lifetime' and then have a process eg via Webform\_civicrm (or Rules) to close them off and start the new one when they move up a level
> 2 votes

---
Tags: civimember
---


title: Renewal Status & Process

text:
# Question
Title: Renewal Status & Process
we might have got our sequence / settings wrong, I'm not certain.

Currently ( and likely in teh future ) we collect membership subs manually, with an annual membership.

We set it up such that memberships expire ( 1 Jan ) and when they expire they go into grace instantly for 2 years.

Then we manually collect sub in the spring and then batch load these based.

The membership contributions get recorded, but the status remains 'grace'.

Have we got this wrong? Should the membership be let expire not go to grace? Logically I guess the sequence should be member - end of year it becomes pending payment and only if payment not received it goes to grace?

Alan

# Answer
It all depends on how your organisation works and how strict the rules are. One could argue that all memberships are renewed at the end of the year and payments are created but with status pending. A member could still benefit altough they did not pay. This means that the membership status should stay active,

One could also argue that as long as someone did not paid the member has no benefit in that case you want an inactive status come into play.

What is really cool about CiviCRM is that it is possible to define those membership status rules yourself. You can do that under Administer --\> CiviMember --\> Membership status rules.
> 1 votes

# Answer
Ah ha - I solved my own issue ....

It was related to some code I put together myself and forgot, that checks to see if a grace member has had a contribution and re-instates membership.

This was related to some other code that I found a couple of years ago that handled the 'joining' of memberships when contributions have been bulk loaded ( which doesn't auto link ) from this post https://forum.civicrm.org/index.php?topic=19322.0 \- but the code had started failing due to deprecated mysql code ... fixed now
> 1 votes

---
Tags: civimember
---


# Question
Title: How do I manually add an additional participant to an event?
In using the 'back end' to register people for an event /civicrm/participant/add?reset=1&action=add&context=standalone.

I'm getting a message stating that *email address* is already registered for the event. The event allows for up to 6 additional participants.

# Answer
A person is not allowed to register for same event twice with same email address. However this can be bypassed by enabling '**Same email address?**' option under '**Online Registration**' tab of an event.
> 1 votes

---
Tags: civievent
---


# Question
Title: How to send a confirmation email when adding a contact to group via API?
I'm using the REST API to create contacts and add them to an existing mailing group. I want to add them as *pending* and trigger the confirmation email but I can't find a way to do it via the API.

The extension org.civicoop.emailapi seems like it does what I need but it only supports up to 4.6 and I'm running 5.0.2.

Are there any other options?

**edit** \- I've installed org.civicoop.emailapi and it's working under 5.0.2, but I can't make it send the group confirmation email as it's not a normal mailing template.

**edit** \- If I create my own mailing template, I can't find a token that generates the confirmation link for a specific user and a specific group. To be clear, I want to recreate the {subscribe.url} token from the *Subscription Confirmation Request* automated message.

# Answer
> 2 votes
I've found the answer.

I was calling GroupContact \> Create with parameter Status=Pending. This worked to create the pending contact but as far as I can find there is no way to then trigger the double opt-in email.

The solution is instead to call MailingEventSubscribe \> Create, with parameters for email address and group id. This adds the pending GroupContact and sends the double opt-in email.

For my use case, I needed to create the contact at the same time, so I use separate API calls of Contact \> Create, then MailingEventSubscribe \> Create.

# Answer
> 2 votes
We’re using civicoop email api extension on 4.7 and that means it should work on 5.x as well.

---
Tags: contacts, api, email, groups, confirmation
---


title: Which Payment Processor should we use?

text:
# Question
Title: Which Payment Processor should we use?
We are using Civi 5.0.1 on Wordpress 4.9.1

Recently I asked if anyone is using Payflow as your payment processor. Not a single person could answer. So I don't believe anyone is using Payflow on their civi install. Also after a lot of troubleshooting, I have come to the conclusion that Payflow is no longer compatible with Civi.

OUr organization needs a reliable payment processor that can process credit cards and recurring payments. We are a U.S. based non-profit. Can anyone tell me what is the most popular processor to use with Civi? I looked into IATS Payments. Are they a reliable options?

Thank you.

# Answer
There likely isn't one clear winner here.

But authorize.net has been my go-to recently. That and PayPal Pro are built-in to Civi out of the box.

The Stripe payment processor extension is operating on 855 installs. iATS Payments is on 602 installs.

Here is a very helpful review from Gingko Street Labs which also addresses the 4 aforementioned processors: https://ginkgostreet.com/content/evaluating-payment-processor-options.

I'm on WP as well.
> 3 votes

# Answer
The key to selecting a Payment Processor is the functionality you’re looking for.

The iATS extension is probably the single-most sophisticated payment-processing integration (for US/CA) - especially re: recurring contribution functionality and the abilty to control/edit/update/schedule recurring contributions from the CiviCRM side.

And finally please note that the iATS Payments Extension now also ships with CiviCRM Core.
> 3 votes

# Answer
We use Stripe Extension (com.drastikbydesign.stripe), which is very easy to implement (to open an account, you just have to provide de Bank IBAN)
> 2 votes

# Answer
I totally agree with the answers given and want to emphasize to the choice of payment processor is context dependent.

It does not only depend on the given functionality but also on the costs.

Some charge a fee per transaction, some a monthly fee, some a combination. So the total cost for a payment processor could differ from organisation to organisation.

So it is a decission you have to make. And implementing a payment processor is not difficult (from a developers perspective) so if you found a payment processor you can probably aslo find a developer to implement it in CiviCRM.

ps. the Omnipay extension contains quite a bit of payment processor implementations: https://github.com/eileenmcnaughton/nz.co.fuzion.omnipaymultiprocessor
> 1 votes

---
Tags: payment-processor, recurring-contributions, iats
---


# Question
Title: Hide contacts from search results ,added to specific group
I am looking for hiding contacts in CiviCRM from search results,added to specific group and also Drupal user should be blocked in automatically soon after adding them to a group.Soft delete using civirules is one option.But I don't want the user to get trashed.Any help?

# Answer
> 2 votes
This is directly not available through UI, but you can do this by creating your own extension and using hooks like post and queryobject.

HTH

Pradeep

# Answer
> 1 votes
You can achieve this via UI with ACLs, but it is somewhat messy and does have some performance implications:

* Use the Include / Exclude Search to search for all contacts but your specific group by excluding it and create a smart group for it
* Remove the CMS permission to view / edit all contacts for your desired CMS user role
* Assign an ACL to read / edit your newly created smart group for your desired ACL role
* Assign users to the ACL roles

Perhaps you can play around with the Drupal Rules module and its CiviCRM integration to block users beeing added to a group.

---
Tags: drupal, groups, search-results
---


# Question
Title: After upgrade to 4.7.31 send mail - recipients - "no recepients"
After upgrade to 4.7.31 / working with Wordpress 4.9.4 I face problems with sending mass e-mails (Rundschreiben): I can choose groups (mailing list groups) in the recipients section, but the estimation shows "no recepients"; I can send test emails to a single email address or a group, and it works. I can start the sending process, but no e-mails are being sent. Any hints on how to solve this problem?

# Answer
I resolved this by going to Adminstrater \> System Settings \> Clean up cache and update paths. Click the Clean up cache button.
> 1 votes

# Answer
I did some extensive debugging, looking at the various SQL queries and found the following problem that affects those of us not using en\_US as the language:

./CRM/Mailing/BAO/Mailing.php has the getRecipients function, and it has the following line: $dao = CRM\_Utils\_SQL\_Select::from('civicrm\_mailing\_group') -\>select('GROUP\_CONCAT(entity\_id SEPARATOR ",") as group\_ids, group\_type, entity\_table') -\>where('mailing\_id = #mailing\_id AND entity\_table IN ("civicrm\_group", "civicrm\_mailing")') -\>groupBy(array('group\_type', 'entity\_table')) -\>param('#mailing\_id', $mailingID) -\>execute();

The problem is that for non-en\_US languages, civicrm\_mailing\_group table has the language-specific view as the entity table, so in my case civicrm\_group\_en\_GB, not civicrm\_group, so the recipients are never found. This code snippet solves the problem - I've yet to submit a patch.

```
$mailingGroup = new CRM_Mailing_DAO_MailingGroup();
$mgtable = CRM_Mailing_DAO_MailingGroup::getTableName();
$group = CRM_Contact_BAO_Group::getTableName();
$recipientsGroup = $excludeSmartGroupIDs = $includeSmartGroupIDs = $priorMailingIDs = array();
$dao = CRM_Utils_SQL_Select::from($mgtable)
         ->select('GROUP_CONCAT(entity_id SEPARATOR ",") as group_ids, group_type, entity_table')
         ->where('mailing_id = #mailing_id AND entity_table IN ("' . $group . '", "' . $mailing . '")')
         ->groupBy(array('group_type', 'entity_table'))
         ->param('#mailing_id', $mailingID)
         ->execute();

```
> 0 votes

# Answer
This bug is marked as being fixed in 5.0 - you should upgrade to the latest release (currently 5.1.2) to get the fix
> 0 votes

---
Tags: wordpress, civimail
---


# Question
Title: GDPR Civicrm Bug when attempting to forward to another thank you page?
On the Communications Preferences settings page (of the GDPR extension) the option to Display a message on the form page works fine, but when attempting to forward to another thank you page

https://peoples-press.com/thank-you

and I put either relative or absolute (which the extensions says I can) the page it sends me to is

https://peoples-press.com/index.php?option=com\_civicrm&task=https://peoples-press.com/thank-you

Have no idea how to tackle

Civicrm 5.1 - Joomla 3.8.7

# Answer
> 2 votes
thank you for reporting the problem. I tried to reproduce the problem on my website - it actually appears at absolute addresses. I link your entry, I will add my screenshots and create a problem notification in the plugin. Regards Marcin Lewandowski The Star of Life Foundation

EDIT - issue is here

# Answer
> 0 votes
I don't know whether you have development skills or whether you have access to fund a developer.

Either way to process is to report an issue on the extension github page (https://github.com/veda-consulting/uk.co.vedaconsulting.gdpr). When you are a developer you could 'fork' the repository on github to your account, fix the bug, commit it to your repository, and then create a 'Pull Request'. Which then allows to original developer to incorporate your changes.

---
Tags: gdpr
---


# Question
Title: Can I import a drupal block into a mosaico mailing template?
I'd like to be able to pull in drupal blocks. e.g. index of latest news. Is that possible?

# Answer
I think this Fuzion extension could provide what you need. Can't say i have tested it for a long time but it used to provide that functionality as a token to include in civimail so not sure why it couldn't do same in mosaico
> 2 votes

---
Tags: mailing, mosaico
---


# Question
Title: Duplicate contact when i log with this one
Apparently when i'm trying to log with a contact, this one is duplicate :-/ Someone said that it could be because the wp email is different of civi email but in my case both are the same. If someone knows how to resolve it :)

Have a nice day

# Answer
You can dedupe contacts in two ways in CiviCRM.

The first one to do a search and find both contacts and then check the checkbox in front of both contacts and select the Merge Contacts from the action list (screenshot is in Dutch).

The other way is from the dedupe functionality under the Contacts --\> Dedupe menu.

You have to select a rule and it will try to find matching contacts which you could then merge.
> 1 votes

---
Tags: duplicate-contacts
---


# Question
Title: CiviCRM select box items can't be selected in wordpress page create
In wordpress, when adding a new page or post, a CiviCRM button is available to add content from Civi. The "Insert CiviCRM Content" dialog box opens as expected, but the select box doesn't allow a selection. The select box contains "User Dashboard", "Profile", "Contribution Page" and "Event Page", but these options open underneath the dialog box and can't be clicked.

Turns out that this is because the select box has a z-index of 399,999. I can't find any CSS conflict that would cause this, and there is no JS error in the console. Any suggestions would be appreciated.

# Answer
I had a similar problem with this - See CRM 18496. It turned out that there may have been interference with CiviCRM's jQuery and CSS from a Wordpress plugin. You could try deactivating any plugins that you have installed, one by one, to see if there is conflict. My problem went away without me discovering which of the many plugins I have was the culprit but one of them that I deactivated was Jetpack.

Unfortunately, you can't test this out on the demo site because you can't there create a new page in which to enter the appropriate civicrm shortcode.
> 4 votes

# Answer
on functions.php add :

```
function my_custom_fonts() {
  echo '
     .select2-drop-active{ z-index: 99999999 !important;}
';
}

```
> 0 votes

# Answer
The solution provided by @mahrez-othemeni is good except it won't work if you are in a popup that has a CKEditor and you open a dialog from there. i.e. try to add a link.

Here is the solution we use that seems to work. Add this css code in your theme :

```
body.toplevel_page_CiviCRM .ui-dialog {
   z-index: 1000 !important;
}

```
> 0 votes

---
Tags: wordpress, cms-integration
---


# Question
Title: Extended Report - Line Item report for price sets final line concatenating all records
The Extended report Line Item report for price sets was working perfectly fine till recently.

Now the last line is concatenating all first name and last names. See Screenshot

# Answer
> 3 votes
This is because of full group by mode. I feel the latest version of CiviCRM group bys with fields that are mentioned in sort by(order by). Try after clearing the sorting fields.

---
Tags: civireport
---


# Question
Title: Dialing Contribution Aggregate by Relationship back a few year
TL;DR: I want Contribution Aggregate by Relationship to show more years in the past.

I'm using the report "Contribution Aggregate by Relationship" to produce a report with columns for giving by year. However, it doesn't go back as many years as I'd like. I found how to control how many years it goes *forward* ("custom" date class in Settings - Date Preferences), but the same date class doesn't affect how far it goes back (three previous years then a catch-all for years before that). Is there something else that controls this? I need it to go back about 10 years or so.

# Answer
Answering my own question:

My fix was to edit a file in "all", which isn't ideal since it'll get overwritten when updating CiviCRM, but I can always re-apply it.

Edit file: `sites/all/modules/civicrm/CRM/Report/Form/Contribute/History.php`

Change Line 61 from `$yearsInPast = 4;` to `$yearsInPast = 20;`
> 1 votes

---
Tags: reports, date-preferences
---


# Question
Title: Upgrading from 4.7.12 to 5.1.2 on Wordpress
Its been a while since we performed and update on our site. Would there be any issues upgrading to the latest version from such an old version?

# Answer
As Pete said - 4.7.12 - 5.1.2 should not cause much concern. If you are able to, I would create a sandbox site, upgrade that site and test to see if it all goes well.

There is one version specific caveat you should know about when upgrading from 4.7.31 to 5.0 Though I am not sure it effects you if you are upgrading directly from 4.7.12 - though maybe someone else can answer that.

Alternatively, if you want to really take it slow, you can find the history of CiviCRM versions on SourceForge \- maybe upgrade to an older version first and test.
> 0 votes

# Answer
Not particularly. We have nursed upgrades through from 4.4 and 4.6 (yes we inherit some shockingly old systems occasionally) without significant problems. On that scale 4.7.12 doesn't seem to be 'such an old version'.

If you backup code and db and give it a try and you hit issues then just roll back and come back on here with some details of problems you encounter.

(Edit to incorporate Ramesh's helpful comment)

Refer this link docs.civicrm.org/sysadmin/en/latest/misc/switch-servers also you can refer to docs.civicrm.org/sysadmin/en/latest/upgrade/drupal7
> 4 votes

---
Tags: wordpress, upgrade
---


title: Unsubscribe error message

text:
# Question
Title: Unsubscribe error message
If the Civi user isn’t logged into their account then they get the following error when clicking token inside their email footer:

> 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.
>
> A fatal error was triggered: is not of type Text
>
> Return to home page.

The link being generated in the mailing is:

`https://example.org/civicrm/mailing/optout?reset=1&jid=15266&qid=6919138&h=e77ea82acfec8278`

**Is this expected behavior?**

# Answer
> 4 votes
I figured it out with the help of the back trace from the error.

It was the CiviAlerts extension which I had installed apparently, I really liked this CiviAlerts too because it let me give my mail admins a message window to see when I wanted all of them to do something differently (like use a different smart group for example in a mailing).

Anyway I just went in and turned off that Extension then redid my test and guess what? The form showed up with the email (and a few asterisks) and a confirmation page. Problem solved. Thanks for the assistance.

The changes described in this Pull Request for the CiviAlerts extensions *should* resolve the issue: https://github.com/mr-vara/me.vara.civialerts/pull/1

---
Tags: drupal, civimail, email
---


# Question
Title: How to fix a blank update my details link in the recurring payments receipt?
I am providing a recurring payments option through the eway credit card gateway and the agileware recurring payments extension.

```
eWay_Recurring (au.com.agileware.ewayrecurring) 1.5.2

```

The template looks like it is loaded from here web/sites/all/modules/civicrm/CRM/Upgrade/4.6.10.msg\_template/message\_templates/contribution\_online\_receipt\_html.tpl

The %1 link is blank in

```
You can update billing details for this recurring contribution by <a href="%1">visiting this web page</a>

```

How do we fix this?

# Answer
> 1 votes
Fuzion did some work to improve eWay recurring using their **RapidDirect, Rapid & Shared** solutions. The code is now available in the Omnipay Extension.

AgileWare helped fund the development of this but can't comment on whether that implies it is their preferred solution now.

# Answer
> 1 votes
If you post a bug report to the Github repo we'll take a look, https://github.com/agileware/au.com.agileware.ewayrecurring/issues

---
Tags: civicontribute, recurring-contributions, eway
---


# Question
Title: Is there a way to put CiviCRM in read-only mode or deactivate forms programmatically?
I have recently set up our website so that I can put it in read-only mode (using the Read Only Mode module) when doing maintenance, such as upgrades and code pulls, however, this is a Drupal function only and I noticed that while in read-only mode, CiviCRM front-facing forms, such as CiviContribute forms, as well as backend functions are still available.

Is there a way to either put CiviCRM into read-only mode or turn off/deactivate the CiviContribute forms? I have written a bash script that runs all my update/upgrade processes and would like to find a way to do this using drush. For staff, I'm thinking of just deactivating the link to CiviCRM in the administrative menu, but I am most concerned with making sure users can't process transactions and write to the database during down-time.

I'm on CiviCRM 5.1.0 and Drupal 7.59

# Answer
For the CiviContribute forms, you can choose Disable for each form from the Manage Contribution Pages screen (civicrm/admin/contribute?reset=1 on 4.6 LTS). The Disable option is under the More link. When maintenance is done, you can Enable each one in the same way.

For something from the command line:

There is an entity in the API called `ContributionPage` with a parameter called "Is Page Active?" (`is_active`). I just executed the `Create` action thru the API Explorer and it seems to have worked. I would test it out and see what works best for you. The API Explorer lists the drush command as: `drush cvapi ContributionPage.create sequential=1 id=15 is_active=0` (`0` being disabled and `1` being enabled)
> 2 votes

# Answer
Maybe, we could just add an extension with a simple call to freeze the form in a buildform hook. Something like -

```
function example_civicrm_buildForm($formName, &$form) {
  $form->freeze();
}

```

This will display all forms in CiviCRM as read-only.

Note: We need to enable this ext before an upgrade and disable after the process is completed.
> 2 votes

# Answer
No there is no way of putting CiviCRM in read only or maintance mode.

However if you put Drupal in maintaince mode only administrators could login and access civicrm. All other users cannot do anything.
> 1 votes

# Answer
You could temporarily disable the CiviCRM module. That would take down all your contribution forms, etc. However you'd have to be careful to re-enable it when doing anything Civi-related in your maintenance. It must be enabled in order to upgrade CiviCRM.
> 0 votes

---
Tags: civicontribute, drupal, 5.1.0
---


# Question
Title: Can a user removed from smart group manually be added back automatically if criteria is satisfied?
I have a requirement, where I need to Limit Scheduled Reminders to Only Members with Active and Grace Status(which is a smart group) But If I remove a user manually from Member with Active And Grace Status Group, will he stop getting Scheduled Reminder even though he/she is an Active Member or Grace Status Member, also is there a possibility when he pays again for membership, will smart group add him back or once removed from smart group manually, he/she will not be added at all

# Answer
> 5 votes
A person once removed(not deleted) from smart group won't be added again back automatically if the contact's updates his/her information or membership. So schedule reminder will exclude the contacts that are removed from smart group.

# Answer
> 3 votes
I would implement this using two smart groups:

**Smart Group A**

* Consists of members with Active/Grace status.
* Cannot have members who are in Group B.

**Smart Group B**

* Members manually added to designate that they shouldn't be in Group A.
* Remove members of group B automatically with CiviRules when they pay membership renewal to allow them to be automatically added to Group A again.

I've tested a similar group membership workflow on a testbed running D7.59 and CiviCRM 5.1.2 and it worked in my, admittedly, limited testing.

**Edit to address feedback from Jon G**

*This may run into performance issues for which there is no workaround at present due to the use of unindexed join due to the combination of smart groups and other smart groups / non-smart groups*

*These performance issues should only really be evident when regenerating the smart group membership.*

---
Tags: smartgroups, scheduled-reminders
---


title: Adding a job as API

text:
# Question
Title: Adding a job as API
As far as I can understand, the way to add a job is to set it up in your extension as an API.

So I have created the default code using

```
 civix generate:api --schedule=Daily Contact myendpoint

```

Enabled the extention and it appears in the API Explorer

But when I run it

```
cv api Contact.myendpoint debug=1

```

it fails

`{
 "error_code": "not-found",
 "entity": "Contact",
 "action": "myendpoint",
 "trace": "#0 /var/www/html/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(166): Civi\\API\\Kernel->resolve(Array)\n#1 /var/www/html/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(100): Civi\\API\\Kernel->runRequest(Array)\n#2 /var/www/html/wp-content/plugins/civicrm/civicrm/api/api.php(23): Civi\\API\\Kernel->runSafe('Contact', 'myendpoint', Array, NULL)\n#3 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Utils/REST.php(311): civicrm_api('Contact', 'myendpoint', Array)\n#4 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Utils/REST.php(548): CRM_Utils_REST::process(Array, Array)\n#5 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(275): CRM_Utils_REST::ajax()\n#6 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem(Array)\n#7 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke(Array)\n#8 /var/www/html/wp-content/plugins/civicrm/civicrm.php(1246): CRM_Core_Invoke::invoke(Array)\n#9 /var/www/html/wp-includes/class-wp-hook.php(286): CiviCRM_For_WordPress->invoke('')\n#10 /var/www/html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters('', Array)\n#11 /var/www/html/wp-includes/plugin.php(453): WP_Hook->do_action(Array)\n#12 /var/www/html/wp-admin/admin.php(224): do_action('toplevel_page_C...')\n#13 {main}",
 "is_error": 1,
 "error_message": "API (Contact, myendpoint) does not exist (join the API team and implement it!)"
}`

So it looks like I'm missing a step somewhere - but can't find it in the docs .. any help?

# Answer
OK I found out what I did wrong

the help message gives

```
Usage:
  generate:api [options] [--] \EntityName>> \ActionName>>

Arguments:
<EntityName>               The entity against which the action runs (eg
"Contact", "MyEntity")
...

```

Being new to this I followed the instructions and typed

```
civix generate:api    \Contact \myendpoint

```

Which works without complaint, and puts the end point in the explore ... but doesn't work.

interestingly

```
civix generate:api    Contact \myendpoint

```

does work - it is the backslash before Contact that breaks things.
> 1 votes

# Answer
@Alan

you are right - to setup a schedule job you need to create an API and then you need to add that API in your JOBS folder -

But you are trying both together - this is the correct syntax

```
civix generate:api NewEntity NewAction

```

First create your extension folder - then cd extensionfolder

Then run the above code to generate an API

Then you need to create an entry in civicrm\_job table - this can be done through SQL or in the front end

Refer: https://docs.civicrm.org/dev/en/latest/extensions/civix/#generate-api

I guess this helps !!!!

Thanks
> 0 votes

---
Tags: api
---


title: Directory of Programs

text:
# Question
Title: Directory of Programs
We are creating a directory of programs and we thought that using CiviMember would be the best way to approach it. Mainly because many of the programs are housed at other organizations/departments and we would want them to submit to the directory. We decided that the programs would register their programs as organizational members.

One website that uses Civi and is an example of what we are trying to accomplish (partly) is https://www.escr-net.org/members \- Instead of Region and Workgroup, we would have something like Category and Age Group, or something along those lines, using custom fields. Similar to the ESCR directory, as a visitor to our site, you would be able to search and click to learn more about the different members.

We also thought membership would be a good approach as we can set expiration dates and have programs update their information when they renew their membership.

Is membership the right approach for what we want to do or is their a better option. Maybe CiviVolunteer?

Using Drupal 7 and Civi 5

Clarification on Programs This is a University Office that is seeking to list all the public programs that other university offices and departments offer.

We also want each department to submit a public program profile, that we will request to be updated yearly. Some of that info will be public, the rest will be private.

Side note: We know we are going to have to work with a consultant to get this working the way we want it, but we wanted to see what the possibilities were, esp since we have seen other CiviCRM orgs do similar.

# Answer
> 1 votes
I would say that programs should either be:

* A contact subtype.
* A custom entity (defined by an extension).
* Not stored in Civi, but in the CMS (assuming Drupal or Backdrop) - and use Entity Reference to connect it to Civi.

Memberships/Volunteers seem like we're stretching the paradigm a little thin.

# Answer
> 0 votes
Agree with Jon G that if you do need to handle it in CiviCRM a contact subtype makes most sense (assuming you do not want to develop, if you do a custom entity in an extension might make just as much sense). And then possibly CiviCase to handle the actual steps in a program (if there are any)

---
Tags: civimember, directory
---


# Question
Title: Is there a way to edit tag colours through the UI?
Having created a number of tags I've decided it would be useful to have them colour-coded. It is straightforward to specify a colour when creating a tag, but I can't work out how to apply a colour to an already created tag, and have it stick. The UI lets me specify a colour, but there seems to be no way to save the change?

# Answer
> 3 votes
Click on the tag to edit, then click on the color rectangle (if white than you will not see any color) . See screeprint

So in this example the color rectangle is the one in the left top hand corner.

---
Tags: tags
---


# Question
Title: HTTP Error 500 during search request - CiviCRM 5.1.1
I have a new installed CiviCRM 5.1.1 property on my server.

My current system configuration is:

Wordpress 4.9.6

The problem: I importet a few contacts but I realized that besides using the search function in the upper left corner and using custom reports I receive an error 500 and no results.

For example, when I use contacts \> find contacts I receive an Error 500 for the following URL: http://mydomain.de/wp-admin/admin.php?page=CiviCRM&q=civicrm/contact/search in Wordpress Debug Mode:

Fatal error: Uncaught Error: Call to undefined method CRM\_Core\_DAO::disableFullGroupByMode() in /var/www/vhosts/xxx.mydomain.de/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/Query.php:4848 Stack trace: #0 /var/www/vhosts/xxx.mydomain.de/wp-content/plugins/civicrm/civicrm/CRM/Contact/Selector.php(1181): CRM\_Contact\_BAO\_Query-\>searchQuery(NULL, NULL, NULL, false, false, true) #1 /var/www/vhosts/xxx.mydomain.de/wp-content/plugins/civicrm/civicrm/CRM/Utils/PagerAToZ.php(108): CRM\_Contact\_Selector-\>alphabetQuery() #2 /var/www/vhosts/xxx.mydomain.de/wp-content/plugins/civicrm/civicrm/CRM/Utils/PagerAToZ.php(136): CRM\_Utils\_PagerAToZ::getDynamicCharacters(Object(CRM\_Contact\_Selector), false) #3 /var/www/vhosts/xxx.mydomain.de/wp-content/plugins/civicrm/civicrm/CRM/Utils/PagerAToZ.php(52): CRM\_Utils\_PagerAToZ::createLinks(Object(CRM\_Contact\_Selector), NULL, false) #4 /var/www/vhosts/xxx.mydomain.de in /var/www/vhosts/xxx.mydomain.de/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/Query.php on line 4848

Could anybody please help with this issue? I was trying to fix it for some time now and searched the whole forum with no result or hint. Thanks a lot in advance.

# Answer
This is a known issue with CiviCRM 5.1.1 that was patched in 5.1.2. The details of the issue are here: https://github.com/civicrm/civicrm-core/blob/5.1/release-notes/5.1.2.md#synopsis

Download the new version from https://civicrm.org/download and update your site.
> 2 votes

---
Tags: wordpress, error, custom-search, error-page, advanced-search
---


title: duplicate database in civiCRM

text:
# Question
Title: duplicate database in civiCRM
Is it possible to duplicate the data base on Civi ? (contacts) Because i need to do it for my traineeship.I don't even know if it's possible but maybe does an alternativ way to do it. thanks and have a nice day.

# Answer
> 0 votes
There is no feature through the UI that lets you duplicate your whole set up since this also involves the CMS etc. Hence suggest you do what Christia suggested in the comments, namely

> set up a local copy of your website and the CiviCRM by following the instructions. Then import a copy of your CiviCRM database.

---
Tags: database
---


# Question
Title: Custom Search Include/Exclude error message
Using Civi linked to joomla web to manage our membership and various mailing lists.

I would like to be able to use a custom search function to find, for example, individuals who are not members, or individuals who are not in our 'newsletter' contact group. Contacts who are not in a give contact group.

I imagine the Custom Search Include/Exclude function would be best for this but when I select this from the Custom Search List I get an error message 'At least one Group and Tag must be present for Custom Group / Tag search.'

Can anyone advise what this means and how I might conduct such a search?

Many thanks

# Answer
This error is displayed when you don't have any groups OR tags available on your site.

* Check if you see any groups listed in `civicrm/group?reset=1`.
* Similarly, check if you have at least one tag available in `civicrm/tag?reset=1`.

In your case, I think you don't have any tags created on your site. As a hacky workaround - you can create a dummy tag from `Contacts -> New Tag` menu in order to get rid of the error on the search screen.
> 2 votes

# Answer
Sounds like you need to create a Group with 'everyone' and another Group with 'Members' and then use the Include/Exclude Group option to get what you are wanting.
> 1 votes

---
Tags: joomla, groups, custom-search
---


# Question
Title: State dropdown empty on form with Drupal webform integration
We are running Civi 4.7.29. with Drupal. We have a webform using Drupal webform integration which populates civicrm fields.

we noticed that the state drop down was empty when previously it was working correctly.

Has anyone come accross this issue?

I checked the state province table in civicrm and it is not empty.

Thanks

Yes there is an error on the page. Please see below. How do I fix this please?

# Answer
> 3 votes
Usually when a javascript element fails to work on your page, it's caused by a general javascript failure on your website. This can be caused by incompatible plugins or themes, etc. So the problem may have nothing to do with the state/province field or webform-civicrm; if Javascript has crashed, then it can't run. To narrow down the problem, open up the console in your webbrowser (F12) and look for any error messages. If the error message contains the name of a plugin, try disabling it. Or take a screenshot of the error and add it to your question.

# Answer
> 1 votes
Our developer updated the jQuery version and this seemes to have solved the javascript errors on the page.

---
Tags: drupal, webform-civicrm, addresses
---


title: CiviMail opt out language

text:
# Question
Title: CiviMail opt out language
I have the latest version 5.1.1 of civicrm. A problem that kind of slipped past our organization in the past is that the page for opting out has been always in English. Mostly people opted out still without a problem, because I guess most Slovaks know enough English to handle that sort of thing, but there would be occasional emails from people asking to unsubscribe that my boss/wife would get complaining about the opt-out process.

I though I had fixed it through setting CiviCRM to follow the Drupal language, which defaulted to Slovak unless I was logged in. Now I realize that just fixed everything but the text of the opt-out page. So I've just changed default language of civicrm to be only Slovak and never change, and for good measure, set Drupal to just be in Slovak. (I can handle it after 8 years of living in Slovakia and learning the language!).

But still, my testing shows me the page for opt out is always in English:

The link for optout sent was: https://info.cbreurope.sk/sk/civicrm/mailing/optout?reset=1&jid=somenumber&qid=somenumber&h=somenumber

What am I missing? BTW, we are using the Mosaico plug in for sending emails. Could that be a problem? Drush is running the cron jobs.

# Answer
The Slovak translation of CiviCRM is only 16% complete \- so it's not surprising that some pages wouldn't be translated. This template (`templates/CRM/Mailing/Form/Optout.tpl`) is correctly configured to be translated, so it seems that this is simply a case of untranslated strings.

If you or someone you know would like to improve the state of the Slovak translation, consider registering for a Transifex account. You'll have the opportunity to enter translations for various English text, which will automatically be added to the Slovak translation files, which you can then download to your site. You'll also be helping other Slovak-speaking organizations with your efforts!
> 3 votes

---
Tags: civimail
---


# Question
Title: Exporting Drupal user account ID's through Civi search
I'm trying to export the Drupal User ID's for a particular Civi group, in preparation for GDPR and as a general clear out. I am able to search for all users in Civi which are a CMS user (and therefore have a Drupal account) but when I go to export and download this information none of the available fields will provide the Drupal User ID, the columns are just blank.

Is this my Civi getting confused and refusing to provide information (which it does do sometimes) or do I need to download this information in a different way.

Hope that makes sense and thanks for any help!!

# Answer
> 4 votes
We needed to do something similar, though not GDPR related. Because the Export does not access the Drupal user fields, we created a simple View (page display) to give us this data, based on CiviCRM Contact.

We also used the Views Export Data module and 'attached' the csv to the Page above. Note the page is not required, you can simply use the csv display via the URL you configure for it.

---
Tags: drupal, groups, export, cms-integration, gdpr
---


# Question
Title: Undefined Index in an Event+Contribution Registration Webform
Running Civi 4.7.27 / Drupal 7.59 + Webform Integration

I have Webforms to register Parent + Children and pay for an Event (the webforms are a bit complex, with lots of custom fields, but they used to work correctly).

Now, when I open the Webform second page (Contribution Page), I get the following message :

*Notice : Undefined index: fee\_amount in wf\_crm\_webform\_postprocess-\>validateParticipants() (line 410 in /home/bapaparoisse/www/www/sites/all/modules/webform\_civicrm/includes/wf\_crm\_webform\_postprocess.inc).*

However, everything seems to work correctly : the payment can be performed. Other such but simpler Webforms seem to work wiyhout this Notice.

I don't know when this began, since those events are passed now. I just know that I made some Extensions cleaning recently.

I will be glad if someone can bring me some light about this (where does it come from ?)

# Answer
> 1 votes
Given that is 'only' a Notice have you considered turning Notices off in the Drupal settings since it is normal practice to not display these on a production environment.

---
Tags: civicontribute, webform-civicrm, contributions
---


# Question
Title: Following a CiviCRM checksum link doesn't populate civicrm tokens but logging in populates the tokens.
Example use case:

You want to link a user to a page and populate some information about them (e.g. display an online membership card):

\[current-user:civicrm-contact:display-name\] \[current-user:civicrm-contact:custom-122\]

These tokens do not populate following a checksum link but do populate when the user logs in. Is there an easy way to make the checksum link behave in the same way as logging in for the purpose of these tokens?

# Answer
> 2 votes
1. I assume the "page" you're referring to is using a Webform, If that's the case, then you should mention that in the title.
2. The link to the form should be of the format `http://example.com/your_form?cid={contact.contact_id}&{contact.checksum}`.
3. On the CiviCRM tab, in the Contact Field section, select Existing Contact, as well as all the fields you want to appear on your Webform.

---
Tags: tokens, user-account, checksum
---


title: How to Change Profile Type

text:
# Question
Title: How to Change Profile Type
I have a profile whose type is set to: ParticipantEventName:Event Name. I want to change it to be just "Participant." That field does not seem to be editable in the Profile listing table.

How can I do this?

# Answer
> 3 votes
The 'Type' field is automatically calculated upon the fields present in the profile. Your profile must be having custom field for certain Event name that's the reason it shows 'ParticipantEventName:Event Name'. There is no way you can update this field through UI. However if you want to update then either you can run update query or run api in create mode from api explorer, but still the 'Type' will be recalculated when the profile fields will updated or added.

---
Tags: profile
---


# Question
Title: CiviCase css problem (Joomla version) after upgrade to 4.7.14
There is a problem with css class "label" in CiviCase. This affects the CiviCase dashboard and custom fields in the Case view panel. I think this only affects the Joomla version of CiviCRM 4.7.14.

# Answer
This problem was fixed in version 4.7.16. More details here. If for some reason you need a quick fix for version 4.7.14, comment out the last 10 lines of css/joomla.css.
> 0 votes

---
Tags: joomla, civicase, css, 4.7.14
---


# Question
Title: Webform-civicrm Address fields not being saved in CiviCRM
We are running Civi 4.7.29. with Drupal. We have a webform using Drupal webform integration which populates civicrm fields. When the form is submitted the address fields (Street, State, Postal Code, Country) are not being saved in CiviCRM.

Has anyone come across this issue?

# Answer
> 2 votes
I have solved the issue in the code: https://github.com/colemanw/webform\_civicrm/pull/137/files (It is a one line change)

Above is from a Pull Request and that Pull Request is not merged after discussing it because it is caused by a regression bug in CiviCRM core which is fixed in a newer version of CiviCRM. So the other solution is upgrading your CiviCRM.

# Answer
> 2 votes
Are the affected fields selected in the "Fields to lock' dropdown in the "CONTACT FIELD HANDLING" section of the "Existing Contact" field of the webform?

IF so, then see this issue. At the bottom is a link to a much-needed pull request which has been available since Dec 2016. I don't know why it was never merged. With each update of webform\_civicrm, I apply the third commit in that PR. Not sure of the importance of the first two commits shown there.

---
Tags: webform-civicrm
---


# Question
Title: CiviRules - Configuring a rule to grant a point for each month that a contact has an active membership
We are running CiviCRM 4.7.12 on Wordpress. We have a number of donors who have an active membership. They contribute monthly towards the membership. We have CiviPoints and CiviRules installed. We want to use CiviRules for the following:

1. Grant 1 point to a contact for each month that the contact remains an active member (the membership status must be either new or current).
2. Deduct 2 points for each month that the contact remains inactive (due to cancellation or lapse in payment)

How can we setup CiviRules to perform 1 and 2 above?

# Answer
Out of the box that is not possible with CiviRules. You need to write your own trigger which fires every month.

The good news is that the SQLTasks extension might do this: https://civicrm.org/extensions/sql-tasks-extension-configurable-recurring-tasks
> 1 votes

---
Tags: civirules, civipoints
---


# Question
Title: How are CiviCRM form names defined (civicrm_validateForm)?
I am attempting to perform form validation on various CiviCRM forms (profile forms and forms within contribution pages) by hooking into `hook_civicrm_validateForm`.

In my php code, I would like to differentiate between the different forms so that I can execute appropriate validation functions. According to the CiviCRM documentation, this can be done by checking against the `$formName` parameter.

While debugging, I found out that a contribution page I am using has a `$formName` of `CRM_Contribute_Form_Contribution_Main`. For a profile form its `$formName` is `CRM_Profile_Form_Edit`.

Is there a way of finding out how the names of form are defined? If so, does CiviCRM supporting assigning forms with custom form names?

# Answer
> 2 votes
In principle the names are based on the files, so the form which is CRM/Contact/Form/Contact.php will be CRM\_Contact\_Form\_Contact.

AFAIK the name of the form will always be commented if you inspect the form with Firebug, Firefox or Chrome.

In some cases forms will be called from pages (like the contribution page). This is kinda hard to find out, I always do a post hook in my extensions to log the $formName parameter to find out what forms are called during the process.

AFAIK you will need to include a call to the form hook to make sure your customized form is also usable in a validateForm hook (see below). But I would certainly try first if the parent CRM\_Core\_Form does not handle that and you can indeed already check for your customized form name.

```
    CRM_Utils_Hook::validateForm(
  get_class($this),
  $this->_submitValues,
  $this->_submitFiles,
  $this,
  $hookErrors
);

```

# Answer
> 0 votes
The form names are usually the same as the class name of the form object. And the class names follow a pattern as CRM\_aaa\_Form\_bbb meaning that this class resides in the file CRM/aaa/Form/bbb.php

There is no possibility to define custom form names. Or at least I am not aware of it and I would object against it because then the same form could be named differently in different installations and that makes the whole thing more complex.

---
Tags: profile, contribution-page, php, hooks, forms
---


title: Long running Scheduled Job

text:
# Question
Title: Long running Scheduled Job
In the Areas extension (https://lab.civicrm.org/extensions/org.civicoop.areas) an administrator can define areas such as West Coast and a contact living in a city in West Coast is linked to the area West Coast.

Every time an address is updated the linked areas of that contact is also updated.

However we need to have a solution for the use case when an administrator adds or changes an existing Area.

My idea is that a cron job runs every day and queries the contact table and checks contact for contact the linked areas. This would probably work fine a small database but I am worried that this job times out in a large database.

How would a solution look like if the database has for example 1.000.000 records?

# Answer
> 3 votes
If you run the schedulded job as a cron job and don't use the http-method for the setup you will not face a php runtime timeout. We did have no issues with schedulded jobs running multiple hours.

---
Tags: developer, cron-job, cron
---


title: Search by date removed from group

text:
# Question
Title: Search by date removed from group
I need to rebuild some groups where all the members were removed by the link between CiviCRM and Mailchimp. I have found the ability to list all members of a group who have ever been removed from that group, but I also need to be able to filter this by the date they were removed. Is there any way to search for members of a group who were removed on a specific date?

# Answer
> 3 votes
I'm not sure if this functionality exists from the UI or API. I think it's not.

A quick recall says that this info is being stored in `civicrm_subscription_history` table where `contact_id`, `group_id`, `status(Added or Removed)` and `date`(the one when the action was triggered) can be viewed.

# Answer
> 3 votes
I have an extension that provides a custom report Subscription History that does this.

# Answer
> 2 votes
For info, the GDPR extension (first released March 2018) includes a "Search Group Subscription by Date Range" custom search i.e. you can select a group, a group status and importantly a date criteria.

If the rest of the GDPR extension functionality isn't needed, and you're keen and able, the relevant sections of code could be used as a basis to make your own custom search extension.

Or adding to jitendra's answer, output the contact IDs with something like this database query:

```
SELECT * FROM civicrm_subscription_history WHERE group_id = ? AND status = "Removed" AND date > "????-??-?? ??:??:??";

```

As required, these could then be output as CSV e.g. using phpMyAdmin and then added to a group(s) via Import Contacts.

---
Tags: groups, search
---


# Question
Title: "Could not find a valid session key." Unable to save any admin forms
When I try to save any form in the CiviCRM admin area, I get this error:

```
Sorry but we are not able to provide this at the moment.
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 adminstrator 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.

```

I have rebuilt my VM multiple times, and I'm fairly sure this has nothing to do with the cookie being set on the wrong domain.

What am I doing wrong? I hope this is me doing something stupid and not an actual bug, but I made a JIRA issue anyway: CRM-16508.

I have tracked the error message to this file, if that helps.

I am aware of this related question, but I am positive I'm not swapping between HTTP and HTTPS (I use HSTS) and I can't actually change any settings in the admin area anyway.

# Answer
As Coleman's answer suggests, the most common cause for this I've seen is a mismatch between the URLs CiviCRM is configured to use and the ones it actually uses.

Other places to check are -

* your webserver configuration (eg a canonical URL redirect)
* the `CIVICRM_UF_BASEURL` constant in `civicrm.settings.php`
* **Administer \> System Settings \> Resource urls** as Coleman mentions

If your site DB has been migrated to your VM, you may also need to follow the steps in Moving an existing CiviCRM installation.

If these various settings don't match, CiviCRM doesn't recognise / receive its session identifiers, and the result is this confusing (and often reported) error message.
> 4 votes

# Answer
We experienced this issue today on our Wordpress installation of CiviCRM. The Apache/PHP Error log had the following output:

```
AH01071: Got error 'PHP message: PHP Warning:  session_start():
open(/var/lib/php/fpm/session/sess_f8fpr0iq1oclh7i6uun8bu3vd0, O_RDWR)
failed: Permission denied (13) in /data/vhosts/ourwebsitedomain.org.uk/wp-
content/plugins/civicrm/civicrm.php on line 305

PHP message: PHP Warning:  Unknown:
open(/var/lib/php/fpm/session/sess_f8fpr0iq1oclh7i6uun8bu3vd0, O_RDWR)
failed: Permission denied (13) in Unknown on line 0\nPHP message: PHP
Warning:  Unknown: Failed to write session data (files). Please verify that
the current setting of session.save_path is correct
(/var/lib/php/fpm/session) in Unknown on line 0'

```

In our case, our server provider (Rackspace) found that a recent automated update of either our PHP or Apache packages caused a change of ownership for a couple of php-fpm related directories from 'apache' to 'root'. Once this change of ownership was rectified the problem disappeared.

These directories in our case were:

/var/lib/php/fpm

/var/lib/php/fpm/session
> 2 votes

# Answer
Please ensure you have correctly configured **Administer \> System Settings \> Resource urls**.
> 1 votes

# Answer
This error has a multitude of causes, and is often (not always) unrelated to session keys and cookies.

A cause of this problem I haven't seen mentioned on other Stack Exchange questions (, , , ) is that this occurs when your forms allow file uploads, and those file uploads exceed the `upload_max_filesize`/`post_max_size` defined in your `php.ini` file.
> 1 votes

---
Tags: wordpress
---


# Question
Title: CiviCRM Entity, Display tags name in contact
Here's what I'm trying to do. I installed CiviCRM with CiviCRM Entities. + few other modules.

At Structure -\> CiviCRM Entity -\> CiviCRM Contact -\> Add custom field (CiviCRM Entity Reference)

I did add a custom field called tags. Connected to `Tag Entity`. It will appear in display. But tags are numbers.

Now i need to fetch tag names from Tag Entity.

I tried to add it in Contact and with Tag Entity itself. Did try to add custom field just like Contact.

`(Target: Tag, Join: Tag ID, Host Source: ID)`.

It won't work. Apparently there's no way to get Tag from Tag Entity for me.

I wonder what's going wrong in here. Can anybody help?

# Answer
> 3 votes
I need to add an option "Tag ID" in the Host Source Column field setting of the CiviCRM Entity Reference module to make this work.

It won't take much to add it. Look in your code to the matching file, add:

'tag\_id' =\> 'Tag ID (Entity Tag)',

https://github.com/eileenmcnaughton/civicrm\_entity/blob/7.x-2.x/modules/civicrm\_entity\_reference\_field/civicrm\_entity\_reference\_field.module#L148

Then you can add another CiviCRM Entity Reference Field to the Entity tag entity type: admin/structure/civicrm-entity/civicrm\_entity\_tag/fields Target Entity: Tag Target ID: Tag ID Host source column: Tag ID (Entity Tag)

Set this field to render in a view mode on the entity tag manage display area:

admin/structure/civicrm-entity/civicrm\_entity\_tag/display

This will render the tag entity, you can configure which fields of the tag entity show by configuring a view mode and configuring to use it on the render

admin/structure/civicrm-entity/civicrm\_tag/display

Now back at your Contact, make sure and render the view mode of Entity Tag, that renders the right view mode of the Tag entity, and you'll be rocking.

I will add a PR to CiviCRM Entity to add the one line of code necessary to make it work out of the box, but it may be a couple weeks before the next release goes out.

---
Tags: civicrm-entity, entity-reference
---


# Question
Title: How to restrict access to CiviMail's reports, e.g. click rates
If one sends out a mailing using CiviCRM, one can access an overview of the mailing's result from the mailings menu (see screenshot). From this summary you will also be able to access more detailed information, including the unique opens (see screenshot).

As this information can be considered quite sensitive in regard to data protection, I would like to restrict access to it to certain users/roles. I tried editing the permissions of all relevant mailing reports I could find.

However, it turns out that this information does not seem to be based on CiviCRM'S report function. Even If restrict user's access to any report functions, the detailed mailing information can still be viewed.

Hence my questions are:

* Which permission is actually relevant for opening pages such as civicrm/mailing/report/event?reset=1&event=opened&mid=XYZ&distinct=1 ?
* Is there any way to restrict access to this information without denying users to use CiviMail at all?

Tested on CiviCRM 4.7.18 and Drupal 7.54.

# Answer
We ended up using a hook as suggested. Anyone interested in how we did it can take a look at the code.
> 0 votes

# Answer
I think you can bypass using permission\_check hook.
> 3 votes

# Answer
I don't know an intended way to alter the permissions directly.

However, you can play around with disallowing the simple mailing event reports altogether for unprivledged users and restrict access for users to the regular reports as you need it.

`SELECT * FROM civicrm_menu where path = 'civicrm/mailing/report/event';`

e.g. altering `access_arguments` from `a:2:{i:0;a:1:{i:0;s:15:"access CiviMail";}i:1;s:3:"and";}` to `a:2:{i:0;a:1:{i:0;s:18:"administer CiviCRM";}i:1;s:3:"and";}` will only allow admins to view any of the event reports.
> 2 votes

---
Tags: civimail, permissions
---


title: CiviContribute giving errors

text:
# Question
Title: CiviContribute giving errors
Couple issue I wanted to gets some input on. First, has anyone ever seen this error message: LESS error: .black is undefined: failed at `.black !important;` sites/all/themes/shriver/style.less on line 1091, sites/all/themes/shriver/style.less

I'm thinking a file is missing.

Second question: The monthly contribution check box is all the way in the top left corner of the page instead of next to the text.

Any fixes??????

# Answer
> 2 votes
This seems to be a theming issue that is not necessarily specific to civicrm. can you try a different theme. also update your Question to include your CMS.

---
Tags: error
---


# Question
Title: Blank civicrm?page=CiviCRM&q=civicrm/contribute/transact&reset=1 live contribution page wordpress
Wordpress 4.9.6, CiviCRM 5.1.2. Logged in as Administrator, all works fine (Events links, TEST Contribution page) but **LIVE Contribution pages**: gives just blank page. **Nothing** in php.error.log, Apache error\_log. ConfigAndLog/\* repeatedly says something about "access to page" which, perhaps, is not relevant for WP "super-user".

Deep googling has brought a few of same cases, each of them has own cause, so there is no pattern. Any chance this is a well-known issue in the latest versions of CiviCRM / WordPress? Thanks!

```
#0 /public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(381):
CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /public_html/wp-
content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php(350):
CRM_Core_Error::fatal("You do not have permission to access this page.")
#2 /public_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/System.php(74):
CRM_Utils_System_WordPress->permissionDenied()
#3 /public_html/wp-
content/plugins/civicrm/civicrm/CRM/Event/Page/EventInfo.php(58):
CRM_Utils_System::__callStatic("permissionDenied", (Array:0))
#4 /public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(309):
CRM_Event_Page_EventInfo->run((Array:3), NULL)
#5 /public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(84):
CRM_Core_Invoke::runItem((Array:15))
#6 /public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(52):
CRM_Core_Invoke::_invoke((Array:3))
#7 /public_html/wp-content/plugins/civicrm/civicrm.php(1246):
CRM_Core_Invoke::invoke((Array:3))
#8 /public_html/wp-
content/plugins/civicrm/includes/civicrm.basepage.php(141):
CiviCRM_For_WordPress->invoke()
#9 /public_html/wp-includes/class-wp-hook.php(286):
CiviCRM_For_WordPress_Basepage->basepage_handler(Object(WP))
#10 /public_html/wp-includes/class-wp-hook.php(310): WP_Hook-> apply_filters(NULL, (Array:1))
#11 /public_html/wp-includes/plugin.php(515): WP_Hook->do_action((Array:1))
#12 /public_html/wp-includes/class-wp.php(726): do_action_ref_array("wp",
(Array:1))
#13 /public_html/wp-includes/functions.php(960): WP->main("")
#14 /public_html/wp-blog-header.php(16): wp()
#15 /public_html/index.php(17): require("/public_html/wp-blog-header.php")
#16 {main}

```

# Answer
> 1 votes
By testing on the wpmaster.demo.civicrm.org site and going to what i take it is the public version of the contribution page at eg

> http://wpmaster.demo.civicrm.org/civicrm/?page=CiviCRM&q=civicrm/contribute/transact&reset=1&id=4

I do not get a blank page which suggests several things including that it isn't broken on dmaster.

Some possible things to try

* switching WP themes
* using Inspect to compare output on demo v your site

Not sure how much either will help as not a WP specialist

---
Tags: wordpress, civicontribute, contributions, contribution-page
---