title: Backlog of scheduled reminders

text:
# Question
Title: Backlog of scheduled reminders
We have a civi install with imported memberships, which have ended between 1 month and two years ago. We would like to start sending out reminders but when we send out sheduled reminders (with repeat option) it looks like it only sends when the exact period is matched.

I would have expected that it would send out mails to all memberships that have ended at least one month ago and then repeat following the settings in the repeat option... Can anyone help me with the logic of this (and send out reminders for these old expired memberships?

Thanks!

# Answer
I've had this problem

How to safely restart Scheduled reminders

And got a really clear and succinct answer.
> 1 votes

---
Tags: civimember, scheduled-reminders
---


# Question
Title: Custom field - Drop down. How to create?
Hi guys and thank you in advance.

I am extending the options available under "events". I need to create a new custome field (called 'collaboration type') that presents the user with a dropdown list (a. supported, b. hosting, c.joint, d. sponsored)... but I am not sure how to do so.

Kind regards A.

# Answer
You can create custom fields under Administer --\> Customize Data and Screens --\> Custom Fields. You first create a custom group for the event. You could even limit this group to a certain type of event. You then add a field in this group with type Text and HTML type Select.
> 3 votes

---
Tags: civievent, custom-fields
---


# Question
Title: REST API, iATS: How do I create a membership through the API without using CiviCRM's forms?
I'm building a software system that uses CiviCRM as a membership database and a billing engine for recurring dues. Our members do not have direct access to CiviCRM or the server on which it runs, and the software I'm writing can only communicate with CiviCRM through CiviCRM's REST API.

My signup flow needs to perform the following steps:

1. Create a contact in CiviCRM
2. Collect payment information and retreive an iATS token
3. Pass that token to CiviCRM, and associate it with the contact.
4. Record, somehow, whether the prospective member wants a monthly, biannual, or annual membership. **Important:** At this point, CiviCRM must not activate a membership or charge money.
5. Wait for a period of time, potentially days, for some offline stuff to happen.
6. Finally, process payment and activate the membership.

Again, all of this has to happen through the REST API. The software that processes signups cannot use CiviCRM's forms and cannot read or write to CiviCRM's database directly.

Is what I want to do possible without writing custom CiviCRM extensions?

From looking at the V3 endpoints for the iATS extension, I see code that lets me get information out of CiviCRM, but no way to get payment information in. What am I missing?

**Edit:** In retrospect, this might not be clear: I don't want to write my own CRM -- I just want to use CiviCRM as our CRM and only interact with it through its REST API. If, for instance, my custom software is decommissioned or replaced, I want CiviCRM to keep on storing and processing memberships without having to migrate data from one custom webapp to the next. I can do most of what I need to do through the V3 API, but membership signup seems to be a more complicated problem.

# Answer
> 1 votes
The iATS extension does not expose any api functions for assigning iATS "payment tokens" to contacts (not to be confused with CiviCRM tokens, a completely different thing).

The next version of the iATS extension (1.7) will use the CiviCRM standard payment token mechanism, so you can assign them that way.

You did check the super-awesome api explorer, yes? It makes using the api so much more fun.

Also, if you look at this file ... https://github.com/iATSPayments/com.iatspayments.civicrm/blob/master/CRM/Iats/Transaction.php

... you might find some useful code for your purposes.

# Answer
> 0 votes
CiviCRM does support REST API - where you can get/create information in Database using REST API

**To access civicrm API:** In the menu click support -\> Developer -\> Api Explorer v3

https://dmaster.demo.civicrm.org/civicrm/api#explorer

Example:

```
https://dmaster.demo.civicrm.org/sites/all/modules/civicrm/extern/rest.php?entity=Contact&action=create&api_key=userkey&key=sitekey&json={"contact_type":"Individual","first_name":"test","last_name":"test","display_name":"test"}

```

In order to use Rest Api you need to know the Sitekey, API\_key and site URL - see the example.

**Reference:**

**API Documentation:** https://docs.civicrm.org/dev/en/latest/api/interfaces/

**If I am not wrong** Are you trying use civicrm payment processor in your third-party application then i guess you need to create a payment process supporting your third-party application separately- I don't think you can use CiviCRM Payment processor in your other application directly

I hope this helps !!!

# Answer
> 0 votes
You can access pretty much all entities (both read and write) in civi via the api (rest api) as soon as you have set up the keys

they are some thin wrappers around these api calls (for php, nodejs and I think python)

It is completely possible to have a UI on a different server that interact to civi in the background through that API.

However, most of the API is CRUD, ie rather low level and for core entities only. Some extensions offer more apis for their own entities, some others will need you to contribute the missing code to make these apis happen. I'm not familiar enough with iATS to be sure, but it looks that some api aren't there to create tokens

As for writing custom extensions: I found that it is often more convenient to have custom APIs that are including some business logic and creating the membership and contact and whatever is needed within a single call rather than having to implement that logic on the client side and chain rest calls.

As you've seen from the link to the iATS, creating a new API is "simply" a matter of putting the right file at the right place and it will automatically be accessible via the REST interface.

I don't know enough about your use case, but I would suggest you to evaluate creating your own API, it's fairly easy and can be quite a time saver

X+

---
Tags: civimember, api, iats, rest
---


# Question
Title: GDPR Extention and PETITIONs (in Wordpress)
(CiviCRM on Wordpress) We see that in Petitions it is not possible to activate the GDPR Extention for Privacy Policy Acceptance. How is it possible? Are we wrong?

The Privacy Policy Acceptance following a Petition signature does not seem prohibited by the GDPR.

Do we get the same result with a work-arround?

# Answer
> 1 votes
We resolve by using CiviRules: "if the action is a petition signing then accept the Privacy Policy and Communication Preferences for that contact".

---
Tags: wordpress, gdpr, privacy, petition
---


# Question
Title: I keep getting Payment Instrument not valid when trying to import Contributions - after upgrade from LTS 4.6 to 5.3.x
We recently upgraded from LTS 4.6 to 5.3.1 (in July). Via the GUI we can see the Payment Method that we'd like to import -\> Moneris -\> id=6

**Importing with Payment Method:**

* Moneris -\> fails: Reason: Payment Instrument is not valid: Moneris
* 6 -\> fails: Reason: Payment Instrument is not valid: 6

What else can I try?

# Answer
Ok next thing to try is to check the `civicrm_option_value` table. Note it has a name column (in addition to what you can see in the GUI in 5.3.x). In the old days this name column was exposed and could be set independently: here it was set to `Offline Credit Card` \- Importing with Payment method:

* Offline Credit Card -\> works!
> 5 votes

# Answer
Karen's answer above certainly showed me what is wrong. It seems that its edits the label and not the name but the check on import is to name and not label. Is this a bug? I am on CiviCRM 5.15.1 at present.

I sorted things out for me by deleting the Payment Method that was causing the problem and then recreating it. This was no problem for me as there were no existing contributions. Might have side effects in a mature site.

Update: deleting and re-inputting won't work for the "Check" Payment method as this is reserved and can't be deleted. So for this one I had to go in and change the database.

It looks like its fixed in 5.17.0 though... see https://lab.civicrm.org/dev/core/issues/1133
> 1 votes

# Answer
This could also be a translation issue. After upgrading to 5.3.1 we had to change 'Cheque' to 'Check'. Haven't dug into that one yet.
> 0 votes

---
Tags: civicontribute, import, data-import
---


# Question
Title: Adding expired/grace membership numbers to the Membership Dashboard
I am looking at add a column for expired/grace members to the Membership Dashboard, but I am running into a roadblock on how to do it.

I know that the DashBoard.tpl file pulls in list of new and renewed members and that DashBoard.php also needs to modified. Dashboard.php refers to CRM\_Member\_BAO\_Membership, which comes from CRM/Member/BAO/Membership.php. There are three functions in Membership.php, getMembershipJoins, getMembershipRenewals and getMembershipStarts that pull numbers from the SQL side.

My problems: 1. In Membership.php there is this function: public static function \_getActTypes() { which very helpfully has this as a code comment: * @todo document me - I seem a bit out of date....

These functions call things from the CRM\_Utils\_Array, which I cannot find. Which file is that in? I am not a PHP programmer, but is this a general function call that is extended by several files?

2. Does CRM\_Utils\_Array::key('Membership Grace', $activityTypes); or CRM\_Utils\_Array::key('Membership Expired', $activityTypes); exist? If it doesn't, would I add such a function to Membership.php and then call it through the previously mentioned files?

# Answer
In my experience, the Membership Dashboard isn't really a great tool, and I was it was deprecated. It's extremely inflexible (as you're seeing here) and any reports you need can be placed on the main dashboard as a dashlet. So I would recommend a different approach.

To answer some of your other questions - class names and file locations map to each other. You should find the `CRM_Utils_Array` class in `<civiroot>/CRM/Utils/Array.php`.

Finally, it's a bad idea to change core CiviCRM files, because they'll be overwritten on upgrade.
> 4 votes

---
Tags: civimember
---


# Question
Title: Multi-value Custom fields not showing up for export
I have created custom fields for individuals. When I am trying to export data, those which are single value custom fields, I am able to export. While Multi-value Custom fields are not showing up for export

# Answer
> 1 votes
Multi-value (also called multi-record) custom fields can't be exported by the normal export. See https://docs.civicrm.org/user/en/latest/organising-your-data/creating-custom-fields/#multiple-record-fieldsets.

However you can get round this using a report then exporting as CSV. Two caveats. Not all reports will include the multiple values. Constituent detail doesn't allow CSV export, but I have found constituent summary to work for all I need.

---
Tags: custom-fields, export, custom-search
---


# Question
Title: can a search for the individuals in a group display notes instead of address, etc
I would like to be able to read the notes for a group of individuals when I am looking at the resulting list of contacts from a search.

# Answer
That might be a little visually difficult if they have 30 notes, but here's two options:

1. At the search results screen select some or all and then from the actions dropdown at the top of the list choose Export.
2. In the export screens choose "select fields for export".
3. When choosing the fields, include the field called "Note(s)".

If you want it on the screen instead of an export, and you're ok with **only seeing the first note** you can do like so:

1. Go to Administer - Customize Data and Screens - Profiles.
2. Click on the Reserved tab.
3. Click on "Fields" on the right side of the screen next to the Summary Overlay one.
4. Click Add Field.
5. For field name, select Contacts , and then the one called "Note".
6. Click save.
7. Do a search and in the search results list, if you hover over the contact icon in the 2nd column you'll see the first note in the popup that comes up.
> 1 votes

# Answer
I'd originally thought that Demerit's solution only showed one note. But testing again, it does have all notes but in one row comma separated, which is confusing, particularly with multi-line notes. Also the subjects are not included. I don't think there is a perfect solution!

If you had a very particular thing you wanted to do, you might consider a multi-value custom field, which you can view in certain reports (something derived from Constituent Summary works) but beware that there are other limitations of multi-valued custom fields so think it all through.

I'd thought that you might be able to use a report instead of a search (based on my idea above) but you can't get the notes in a report!
> 0 votes

---
Tags: contacts, groups
---


title: Default Value for Custom Field

text:
# Question
Title: Default Value for Custom Field
I have a created a custom group and a custom field within that group.

One of the Custom fields is Date.

Is there any way to autoload 'current date' (today) in the default value field Using a hook or something?

I have been googling but i am not getting any results.

Thanks

# Answer
I did this by using CiviCRM hooks (BuildForm).

```
($form == CRM_Core_Action::ADD) {
        $currentDate = date('d/m/Y');
        for ($i = 1; $i < 10000; $i++) {
            $defaults['custom_197_-' . $i] = $currentDate;
            $form->updateElementAttr('custom_197_-'. $i,array('readonly'));
        }
        $form->setDefaults($defaults);
       }

```

This is working
> 0 votes

---
Tags: custom-fields, civireport
---


# Question
Title: Get Contact id from Relationship to use in a Hook
I want to display Contact B ID of a relationship for the current contact. I am building a hook and this is my code so far.

```
if ( $formName == 'CRM_Contactlayout_Form_Inline_ProfileBlock') {
        if ($form == CRM_Core_Action::ADD) {
            $ID= '190';
            $defaults['custom_189'] = $ID;
            $form->updateElementAttr('custom_189',array('readonly'));
    }

```

I want to replace 190 with a code that grabs the contact ID of that current users relationship.

Your help is much appreciated.

Thanks

# Answer
This code worked for me:

```
$contactId = CRM_Utils_Request::retrieve('cid', 'Positive');

```
> 0 votes

---
Tags: custom-fields, relationships, hooks
---


# Question
Title: How do you save generated content not tokens in emails & print/merge?
This seems to be standard that the literal token {contact.display\_name} is saved not the generated result "John Doe".

To my mind this is useless - the data changes - so how can I view the actual letter emailed or printed?

And what is the point of saving the template if it only contains the tokens - you could up saving thousands of identical templates none of which contain any useful information.

Is there a way I can save the generated content inside civiCRM?

# Answer
> 3 votes
The feature seems to be available just it seems very few components use it. For example if you do a contribution search and then choose to send thank you letters from the actions dropdown, it DOES convert the tokens in the filed activity on the contact.

In the code if the caller of this function includes the `$perContactHtml` parameter, then the activities get filed with the tokens converted: https://github.com/civicrm/civicrm-core/blob/5.18.4/CRM/Contact/Form/Task/PDFLetterCommon.php#L278

The contribution one does do that, e.g. https://github.com/civicrm/civicrm-core/blob/5.18.4/CRM/Contribute/Form/Task/PDFLetterCommon.php#L127

and here is where it resolves the tokens: https://github.com/civicrm/civicrm-core/blob/5.18.4/CRM/Contribute/Form/Task/PDFLetterCommon.php#L431

But it seems most of them don't and so it uses the default which is just the verbatim text.

---
Tags: email
---


title: Modify emailed reports content

text:
# Question
Title: Modify emailed reports content
I'd like to get users more in tune with their data by sending them notifications of certain high-value reports. I really don't want them with the data attached in a PDF or worse, a CSV. I'd rather just have the report link by itself (it already does this).

How can I remove the attachment option altogether?

Perhaps more importantly, how can I modify the email template so I can add some message content directly into the report email itself (not in the PDF attachment). What template is this using? I'd just want to hard-code some text that would apply to all reports.

# Answer
**UPDATE:** Since 5.29 you can do this in an extension do like the override example at https://docs.civicrm.org/dev/en/latest/hooks/hook\_civicrm\_alterReportVar

In the extension's main file example.php:

```
function example_civicrm_alterReportVar($varType, &$var, $reportForm) {
  switch ($varType) {
    case 'outputhandlers':
      $var['\CRM_Report_OutputHandler_Pdf'] = '\My\Namespace\PdfOutputHandler';
      break;
  }
}

```

and then in \My\Namespace\PdfOutputHandler something like:

```
namespace My\Namespace;
use CRM_Example_ExtensionUtil as E;
class PdfOutputHandler extends \CRM_Report_OutputHandler_Pdf {

  // Override to remove the attachment
  public function getFileName(): string {
    return '';
  }

  // This is similar to the default output but we replace the "file is attached" text. Adjust more as desired.
  // For reference the default is at https://github.com/civicrm/civicrm-core/blob/1f0a905a1a90e3bb68f0492022c488eab1ed3f82/CRM/Report/OutputHandler/Pdf.php#L52-L56
  public function getMailBody(): string {
    $url = CRM_Utils_System::url('civicrm/report/instance/' . $this->getForm()->getID(), 'reset=1', TRUE);
    return $this->getForm()->getReportHeader() . '<p>' . ts('Report URL') .
      ": {$url}</p>" . '<p>' .
      ts('Here is my text I want to add.') . '</p>' .
      $this->getForm()->getReportFooter();
  }
}

```

---

**OLDER ANSWER FOR OLDER VERSIONS:**

The email body content starts here for csv: https://github.com/civicrm/civicrm-core/blob/5.18.4/CRM/Report/Form.php#L3413, and a bit lower down for pdf.

Note also the attachments are hardcoded in, a couple lines lower down.

Note that in the report itself on the Title and Format tab you can add some text/html at the end of the header which will get included in the email.

The code seems to be after hook\_civicrm\_alterReportVar so I don't think you can use that to remove the attachments, but you should be able to use hook\_civicrm\_alterMailParams to remove the attachments.
> 3 votes

# Answer
I'd probably just make a separate cron script that emails them the links and whatever text you want, i.e. not using the scheduled report task just a plain cron script. If you want to send to a civi group or something like that then the cron script could be a `cv` script and then use the civi api inside the script.
> 1 votes

# Answer
We use the 'Title and Format' tab as Demerit mentions above and have stuck some text/html in the 'Report Header' box. To avoid attachments going out with them went with the below parameters for the scheduled job. instanceId=x format=print Not a global solution but may be suitable if results aren't too large.
> 1 votes

---
Tags: reports, scheduled-job, system-workflow-messages
---


# Question
Title: "Recent Registration" view under CiviEvent - Customise columns
Hi to all (and thank you in advance),

I'm looking to add / remove a number of columns under the "Recent Registrations" view, in CiviEvent (image attached).

Any suggestions are welcome.

(running CiviCRM 5.13.4)

Kind regards A.

# Answer
That table is defined in templates/CRM/Event/Form/Selector.tpl and changing that would require some level of coding (your profile suggests you have this skill). Changing the Selector.tpl template directly would solve your problem but is discouraged because it causes headaches when upgrading to new versions. Creating an extension is the preferred way to make these kinds of changes, but that is much more involved. (See this question for more information.)

A non-coding, quick alternative is create an Event Report with the columns that you want to view, and under that report's Access tab check "Available for Dashboard". That will allow users to add the report to their main Civi Dashboard (rather than the Events Dashboard). That won't get exactly what you want, but may help you solve the usability/workflow issue that I imagine is behind your question.
> 1 votes

---
Tags: civievent, custom-fields
---


# Question
Title: Data Mapping for Importing data from external database
Can someone please guide me to the table/data templates for CiviCRM. We are in the process of migrating from an existing relational Access database to CiviCRM and want to map related data to organisations, individuals, membership payments etc. I have not been able to locate this in any documentation.

Thank you in advance for any pointers/help.

Graeme

# Answer
> 0 votes
https://doc.symbiotic.coop/dev/civicrm/latest/schema/ may offer what you need. If you click on any specific table it will show you all the children and if you keep scrolling down the page you will a 1 or 2 degree relational diagram

# Answer
> 2 votes
During installation the CiviCRM are generated from xml files, and those will not always correspond 1-1 with the tables AFAIK.

You can find the xm definitions in the civicrm folder: civicrm/xml/schema.

Alternative is to use the API Explorer (Support/API Explorer in your CiviCRM menu) and do a getfields action for the entity? I would recommend using the API to do a migration anyway rather than moving into the tables directly.

---
Tags: contacts
---


# Question
Title: Print merge document from case search files on wrong contact
I've already reported this as a bug but would love to help solve this - am hoping you guys can help point me in the right direction. (https://lab.civicrm.org/dev/core/issues/893)

When 'Record generated letters' is set to "Multiple activities (one per contact)" and you print/merge documents, they don't file on the correct contact.

With a list of cases, select all and then choose Print/merge document. The letters are generated in case ID order but they are filed in the order your search screen was last sorted.

For example, the letters are issued in this order:

* Case 1 - Lawrence Ivanov
* Case 2 - Carlos Jacobs
* Case 3 - Sanford Blackwell

But, the default sort if alpha by contact last name:

* Sanford Blackwell (gets Lawrence Ivanov's - case 1 activity)
* Lawrence Ivanov (gets Carlos Jacob's - case 2 activity)
* Carlos Jacobs (gets Sanford Blackwell's - case 3 activity)

I think it can be tracked to the Contact \> Form \> Task \> PDFLetterCommon.php file but I'm having a little trouble wrapping my brain around what's happening in the for each statement in the 'multiple' case.

Thoughts?

# Answer
> 1 votes
At long last, I have a fix to share. Here's the PR that was just merged https://github.com/civicrm/civicrm-core/pull/15626

# Answer
> 0 votes
I think the problem might be the way it gets the contact list. It does it in a way that might work sometimes but might not other times.

What it does is gets the list of cases from your selection, which is fine, but then later it retrieves the associated clients in CRM\_Case\_Form\_Task::setContactIds by calling a function CRM\_Core\_DAO::getContactIDsFromComponent which does it like so:

`SELECT contact_id FROM civicrm_case_contact WHERE case_id IN (1,2,3);`

The thing is I don't think there's any guarantee the results will be returned in the 1,2,3 order, but they might be returned in order sometimes. One solution is slower but should work:

Change these lines

`$IDs = implode(',', $componentIDs);
 $query = "
SELECT contact_id
 FROM $tableName
 WHERE $idField IN ( $IDs )
";
 $dao = CRM_Core_DAO::executeQuery($query);
 while ($dao->fetch()) {
 $contactIDs[] = $dao->contact_id;
 }`

to

`$query = "
SELECT contact_id
FROM $tableName
WHERE $idField = %1
";
foreach( $componentIDs as $id ) {
 $query_params = array(1 => array($id, 'Integer'));
 $dao = CRM_Core_DAO::executeQuery($query, $query_params);
 while ($dao->fetch()) {
 $contactIDs[] = $dao->contact_id;
 }
}`

I haven't tested that. One problem would still be if you had a case with more than one client, but that would also be a problem currently.

---
Tags: civicase, pdf
---


# Question
Title: CiviEvent - Past event participants -> bulk register to new event
Hi guys and thanks in advance.

I would like to find a way to do the following:

a. Advance Search b. Find old event c. Select participants d. Action **e. "Add relationship - register to event"**

In essence, I need to be able to use people that have registered (and may have come) to one of our previous events and register them to a new one.

Any way I can add that option under "Actions"? Or is there another way of going about doing this?

Thank you

# Answer
I was able to search for these participants through Search\>Advanced Search and use the Event Tab below instead, you should be able to see an Action of "Register Participants for Events" after selecting the participants. This doesn't come out if you searched through Events\>Find Participants though.

--CIVICRM 5.13.5 Wordpress 5.0--
> 5 votes

---
Tags: civievent, registration, advanced-search
---


# Question
Title: how to create a report based on date subscription to a group?
I need to have a report that shows members according to their date of being part of a chosen group. I can select by group but not by date of being in this group.

Is this possible?

(I have a special process for membership that includes a control step to fully validate the membership. We have to check some documents so there can be a delay between "civicrm membership" and our membership.)

thanks for your ideas

G

# Answer
> 3 votes
Under custom searches there is a search you can use for date range of subscription to a group. You could then create a smart group from the results if needed. Its called "Search Group Subscription by Date Range"

# Answer
> 2 votes
There is an extension that provides a report to do this https://github.com/MegaphoneJon/org.cpehn.subscriptionhistory that does this.

---
Tags: civireport
---


# Question
Title: Can you create a mailing list based on a relationship setting?
We want to create a mailing list for a subset of people based on their relationship status. Is this possible?

# Answer
It depends what you mean by relationship status, but go to Search - Advanced search and choose "Display results as" - "Related Contacts" and then in the relationships section lower down make your choices. In the search results list there's an Actions dropdown at the top and one of the choices is Group - Add contacts. You can also choose Group - Create smart group if you want the group to keep updated by itself. And then use that Group as your Mailing List.
> 1 votes

---
Tags: mailing
---


title: Problem importing Civi Volunteer Needs

text:
# Question
Title: Problem importing Civi Volunteer Needs
We are working importing Volunteer Needs for various Volunteer Projects via the API csv Extension. When we load the interface, select the entity 'VolunteerNeed' and select file. When we hit continue we get the following:

> Uncaught Error: Call to undefined method CRM\_Volunteer\_DAO\_Project::indices() in /home/\<\>/public\_html/wp-content/plugins/civicrm/civicrm/api/v3/Generic/Getunique.php on line 44 civicrm\_api3\_generic\_getunique() wp-content/plugins/civicrm/civicrm/Civi/API/Provider/MagicFunctionProvider.php:97 invoke() wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php:168 runRequest() wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php:99 runSafe() wp-content/plugins/civicrm/civicrm/api/api.php:43 civicrm\_api3() wp-content/uploads/civicrm/ext/nz.co.fuzion.csvimport/CRM/Csvimport/Import/Form/MapFieldBaseClass.php:126 preProcess() wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php:585 buildForm() wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Display.php:92 perform() wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php:203 handle() wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php:103 handle() wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php:349 run() wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:311 runItem() wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:85 \_invoke() wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:52 invoke() wp-content/plugins/civicrm/civicrm.php:1392 invoke() wp-includes/class-wp-hook.php:286 apply\_filters() wp-includes/class-wp-hook.php:310 do\_action() wp-includes/plugin.php:465 do\_action() wp-admin/admin.php:253

We have used the extension to import other entities with no issues. The site is running WP 5.2.4, CiviCRM 5.13.4, CiviVolunteer v4.7.31-2.3.1 & CSV GUI Import to api v 1.5.

# Answer
That error suggests that the entity (volunteer project) defined in the civivolunteer extension is "incomplete", i.e that it's missing an indices method.
> 0 votes

---
Tags: import, civivolunteer
---


# Question
Title: Event Reporting to call out Custom Fields in related Contribution Record
Is it possible (via extension perhaps) to get a custom field from a related contribution record to be included in a Event Report ? For example, in a paid event registration, this would create a associated contribution record and a custom field created in the contribution record. How can I do a Event report which will include the Contribution record custom field ? the current Report function doesn't seem to allow that. Thanks.

# Answer
> 2 votes
If you have a report that doesn't show the custom fields on an entity, it might be because those fields are not configured as searchable (yes, a very non-obvious thing). If that's the issue, then it's the same as this question/answer: Custom fields in the Report Templates

Alternatively, if it's a problem with the report itself, you can generally hack it with something like the below at the top of the class file:

```
 protected $_customGroupExtends = array(
    'Contact',
    'Individual',
    'Contribution',
  );

```

If you're seeing some custom fields but not the ones for Contributions, just adding in the Contribution entry to your current values should work.

# Answer
> 0 votes
If you open the file that provides the report, you can generally add the custom fields with a single line.

For instance, if you're using Extended Reports extension, the "Extended Report - Participant Line Items" report template is a good one to add contribution custom fields to.

So, for instance, find the files for Extended Report. You can find their server location thusly:

* Go to **Administer menu » System Settings » Extensions**.
* Click the triangle next to *ExtendedReport* to see expanded info (see screenshot).
* Note the *local path* listed.

On your server, go to that folder, then navigate to the subfolder `CRM/Extendedreport/Form/Report/Event` and open the `ParticipantExtended.php` file.

You'll see this at the top (line 15):

```
  protected $_customGroupExtends = array(
    'Participant',
    'Contact',
    'Individual',
    'Event',
  );

```

Insert `'Contribution',` anywhere inside those parentheses (e.g. after `'Event',`) save, and reload the report. You should have contribution custom fields.

This change will be overwritten when you upgrade Extended Reports - but if you test it, it works, and you believe it's a useful addition, ping me on chat.civicrm.org (name in my bio) and I'll submit it to the author as an improvement.

---
Tags: custom-fields, reports
---


title: CiviCRM 5.13.1 API v3 Merge not working

text:
# Question
Title: CiviCRM 5.13.1 API v3 Merge not working
The merge API was worked on 5.0 version but after upgrade to 5.13.1 the merge is Stopped working.

**Any help is very appreciate.**

# Answer
> 1 votes
Normally contact merge process get skipped when there is something common in both contact and merge process unable to resolve it.

e.g. address conflicts (same address type on both contacts).

on actual merge contact UI, we have option to override the record or add additional record with same address type.

You need to pass Merge Mode in api call. string mode: "safe" skips the merge if there are no conflicts. Does a force merge otherwise.

more info at Is there any documentation for 'safe' and 'aggressive' merge modes?

# Answer
> 0 votes
You have a 3rd party drupal module called tm\_follow which something is trying to delete? The error doesn't seem related to merging. Check the ConfigAndLog error log for more details about what might be trying to delete it, although it's not actually an error it's just a warning so there might not be anything there. But anyway the merge seems successful, there's just something going on with that module which you need to investigate.

---
Tags: api
---


# Question
Title: Timezone issue - authenticated vs anonymous: a 6h time warp
When I'm logged in -\> and make a Contribution at 4:20pm - all is well!

I log out and then make a Contribution through the exact same Contribution page and notice that the Contribution clocks in at 10:24pm (so +6h - that's UTC I think as I believe the UK did their timezone change last weekend);

Any clues as to what may be going on here? This is on Drupal 8 / CiviCRM 5.15.1

My default time zone in Drupal is set to Edmonton \[Canada\]. The 4:20pm was correct.

**Additional Info:**

* CentOS thinks it's ET (+2h) - which is fine \[machine is in Montreal\];

This docker instance: php -v =\> PHP 7.3.7 php -i |grep time provides two clues:

* Default timezone =\> UTC
* date.timezone =\> no value =\> no value

For a D7 project on another server \[works fine no +6h time issues - D7 site\] -\> same server config (but PHP 7.1.29):

* CentOS is in ET (+2h) - which is fine \[machine is in Toronto\]
* Default timezone =\> UTC
* date.timezone =\> no value =\> no value

So D8/PHP 7.3.7 vs D7/7.1.29

# Answer
> 1 votes
The main clue is that these date/times are being stored in mysql datetime fields, which do not include a timezone, but implicitly have a server-wide timezone (either adopted from the server, or configured explicitly).

So we know that the problem is at the php level - the code is generating the date time and converting based on the current user's timezone (which it shouldn't in this case).

Since it's an issue with D8 and not for D7, it seems likely that it's a D8 integration issue, some kind of automated handling of date/times that we don't want (we do want date/times to be converted to the users timezone on display).

---
Tags: timezone
---


# Question
Title: Is there a report that I can pull to show me all donors, members and never givers?
Looking to pull a report that includes all contacts with what they have contributed and not contributed.

# Answer
> 1 votes
Most contribution reports only report on folks who HAVE contributed, so normally one would pull a donor and non-donor report.

You don't specify exactly what you mean by "what they have contributed", but assuming you're just looking for a "lifetime total donations" amount, the easiest approach would be to install the Summary Fields extension and enable the "Total Contributed" field. Then you can use any report (e.g. Contact Summary report) and include the total given as a column.

---
Tags: civimember
---


# Question
Title: How do I automatically add a user to a Backdrop (or Drupal) role?
I figured out how to automatically add a newly-created user to a group when they fill out a contribution or event page, but I want to add them to a Backdrop role as well. How can I do that?

# Answer
> 3 votes
First, go to your modules listing and enable "CiviGroup Roles Sync":

Next, go to Drupal's **Configuration menu » CiviCRM » CiviGroup Roles Sync » Add association rule**:

From here, you can set the CiviCRM group that corresponds to the Backdrop/Drupal role:

Note this only works when contacts are newly added to the group (or role). However, you can manually synchronize in the configuration settings.

---
Tags: drupal, groups, permissions, backdrop
---


# Question
Title: Error message on contribution: too many redirects
We have a contribution page via an embedded short code that, upon submit, intermittently throws a "too many redirects" browser error. When this happens, the contribution is not written to Civi, nor does anything get to auth.net. Contributions do work successfully for some visitors, but not for others. For example, we can have success on a desktop, but then retest immediately on a cell phone and get the error message. Doesn't seem to matter whether the cell phone is on the same network as the desktop or if it's on it's mobile network. Also, doesn't seem to matter whether the user is logged in to admin or not. Clearing cookies or cache doesn't solve the issue.

We're running CiviCRM 4.7.15 on a WordPress (4.8.1) site. The site has a Let's Encrypt SSL and both the Wordpress general settings and the Civi base URL are the same (https). Server rewrite rules also rewrites to https. Caching is handled through CloudFlare and W3 Total Cache plugin. We're using authorize.net for our payment processor. All auth.net ip's are whitelisted in WordFence as well as CloudFlare.

Appreciate any suggestions or advice. We're stumped!

# Answer
> 2 votes
I was having the same issue and stumbled upon an answer to a very similar problem, although it didn't appear to be random like mine and yours. This is a pretty old issue, so not sure if my "answer" helps. All I did was navigate to CiviCRM \>\> Administer \>\> CiviContribute \>\> CiviContribute Component Settings. Set 'Default invoice payment page' field to the contribution page that was causing the "too many redirects" when we pressed Confirm. It was previously pointing to a contribution page associated with an expired campaign, which doesn't explain at all why the redirects error appeared to be random. We are running Wordpress 5.2.3 and CiviCRM 5.12.4.

---
Tags: civicontribute
---


# Question
Title: Search Custom Template Directory first when using Smarty {include}
I'm sure this is easy but the answer has escaped me. On a drupal install CiviCRM is installed at: `/webtree/mysite/htdocs/sites/www.mysite/modules/civicrm`

I have a Custom Template File directory set to `/webtree/mysite/htdocs/sites/www.mysite/files/civicrm/templates`

I'd like to store a custom template file "someText.tpl" in the Custom Template File directory that, depending on some logic, may get included in the Online Event Registration system workflow message using the command:

`{include file="someText.tpl"}`

If I place the file at: `/webtree/mysite/htdocs/sites/www.mysite/modules/civicrm/templates/someText.tpl` it is read just fine, but I haven't been able to find a way to place it at `/webtree/mysite/htdocs/sites/www.mysite/files/civicrm/templates`

I've tried assorted dot notation, full paths, etc. but can't seem to read and include a template that isn't in the module/civicrm/templates path. I'd rather not store my custom files there because it creates extra steps during upgrades. Any suggestions?

# Answer
You can find some information about overriding templates and the Custom Template Directory in the developer guide here... along with the recommendation that you don't do that but use extensions instead.
> 1 votes

# Answer
Just elaborate Aidan's answer:

At Administration Console, Directories, at field: Custom Template Directory, fill in say: `[civicrm.files]/custom_templates/`

It refers to directory `<DocRoot>/sites/default/files/civicrm/custom_templates` Go there and make any necessary directory structure corresponding to your include statement. If it is {include file="CRM/Report/Form.tpl"}, then mkdir -p CRM/Report and put Form.tpl there. It would be used if there is a hit.

In case you feel the tpl file you put there is not used, please try this: Administer, System Settings, Cleanup Caches and Update Paths, just click Cleanup Caches. Then go to Dashboard and click Refresh Dashboard Data. Then visit your custom component and see the new changes.
> 1 votes

---
Tags: civievent, message-templates, smarty, system-workflow-messages
---


# Question
Title: Bug in settings for CiviContribute Component?
I have been wondering for a while, why two settings for CiviContribute did never have any effect on the created financial transactions:

* Always post to Accounts Receivable?
* Enable Deferred Revenue?

Since I am beginning to become more familiar with Civi, I tried to dig a bit deeper into the internals of the system, and I might have found the cause.

In general, all settings for all components are stored in the table civicrm\_setting, one row per setting.

BUT: There is one exception. All settings for CiviContribute get stored combined within one single row. Looking into the source code, all relevant settings are then pulled out of this single row. And this is also true for the read access to the two settings I mentioned above.

HOWEVER: It seems that when the settings of these two entries get stored, they are indeed written in distinct rows within the settings table. This would be ok for all other settings, except those for CiviContribute. While the system tries to read the (non existing) values out of the combined row, it always assumes, those values have never been set.

I manually fiddled with this ominous CiviContribute data row and placed a value for deferred\_revenue\_enabled==true:

> a:10:{s:24:"deferred\_revenue\_enabled";s:1:"1";...

and voila, now the expected financial transactions all get generated.

I would like to ask some of the more experienced CiviCRM guys to have a look at this phenomenon, since I am not quite sure yet about the correct way for a bug report.

(My current version of Civi is 5.13.2 in combination with Wordpress 5.2, but this bug exists already for some time, at least since 5.11.)

# Answer
The issue got fixed in release 5.15.0 (see here). Thanks a lot to everyone who contributed!
> 1 votes

---
Tags: civicontribute, bug-reporting
---


# Question
Title: Is it possible to create a progress bar/widget for a contribution page?
Prior to CiviCRM, I used to use the give donation plugin which made a cool little progress bar for our fundraising campaign pages. Looking to create something similar with CiviCRM, I came across the CiviWCI extension, but it only supports CiviCRM 4.4 and has not been updated in some time.

Is there a built in functionality or an alternative extension that I could use?

Many thanks!

# Answer
> 4 votes
We published a small extension that makes it easy to display the progress bar directly on the same contribution page: contributeprogress.

The README.md has more details, but the short version is that once this extension is enabled, you can enable the widget and tweak a few colours. The widget will be displayed directly on the contribution page. Not all of the widget settings are relevant (for example, we do not display the widget title and text body, because it's often redundant with the page introduction text).

The default design is also a bit different that the widget preview, because we wanted something a bit more modern looking (and we wanted to propose something that works out of the box, without requiring a designer).

Credits: Roshani Kothari helped with the visual design picking some of the best elements of how progress bars are displayed on different websites, and Plastic Pollution Coalition helped to fund this work. We welcome feedback to refine and improve it further.

# Answer
> 3 votes
Set your Goal Amount on Contribution Page = Title and Settings

> Enter an optional goal amount for this contribution page (e.g. for this 'campaign'). If you enable a contribution widget for this page, the widget will track progress against this goal. Otherwise, the goal will display as 'no limit'.

Then click through to the Widget tab such as this one on demo: http://dmaster.demo.civicrm.org/civicrm/admin/contribute/widget?reset=1&action=update&id=1

---
Tags: civicontribute, contribution-page, widget
---


# Question
Title: Unsure if I just broke my database with a custom field
I added a custom field for authenticated users to add a bio on their profile page (and if there's an existing field I should use for this, please let me know). Not knowing how long I should make this field, and temporarily forgetting that mysql probably uses fixed-width for this, I set the field length to 32767.

It took a long time to create the field, but the page wait dialog finally completed and the field shows up in the Custom Fields list. But having seen the long wait, I decided to re-do the field at 4095 or 8191, and tried to delete the Bio field. THAT progress window has been a spinning blue circle for nearly an hour, and Bio is still showing up in the Custom Fields list in a different tab.

EDIT: perhaps worth noting that the page where I *created* the field also had a spinning wait cursor nearly 90 minutes after I did so, but I could see the Bio field as expected in the Custom Field list, so that process seems to have completed without letting the page know.

Did I break something, or will this get to my desired state after I wait long enough? This is running on a Linode at $20 a month, so the CPU/RAM is not particularly powerful.

# Answer
> 1 votes
You haven't said what field type you were using, but I think you should probably be using a **note** field rather than an **alphanumeric**. My understanding is that the **note** field isn't stored as fixed length.

# Answer
> 0 votes
Agree with Mick Kahn about using a note. As to the spinning cursor and deleting the field if you're unable to do it in the UI, the spinning cursor usually means a fatal error occurred somewhere, so check the web server logs or CiviCRM ConfigAndLog. To delete the custom field manually:

1. Make a database backup.
2. In the list of custom fields if you hover over or click the edit link for the field the url will have `id=something` in it. Let's say it's id=4.
3. Do `select custom_group_id,column_name from civicrm_custom_field where id=4;`
4. Let's say it shows `7` and `bio_4`.
5. Do `select table_name from civicrm_custom_group where id=7;`
6. Let's say it shows `civicrm_value_something_7`.
7. Do `alter table civicrm_value_something_7 drop column bio_4;` NOTE: I think the field was never actually created in the physical table, so this may say "not found" or something. The original create likely had a fatal error `Column length too big for column` which is why you see the spinning cursor. So if it says not found just keep going.
8. Do `delete from civicrm_custom_field where id=4;`

---
Tags: custom-fields, mysql
---


# Question
Title: CiviCRM profiles / Caldera Forms: What to use when?
I am new to CiviCRM and CiviCRM profiles and Caldera Forms + CiviCRM seem to be two realisations for the same thing: Let users enter data.

What are the advantages of the realisations? When to use what?

# Answer
> 2 votes
This might not be the same, but the information at this link comparing drupal civicrm webform to profiles might be a similar starting point:

https://docs.civicrm.org/sysadmin/en/latest/integration/drupal/webform/#compared-to-civicrm-profiles

---
Tags: profile, caldera-forms
---


title: Solarium vs CiviCRM

text:
# Question
Title: Solarium vs CiviCRM
Drupal solr integration, as of Drupal 8.7.8 solr integration, as of 8.x-3.7 requires solarium/solarium:^5.1 which requires symfony/event-dispatcher:^4.3 which breaks civicrm.

To maintain module security, we're forced to upgrade soon.

Are there any workarounds or patches planned for this?

# Answer
> 2 votes
There is some information at this lab ticket about the current status: https://lab.civicrm.org/dev/drupal/issues/92

You can join the conversation there.

---
Tags: drupal, security
---


# Question
Title: How can webform load billing block information for a specified user?
The context is a staff member taking a phone call from a member and then filling in a webform including a payment for them.

The webform is added to the actions menu so the webform is passed '?cid=XXX' to load the contact. The problem is that when it comes to payment (by Stripe), the billing block is loading the details of the person filling in the form, not those of the person on the phone.

How can webform be configured to use the details of the contact on the form? Answers involving code writing are fine:-)

# Answer
First thing to do is to try this PR by Coleman: https://github.com/colemanw/webform\_civicrm/pull/206
> 1 votes

---
Tags: webform-civicrm, stripe
---


# Question
Title: Order form for materials on donation basis (CiviCRM / WordPress)
We are new to CiviCRM and are looking for an **easy way** to enable the following:

*Must have:*

* An interested person may order materials (e.g. postcards) and may promise to give donations for it
* Verification email
* The person and a person doing the shipping should receive an email

*Nice to have:*

1. Update of CiviCRM contact
2. Creating a activity for that contact
3. Possibility to do the donation with CiviCRM

From StackExchange research I got the impression that best way to do the "must haves" and 1./2. would be a best to use Caldera Forms + Caldera CiviCRM Plugin + Caldera Verify Form.

Is this the appropriate way to do it, or is there something easier (e.g. CiviCRM forms/profiles)?

Is it possible to include the donation from CiviCRM directly into such a thing? (It's not a shop function, where you have to pay, it should really be a donation.)

# Answer
> 2 votes
In theory you can set up a Contribution page with Price Set with all your 'merchandise' available as Price Fields so they could order eg 5 postcards or 3 x pack of 3 cards etc.

Then i you set the form for Pay Later that becomes a 'promise' which is recorded in civicrm as a pending transaction.

when they submit then the purchaser will get an email, and the 'person doing the shipping' can be added as a CC or BCC via the Contribution Page settings

may not fit what you need but worth understanding what is possible via that route

it does not create the Activity (other than the one that CiviCRM creates for any contribution)

---
Tags: wordpress, donations, caldera-forms
---


title: Fatal Pear Error with form

text:
# Question
Title: Fatal Pear Error with form
This form used to work: https://hej-support.org/subscription-chemicals-in-products-newsletter/

Now it gives back a Fatal error: Cannot redeclare \_PEAR\_call\_destructors() (previously declared in /kunden/549141\_85221/webseiten/wordpress/wp-content/plugins/civicrm/civicrm/packages/PEAR.php:773) in /kunden/549141\_85221/webseiten/wordpress/wp-content/plugins/backwpup/vendor/pear/pear-core-minimal/src/PEAR.php on line 812

# Answer
Seems to be due to the `backwpup` plugin enabled on your site. Try submitting the form after disabling the same.

This looks like a problem with this plugin. It was also raised on WP support - https://wordpress.org/support/topic/fatal-error-cannot-redeclare-class-pear/
> 2 votes

# Answer
Unfortunately, the backWPup tickets were closed with "The topic ‘Conflict with CiviCRM and CRON jobs’ is closed to new replies." I opend a new ticket.

As a weired workaround, I used the wp-cli approach, described in the CiviCRM docu, created a php file that executes the wp-cli, and used an external cron service to start that php file.

wp-cli enables a temporary disabling of plugins, but this was not even necessary.
> 1 votes

---
Tags: wordpress
---


title: Creating specific Report

text:
# Question
Title: Creating specific Report
How would we go about achieving the following report results? (I have looked at the report page but haven’t worked with this yet)

I have pasted a snippet below.

# Answer
Zephyr,

The report you looking for is not available in CiviCRM. You will need to program to add such report through an extension.

Thanks

Pradeep
> 1 votes

# Answer
In addition to Pradeep's answer, some folks will use a third-party business intelligence (BI) tool to achieve this. Google Data Studio, Tableau and Pentaho Data Suite are all viable options. However, this often requires advanced configuration, and just shifts the programming burden from CiviCRM/PHP to the BI tool.
> 0 votes

---
Tags: civireport
---


title: Nested CiviEvents

text:
# Question
Title: Nested CiviEvents
Hi to all (and thank you in advance).

I am looking for a way to nest CiviEvents. We run small conferences that sometimes have sessions during the day. We need to use the same functionality (and fields) that we have for an event, for its session (with the addition of time e.g. 09:30 - 11:30 / which I can do).

Example:

Conference about the healing powers of coffee

1. Session 01 (09:30 - 11:30) - To drink or not to drink
2. Session 02 (11:30 - 13:30) - The importance of Biscotti

Is there an add-in, extension, module etc that does this? (or any other way that does not require to re-invent the wheel)

Best A.

# Answer
> 4 votes
Karin's approach is good; the Civi-native way (in case you're not on Drupal) is to use Price Sets for sessions. This is covered in the Complex Event Fees section of the CiviEvent documentation. They're very configurable, and allow you to set per-session limits, additional costs for some (or all) sessions, and more.

If you go this route, install the Extended Reports extension because its Event/Participant with Line Item reports specifically address some of the shortcomings of the built-in reporting for this use case.

# Answer
> 3 votes
We use Webform CiviCRM modules for this: Sessions are custom CiviCRM fields on the Partipant entity and Webform Select Limit module lets you put limits on how many participants can select a certain Session.

---
Tags: civievent, webform-civicrm
---


# Question
Title: Non-admin user can't reserve survey respondents without getting error "Missing Interviewer contact."
WordPress 4.9.10
CiviCRM 4.7.29

When I'm logged into CiviCRM as an admin, the process of reserving respondents for a survey works fine. However, if I'm logged in with a WP "Contributor" role (which is the role all my civicrm users have) I get an error message when I try to reserve them, "Missing Interviewer contact.", as seen below.

Looking at the search criteria I see that there is no field to assign the interviewer as there is when I'm logged in as an admin:

I checked my survey-related permissions and I think I have it setup correctly so a person with the "contributor" role should be able to do this:

Is there something else permissions-related that I need to be setting, or is this maybe a bug?

Thanks for any help,

Ruth

# Answer
> 1 votes
I believe you also need the "CiviCRM: access contact reference field" permission, based on what you're reporting.

# Answer
> 1 votes
It seems like you'd need to do 'Administer CiviCampaign' to get it going. What I did was enable that for the user group and then hid the admin stuff from the contributor role for editing the navigational menu

---
Tags: error, permissions, civisurvey
---


# Question
Title: How can I log hours that I have contributed to the project?
CiviCRM is contributed to by hundreds of people: users who report issues/bugs/suggestions; implementers; developers; people who take time to offer advice on this site or on chat.civicrm.org.

It's useful for the project to have a measure of this, so we can appreciate everyone's input. As well as helping build a picture of the work that goes into improving CiviCRM over time, people who contribute enough hours can be listed on the find an expert page.

How can this be measured and how can I record my time?

(Note: I'm listing this here with an answer because the information was very hard to find.)

# Answer
You can log your contributions by either:

* signing up for an account at lab.civicrm.org which is where most of the work goes on and many community discussions happen; then "joining" a project; then recording your time in a comment using a special code.

*or*
* signing up for an account on https://civicrm.org and then using a special work log import form.

This process, as well as what is and isn't considered a "contribution" is set out in detail in a wiki page in the gitlab project called *Community Engagement*. The relevant page is:

https://lab.civicrm.org/community/community-engagement/wikis/Tracking-Contributions
> 5 votes

---
Tags: community
---


# Question
Title: Is there any way to switch off e-mail notifications in CiviCase?
It seems that CiviCase sends out e-mail notifications for any change that is done in case activities. Is there a way to switch off these automatic e-mail notifications? (manual e-mail messages should still be possible, though)

# Answer
AFAIK you can only switch off for email notifications for all activity mails, not specifically for case activities only.
> 2 votes

---
Tags: email, civicase
---


title: Can I add sent mailing to a campaign

text:
# Question
Title: Can I add sent mailing to a campaign
The NGO I'm working with decided to create campaigns for all the ongoing projects. We weren't using this information previously, so I wasn't tagging the mailings to a project but now retroactively some of the mailings belong to some of the campaigns. Is there any way that I can edit the sent mailing and use campaign information?

# Answer
> 1 votes
campaign\_id is a field in the civicrm\_mailing table in your database. I suspect that the only ways to modify this are \- edit the db directly \- use the API Explorer to change the value assuming this is available via the UI (via /civicrm/api#explorer)

hopefully those are enough pointers for a start

---
Tags: civimail, civicampaign
---


# Question
Title: Hi, how do I run a report that shows me all the people that became a NEW member (not renewals) for the month of October 2019?
how do I run a report that shows me all the people that became a NEW member (not renewals) for the month of October 2019?

# Answer
If you use Adv Search and set the Date range for example to be 'Join Date' in October does that not give what you need?
> 2 votes

# Answer
Welcome to SE. It depends on how you have used membership status, but in the Membership Details reports, if you go to the filters tab, you may be able to just filter on the new status for recent memberships or perhaps better filter on the membership since field with an appropriate date range. Have a play to see what works best for you.
> 1 votes

---
Tags: civimember
---


title: Are the WordPress install docs wrong?

text:
# Question
Title: Are the WordPress install docs wrong?
I'm following the docs at https://docs.civicrm.org/sysadmin/en/latest/install/wordpress/

I downloaded 5.17 in a zip file from https://github.com/civicrm/civicrm-core/releases, unzipped it and renamed it `civicrm` (I need 5.17 and not 5.18 for various reasons).

The docs say:

> You should now have a /var/www/wordpress/wp-content/plugins/civicrm directory containing civicrm.php, README.txt and another civicrm directory (which in turn contains bin, CRM, sql, templates, etc.).

The unzipped `civicrm` directory does not contain civicrm.php at the top level; that file is in a folder called `install`. There is no directory inside `civicrm` called `civicrm`. As a result, the CiviCRM plugin does not show up in WordPress admin to be activated, even with correct `_www` and 755 permissions.

Do I create a directory inside `civicrm`? How do I get the plugin to show up in WP admin?

And, using the plugin installer in WP Admin to upload the zip file `civicrm-core-5.17.zip` directly results in the error `The package could not be installed. No valid plugins were found.`

# Answer
Is there somewhere in the docs where it says to go to https://github.com/civicrm/civicrm-core/releases because that isn't the right place to download and all you get from there is core, not the wordpress parts, so if it says that it should get changed.

You need to download from https://civicrm.org/download and if you need an older release you can go to https://sourceforge.net/projects/civicrm/files/civicrm-stable/
> 3 votes

# Answer
If you are trying to get a different version of the wordpress download you can just swap in the relevant version number in the url

for example -\> https://download.civicrm.org/civicrm-5.17.0-wordpress.zip
> 2 votes

---
Tags: wordpress, installation, documentation
---


title: Can't add custom field to form

text:
# Question
Title: Can't add custom field to form
I'm trying to add a custom field to the Event form programmatically.

So far, I've created a new extension and enabled it, with hook\_civicrm\_buildForm function in a PHP file. The function's being executed as I can get it stop at a breakpoint. I'm using the addEntityRef method to add a new field.

```
/**
 * Implements hook_civicrm_buildForm()
 *
 * Adds a field for linking a parent event
 *
 * @param string $formName
 * @param CRM_Event_Form_ManageEvent_EventInfo $form
 * @return void
 */
function myExtension_civicrm_buildForm($formName, &$form) {

  if ($formName == 'CRM_Event_Form_ManageEvent_EventInfo') {

    $form->addEntityRef('my_field', ts('My Field'), [
      'entity' => 'Event',
      'placeholder' => ts('- any -'),
      'select' => ['minimumInputLength' => 0],
    ]);

    $form->buildQuickForm();
  }
}

```

I've followed other posts by adding a template file named my\_field.tpl in my extension's templates directory with the contents:

```
<tr id="my-field-tr">
  <td>Parent Event:</td>
  <td>{$form.my_field.html}</td>
</tr>
{* Reposition the above block after the Event Type field *}
<script type="text/javascript">
  cj('#my-field-tr').insertAfter('.crm-event-manage-eventinfo-form-block-event_type_id')
</script>

```

But I am struggling to get the field to appear. TIA

# Answer
> 2 votes
There are multiple ways to do this. One is to use a .extra.tpl which has to have the same path and first part of the name as the original .tpl where you want it to get inserted. If you name it that way the tpl file will get picked up automatically. So in this case the original .tpl that controls that event screen is in templates/CRM/Event/Form/ManageEvent/EventInfo.tpl, so you want to make a file templates/CRM/Event/Form/ManageEvent/EventInfo.extra.tpl

Another way is like in your original question but then you're missing the line from the docs (https://docs.civicrm.org/dev/en/latest/hooks/hook\_civicrm\_buildForm/) that says

```
CRM_Core_Region::instance('page-body')->add(array(
  'template' => "{$templatePath}/testfield.tpl"
));

```

to tell it the path and name of your template file. Otherwise it doesn't know about your .tpl file.

---
Tags: civievent
---


# Question
Title: Multiple transactions recorded against contribution using webform
I am using webform\_civicrm to allow users to register for memberships. I changed the default payment method from **credit card to invoice**. As a result of which now multiple transactions are being recorded against the contact.

**Transactions recorded with invoice as default payment method:**

**Transactions recorded with credit card as default payment method:**

**Payment methods**

Please note that I tested with latest civicrm as well and the behaviour is stil the same.

Any help would be appreciated :)

Thanks!

# Answer
Seems like a known issue which recently got fixed in webform civicrm. Can you try applying the patch https://github.com/colemanw/webform\_civicrm/pull/180 or use the latest 7.x version from github and see if it fixes this problem for you?
> 3 votes

---
Tags: civimember, webform-civicrm, contributions
---


# Question
Title: I have an uncorrect css path in the front-end html code
I am using CiviCRM 5.18.3.with Joomla! 3.9.12 and I can not solved a path problem within the html page where "/components/" should be replaced by "/administrator/components/" (see below). It works OK for the back-end but not for the front-end ?? Please, your help would be well appreciated. Tks.

> ...

# Answer
Are the paths in the civicrm.settings.php files each pointing to the right place?

There's one for each of front and backend: \- /components/com\_civicrm/civicrm.settings.php \- /administrator/com\_civicrm/civicrm.settings.php

If you just copy and past the paths that are set those two files (e.g. after a server migration) then you might get the error you currently have. But the paths in one file need to point to front-end Civi, and in the other point to back-end Civi (ie with /administrator appended).
> 1 votes

---
Tags: joomla, css
---


# Question
Title: Adding multiple Case Coordinators in a Drupal webform?
I've got a multi-site with the following roles in Drupal:

* Site admin (full access)
* Local admin (can view all contacts)
* Case Manager (can view all Cases)
* Staff (using ACLs, can view site-specific contacts and no Cases)

We want to restrict the Case Managers so that they can only see the Cases on their own site, even if they also have 'Local admin' (view all contacts).

I've only managed to implement so far by adding all Case Managers as 'Coordinators' to every Case in their local site, so that the 'View my Cases' enables them to see the local Cases.

This is fine, however I cannot work out how Case Managers can then add more than one Case Coordinator for new Cases.

* Using the Drupal webform, I can only specify a single contact for Case Coordinator (regardless of permissions)
* In the normal Case Dashboard, only people with 'Site Admin' (i.e. full access) have the ability to add more Roles to a Case
* In the Case Type set-up, it only allows one of each relationship type for the default set up.

Is there a way to enable staff to either see all Cases for their local instance *only* or to enable them to manually add more than one Case Coordinator so that the three staff can see all Cases for their local site?

# Answer
Technically it's the permission "access all cases and activities" that can add roles on Manage Case but I guess that's the same as "site admin"/"full access" in your setup. The reason seems to be to avoid a loophole where access to cases could be granted that shouldn't be (see https://civicrm.stackexchange.com/a/33409/181).

Anyway what you might be able to do is tag or group the people who should all be case managers for a given local site, and then using hook\_postProcess or hook\_post add some code that automatically adds those roles when a new case is created for people who have the same tag/group as the case creator, i.e.

```
loop for each person with the same tag/group as the logged in user:
civicrm_api3('Relationship', 'create', [
  'contact_id_a' => 123, // client id
  'contact_id_b' => 194, // other person's id
  'relationship_type_id' => 9, // Case Coordinator is
  'case_id' => 12345,
]);

```
> 1 votes

---
Tags: webform-civicrm, civicase, permissions
---


# Question
Title: Braintree with Wordpress not working with CiviEvent
I have a wordpress Civicrm instance and we are using Braintree as the payment processor. I'm trying to create a CiviEvent, selling tickets to an event. When I try to test payments out by submitting test payments, I get an error.

```
Looks like there was problem. Payment Response: Braintree\Configuration::merchantId needs to be set (or accessToken needs to be passed to Braintree\Gateway).:

```

The weird thing is, the merchantId and all the API keys are already defined. I made a test payment on a CiviContribute page and that worked just fine. I'm confused as to why it would work on one Civi module and not work on the other.

Can anyone help advise me on how to fix this? Thanks.

# Answer
Figured it out. For some reason, the braintree keys were not being loaded at the time before it started to post to Braintree. In Braintree.php I added the following

```
 if (empty(Braintree_Configuration::environment())) {
  $environment = ($this->_mode == "test" ? 'sandbox' : 'production');
  Braintree_Configuration::environment($environment);
}

if (empty(Braintree_Configuration::merchantId())) {
  Braintree_Configuration::merchantId($this->_paymentProcessor["user_name"]);
}

if (empty(Braintree_Configuration::publicKey())) {
  Braintree_Configuration::publicKey($this->_paymentProcessor["password"]);
}

if (empty(Braintree_Configuration::privateKey())) {
  Braintree_Configuration::privateKey($this->_paymentProcessor["signature"]);
}

```

Right before the following:

```
try {
  $result = Braintree_Transaction::sale($requestArray);
} catch (Exception $e) {
  return self::error("Oops! Looks like there was problem. Payment Response: " . $e->getMessage());
}

```

And it worked. I'm not entirely sure why the values weren't being loaded initially but this will do!
> 2 votes

---
Tags: civievent, payment-processor, payment
---


# Question
Title: How to set read only field in Drupal CiviCRM
I would like to set a read only field in Drupal CiviCRM:

```
mymodule_civicrm_buildForm($formName, &$form) {
  ...

  // Set default value
  $defaults['readonly_field'] = xxx;
  $form->setDefaults($defaults);

  // Set read only
  $element = $form->getElement('event_type_id');
  $element->updateAttributes(array('disabled'=>true));
}

```

The field is disabled for input; however, the default value cannot be passed through the form submission.

The form warns that this required field does not input.

Could you advise how to set the read only field correctly?

Thanks a lot!!

# Answer
> 2 votes
Try `$element->updateAttributes(array('readonly'=>true));`

The difference between readonly and disabled is a common thing with HTML and forms.

See for example https://stackoverflow.com/questions/7730695/whats-the-difference-between-disabled-disabled-and-readonly-readonly-for-ht

---
Tags: drupal, php, civicrm-home
---


# Question
Title: Wordpress profile permissions to select contact reference field
We are in WordPress, which is new to me. We have a registration profile that includes a custom field which is a contact reference field filtered to include only a specific group of contacts. When I'm logged in, this shows up and works great on the profile, but an anonymous user can't even see the custom field on the registration profile. The custom data set is set to public, don't know if that matters.

What permissions do I need to give an anonymous user so that they can make a selection from the filtered contact reference field?

I've installed the User Role Editor plugin to hopefully give me the flexibility to do this- also please let me know if a different plugin is needed. Thanks!

# Answer
> 2 votes
The permission you're looking for is `CiviCRM: access contact reference fields`. You can view the list of permissions from civicrm menu too via `Administer => Users and permissions => Permissions`

and then click on `WordPress Access Control` link displayed on the page.

---
Tags: wordpress, profile, permissions, contact-reference
---


# Question
Title: Email is not CC'd when a membership on behalf of organisation contribution is made
When an individual joins on behalf of an organisation, the receipt/invoice is not CC'd to the individual. It goes to the organisation email.

On the email, it says it is CC'd to the individual but it does not arrive.

Any ideas? I'm basically trying to email the individual who completed the contribution page, not the organisation.

# Answer
You can solve this with CiviRules. You can create a rule saying that when a new membership is added send an e-mail to a related persion.

You need both CiviRules and the email api extensions.
> 2 votes

---
Tags: civicontribute, civimember
---


# Question
Title: Event Fees display as total of contribution when they should not
Is there a way to have events not total into a contact's contributions? I want to register people for events but each time I do and use event fee it shows the running total in contributions which is not correct for our usage case.

I see contributions as donations so I don't want fees from events (in this case a theater production) to show as a contribution (donation) for tax purposes.

Any ideas? I have tried to change how the funds are

# Answer
> 1 votes
There are two solutions:

1. Make your events free in civicrm but I assume that is not what you want
2. Differentiate in your reports between financial types. CiviCRM has Financial type system to register event fees with the type event fee, and donation with the type donation. You can also add other financial types.

See the manual: https://docs.civicrm.org/user/en/latest/contributions/key-concepts-and-configurations/#financial-types-financial-accounts-and-accounting-codes

# Answer
> 0 votes
You could also set up Summary Fields then you have any easy 'count' happening for all your Donations and exclude Event fees based on your settings in Summary Fields.

https://civicrm.org/extensions/summary-fields

# Answer
> 0 votes
I don't know where you are based, but in the UK, the Gift Aid extension https://civicrm.org/extensions/gift-aid-extension-uk is designed to deal with the tax differences for different sorts of income. Even is you are elsewhere it might be worth looking at it to see if it will work for you.

---
Tags: contributions
---


# Question
Title: How do I display user statistics/analytics on their dashboard?
I'm using civicrm and I'm wondering how I can better customize the home dashboard. We have people that are going to be doing walklists and interviewing them. How can I make it so that when they log in, they can see how many people they interviewed so far? Keep in mind that it is specific to all volunteers so ideally, I'd like it if I could setup a global view where they can see how many contacts they have interviewed.

I hope there's a straightforward way to do it. I'm open to using SQL or anything to get it to work. Is there a way to add custom HTML to the dashboard as well? I want the UX/UI to be very simple for volunteers so I'd like to have custom buttons to tell them to 'Start Interviewing' in their walklists, rather than have to go through the menu.

# Answer
> 1 votes
If you aren't using the campaign report (which can be made into a dashlet by checking the Available For Dashboard checkbox when you save - see https://docs.civicrm.org/user/en/latest/the-user-interface/menu-dashboard-and-dashlets/#dashlets), then you could either use https://docs.civicrm.org/dev/en/latest/hooks/hook\_civicrm\_dashboard/ to put something custom into the /civicrm/user page, or make your own dashlet to be available at /civicrm/dashboard (see e.g. https://civicrm.stackexchange.com/a/28877/181)

---
Tags: wordpress, user-dashboard
---


# Question
Title: Wordpress newbie: Not show author, date at top and garbage at bottom of Civi registration profile
First-timer using Wordpress with Civi (and new to WordPress): We have set up online event registration for a Civi event that is integrated with a (empty, dummy) WordPress site. The registration shows the author and date at the top (minor), and then below the registration profile it shows a bunch of junk at the bottom- a search bar, recent posts, RSS feed, etc. (unacceptable).

How can I have it JUST SHOW the profile questions on the event registration page?

Thanks!

# Answer
> 2 votes
That's a wp issue, will be standard on all pages unless you remove it from your theme settings on wp. This has nothing to do with civicrm.

---
Tags: wordpress, profile
---


title: Edit Message Template Permission

text:
# Question
Title: Edit Message Template Permission
Can anyone shed some light on the new(ish) permissions for editing message templates? I'm moving to Civi 5.5.3 on Drupal 7 and noticed that now the permissions are broken out into

* CiviCRM: edit message templates (previously this was the only permission)
* CiviCRM: edit system workflow message templates
* CiviCRM: edit user-driven message templates

I looked through, I thought pretty in depth, all the release notes I could find and wan't able to find a reference to this change. I'm not entirely sure why there are 3 total permissions rather than just two.

I think "edit message templates" allows you to edit both system workflow and user-driven message templates. How is that different than just checking both "edit system workflow message templates" and "edit user-driven message templates"? Is there more controlled under 'edit message templates"?

# Answer
There was an issue with the permissions on saving a message template that has been fixed and will be released in 5.7 PR for 5.7. The situation is that there is now the ability to have more finer grained permission, so if you only want some users being able to edit just the User templates your will be able to do that by just granting the CiviCRM: edit user-driven message templates permission for example.

The reason for the 3 is to maintain backwards compatibility so the people who had assigned the CiviCRM: edit message templates permission that would still work exactly the same.
> 2 votes

# Answer
I didn't mean to answer my own question but I kept poking around - I'm also not sure that this is the whole picture:

I found that the main "edit message templates" permission shows the "Message Templates" option in the Mailings menu. But with either of the other two permissions turned on, you can still access the page at yoursite.org/civicrm/admin/messageTemplates.

I also found that the ability to Enable/Disable a template is tied to the **new** permissions. The option is displayed but it throws an error if you try without the additional permission(s)

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

Meaning you'll want to add these additional permission(s) to anyone who already had the previous "edit message templates" permission - so that they are still able to enable / disable templates.

If anyone has additional info please feel free to add!
> 3 votes

# Answer
Both answers above have been very useful, but I have found out a bit more. If you use the **edit message templates** permission to show the **Message Templates** menu item, then it still allows the editing (but not deleting and disabling) of the **System Workflow Messages** even if **edit system workflow message templates** permission is nitset. I don;t want to allow this when I allow editing of the **User-driven messages**. I got round this by adding the **edit user-driven message templates** permission to the **Message Templates** menu item with the OR option and leaving the **edit message templates** permission template unset. Seems to work.
> 1 votes

---
Tags: civimail, permissions
---


title: WP CivicCRM Menubar styles not loading

text:
# Question
Title: WP CivicCRM Menubar styles not loading
In display preferences I have an option to set the menubar above or below content, but the styles for the menubar are not loading. It just dumps the list of links. Any ideas what the deal is?

# Answer
Welcome to SE! You don't give a lot of detail. Are you just setting up or did it work and now it doesn't?

I've seen something like this (though the menu items were part hidden under the LH WordPress menu) when I'm hosting in a subdomain. Possibly because of the symlinks in my hosting provider. I got round this by going to Adminster \>\> System Setting \>\> Resource URL (or http://..org/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fadmin%2Fsetting%2Furl&reset=1 if you can't actually see the menu) and changing the Image Upload URL to http://..org/wp-content/uploads/civicrm/persist/contribute/

Can't remember now how I worked that out as it isn't obvious!

If that doesn't work you need to provide a few more details.
> 1 votes

---
Tags: wordpress, civicrm-home, menu
---


title: Running report gives me a 404

text:
# Question
Title: Running report gives me a 404
Having a very odd error with a CiviCRM install on wordpress. Every seems to be working (membership signup, looking up people, etc.) except running reports.

1. Click on report URL
2. View report options, then select "Refresh Results"
3. Page loads "No Results Found"

If I add &reset=1 to the end of the report, it works correctly

CiviCRM 5.15.0 Wordpress 5.2.2–en PHP 7.2 on hosted service

# Answer
> 1 votes
So I figured out the error seemed to be related to partial upgrade I had (the SQL upgrade had worked, but the system hadn't changed the version number back from .upgrade, so it thought it wasn't finished). Once I fixed that, this problem went away.

---
Tags: wordpress, reports
---


# Question
Title: Issue with CiviMail reports after upgrade to 5.19.0
I upgraded to 5.19.0 and noticed that every report for completed mailings listed on the Find Mailings screen is now showing this message in the Delivery Summary section:

```
Delivery has not yet begun for this mailing. If the scheduled delivery date and time is past, ask the system administrator or technical support contact for your site to verify that the automated mailer task ('cron job') is running - and how frequently.

```

Despite this, the reports still show the Click-through Summary and other sections.

I see this issue on both my production and development systems. I tried clearing cache. Other CiviMail reports (from the Reports tab) seem to be correct.

CiviCRM 5.19.0
Wordpress 5.2.4
PHP 7.2.21
MySQL 5.7.23

# Answer
I believe this is fixed with https://github.com/civicrm/civicrm-core/pull/15780. It will be hopefully included in a point release that should come out soon for 5.19
> 3 votes

---
Tags: wordpress, civimail
---


# Question
Title: Mailing summary doesn't display - says that mailing not complete
Updated to CiviCRM 5.19 - ran one of our biweekly mailings last night and I wanted to check the open count. But Civi says that the mailing isn't completed, even though it shows on the mailing summary that it completed at 5:45 AM.

Does anyone else have this issue?

# Answer
> 2 votes
@logan Bear i would recommend you upgrade to 5.19.1 It has just come out and should include this PR https://github.com/civicrm/civicrm-core/pull/15779 which should resolve your issue

---
Tags: civimail
---


# Question
Title: Issue with Drupal 8 CiviCRM Views + CiviCRM event
Does anyone know how to create a Drupal view to show only future/upcoming CiviCRM events in Drupal 8? I tried by adding the Event start date as filter but it doesn't provide the filtering options to set the date or choose an offset like it did in D7.

# Answer
> 1 votes
I just checked and this is working using the latest D8 CiviCRM Entity - it is under development, so best to use the latest directly from its GitHub Repo:

```
https://github.com/eileenmcnaughton/civicrm_entity/tree/8.x-3.x

```

If you're interested in helping us to advance/accelerate this development - consider becoming a Maker/sponsor of the D8 integration projects (D8 Webform CiviCRM and D8 CiviCRM Entity) modules.

---
Tags: civievent, drupal-views, civicrm-entity, drupal-8
---


title: Importing signatures into Petition?

text:
# Question
Title: Importing signatures into Petition?
I am bringing old data into CiviCRM and we have a number of old petitions in a variety of formats (paper, YAWPP) and I didn't see a way to import the old names & emails into a petition. Did I miss something?

# Answer
> 4 votes
So I figured out how to do this, for the future.

You need to import an Activity for each contact. Match as per any other import

Key import details:

* source\_record\_id = petition id (you may have to look into the db to find this)
* activity type = 32 (or the activity type id listed for Petition Signature in Administer \> Customize Data and Screens \> Activity Types)
* subject = by default, this is the title of petition
* data = date signed

---
Tags: civicampaign
---


# Question
Title: When adding CSS in civimail (under source) getting an error when trying to see or send test
Trying to use my own custom html e-mail in CiviMail with custom CSS in it (specifically to optimize on mobile). When I have the CSS stylesheet info on top I cannot send a test email or preview in HTML. when I click either of them I get Error "Sorry an error occurred and your information was not saved" How can I get around this?

# Answer
> 0 votes
What fixed or for me was creating a css file and copying the style sheet into that file and referencing it as a external style sheet in the html (instead of having it in the actual email)

# Answer
> 2 votes
You will need to add your style sheet inside {literal} when adding stylesheet in Message template. For example

```
{literal}
<style>
 your code
</style>
{/literal}

```

---
Tags: civimail, css
---


# Question
Title: Does the CiviCRM API comply with the OpenAPI Specification?
Does the CiviCRM API comply with the OpenAPI Specification?

# Answer
No the CiviCRM api does not comply with the open api specification. Is there any reason why you are asking this?
> 1 votes

---
Tags: api
---


title: Has this member data been encrypted?

text:
# Question
Title: Has this member data been encrypted?
*Update 11-11-2019 See my answer below.*

---

When dumping a Drupal CiviCRM database to move and convert to a new WordPress install, I've found that the membership data appears to have been encrypted; these random character strings appear in WordPress in Memberships\>Dashboard, i.e. `bs00fgcb` for name, `hgaibbsf@example.org` for email, etc. But the two letter state abbreviation isn't a random string.

The garbage data appears in the database dump when viewed with a text editor, *before* I import into the new database.

No other database data seems to be affected, and CiviCRM appears to run fine in WordPress, other than the data display above.

Does this appear to be encryption? There are no encryption modules in Drupal (no Drupal Encrypt) that I can see., nor CiviCRM extensions Where would I find the functions that do the encryption and decrypting? In Drupal `[cms.root]/sites/default/files/civicrm/custom/`? Or could encryption be done at the MySQL level?

CiviCRM is the same version between Drupal and WordPress; same MySQL database and encoding (both sites are on the same server). Database collations are exactly the same between the two: latin1\_swedish\_ci. No other data is corrupted. I've tried importing multiple times.

# Answer
There is no encryption in CiviCRM. This sound something that your database dump got corrupted. Or that you imported in a database with another collation (character set) than the source database.
> 3 votes

# Answer
In the end, I'm not sure what the problem was: either Adminer when either exporting and/or importing; or, the table collations being `latin1_swedish_ci`, even though both databases used the same collation; or even a conflict between the very old linux version and newer MySQL versions on the server.

But I exported using mysqldump via SSH while forcing UTF, and then changed the table collation to utf8\_unicode\_ci on the import database, and that worked.

So, export directly from MySQL using mysqldump while forcing utf8:

`mysqldump -u root -p --default-character-set=utf8 my_database > backup.sql`

Or use gzip, if needed:

`mysqldump -u root -p --default-character-set=utf8 my_database | gzip > backup.gz`

Then I set the table collation on the database I was importing into at `utf8_unicode_ci`, and imported the database with Adminer.
> 3 votes

---
Tags: wordpress, drupal
---


# Question
Title: How to get data via relationships with APIv4?
*Wilma* has relationship: *is campaigner at* organisation *System Change Not Charity*.

How can I get a list of individuals like Wilma and the organisations that they are campaigners for?

I've read the documentation but I can't figure out how I would join on relationship?

I tried this which I thought would at least give me the names of people with that campaigner relationship type, but it gives nothing.

* Entity: Contact
* Action: get

```
{
    "select": ["display_name"],
    "where": [
      ["relationships.relationship_type_id", "=", 15]
    ],
    "limit": 25,
    "checkPermissions": false
}

```

# Answer
> 2 votes
Not sure if this is what you're after but works for me; the 'join on' is a bit hidden in the 'Select' box.

```
CRM.api4('Relationship', 'get', {
  select: ["contact_a.display_name"],
  where: [["relationship_type_id", "=", 5]],
  limit: 25
}).then(function(relationships) {
  // do something with relationships array
}, function(failure) {
  // handle failure
})

```

# Answer
> 1 votes
For the part about making your first-step example work, use 'contact\_a.display\_name' instead of display\_name.

Also it's missing from your example but it would be `'Relationship', 'get',` at the very beginning, so the whole thing, to also get the org, is

```
$relationships = civicrm_api4('Relationship', 'get', [
  'select' => [
    'contact_a.display_name', 'contact_b.display_name'
  ],
  'where' => [
    ['relationship_type_id', '=', 15],
  ],
  'checkPermissions' => false,
]);

```

---
Tags: api
---


# Question
Title: How to create a modern looking contribution page?
I have just came across this webpage where they seem to using CiviCRM. But would have an idea how did they created the layout of this contribution pages? Wordpress drupal or something else? https://action.aclu.org/give/now I like the layout of it and wondering if can be implemented on our site using drupal? Thanks

# Answer
> 2 votes
You can use the Civi Bartik Public Theme for Drupal/CiviCrm.

The theme has some configuration as to change colors, logo etc...

# Answer
> 1 votes
I don't think there is any way to do this within CiviCRM as it stands. But someone else seems to have similar ideas and may be thinking of developing an extension to do this. See https://lab.civicrm.org/dev/user-interface/issues/8. By the way, I don't see any evidence to suggest that ACLU are using CiviCRM.

# Answer
> 1 votes
It does look like it's a drupal page using webform, according to the page source. But I don't see anything in the source referring to civicrm.

But, since it uses webform, you might be able to create something similar with the civicrm\_webform module.

# Answer
> 1 votes
This may take you part way towards what you are looking for https://lab.civicrm.org/extensions/recurringbuttons/tree/master

---
Tags: contribution-page, theme, display
---


# Question
Title: How do use upload function for mail merge with Word
After many researchs on Internet, I have not found an answer to how to use the upload function, in order to do a mail merge based on an existing Word document.

Print/Merge document has an option to upload a .docx word file. But I have not figured out how to use it.

Is is possible to create a Word document and somehow add the tokens directly in this document? And then do the merge via the upload? Thanks for your help. (Drupal 7.67 & Civi 5.7.0)

# Answer
> 1 votes
There's two different things:

1. Mail Merge, which is a native feature of word.
2. Print/Merge document, with output as a word document, which is a feature of CiviCRM. (I'm not sure it has the ability to "upload" a word document. If it does I'm not familiar with it, but see below.)

For the first one, you would want to do a contact export in csv format, and then from within MS Word do your mail merge as you would with any excel data source.

For the second one, inside CiviCRM:

1. Go to Administer - CiviMail - Message Templates and create a new template.
2. In the HTML section, copy/paste from MS Word into the box using the Paste-From-Word icon.
3. Then you will need to replace your tokens with the civicrm versions of the tokens, using the dropdown.
4. Then when you do a contact search you can choose Print/Merge document from the actions dropdown on the search results page and choose your template and MS Word as the output format.

---
Tags: upload, printmerge
---


# Question
Title: Remove Employer/Job Title Fields and Reorder Fields
How do I remove the "employer" "job title" "nickname" fields in the Individual contact summary? Is there a way to reorganize the information on this screen (e.g., demographics should go first)?

I'm currently running the most recent version of CiviCRM 4.6.3.

# Answer
> 5 votes
You can adjust the order of the panels under Display Preferences here: civicrm/admin/setting/preferences/display?reset=1

The order of your custom data sets will be based on the order of your Custom Data here: civicrm/admin/custom/group?reset=1

Under display preferences you can also hide some fields, but not the ones you're after. We never customize our installations to remove those types of fields. Unless you have the skills in house for those types of customizations, you may end up relying on a developer for each upgrade to hide them every time. Most find that an unnecessary expense and just ignore them.

Heather.

# Answer
> 4 votes
If you happen to be a developer and your are asked to do this you can take the following route.

* Create a new extension.
* Identify the class that generates the unwanted field. For example, the employer field is created by `CRM_Contact_Page_View_Summary`.
* Add a template in your extension with the same name (and directory) as the template that belongs to this class, with only one difference. Add `extra` before the `.tpl`. So for `CRM_Contact_Page_View_Summary` the template is `\templates\CRM\Contact\Page\View\Summary.extra.tpl`. The contents of this template wil be appended to the regular template.
* Add some javascript code that hides the field.

Example:

```
 {literal}
 <script type="text/javascript">
 $('.crm-contact-current_employer').parent().hide();
 </script>
 {/literal}

```

# Answer
> 2 votes
The Contact Layout Editor extension, first released in 2018, allows you to do quite a bit of hiding and rearranging on the Contact Summary screen.

---
Tags: contacts
---


title: Unable to list groups with CiviCRM API

text:
# Question
Title: Unable to list groups with CiviCRM API
When I run the API command (via CiviCRM API Explorer) to list all the "Mailing Lists" i.e.

`$result = civicrm_api3('Group', 'get', ['group_type' => "Mailing List"]);`

I get the full list of mailing list groups. However if I run the with "LIKE" filtering option instead of "=", i.e:

`$result = civicrm_api3('Group', 'get', ['group_type' => ['LIKE' => "Mailing List"],]);`

I don't get any results and the console suggests that i hit a **403** error, which indicates this is a permission problem. I am running this as an administrator so I should have full access to the system.

Any suggestions on how to address this issue are welcome.I am running CiviCRM 5.18.4 on Wordpress 5.2.4.

# Answer
Turns out this was caused by some server settings by my hosting provider (apparently they did some changes to the firewall). They managed to fix it and it seems to be working fine.
> 1 votes

---
Tags: api, groups, permissions, mailing
---


# Question
Title: Unable to load the recipients group when sending mailing with Civimail
I am running CiviCRM 5.17.4 on Wordpress 5.2.3. The problem I am facing is that I am unable to send mailing to mailing lists (defined as groups) via CiviMail.

When I try to enter the group in the **Recipients** box I get **Loading Failed** message and none of the available groups is loaded (see image below). The problem appears for existing and new mailings.

Interestingly when I re-use the existing mailing I can still send it to a previously used group (though I cannot change the recipient lists). The groups load normally in manage group page.

Any advice on the problem or debugging suggestions would be very welcomed.

# Answer
> 1 votes
Turns out this was caused by some server settings by my hosting provider (apparently they did some changes to the firewall). They managed to fix it and it seems to be working fine.

---
Tags: civimail, groups
---


# Question
Title: How to control which activity types show up in dropdown when creating new activity
I cannot figure out why some activity types display in the dropdown when adding a new activity, and others do not. For example, on the demo site, I can see that there are many (16 in the screnshot) activity types linked to the "Contact" component:

But when I go to add an activity to a contact on the demo site, I only see 7 options:

What if I wanted to add an activity of a type that is not included in this list of 7? How did those 7 get to this dropdown list?

I'm desperate to figure this out.

Thank you! Kristin

# Answer
Only activity type that has component = Contact gets listed on the dropdown displayed on the contact summary page -\> activities tab.

> `Bulk Email` also has component = contact, then why it is not shown listed on the dropdown?

Some activity types are reserved for system usage which has `filter` value set to 1 in `civicrm_option_value` table. These activity types are filtered from the dropdown list.

Email/SMS activity type will only be shown in the dropdown if the contact has a valid email/phone value stored in it.
> 1 votes

# Answer
Some of those are "system" types that get added by other actions. For example `Bulk Email` is related to mass mailings of newsletters and such.

To add a custom type, you can define that by going in the menu to Administer - Customize Data and Screens - Activity Types. (EDIT: Oops obviously you found that screen - haha. If there's a specific one you're interested in and want to know how it gets used, then you can update and ask that.)
> 0 votes

---
Tags: activities
---


# Question
Title: Dog as sub-contact type of individual but they have no last name
We've seen references to use a individual sub-contact type (CiviCRM for animal rescue charity) but the issue is dogs do not have last names. Atleast, not always ;)

So how have people handled this? Adding in a placeholder for last name is a workaround I want to avoid. I think the best situation is to disable last name only for a certain sub-contact type or add in the CID to the last name field.

# Answer
> 2 votes
Depends what you want to do with the dog contacts, but another option for your last name question would be to use a sub-type of Organization rather than Individual since that only requires a single name.

# Answer
> 1 votes
I'm assuming the dog doesn't have email? Then again, it's almost the year 2020. All joking aside, if the org were to register a .dog domain name (which does exist), they could assign emails for the dogs and maybe get some publicity along with it. Then last name becomes optional.

https://donuts.domains/what-we-do/top-level-domains

---
Tags: sub-types
---