# Question
Title: How to create tokens for custom fields (participant, individual, organisation)
Drupal 7, Civi 5.12 I have created custom fields for civievent bookings (to be used for Participants, Individual, Organization).

Is there an easy way for a non developer to create tokens for these custom fields so that I can include them in the Contributions Invoice template?

(I asked the same question in 2017 and found a way around by using custom contact fields, but that was kludgy).

# Answer
> 3 votes
Davy, You can use CiviCRM api to fetch the custom fields of participants, contact and then use as smarty in your message template

Something like this you can include in invoice template

```
{crmAPI var='result' entity='ParticipantPayment' action='get' return="participant_id.contact_id.custom_3,participant_id.custom_4" contribution_id=$id}
{assign var="contactCustomField" value="participant_id.contact_id.custom_3"}
{assign var="ParticipantCustomField" value="participant_id.custom_4"}
{foreach from=$result.values item=participantpayment}
  <tr>
    <td>Contact custom field</td>
    <td>{$participantpayment.$contactCustomField}</td>
  </tr>
  <tr>
    <td>Participant custom field</td>
    <td>{$participantpayment.$ParticipantCustomField}</td>
  </tr>
{/foreach}

```

HTH

Pradeep

---
Tags: civievent, drupal, tokens
---


# Question
Title: Is there a report to export the transfers from CiviCRM to my bank account?
I can see all of the payments that people make, but I would also like a CSV export that includes the transfers from civiCRM to my bank account. Is there a report for that?

# Answer
Amy, Welcome to SE world.

You can use contribution report or contribution search to list all the contribution recorded in CiviCRM based on Payment method used in one of your payment processor. For example if you are using PayPal and have payment method set to Credit card for the paypal payment processor then you can search on payment method in 'Credit card' and then export the results in a csv.

To get the list of payments associated with the contribution(s) you can use Find Payments extension to find the payments for payment method in 'Credit Card' and then export the result into CSV.

HTH

Pradeep
> 2 votes

---
Tags: civireport
---


# Question
Title: Failed to locate template for civicrm.config.php
I'm trying to generate DAO and SQL files, when I run "php ./GenCode.php" in my xml path, I get this error in my console.

```
$ php ./GenCode.php

civicrm_domain.version := 5.1.alpha1

Parsing schema description schema/Schema.xml
Extracting database information
Extracting table information

Fatal error: Uncaught exception 'Exception' with message 'Failed to locate template for civicrm.config.php' in
C:\wamp64\www\drupal\modules\civicrm\CRM\Core\CodeGen\Config.php:35

```

Stack trace:

```
#0 C:\wamp64\www\drupal\modules\civicrm\CRM\Core\CodeGen\Config.php(10): CRM_Core_CodeGen_Config->setupCms()
#1 C:\wamp64\www\drupal\modules\civicrm\CRM\Core\CodeGen\Main.php(115): CRM_Core_CodeGen_Config->run()
#2 C:\wamp64\www\drupal\modules\civicrm\CRM\Core\CodeGen\Main.php(100): CRM_Core_CodeGen_Main->runAllTasks()
#3 C:\wamp64\www\drupal\modules\civicrm\extern\membership\xml\GenCode.php(39): CRM_Core_CodeGen_Main->main()
#4 {main}

```

thrown in C:\wamp64\www\drupal\modules\civicrm\CRM\Core\CodeGen\Config.php on line 35

when I look to the config.php file, it seems correct

```
elseif ($this->config->cms !== 'joomla') {
  $configTemplate = $this->findConfigTemplate($this->config->cms);
  if ($configTemplate) {
    echo "Generating civicrm.config.php\n";
    copy($configTemplate, '../civicrm.config.php');
  }
  else {
    throw new Exception("Failed to locate template for civicrm.config.php");
  }
}

```

but it gives the same error, can you help me please? Thanks Fidi

# Answer
> 1 votes
I had this same problem today. While this may be too late for you, what I found was that somehow, the git repo in `<webroot>/sites/all/modules/civicrm/drupal` was set to the `master` branch and not the `7.x-master` branch. Once I checked out `7.x-master` and did a `git pull` my problem resolved.

---
Tags: drupal
---


# Question
Title: CKEditor does not display when editing event
I just upgraded to civicrm 5.12.0 and the ckeditor is not available when editing an event. It is there when entering a new event. I think we had this problem with the previous version as well.

# Answer
My solution to my own earlier question: WYSIWYG editor not present with WordPress may provide an answer. If this was the cause of your previous problem it would have reverted on an upgrade.

Is CKEditor missing in all circumstances (eg sending an email)?
> 2 votes

---
Tags: ckeditor
---


title: Conditions in profile and membership

text:
# Question
Title: Conditions in profile and membership
I have individual members that can have different criteria for example: Are you an English teacher : checkbox yes / no (if yes :: appears in contribution form): what is your degree?: check boxes: bachelor/master/PhD (if no :: appears in contribution form): what is your level at TOEFL? : free text.

How do I set conditions in forms using WordPress? Our membership for individual (member) is very complex and I don't want the form to be 1000 lines long.

I couldn't find this in the documentation. Any help? regards Guillaume

# Answer
You don't mention which CMS you are using but if Drupal, you might find it easier to do this with a webform.

If you're not on Drupal and want to do this with profiles then take a look at the Profile Conditionals extension
> 2 votes

---
Tags: wordpress, civimember
---


# Question
Title: How can I refresh a custom data tab in the contact summary?
I want to store an email address (or phone or address) in a custom group when they are deleted. So if for contact John Doe the email address john.doe@example.org is deleted, it is stored in the custom group Former Communication Stuff. This works nicely on the pre and post hook but the custom group (which is Tab with table) tab is not refreshed when an email is deleted. And I would want the tab for the custom group refreshed when I delete an email address.

I have seen related questions here, notably Can I update/requery a custom field that got changed via another field on the same page?. However, this solution does not work for this case. I do not see any ID I can use in jQuery on the custom data tab, and if I do try to use one I get an error (just keeps running) either when adding the email again or when deleting the email.

I have one solution, which is to do a location.reload on the inline edit form, but that seems pretty rough. Any suggestions for another solution? And this is a going to be a generic extension, so anything that uses the random ID "#ui-id-17" does not work because the number could be different in many installs?

# Answer
I think you can set something in postProcess hook to reload the tabs possibly below code but not sure, it does work for us when we update something in a form we update the contribution tab using below code

```
$form->ajaxResponse['updateTabs']['#tab_contribute'] = 1;

```

HTH

Pradeep
> 3 votes

# Answer
So to enhance on the answer from Pradeep, here is what I have done:

```
function myextension_civicrm_postProcess($formName, &$form) {
  if ($form instanceof CRM_Contact_Form_Inline_Email) {
    $form->ajaxResponse['updateTabs']['#tab_custom_32'] = 1;
  }
}

```

Where the 32 is the ID of my custom group, so I will obviously change that so it will retrieve the id in the specific environment.
> 2 votes

---
Tags: custom-fields, contact-view, jquery, datatables
---


title: URL Query String - Phone Number

text:
# Question
Title: URL Query String - Phone Number
How can I add a phone number in a URL query string in CiviCRM?

Goal: To bring up all records associated with that number

Thank you,

Laurie

# Answer
> 2 votes
It depends what you mean by "all records", but the custom search called full-text search (under Search - Custom Searches) can be made to run via url like so:

https://dmaster.demo.civicrm.org/civicrm/contact/search/custom?csid=15&text=894-1515&table=Contact&force=1&reset=1

That will bring up the contact with phone 894-1515.

If you want to include activities and such, then leave out the "table=Contact" part.

# Answer
> 1 votes
LAE, You can do this in many ways

1. As suggested by Demerit you can use Full text search and append in url.
2. If you are using Drupal, then you can use Views to create list of contact and then use CONTEXTUAL FILTERS to filter based on arguments from URL

HTH

Pradeep

---
Tags: database, urls
---


# Question
Title: CiviDiscount: How do I disable the automatic member discount for additional participants?
I was disheartened to learn that the automatic discount I created to give members a discount off the conference registration fee applies to other participants the member registers even though they are not members. I think the same goes for if the member isn't registering themselves but someone else--if they are logged in as a member, the discount applies for whoever they are registering, even though they are not members. Does anyone know how to be more restrictive with the discount code so it only applies to the member, and not their plus ones? We are using CiviDiscount 3.3.

# Answer
I don't think CiviDiscount does what you want. If you are on Drupal you could use a webform.
> 2 votes

# Answer
You could use some CSS to display/hide certain rows of your Price Set for only the first participant. This is only partially an answer to your question, in that it will allow a member to only purchase one registration at the discounted price, but that one registration won't be restricted to that member (they could purchase one registration for another individual).

1. Create a Price Set with a checkbox price field (let's call it "Tickets") with two options: First Registration, Additional Registrations.
2. Create your Discount code, applied only to the "First Registration" option.
3. Use that Price Set for your Event and visit the registration page to determine the exact CSS classes of those price field options. Will be something like "Tickets-row1" (or whatever your checkbox price field is).
4. Then add the following styles to the Price Set Pre Help (adjusted to your specific classes):

`<style>
.crm-event-additionalparticipant-form-block .Tickets-row1 {display: none;}
.crm-event-register-form-block .Tickets-row2 {display: none;}
</style>`
> 1 votes

---
Tags: civievent, cividiscount
---


title: POST format for a chained create

text:
# Question
Title: POST format for a chained create
when I try to chain commands in the content body of a POST, the contact is created fine, but the chained address is not created. I am not OK with passing sensitive donor information as parameters in the URI (which is against the HTTP protocol specifications for a valid reason), so I need to figure out what the expected syntax is for body contents:

contact\_type=Individual&first\_name=joe&last\_name=blow&api.Address.create={"location\_type\_id":"Home","street\_address":"123 somewhere st"}

passed in the URI, the above works fine...

in the header I'm specifying Content-Type: application/x-www-form-urlencoded and json=1 in the URI

# Answer
> 2 votes
CiviCRM allows you to send api params in POST by encrypting the params in json. Here is an example on how you can build api params used in REST call

```
http://www.domain.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","api.Address.create":{"location_type_id":"Home","street_address":"123 somewhere st"}}

```

You can use api explorer to build your params.

Thanks

Pradeep

# Answer
> 2 votes
@pfigel in chat.civicrm.org responded that this is possibly a problem with encoding. This works for him:

```
curl -X POST 'http://civicrm.example.com/sites/all/modules/civicrm/extern/rest.php' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' --data 'api_key=hunter2&key=hunter2&entity=Contact&action=create&json=%7B%22contact_type%22%3A%22Individual%22%2C%22first_name%22%3A%22John%22%2C%22last_name%22%3A%22Doe%22%2C%22api.Address.create%22%3A%7B%22location_type_id%22%3A%22Home%22%2C%22street_address%22%3A%22Main+Street%22%7D%7D'

```

---
Tags: api, rest
---


title: Cron job has started producing output

text:
# Question
Title: Cron job has started producing output
I have a cron job

/www/www/job.execute.sh

That runs the civiCRM scheduled tasks:

```
#!/bin/sh
drush -r /home/crwheelmen/www/www --quiet civicrm-api job.execute

```

This has been running successfully without any output for months. Now it has started producing this output:

```
Array
(
[is_error] => 0
[version] => 3
[count] => 1
[values] => 1
)

```

which has the effect of sending me an email with this content every hour. AFAIK, I did nothing to cause this, but it is very annoying. Do you know why this has started happening?

# Answer
> 4 votes
Not sure why it's suddenly started producing output when it didn't previously, but you could use:

```
#!/bin/sh
a=`drush -r /home/crwheelmen/www/www --quiet civicrm-api job.execute`
if echo $a | grep -qv '\[is_error\] => 0'; then echo $a; fi

```

(capture the output of drush to variable `a` then check whether `is_error` is 0. If it is, do nothing otherwise show the output)

---
Tags: cron, drush
---


# Question
Title: Weird issue when upgrading to 5.12 - errors re deleting a payment processor type
I don't know why it would want to delete a payment processor type, but it did. I ended up clearing the civicrm cache again and running the upgrade again - this time with no issue.

# Answer
> 4 votes
The recent civi upgrade tries to disable some obsolete extensions during the process. This functionality was added in https://github.com/civicrm/civicrm-core/pull/13298

And from the comment posted at https://github.com/civicrm/civicrm-core/pull/13298#issuecomment-462961558, it seem it do provides a list of extensions that will be disabled.

The above error seems to be triggered when an extension related to payment processor type is disabled which in turn tries to remove the payment processor type attached to it.

Not completely sure, but this is what it seems from the backtrace shown.

UPDATE -it looks like there are 4 noted extensions which are checked by the above PR during the upgrade process.

`uk.squiffle.kam`, `com.aghstrategies.slicknav`, `de.systopia.recentitems`, and `com.ixiam.modules.quicksearch`.

If any of the extension is present on the site, it will try to disable them which throws the error on upgrade.

Note that none of these extensions are related to any payment processor.

So, it must be something in your DB which mismatches with the expected values resulting into this error. Would recommend disabling these extensions manually before starting an upgrade process.

# Answer
> 1 votes
I had a similar experience. Flushing cache didn't do it for me (I tried 'cv flush', too). Found this: https://github.com/ixiam/com.ixiam.payment.redsys/issues/24 and tried deleting the payment processor records in table civicrm\_managed. Upgrade went ok after that. The records were for the iATS payment processor, which I had recently tested but am not actively using. It looks like they were recreated after the upgrade.

---
Tags: upgrade
---


# Question
Title: API v3 get multiple results for one field
I have a custom field that can be inserted multiple times in a contact. I'm trying to get the right syntax for the API to display an array with the different results.

Here what I'm trying: `civicrm/extern/rest.php?entity=Contact&action=get&api_key=userkey&key=sitekey&json={"sequential":1,"return":"custom_40","id":900}`

I thought that "sequential" would give multiple results but it's showing only one

{

```
"is_error": 0,
"version": 3,
"count": 1,
"id": 900,
"values": [
    {
        "contact_id": "900",
        "civicrm_value_fellowships_3_id": "305",
        "custom_40": "2007-06-30 00:00:00",
        "id": "900"
    }
]

```

}

# Answer
> 1 votes
Contact API sends one result per contact. In case if you want to retrieve all custom field value(multiple) of a contact than you need to use CustomValue api. Snippet for reference

REST:

```
http://localhost/drupal7/sites/all/modules/civicrm/extern/rest.php?entity=CustomValue&action=get&api_key=userkey&key=sitekey&json={"sequential":1,"return":"custom_81,custom_80","entity_id":296,"entityType":"contact"}

```

PHP

```
$result = civicrm_api3('CustomValue', 'get', [
  'sequential' => 1,
  'return' => ["custom_81", "custom_80"],
  'entity_id' => 296,
  'entityType' => "contact",
]);

```

entity\_id = contact id

return = custom fields

HTH

Pradeep

---
Tags: api
---


# Question
Title: How to setup CiviCRM to proper send authenticated (DKIM) emails?
i want to make sure that all emails send out through CiviCRM have the proper authentication (DKIM). Currently I use (ticket@yogamela.org) as email from address for online event registrations. The same email I created also as mailbox in CiviCRM. But tests show, that the mail is sent with wrong DKIM signature. How to configure it in the right way? Is CiviCRM using the mailbox i configured for sending out the email if the email address is the same, or do i need to change anything else?

Mails send directly through using webmail have the proper DKIM signature.

Here the test result if the mail is send through Event Registration in CiviCRM:
https://www.mail-tester.com/test-fp3hn&reloaded=1

Could it be that i have the same problem like described here: CiviMail DKIM signature failure

Or did i just set it up wrong?

UPDATE:

For now i try to setup one authenticated email. Later i may want to add more. In case so can I add them all as Outbount Mails? Sitegound provides both email hosting and server hosting.

As suggested I setup now an new Outbount Mail using SMTP: Administer --\> Settings - Outbound Mail

ssl://c15801.sgvps.net (i tried also without ssl://)

465 (i tried also 25 without ssl:// and authentication: no)

Authentication? Yes

ticket@yogamela.org

Then this error comes after clicking save and test:

The site administrator needs to enter a valid 'FROM Email Address' in Administer CiviCRM » Communications » FROM Email Addresses. The email address used may need to be a valid mail account with your email service provider.

In the FROM Email Addresses I just entered ticket@yogamela.org.

Is my smtp server setup wrong, or my FROM email setup? The email address / password is a valid email with sitegound the port and server (without the ssl:// part) is what siteground recommended to use.

# Answer
> 3 votes
> Is CiviCRM using the mailbox i configured for sending out the email if the email address is the same, or do i need to change anything else

For outbound mail, CiviCRM uses whatever you have configured at **Administer \> System Settings \> Outbound Email (SMTP/Sendmail)**. How do you have that configured?

From a quick look at the source code of the email you linked to, my best guess is that you have it set up with the `mail()` option, which is likely not going to handle dkim (though that does depend on your webserver set up). If you have SMTP details for tickets@yogamela.org you could choose SMTP option there, add your details and then your SMTP server will then take care of DKIM.

Choosing SMTP and adding your details is likely the simplest route if you want to just get it working. That said, there are a few different ways that outbound mail can be configured so it is hard to give the best advice without knowing a bit more about your set up. Answers to questions like:

* Who provides your email?
* Do you want to email from multiple addresses or just tickets@yogamela.org?

would help provide a better answer.

Depending on your email provider, the SMTP details you have may allow you to send email from any email that ends @yogamela.org. Otherwise, if you want send email from lots of different email addresses ending @yogamela.org, you might want to look at a third party provider like Sparkpost or Sendgrid.

UPDATE:

That error message you pasted is a a bit wrong. The text does not match with the link. The text references FROM Email Addresses (`civicrm/admin/options/from_email_address?reset=1`) but the link you shared points at `/civicrm/admin/domain?action=update&reset=1`. What do you have set in `/civicrm/admin/domain`? (see picture below). Try adding tickets@yogamela.org there.

I suspect it will then work.

---
Tags: civievent, email
---


title: Profiles in iframe

text:
# Question
Title: Profiles in iframe
I am trying to include a subscription form (civicrm profile) in a static html using an iframe. Using '&snippet=1' in the url I can remove all the irrelevant page parts.

Works good when loading and submitting except when there is an error: then the page reloads without the '&snippet=1' and so the full page of civicrm site is loaded ...

Is there any way to force the 'snippet=1' part or should I look at making a second site with a shared civicrm db to do this. I need the crm site to work properly and to have a theme but I could add a second site with a stripped theme.

Thank you!

# Answer
Sorry, I foundout: HTML snippets are available in profiles if you enable external profiles only (System settings \> Misc...). Will give that a try. Not really an answer to the initial question but will probably be good enough.
> 1 votes

---
Tags: profile
---


# Question
Title: How Do I Get a CiviCRM Report to be an attachment in a schedule job to email to a colleague?
I have created some reports for our membership director and have set up scheduled jobs to email those reports on the first day of each month.

I tested them out but got lines of code and then the report was embedded in the body of the email. I'd prefer to have the reports as attachments in PDF or csv format.

How do we set this up?

Our site is on WordPress.

# Answer
> 2 votes
One of the scheduled job parameters is "format". See https://docs.civicrm.org/user/en/latest/initial-set-up/scheduled-jobs/#job\_mail\_report

---
Tags: wordpress, reports, pdf, scheduled-job
---


# Question
Title: How to patch / add a plugin to Joomla CiviCRM?
We have the CiviCRM Admin Bar showing up on the Front-End of our site and I've found a possible solution/patch, 'https://github.com/civicrm/civicrm-core/pull/13820, but I don't know how to install the patch. I've downloaded the .zip of the patch from github. Now what do I need to do to get it installed on our site? Thanks in advance for any assistance you can provide.

# Answer
Aidan's answer is a good one in your case! However, the general process is this:

### If you have command-line access to the server running CiviCRM

### If you can edit files on the server but don't have command-line access

* Find the URL of the patch. As you note, in this case it's https://github.com/civicrm/civicrm-core/pull/13820.
* Click on the "Files Changed" tab.
* Note how many files have changed (see screenshot). In this case, it's just one.
* Note the name of the file that's changed (see screenshot). In this case, it's `CRM/Core/Resources.php`.
* **Make a backup** of the file that you're going to change!
* Remove the lines in red on the left side, replacing them with the lines in green on the right side. Use the line numbers to make sure you're changing the right lines!
* Save the file.
> 1 votes

# Answer
What version are you on now? That patch is in 5.12.0 so your easiest option may be to upgrade to that version.
> 3 votes

---
Tags: menu, admin
---


title: Drush sql-sync and civicrm issue

text:
# Question
Title: Drush sql-sync and civicrm issue
I wanted to quickly pull all the data (contacts, custom types, etc) from one Drupal CiviCRM install to another.

I got a little too clever for myself and used `Drush sql-sync` to do it. It failed. As I was in a hurry and it seemed to be a permissions issue I re-ran the import as the DB root. This worked, and the site appears to work fine. However, `Drush sql-sync` now always fails when I try to pull from live to staging or to dev servers.

After much digging I realised the original sql query included a number of triggers related to the user of the copied website, eg:

```
 1156 DELIMITER ;;
 1157 /*!50003 CREATE*/ /*!50017 DEFINER=`source_user`@`localhost`*/ /*!50003 TRIGGER civicrm_activity_before_insert before insert ON civicrm_activity FOR EACH ROW BEGIN
 1158 SET NEW.created_date = CURRENT_TIMESTAMP;
 1159  END */;;

```

I assume I want to change these entries, is there a "safe" way to go about that?

Is the presence of these bad for the site?

The `source_user` has no grants on the new site.

There are at least 60 or so references to the database user in civiCRM related triggers and definitions.

As an aside, Why does civi need to do this when there is a settings file?

# Answer
> 3 votes
In stead of using drush for this, I use the "mysqldump --skip-triggers"command exactly for that reason:

```
mysqldump --skip-triggers -u db_user -pdb_password db > export.sql

```

# Answer
> 3 votes
Civicrm utilises sql triggers for a number of purposes - including but not limited to populating values into the log\_civicrm\_% tables - if you have logging turned on under Admin -\> System Settings -\> Misc

You can't alter triggers. Easiest to dump the database then strip out triggers using the following perl

```
perl -pi -e 's#\/\*\!5001[7|3].*?`[^\*]*\*\/##g' /path/to/mysqldump.sql

```

by way of Jon G and Chris Burgess on Why do I get "Access denied; you need (at least one of) the SUPER privilege(s) for this operation" when importing a SQL dump to CiviCRM?

after you import Civicrm will rebuild triggers as needed.

---
Tags: drupal, mysql, drush
---


# Question
Title: CiviCRM 5.12.0 - Case API returning an Analyzer object containing XML and JSON. Only want JSON
I had a working script set up to create cases in CiviCRM using REST.
https://domain.com/administrator/components/com\_civicrm/civicrm/extern/rest.php?entity=Case&action=create&json=1&version=3&key=xxxxxxxx&api\_key=yyyyyyy
(obviously with the correct payload etc). This worked fine. It returned the specified return:id etc in a nice small JSON. Now, the same script is failing because it can't parse the returned JSON. It seems that the API is now returning a Civi\CCase\Analyzer Object which contains the full case data as XML and as JSON. Is this change intentional? Is it documented anywhere? I'm wondering how to extract the JSON from the returned Analyzer object. Thanks.

# Answer
> 1 votes
Not a direct answer, but following on from the comments here are some more things you can try.

1. If you haven't already, check the civicrm log. Maybe there is something helpful there. For example maybe there is a recoverable error happening but it dumps some output to stdout instead of the log, which during a REST call will be part of the response output.
2. It's possible you have some code or an extension that implements the civicrm\_caseChange hook and then does some debug output. When looking or grepping be sure to look in any custom php and extension folders defined at admin -\> system settings -\> directories.
3. Use `diff -r` or `kdiff` or something to compare your civicrm tree to a fresh unzipped 5.12 download to see if there's any differences.
4. It's definitely print\_r output, but it might be coming indirectly from something that calls 'CRM\_Core\_Error::debug(' or 'CRM\_Core\_Error::debug\_var(', so can try grepping for that. Note I've included the opening bracket in the search string since I'm thinking that will give the least false matches.
5. Try disabling some extensions one by one.
6. Run a php step-debugger to see exactly what step it gets output and where it's coming from. This will be time consuming, but you will almost certainly find it. If you can reproduce the problem on a local development copy of the site it will be slightly easier to set this up using that copy.

---
Tags: api, civicase, rest
---


title: Civicrm_financial_trxn missing trxn_id

text:
# Question
Title: Civicrm_financial_trxn missing trxn_id
I only now noticed that trxn\_id was NULL for a number of rows on a particular date, for payment transactions in civicrm\_financial\_trxn. The schema/table def. shows that trxn\_id cannot be null in civicrm\_financial\_trxn, and as expected, is set to auto-increment - what could account for those null IDs? I don't have root access so cannot see mysql log from that date. Total\_amount is \> 0, status\_id = 1, datetime stamps are there, the rows were written, but trxn\_id is NULL btwn ~ 14:00 and 21:00 on that date.

# Answer
Lesley, I think you are confused with civicrm\_financial\_trxn.id v/s civicrm\_financial\_trxn.trxn\_id field.

id is a primary Auto-increment integer field and cannot be null. However trxn\_id hold transaction id received from payment processor or manually entered through CiviCRM form and can be NULL since for payments taken as for eg cash won't have transactions id.

There can be various reasons why a payment won't have transactions id. Payments taken from payment processor should have trxn\_id, you can fire an sql query to find if any payment processor payments has missing transaction id

```
SELECT id, trxn_id FROM civicrm_financial_trxn WHERE payment_processor_id IS NOT NULL AND is_payment = 1;

```

Cheers

Pradeep
> 1 votes

---
Tags: civievent
---


title: sparkpost email config

text:
# Question
Title: sparkpost email config
Trying to set up Sparkpost for Civicrm 5.12.0 / WP 5.1.1 / php 7.2

I was trying the cividesk extension but I'm on the EU server and can't figure out the fiddling needed to access that just yet.

So I've tried setting up smtp. I've configured Admin \> Settings \> Outbound mail and got a confirmation note from Sparkpost that it works. However, that test email hasn't been subsequently sent - Sparkpost has it as 'accepted' but not gone anywhere.

As advised by Sparkmail - I've set up mail.digilocal.org.uk as my mail subdomain. The sending DNS checks have been verified (DKIM / bounces).

I've tried sending a bulk email (just to myself but using a test group) with the following bounce report:

> authentication failure \[SMTP: Invalid response code received from SMTP server while sending email. This is often caused by a misconfiguration in Outbound Email settings. Please verify the settings at Administer CiviCRM \>\> Global Settings \>\> Outbound Ema

I have a FROM email address mail@mail.digilocal.org.uk and have set up a mailbox on my domain with that address. I've also set it up as the default bounce address (which is I guess how I'm getting the report).

I've got two other installations of civicrm working and not had these issues. Not quite sure what's so different with this domain.

# Answer
closing as I think the problem is in CiviCRM - sending test mailing works, whenever I send a full scheduled run it falls over and bounces everything. So the error is in CiviCRM (or my config of it) rather than SparkPost.
> 0 votes

---
Tags: civimail, sparkpost
---


# Question
Title: How can I include Employer in display name?
I have tried this but doesn't work. Can anyone suggest a correct token format please? Thanks

```
{contact.first_name}{ }{contact.last_name}{ }{contact.current_employer}

```

# Answer
> 1 votes
Tapash,

Unfortunately current\_employer doesn't work for display even though the code is meant to handle.

Solution:

1. Submit a PR to handle for current employer.
2. Use pre hook to alter the display name just before it is written into the database.

HTH

Pradeep

---
Tags: tokens, settings, display
---


# Question
Title: how to write PHP Unit test for an entity using hooks
I am to write a unit test for a simple extension using hooks with postprocess and formbuild. How can I do it? Please provide some example.

# Answer
An example is in `tests/phpunit/CRM/Contribute/Form/Task/PDFLetterCommonTest.php`, testing that `hook_civicrm_tokenValues` works correctly on PDF letters.

You write a function using the hook, but you can name it whatever you want. Then you call $this-\>hookClass-\>setHook, specifying the function name.
> 1 votes

---
Tags: testing
---


title: PayPal Multiple IPN Setup in Civicrm

text:
# Question
Title: PayPal Multiple IPN Setup in Civicrm
A nonprofit entity introduces other nonprofits for social awareness.

Nonprofit entity is willing to use Civicrm in a way that their member Nonprofits can setup their donation pages with their own PayPal IPN/Account for Donation collection. This way the donation will go directly to respect nonprofit.

Is this scenario possible to setup Multiple PayPal IPN/URL for each nonprofit member to collect the donation?

Thank you kindly and please advise.

Rizwan Ashraf

# Answer
Its possible to have payment processor of same type i.e it is possible to have more than one paypal payment processor in CiviCRM. You need to make sure you include correct payment processor on contribution or event page and also configure paypal ipn on each paypal account correctly.

https://docs.civicrm.org/sysadmin/en/latest/setup/payment-processors/paypal-standard#assign-this-processor-to-your-contribution-or-event-registration-pages

https://docs.civicrm.org/sysadmin/en/latest/setup/payment-processors/paypal-pro#assign-this-processor-to-your-contribution-or-event-registration-pages
> 3 votes

---
Tags: civicontribute
---


title: WordPress CiviCRM Map Contacts

text:
# Question
Title: WordPress CiviCRM Map Contacts
WordPress v5.1.1 - CiviCRM v5.10.4 Trying to display a map of my Contacts. Created SmartGroup of all Current Members. Click Map Contacts from SmartGroup. Only displays myself on the map. Created Google API Key and set up billing (worried as I don't know how much this costs but says I get a $200 credit/mth).

Any help would be appreciated including whether or not I need this Google API to get the geocoding done!

# Answer
Google stopped offering a free access to Map API back in June 2018 - for most organizations - the 200 credit is sufficient - click here for examples. I believe the cost of the Geocoding API is $5.00 per 1,000 calls.

The disclaimers on the github regarding nominatim.osm.org are likely why you don't see this in core. Many extensions like these are normally found via the web extension directory.
> 1 votes

# Answer
What ended up working was that I manually installed the OSM Extension which IS NOT in the Extensions Directory (built in) and located here:

https://github.com/bjendres/de.systopia.osm

Crazy that a) the OSM Extension is not a STANDARD and BUILT IN Extension; and b) that the Google API does not work.
> 0 votes

---
Tags: wordpress, geocoding
---


title: Override automatic geocoding for events

text:
# Question
Title: Override automatic geocoding for events
How can i override or update the coordinates for an address on an event that isn't displaying correctly. Seems like the option in wordpress for Override automatic geocoding is missing in drupal - or maybe its elsewhere?

Thanks!

Drupal 7, Civi 5.12

# Answer
The Latitude, Longitude fields are only visible when they are enable in 'Address Editing'. To enable it navigate to Administer \>\> Localization \>\> Address settings. Check for 'Address Editing' option. Check box for Latitude, Longitude option and save the settings.

HTH

Pradeep
> 4 votes

---
Tags: civievent, geocoding
---


title: Mosaico extension uses

text:
# Question
Title: Mosaico extension uses
Is anyone using Mosaico for designing a newsletter? Is it easy to use? Can you send a newsletter directly through mass mail? I would appreciate any comments. Thank you.

# Answer
Welcome to Stack Exchange OSRT! Yes, you can use Mosaico for designing newsletters. Whether it is easy to use is a matter of opinion, but probably most would agree it's pretty straightforward. You create your newsletter within CiviCRM using the Mosaico extension and then send it out from there.

The main CiviCRM demo sites are not using that extension, but you can watch a quick demo of Mosaico itself and try it on the Mosaico site. Note that the way Mosaico is used within Civi is slightly different but the basic use is the same.

You will also need to configure your system to send email.
> 2 votes

---
Tags: extension
---


# Question
Title: How to get a data for a perticular logged in user ( through API)?
I gave an ACL role to users for data segregation. I want to fetch data from database but data must filter i.e. ACL. How to get data. Also I want a userkey and sitekey?

# Answer
In that case you will need to send api key of the logged in user who access is limited by ACL (also check\_permission = 1 in api params).
> 2 votes

---
Tags: api, extension, php
---


# Question
Title: Is there an update to AuthorizeNet.php with SHA-512 to replace MD5 check?
Is there an SHA-512 replacement for the AuthorizeNet.php module yet? If not I can work on it

# Answer
Lesley, CiviCRM 5.11.0 doesn't use anymore MD5 check on authorize.net. This PR removes the check. However there is still not PR submitted by anyone to support SHA-512 check.

If you can submit a PR to support this would be very useful to the community.

Cheers

Pradeep
> 2 votes

---
Tags: civicontribute
---


# Question
Title: Why is date_created field is ignored for Contact creation via API?
when I attempt to import historical data to seed the CRM, created\_date is ignored and today's date/time is used instead. Using the API explorer, it looks like the date should be saved, but, when I do a subsequent get, it has today's date:

https://somewhere.com/sites/all/modules/civicrm/extern/rest.php?entity=Contact&action=create&api\_key=userkey&key=sitekey&json={"contact\_type":"Individual","created\_date":"2018-01-01","first\_name":"Peteww"}

returns: {

```
"is_error": 0,
"version": 3,
"count": 1,
"id": 288,
"values": {
    "288": {
        "id": "288",
        "contact_type": "Individual",
        "contact_sub_type": "",
        "do_not_email": "",
        "do_not_phone": "",
        "do_not_mail": "",
        "do_not_sms": "",
        "do_not_trade": "",
        "is_opt_out": "",
        "legal_identifier": "",
        "external_identifier": "",
        "sort_name": "Peteww",
        "display_name": "Peteww",
        "nick_name": "",
        "legal_name": "",
        "image_URL": "",
        "preferred_communication_method": "",
        "preferred_language": "en_CA",
        "preferred_mail_format": "",
        "hash": "74c74a58f64681a6e3a4f8d9ccd32bfd",
        "api_key": "",
        "first_name": "Peteww",
        "middle_name": "",
        "last_name": "",
        "prefix_id": "",
        "suffix_id": "",
        "formal_title": "",
        "communication_style_id": "1",
        "email_greeting_id": "1",
        "email_greeting_custom": "",
        "email_greeting_display": "",
        "postal_greeting_id": "1",
        "postal_greeting_custom": "",
        "postal_greeting_display": "",
        "addressee_id": "1",
        "addressee_custom": "",
        "addressee_display": "",
        "job_title": "",
        "gender_id": "",
        "birth_date": "",
        "is_deceased": "",
        "deceased_date": "",
        "household_name": "",
        "primary_contact_id": "",
        "organization_name": "",
        "sic_code": "",
        "user_unique_id": "",
        "created_date": "20180101000000",
        "modified_date": ""
    }
}

```

}

but when I do:

https://somewhere.com/sites/all/modules/civicrm/extern/rest.php?entity=Contact&action=get&api\_key=userkey&key=sitekey&json={"sequential":1,"return":"created\_date","id":288}

I get: {

```
"is_error": 0,
"version": 3,
"count": 1,
"id": 288,
"values": [
    {
        "contact_id": "288",
        "created_date": "2019-04-15 18:00:01",
        "id": "288"
    }
]

```

}

# Answer
> 4 votes
Mike,

Unfortunately you can't set created\_date in create api of Contact since there is a trigger which will over-ride your created\_date value

```
DELIMITER $$
CREATE TRIGGER `civicrm_contact_before_insert` BEFORE INSERT ON `civicrm_contact` FOR EACH ROW BEGIN
SET NEW.created_date = CURRENT_TIMESTAMP;
 END
$$
DELIMITER ;

```

Either you can delete this trigger or update the contact using same api by passing contact id to set created\_date after its been created

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

https://somewhere.com/sites/all/modules/civicrm/extern/rest.php?entity=Contact&action=create&api_key=userkey&key=sitekey&json={"id":"288","created_date":"2018-01-01"}

```

Thanks

---
Tags: api
---


# Question
Title: How can I create a new type of block in Mosaico?
The Mosaico CiviCRM Integration extension includes a base template that provides several different types of blocks to use in composing emails.

I need a type of block that's not included in that base template. My block type would contain a name (editable text) on the left, a signature (uploadable image) below the name, and a logo (uploadable image) to the right.

How can I create this custom block type, and make it available in my templates?

# Answer
> 5 votes
I believe you can use hook\_civicrm\_mosaicoBaseTemplates() hook to create your own new mosaico block template definition (alternative to versafix-1).

Documentation on how you can use this hook can be found here.

HTH

Pradeep

---
Tags: email, mosaico
---


# Question
Title: When a Case is set to Closed we would like all un-Completed Activities on the Case to have their Status changed (eg to Cancelled
anyone have a working model of this. we thought about drupal/civi rules but may just add in an extension.

seems to us that it could be quite a generic solution, after all, when a Case is Closed you don't want to keep finding Activities that may be eg Scheduled

# Answer
I would hook on https://docs.civicrm.org/dev/en/latest/hooks/hook\_civicrm\_post/ to find cases being closed then do the work from there. I would follow the civicrm\_option\_value grouping field to determine if a status represents closed.

This seems like an opportunity for a nice small single purpose extension. Maybe 3-4h to develop and publish.
> 1 votes

---
Tags: civicase, activities
---


# Question
Title: How do I set up discount for people under 18 for CiviEvent?
Drupal 7.39
Civi version 4.6.7

Using CiviDiscount 3.1 to add Automatic Discount to an event for folks under 18.

In researching, I saw a PR referenced, that seems to address the issue, but it still doesn't work for me on two different sites. I applied the patch but it doesn't seem to do anything.

Perhaps I'm misunderstanding the Auto Discount section, but in our use case, folks registering are more often than not, new unknown contacts as they register. Do the contacts have to be logged on and/or known users for Auto Discount to work properly?

On the registration pages, we are including DOB.

However, regardless of whether we hit apply in the blank code area, the discount is not taken.

If we manually enter the code and hit apply, it works. But seems to disregard the age criteria. If I am over 18 and have entered the code, I still get the discount.

Our discount configuration looks like this:

So the two issues I'm experiencing are:

* The discount does not apply without the code
* The discount criteria seems to be ignored and applies the discount to anyone

# Answer
In the end, I was not able to get this to work.
> 0 votes

# Answer
> Do the contacts have to be logged on and/or known users for Auto Discount to work properly?

Yes I believe this is the case.
> 1 votes

---
Tags: civievent, drupal, cividiscount
---


title: Get civiMail report by API

text:
# Question
Title: Get civiMail report by API
I'm trying to get Report data about a Sent email through the API. I can see the report at:

`www.example.com/civicrm/mailing/report?mid=388&reset=1`

And I can get data corresponding to the email from the API explorer as follows:

But I can't seem to access the civiMail report with the API. I have tried a few options but can't seem to find it. Any tips?

# Answer
I think you're looking for the `ReportTemplate.getrows` API call. You can see examples of its use in the API explorer's built-in help (also available on Github). More examples exist in the tests folder, since the most common use of this API is to create tests for reports.

UPDATE: As @demerit points out, this answer isn't really correct - but it CAN be :) All(?) of the info on this mailing report is also available from the "Mailing Summary" report (for the stats) and the "Mailing Detail" report (if you need drilled-down data on click-throughs etc.). So I recommend Demerit's answer if you're writing an extension, but my answer if you need to collect this data over REST.
> 2 votes

# Answer
You might have to do something like this: https://github.com/civicrm/civicrm-core/blob/master/CRM/Mailing/Page/Report.php#L107-L110

For the $this variable, you can probably use a dummy, e.g. `$page = new CRM_Mailing_Page_Report();
$page->_mailing_id = 388; // or whatever number
$report = CRM_Mailing_BAO_Mailing::report($page->_mailing_id);
CRM_Mailing_BAO_Mailing::getMailingContent($report, $page);`

Lower down it assigns $report to the smarty template, and you can see how it's used at https://github.com/civicrm/civicrm-core/blob/master/templates/CRM/Mailing/Page/Report.tpl, so you should be able to do the same thing in php, accessing the member elements of $report.
> 1 votes

---
Tags: civimail, api, reports
---


# Question
Title: Civicrm permissions for different departments
can anyone advise if civicrm supports permissions at department level for a business. So that all departments have access to create/edit an event within their department. They don't have access to events created in other departments? I am referring to Manageing the events for departments not signing up to events.

Can the roles be configured to allow this somehow?

Thanks for any help

# Answer
> 1 votes
We have recently worked on an extension for a sports club association which means each club has officers who can create/edit events which are linked to that club, but not to other ones. It is not ready for publishing yet but will be something we will do if we think it can be made generic enough.

If you want to discuss them may be better to open a channel in https://chat.civicrm.org/civicrm/

I am doing some digging to check what the scenarios are that it caters for and which it doesn't and what it might require to make it generic.

---
Tags: permissions
---


# Question
Title: Trouble authorizing agileware.civiquickbooks
I have been trying to connect CiviCRM and QuickBooks Online using the extension from Agilware. I have followed the instructions (I think) but can't get past the authorization. I have entered the production keys on the settings page, but when I click AUTHORIZE, I get the error message (from QuickBooks) "We're sorry! We're experiencing some problems. Please try again later."

Has anyone else encountered this issue? I found other people getting this message (while connecting other apps) and I wonder if my issue is the redirect URI, but it doesn't say anything about this in the instructions from Agilware. Any help is greatly appreciated.

Steve

# Answer
I see Steve did open an issue on their github at https://github.com/agileware/au.com.agileware.civiquickbooks/issues/3 which is now set as Closed with the response from the developers

> (AgileWare) have tested this using Australian QBO users - it works fine. This extension uses the QBO API to connect to the QBO services, I'm not aware of any specific reason as to why it "would not work in the US" - it should work
> 1 votes

---
Tags: extension, accounting
---


# Question
Title: Confirmation email - providing a WYSIWYG so users can add HTML-ified content?
How do you go about having HTML in your confirmation email? I don't mean the part that you can edit under Message Templates. I mean the part that you can customized on each event's "Online Registration" tab. It shows as just a plain text box. I need to be able to add some html in that field so that there are some bolded headers in there.

I've included a screenshot of the spot that I mean.

Thanks!

EDIT: I mean a WYSIWYG editor like pretty much every other email box within CiviCRM has. Not hand coding since most people have no idea how to code HTML.

UPDATE: Ok, so I hit another snag on this. On the event's settings page for the confirmation email, I can manually input html. That's not great since the people using it don't know HTML, which means I have to do all the changes. But now I've found a second part of the problem - that same text is copied into the field when a registration is manually entered by an admin or where they finish a registration (like taking a payment over the phone and then marking an incomplete registration as complete). However, that field can't have HTML in it. Any text there gets sent out as plain text, even though the email it is inserted to is HTML. So people see the html written out for that section instead of it being in HTML.

# Answer
> 1 votes
You can put basic HTML in the text box you have pictured above. **Bold** works for email clients. The majority of email clients don't support every type of HTML content you see on the web. Web browsers are able to display scripts, animations, and complex navigation menus, while your typical email inbox isn't built to handle this type of content.

Safe to use for most email clients: static, table-based layouts

HTML tables and nested tables

template width of 600px-800px

simple, inline CSS

web-safe fonts

# Answer
> 0 votes
Can you check this PR for the patch https://github.com/civicrm/civicrm-core/pull/13976

---
Tags: civievent, html
---


title: Caldera Forms and Smart Groups

text:
# Question
Title: Caldera Forms and Smart Groups
I want to have a newsletter signup form that has a dropdown field that a non-signed in user can select from. I want their selection to assign them to a smart group for later use in bulk mailings. What's the best way to accomplish this?

# Answer
> 3 votes
Jsgoti, Welcome to CiviCRM SE. You definitely achieve this using Caldera module. All you have to do is

1 - Create a form with First Name, Last Name and Email field and also drop down in Caldera form.

2 - Click on Processor tab.

3 - Add a new processor of type 'CiviCRM Group'.

4. Then configure the settings to link contact to group
5. Add condition by clicking condition tab to add to group based on selection.

HTH

Pradeep

---
Tags: wordpress, smartgroups, caldera-forms
---


title: Find contacts on CiviCRM

text:
# Question
Title: Find contacts on CiviCRM
Good morning,

Every time I search for a contact, which I know is on our database, I get the message 'No contact found'.

Please can you advise?

Many thanks

Kind regards

Myriam Barker

# Answer
> 3 votes
(Adding this answer based on Comment by Myriam)

This could be a Permission issue. If the contact is in the db but you do not have permission to see them then you won't see any results.

Ways to confirm this would be use the QuickSearch and just hit ENTER (or type % and hit Enter if the former has no effect), do you see all the results of contacts, ie your complete list.

If you do and you still do not find them, then you may also need to search in Trash

If you only see a subset of your contacts then there could be some ACL that is restricting which contacts you can see

If you only see your record, then it is likely to be civicrm Permissions which are set by your CMS

# Answer
> 1 votes
If you are using the contact search in the upper right corner, be sure that the correct radio select is checked. For example, if you are searching for Judy, be sure that Name/Email. Or searching Chicago, be sure that City is checked.

# Answer
> 0 votes
How are you doing your search? What are you searching for?

For instance, I often use the quick search box in the top left. I may be searching based on their ID, but have the name/email option selected.

Or I search on a name and do it wrong. For instance, to look up Judy Smith, you would type in: Smith, Judy

# Answer
> 0 votes
Similar to Jenni's comments, and I also suspect that you are using search incorrectly. To use her example, if you put in "Judy Smith" it would not find her. Have you tried part of the name: "judy" or "smith" both of which should work. That works for either the quick search box or "Find Contacts".

The more information you give, the more likely people will be able to help.

# Answer
> 0 votes
I had a similar problem a few days ago. And the contact I was looking for was me. So I knew I was there.

it might be a caching issue locally or at server level.

If you can clear the civicrm cache sitename/civicrm/clearcache

Clear cache in the content management system

and finally clear browser cache locally

One of those sorted it for me.

---
Tags: contacts
---


# Question
Title: Add multiple target contacts in advanced search
I'm looking to send a mailing out to a subset of our contacts - those that have a relationship 'member of' and then Target Contact ' Group 1, Group 8, Group 12 etc' I'm creating a Smart Group to do this but had hoped that I could add more than one value in the 'Target Contact' field before running the Search but apparently not. They appear to need to be done one at a time which is a very time-consuming process if there are say forty groups that need to go into the smart group. I tired comma separation but it didn't work. Any ideas?

# Answer
I'm assuming your using Adcanced search to build this

You could try adding your targets ' Group 1, Group 8, Group 12 etc'

Into just a standard static group.

Then Advanced search group="new group"

Display results as- switch to related contacts "relationship type=member of"

Does that get you closer?
> 1 votes

# Answer
Try the Search Builder, this should let you do the required set of sub-searches
> 0 votes

---
Tags: advanced-search
---


# Question
Title: Change the root directory D8 [docroot > web]
I encounter lot of issues with CiviCRM on a Drupal 8 production site :

When sending a mailing there is : \- No tracking of opened mail \- No indication of click through There is another issue with the cron that doesn't run.

The issue might concern the root directory D8 that is the non standard **docroot** instead of the **web** directory. This can be a direction for this issue as the installation roundearth of David Snopek's. It is based (or used to be) on the **web** directory

What is the best practice to move the root directory ?

# Answer
Drupal itself doesn't care about its folder name (at least, not that I've found). CiviCRM cares, and so does Composer.

* When you rename your folder, find the `installer-paths` section in `composer.json` (in the webroot) and change `docroot` to `web` there.
* You'll also need to change all instances of `docroot` in civicrm.settings.php.
* Rebuild your Drupal cache and flush Civi caches as well.
* If you have absolute paths (that is, not using tokens like `[cms.root]`) in Civi's `Administer » System Settings » Directories` or `Administer » System Settings » Resource URLs` menus, change those too.
* Of course, don't forget to change your web server configuration :)
> 2 votes

---
Tags: civimail, drupal-8
---


# Question
Title: Unable to access volunteer functionality
With Drupal 7.64 CiviCRM version 5.10.4 & civivolunteer version 4.7.31-2.3.1 Created a new event. Under the Volunteer tab in event configuration, there are three buttons Log Volunteer Hours button is working and other two buttons Define Volunteer Opportunities, Assign Volunteers not working after clicking on those buttons nothing happens. Anyone facing the same issues?

# Answer
There are many reasons why this may fail, You can use troubleshoot method below to find cause of the problem.

1. Make sure you don't have any JS error on browser console.
2. Check if you have set extension url in Administer \>\> System Settings \>\> Resource URL
3. Clear template\_c by running cleanup caches(Administer \>\> System Settings \>\> Cleanup Caches and Update Paths)

Thanks

Pradeep
> 2 votes

# Answer
It's not that strange; those buttons are wired up differently. It could be a bug -- CiviVolunteer has not had a proper release in 10 months and may be out of sync with CiviCRM core. On the other hand, if memory serves, those modals are powered by Backbone.Marionette, so the problem may actually be that the appropriate JavaScript isn't being loaded in that context.
> 0 votes

---
Tags: civivolunteer
---


# Question
Title: CiviMail Change the Track Opens Tracking URL to a pretty URL
I'm using the Track Opens option in CiviMail.

In CiviCRM for Wordpress the regular mail tracking url looks something like this: https://mywebsite.co.uk/wp-content/plugins/civicrm/civicrm/extern/url.php?u=123&qid=1234

It is fine for a lot of recipients and tracking works perfectly.

However I have had reports that because the url links to a file within the Wordpress plugins directory, some systems suspect the links to be malware or spyware so the Urls are removed from the email.

Without hacking any civi files, is it possible to change the Url to something pretty like: https://mywebsite.co.uk/civimail/?u=123&qid=1234

I'm thinking it would involve the htaccess file?

Thanks

# Answer
I figured this out and my solution is as follows:

1. Change the CiviCRM Resource URL to something of your choice e.g. https://mywebsite.co.uk/mycrm
2. Add a mod\_rewrite rule to your htaccess file (above the Wordpress rules):

```
<IfModule mod_rewrite.c>
RewriteBase /
RewriteRule ^mycrm(.*)$ /wp-content/plugins/civicrm/civicrm$1 [R=301,NC,L]
</IfModule>

```

Hope this helps someone.
> 1 votes

---
Tags: civimail
---


# Question
Title: (Part solved) Missing line items on event invoice and confirmation email for Event (using Webform CiviCRM)
Drupal7 / Civi5.12 I have created a webform for event bookings, using webform\_civicrm. The webform uses Participant Fee for the exhibition cost, and a Line Item for an additional booking fee.

Can anyone guide me how to make the line item reflect on the Invoice and in the confirmation email?

UPDATE - the solution from @KarinG below fixes the invoice issue.

STILL NEED HELP WITH CONFIRMATION EMAIL \- does not print the line item \- has wrong sales tax amount (shows the percentage not the amount) \- reflects Amount after tax in the "Amount Before tax' field

# Answer
> 2 votes
I believe this PR by Andrei (who works on the Wordpress/Caldera form integration) may help fix this (Core) issue:

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

It removes bad logic re: participants -originally included in Core invoicing code and works great. I’ve tested it/used it myself using Drupal/Webform CiviCRM module.

Unfortunately Andrei’s PR has been deemed ‘needs work to be reviewable’ - so it has gone nowhere. And that’s unfortunate.

# Answer
> 0 votes
I had a similar problem with contribution receipts. In the message template I found {if $lineItem and $priceSetID and !$is\_quick\_config} Since the Webform CiviCRM Integretion module does not fill in the PriceSet ID fields in the table civicrm\_line\_item, it does not use this code to pull data for the receipts.

My fix was to remove "and $priceSetID" So it now looks like: {if $lineItem and !$is\_quick\_config}

Maybe it is the same for events

---
Tags: drupal, webform-civicrm, invoice, line-items
---


# Question
Title: Has Contact ID been removed from the Contact Import "Matching"?
I have a v strong memory, and screenshot evidence that we used to be able to 'match' by including the Contact ID in the import.

This was discussed in https://chat.civicrm.org/civicrm/pl/sjht4rjsxifwtk6iofe3a19ftw and here is the screenshot I have which I used to explain to a client how to do this back in Nov 2018 (haven't dug out the version but would have been as least the Security Release that was current at the time.

No such field shows on dmaster, and nor does eg 'internal id' or any other variation I could think of.

# Answer
> 3 votes
On the first step you have to check "update" where it says For duplicate contacts.

---
Tags: import
---


# Question
Title: Can I track grants against contributions?
Is there a way with CiviGrant to match money received as Contributions with money disbursed?

E.g. if I receive a donation for $100K for a scholarship fund, and I give out 3 scholarships of $20K each, is there a report that can show me that I have $40K left in the fund?

# Answer
> 3 votes
CiviGrant is not sync'd with CiviContribute in current CiviCRM version. You will need to build an entity that will link CiviGrant with CiviContribute or use Financial Accounts(linked with Financial type).

This look like nice feature. I am happy to build an extension for this if you willing to sponsor.

# Answer
> 2 votes
To meet this need, I commissioned the Grant Financial Support extension, which fills an important piece of this need. It's not complete in and of itself, but enables accounting integration for grants. I have a second extension that links grants to financial types with the help of this first extension, but it's not stable enough for release yet.

---
Tags: civicontribute, financial-types, civigrant
---


# Question
Title: CiviEvent Confirmation Email causes Time-Out
I'm using wordpress 5.11 and CiviCRM 5.8.2. I am trying to get a CiviEvent to send confirmation emails but when I select the confirmation emails, the session times-out for the user (error 504). The registration does go through, but no email is sent.

Some observations, turning off the confirmation email works. Registration completes and it goes to the completion page.

I can go into Find Participants, Edit their payment and send a confirmation email from there and it works.

I'm configured to use CiviSMTP as my email host. I have no issues sending out bulk emails or day to day processing emails like renewal notices.

I have checked the logs and there is nothing reported.

I found a similar post here that suggested modifying/adding session.saved\_path=/my/temp/dir which I put in as displayed here. I'm not certain that is the correct format. As displayed it made no difference. The 504 Timeout is consistent and happens every time.

Any help would be greatly appreciated - this is a big event and it opens on Friday so I would really like to have this working by then. I don't really want to have to do manual confirmation emails!

Thanks Norm

# Answer
Although not a perfect solution, it turns out to be the PDF processing that is causing it to time out (known issue apparently).
I disabled the PDF generation for emails and everything works fine now.

Thanks! Norm
> 1 votes

# Answer
If PDF processing is the issue, consider installing wkhtmltopdf. It's much more efficient than the built-in PDF generation.

It can't ship with CiviCRM because it's written in a compiled language - so unlike CiviCRM, which can run unmodified on Windows, Linux, MacOS, etc., wkhtmltopdf is OS-specific (and to some extent, processor-specific). However, it's easy to download and tell CiviCRM where to find it.
> 1 votes

---
Tags: civievent, email, confirmation
---


title: Adding images in CKEditor

text:
# Question
Title: Adding images in CKEditor
I can't browse images to include in CKEditor when using CiviMail. When I click the browse button in the image window, the following pops up

\[....\]/civicrm/civicrm/packages/kcfinder/browse.php?cms=civicrm&type=images&CKEditor=crmUiId\_1&CKEditorFuncNum=0&langCode=en

and get "500 - Internal Server Error" with suggestions that file permissions are not correct. Don't know what to check specifically, but all the resource URLS and directories are defaults and file permissions look generally OK.

I have WordPress 4.8.2 and CiviCRM 4.7.25. There are one or two similar posts about not being able to browse files, but none quite the same and answers not very specific about what what files to check permissions of. Nothing in the ConfigAndLog directory. Works fine on the demo WordPress site, but of course can't see permissions etc. I'm stuck!

# Answer
I forgot to post an answer before, but am prompted to do so as someone has a similar problem.

I needed to set directory 755 and files 644 for wp-content/plugins/civicrm/civicrm/packages/kcfinder because the WP distribution didn't set permissions that worked in my hosting environment.

But since CiviCRM 5.2.2 this wasn't necessary.
> 3 votes

---
Tags: wordpress, ckeditor, images
---


title: Event invoice (receipt) - custom tokens

text:
# Question
Title: Event invoice (receipt) - custom tokens
Can anyone provide guidance how to create tokens for custom participant fields, to be added into a Contribution Invoice Receipt for event registrations? Our tax system requires that VAT registration numbers are included in all invoices, and we want to also add purchase order numbers.

(Drupal, Civi 4.7)

Many thanks Davy

# Answer
UPDATE - instead of the workaround have a look at the answer to this more recent question How to create tokens for custom fields (participant, individual, organisation)
> 1 votes

# Answer
I'm not sure if this is possible - until very recently (version 4.7.17), there wasn't support for custom contribution tokens on a receipt, let alone participant custom tokens. See CRM-8526 for details.
> 1 votes

# Answer
I found a workaround by creating custom contact (rather than participant) fields, as it is possible to add tokens for custom contact fields to the Contribution Invoice Receipt template.

Here is the process for other non-developers like me:

1. Create the necessary custom fields (select Contacts in the Used For field)
2. Create a profile that includes the new custom fields
3. Add the profile to the Fees section of the Event configuration. Now when delegates register they can complete the new fields.
4. Add a token for the custom field to the Contribution Invoice Receipt template (the format for the custom fields is {contact.custom\_12} where 12 is the ID of the custom data field. To find the ID, go Administer \> Customize Data & Screens \> Custom Fields and click ‘edit’ on the field you want to use. Look at the URL. The last part of the URL will be an equal sign and a number (=12). The number (12 in this example) is the id of that custom field.) *(Thanks Joe Murray for that bit of help)*

Caveat: The workaround is not ideal as the PO number is likely to change every time the person makes a new registration so the history will not be retained.
> 1 votes

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


# Question
Title: How do I display a custom field in an invoice?
I'd like to be able to display a custom field in the generated PDF invoice for a contribution. I've added the custom field to contributions, but it will not show up in the invoice.

Is it possible to display this custom field on the invoice? If so, how?

# Answer
> 9 votes
So, I remembered that there is such a thing as Smarty calls to the CiviCRM API.

Stuck the following code into the template and bam! Got my custom field to show up in my generated invoice.

```
{crmAPI var='result' entity='Contribution' action='get' invoice_id="$invoice_id"}
{foreach from=$result.values item=poid}
    {$poid.custom_40}
{/foreach}

```

# Answer
> 1 votes
Also have a look at the answer to this more recent question about how to add custom Participant and Organisation fields to an invoice.

How to create tokens for custom fields (participant, individual, organisation)

---
Tags: civicontribute, invoice
---


title: Custom fields for invoice / PDF

text:
# Question
Title: Custom fields for invoice / PDF
I know that sticking in a contact-related custom field to the invoice template is just "contact.custom\_xx" (where xx = custom field id).

We're trying to do the same for a Contribution-related custom field, but the syntax:

contribute.custom\_xx or contribution.custom\_xx is not working.

Any suggestions?

# Answer
Tokens are available only for contact related columns - if you want to use contribution related columns as tokens then you need to create an extension and add token hooks for making the values available in tokens list

Please refer to the following link for creating token hooks

http://wiki.civicrm.org/confluence/display/CRMDOC/hook\_civicrm\_tokens

http://wiki.civicrm.org/confluence/display/CRMDOC/hook\_civicrm\_tokenValues
> 1 votes

# Answer
Also have a look at the answer to this more recent question about how to add custom Participant and Organisation fields to an invoice.

How to create tokens for custom fields (participant, individual, organisation)
> 1 votes

---
Tags: civicontribute, custom-fields, pdf, invoice
---


# Question
Title: Creating a custom Form: Action (view vs update)
I'm building my first extension, and have created the sample quickform using civix generate:form. So far, so good, the form shows and works within a modal popup.

I've noticed with Core forms (like Contribution edit/view), I can send in an "action" query param, and based on the value of that, the form will either just display a view of the data for that ID, or will show the actual form to edit the data and save it.

I was wondering how I could do that in my custom extension. Do I need to create two sets of php/tpl files, one for editing and one for viewing? Or is there some method or something that will convert the form template to just a view of the fields for me?

If there is a simple example of this type of form (maybe an example extension I could look at), I would appreciate a pointer to it.

# Answer
Paul B,

Its not necessary to have 2 separate tpl for View and edit, the logic can be added in one tpl or php file. But for convenience Civi tries to keep it separate.

A good example for view and add form will be New/Update/ View Membership forms.

1. **The action for CRUD is registered here** https://github.com/civicrm/civicrm-core/blob/master/CRM/Member/xml/Menu/Member.xml#L13

https://github.com/civicrm/civicrm-core/blob/master/CRM/Member/xml/Menu/Member.xml#L48

2. When above one of the 2 url is hit CiviCRM will execute run() function from here. Where you decided which file to invoke for example to create view form process view(), Add/Edit process edit(), listing process browse()
3. Each php file should have tpl associated with it.

You can copy paste same file and structure and just change the class name. It should work for you.

HTH

Pradeep
> 3 votes

---
Tags: extension, civix, quickform
---


# Question
Title: How do I removed accordions in the advanced search
My charity needs a custom address field, rather than the address field that comes with civicrm. This is mostly set up, but there is one issue we have.

We have removed the fields from the advanced search, but the accordion for 'address' fields is still there. I have tried going through the templates, but I have no idea where to find it to remove it...

Here is a screenshot that shows what I mean. How can I remove this 'Address fields' accordian/ where is it located in the files.

(I would also like to rename the custom fields accordion, but I'm hopeful that this would be in the same place )

# Answer
> 3 votes
Unchecking the box in the image below for each field in your custom data set ensures it is not searchable. If no fields within the custom data set are searchable, the "accordion" is removed from the advanced search. If just one is searchable, then the accordion appears.

Just confirmed this with 5.10.3.

As for your second question, if you want to rename "Custom Fields" to something else, you can do that using CiviCRM's word replacement tool. Go to Administer \> Customize Data & Screens \> Word Replacement.

---
Tags: search, templates, advanced-search
---


# Question
Title: Cannot edit links (or source code directly) in Scheduled Reminders
Configuration: Wordpress 5.1.1, CiviCRM 5.10.3

We needed to edit a link in our Scheduled Reminders and discovered we can no longer do so. This is the behavior:

We can edit these reminders just fine, but when we select linked text to edit (or to add a new link), I cannot put the cursor in the edit box to make the edit (see 1st screenshot below). That seemed strange so I clicked on the "Source code" edit button and, once again, I could not place the cursor in the window to make the edit (see 2nd screenshot below). I then checked the ability to edit in CiviMail and also in CiviEvents. I had no problem editing/inserting links there.

I thought this must have something to do with TinyMCE editor or possibly some weird conflict with our Wordpress theme, or even conflict with a block editor that we use (Elementor). I changed to a pure vanilla WP theme (2019) and deactivated Elementor. No dice. Thinking that it was TinyMCE, I upgraded Civi to 5.12.3. All these things did not fix this strange behavior.

Wordpress 5.x was a major upgrade regarding editing where they are pushing their Gutenberg block editor, so maybe this started when we upgraded to 5.x, but there's no turning back at this point, but I suspect there is some weird TinyMCE mess up somewhere and have no clue why it would only show up in editing Scheduled Reminders, whereas all edit functionality in CiviMail and CiviEvents seems to be working.

Any clues would be helpful. We NEED to edit our reminders as our special renewal contact links display weirdly under a recent WP theme change we made and we have it fixed by just pointing the contact link to a different page.

# Answer
OK, I'm going to be bold and answer my own question. According to https://civicrm.org/extensions/tinymce, starting with CiviCRM 4.7, an internal editor CKEditor was provided to handle all Civi backend editing. Since we started using Civi prior to that, we had the TinyMCE extension installed and I should have been aware to disable TinyMCE in favor of the default CKEditor at that time.

I'm interested if anyone else has anything to add. At the very least this post does note an evident TinyMCE bug with our Wordpress/CiviCRM versions configuration.
> 3 votes

---
Tags: wordpress, scheduled-reminders, editor, tinymce
---


# Question
Title: Menu does not appear unless in debugging mode in wordpress
I just freshly installed Wordpress and CiviCRM on my GoDaddy hosting. Installation appears to have worked fine.

When I go into CiviCRM however, the CiviCRM menu bar does not appear at the top but does appear at the bottom of the page half-obscured as text links in sort of a drop down fashion.

When I enable debugging mode, everything works fine...

Any ideas? Any help would be GREATLY appreciated.

# Answer
> 1 votes
JavaScript for the menu bar is served up from two different places, depending on your debug setting. So good job tracking down that difference.

* in debug mode it is served from a dynamic script which is slower, but doesn't rely on the file system.
* in regular mode, the script is cached in a file. If you're CiviCRM files directory is incorrectly configured, or inaccessible due to permission problems on your server, then it will not load. FYI all Angular-based pages (e.g. CiviMail) rely on this file caching as well, so they too will be broken.

I recommend you double-check your system settings for file directories and resource URLs, and also ensure those directories are publicly readable on your server.

---
Tags: wordpress, menu
---


title: Manage Tags is loading a blank page

text:
# Question
Title: Manage Tags is loading a blank page
When a staff or admin goes to manage tags, the page doesn't seem to load anything. I have checked in Drupal permissions that both admins and staff have permissions to administer tags and tag sets (in `https://www.fosterclub.com/civicrm/tag?reset=1` or Contacts \> Manage Tags).

I checked the following logs and can't seem to find anything related:

* CiviCRM `sites/default/files/civicrm/ConfigAndLog` latest log
* Apache
* MySQL
* Drupal (I use Drupal syslog in `/var/log/drupal` instead of watchdog)

I have checked in my development environment and the issue doesn't exist, and no code changes have been made or tracked through git.

Has anyone heard of this issue or know what I should try or look for? Thanks!

Edit: Other pages that seem to be affected:

* New Tag
* New Activity
* Payment Processor settings

# Answer
This was caused from the oldest problem in the book. I needed to delete the everything inside `sites/default/files/civicrm/templates_c` and then clear caches and make it writeable (chmod `775`).

That solved all of the above mentioned page load issues.

We had recently restored the website from an older backup and this always needs to be done when moving or refreshing CiviCRM on the server.
> 2 votes

# Answer
I recently encountered a similar problem to this, but with a different solution. Thought I'd document it here. Manage Tags was failing to load with a *nearly* blank page.  but the problem turned out to be a malformed date in the created\_date field of the 'tags' table. one date was set to 000-00-00 00:00:00 (don't ask me how, I don't know). Setting this field to any valid date corrected the problem.
> 1 votes

---
Tags: drupal, error, tags
---


title: Management of Tags not possible

text:
# Question
Title: Management of Tags not possible
Every time when i try to manage the existing tags i get into a loading loop without any end! No Tag is listed, no modification is possible)

Installation: wp 5.x multisite but civicrm is active only on first site right now

what i tried: \- reinstall complete remove and migrate to external database -\> no success \- reinstall -\> no success \- upgrade to version 5.12.beta1 -\> no success .. used IE Edge, IE11, Firefox (current) for testing already

Anyone have any idea ? without tagging this makes no sence for me ..

Harald

# Answer
> 1 votes
I recently had a similar problem with the Manage Tags interface that was caused by a 'created\_date' field in the tags table having a value of zero. Providing a valid date in the field solved the problem.

---
Tags: tags
---


# Question
Title: CiviCRM CK editor trying to access Skins.js, and CSS resources from the Drupal 8 core assets instead of the Civi directories
So I'm having a weird issue where when trying to create a new mailing or event. The wysiwyg editor does not show up, instead the html editor appears as blank. There are errors in console (404 errors) where the page is trying to load ckeditor/skins/moono/skin.js. However, it is trying to load it from the web root via the Drupal core.(\['web\_root'\]core/assets/vendor/ckeditor/skins/moono/skin.js)

This is the same with other assets like the editor.css file.

Naturally these assets do not exist in the Drupal core ck-editor directory. Is there a way to direct these to the Civi resources (that do exist) or fix these error.

I ran into this after fixing the Error name not resolved error with crm.ckeditor.js. I followed the guide steps in this Civi stack exchange here.

crm.ckeditor.js not found

This allowed for the crm.ckeditor.js script to be found, but now it cannot find the aforementioned assets. Which previously were not being loaded or called.

# Answer
> 1 votes
I also had this problem. It happened ~95% of the time but not 100% of the time, leading me to believe there's a race condition present. It started when I upgraded from Civi 5.12.1 to 5.12.3, but you experienced this problem sooner and I'm guessing it's tied to Drupal 8.6.15. It also happened on my test site but not my dev site (haven't pushed to the live site yet for obvious reasons).

I was able to solve it by uninstalling/reinstalling the core `ckeditor` module via `drush`. However, I'm not sure *why* that fixes it, but I've been unable to trip the issue. In my debugging, it certainly seems that Civi's CKEditor is loading the paths of the Drupal CKEditor. I'm not sure why though.

# Answer
> 0 votes
Part of the install process for drupal 8 currently involves copying some things to the libraries folder. If you used the composer method (https://gitlab.com/roundearth/drupal-civicrm-project) it gets handled mostly automatically, but you might still need to set some settings in civicrm.settings.php. See https://hq.megaphonetech.com/projects/commons/wiki/CiviCRM\_for\_Drupal\_8\_installation\_notes

---
Tags: ckeditor, drupal-8
---


# Question
Title: Page - specific Datepicker config in jcalendar.tpl
How does one add a default value in one of Datepicker fields while adding or editing Relationship? For example, set today's date as a start date at Enabled checkbox check and as the end date if un-checked. Should it be a custom piece of jQuery code or it's better to alter jcalendar.tpl? If latter, how one defines "Add/Edit Relationship" modal frame has been triggered and not, say, "Add/Edit Membership?" one.

# Answer
You can set a datepicker's default value in the `setDefaultValues()` method of the form. Here is a snippet of code that sets a date to today if none exists, and to a saved date if it does:

```
    if (empty($data['thank_you_date'])) {
      $defaultValues['thank_you_date'] = date('Y-m-d');
    } else {
      $defaultValues['thank_you_date'] = $data['thank_you_date'];
    }

```
> 1 votes

---
Tags: best-practice, dates
---


# Question
Title: Anonymous user filing out a profile unintentionally remove themselves from groups
When an anonymous user fills out a contribution or other form with a profile that includes the ability to select groups, the user may leave those checkboxes blank, like so:

If the anynomous user leaves a checkbox unchecked for a group and that anynomous user is deduped with an existing contact, who is currently a member of the same group, during the processing of the form, then the contact will be removed from the group.

If those groups are used as mailing lists, it is normal for users to leave the box unchecked (as they would not think that they need to check a checkbox to remain on a mailing list they have already signed up for). This is confusing for the user, who unintentionally removes themselves from a group. It is also confusing from the backend as it does not function the same as other fields (e.g. if the user leaves a phone number blank, their phone number is not erased).

This same behaviour is found with a custom field that uses checkboxes or multiselect, while it isn't the same in a custom field using select.

To me, this looks like it isn't the intended behaviour, as it is inconsistent with the behaviour of other fields. Perhaps it has to do with the order in which the deduplication happens relative to the groups. It is also inconsistent with how merging contacts normally works, where groups are added to, but not removed from, the merged contact.

Is this a bug? If it isn't a bug, is there a way to change the behaviour so users aren't removing themselves unintentionally from groups?

I think using a custom field and a smart group would likely solve this problem, but perhaps there is a better way—or this should be changed in general.

# Answer
Checkboxes are inherently a confusing html element, because when not selecting them, no value is sent (i.e. not even a null or empty placeholder value). So I can imagine that the core code that this is using is trying to handle that kind of situation from other contexts.

If that analysis is correct, then I suspect the empty box is triggering an unsubscribe, and that unsubscribe is getting merged.

To be fair, in some worlds, that might be the right answer - e.g. if that contact was authenticated when filling in the form, it would be checked, and actively unchecking it should remove the contact from the group. I'd bet you can find an issue of a description like "unsubscribing from a group via a profile not working".

Given your observations, I'd say that an anonymous contact should not be generating those unsubscribes, and if you can figure out where this code happens, it could be improved.
> 2 votes

---
Tags: profile, groups, duplicate-contacts
---


title: Manage Groups not listing groups

text:
# Question
Title: Manage Groups not listing groups
None of my groups are listed on the **Manage Groups** option in the Contacts menu. Its applies to all my sites which vary between CiviCRM 5.2 to 5.11. Some are new sites some upgraded from 4.7.x where it worked fine as far as I can remember. The groups are there (for example in a drop down in Find Contacts). I can add a new group, but that doesn't show in the listing either. Also there is no search button on the Find Groups part of the page (it is there in the documentation).

I tried the WordPress sandpit demo and that is the same (though most of the menus are missing (but fortunately Manage Groups was there) so it looks a bit odd and on the Drupal sandpit I couldn't see any menu, so couldn't try there). Nothing in the CiviCRM log at the time I tried.

I'm using WordPress 5.1 and CiviCRM 5.2 to 5.11 on various sites.

# Answer
I've found out what the problem was (or at least how to cure it) and RayWright's Awnser above pointed me in the right direction. I looked at the console and saw some javascript errors (that meant nothing to me) so I tried a different browser, which all worked, so I tried closing my main browser (Firefox) and restarting and everything worked just fine!

The menus on the sandpit sites are now fine so this may have been the same cause or possibly something may have changed on the sandpit sites.

Finally, the Manage Groups screen has changed and the documentation isn't now current. the layout is changed as well as the search button not being there. Searching does work as RayWright suggests.
> 2 votes

# Answer
I'm in 5.7.5 on Drupal 7.64 with no issues, I can see a list of all my groups on this screen (Contacts Menu \> Manage Groups).

There isn't actually a search button on this screen - I believe its ajax/javascript that powers the search. After you type something in a field and press enter or tab it refreshes the group listing.

Are there any javascript warnings/clashes in your console?
> 2 votes

---
Tags: groups
---


title: DB Error: no such table

text:
# Question
Title: DB Error: no such table
I am using CIVICRM imported from a Drupal installation now in wordpress.

The entire import process was done according to the corresponding tutorials.

Everything works fine, except when trying to see the detail of a member through the list of members. The following error appears: DB Error: no such table

Next I copy the result of the backtrace

I am a new user of CIVICRM, I saw similar topics in the forum but I do not understand where the error may be.

I already appreciate the help you can give me. Excuse my English, it has been translated from Spanish automatically.

```
#0 /home3/andrcdd/public_html/nueva/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(190): CRM_Core_Error::backtrace()
#1 /home3/andrcdd/public_html/nueva/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(921): CRM_Core_Error::handle(Object(DB_Error))
#2 /home3/andrcdd/public_html/nueva/wp-content/plugins/civicrm/civicrm/packages/DB.php(985): PEAR_Error->__construct("DB Error: no such table", -18, 16, (Array:2), "SELECT  id, name  \n FROM civicrm_worldregion \n \n \n \n \n ORDER BY id  \n ...")
#3 /home3/andrcdd/public_html/nueva/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(575): DB_Error->__construct(-18, 16, (Array:2), "SELECT  id, name  \n FROM civicrm_worldregion \n \n \n \n \n ORDER BY id  \n ...")
#4 /home3/andrcdd/public_html/nueva/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(223): PEAR->_raiseError(Object(DB_mysqli), NULL, -18, 16, (Array:2), "SELECT  id, name  \n FROM civicrm_worldregion \n \n \n \n \n ORDER BY id  \n ...", "DB_Error", TRUE)
#5 /home3/andrcdd/public_html/nueva/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1907): PEAR->__call("raiseError", (Array:7))
#6 /home3/andrcdd/public_html/nueva/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(933): DB_common->raiseError(-18, NULL, NULL, "SELECT  id, name  \n FROM civicrm_worldregion \n \n \n \n \n ORDER BY id  \n ...", "1146 ** Table 'andrcdd_wpcivic3.civicrm_worldregion' doesn't exist")
#7 /home3/andrcdd/public_html/nueva/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(403): DB_mysqli->mysqliRaiseError()
#8 /home3/andrcdd/public_html/nueva/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1216): DB_mysqli->simpleQuery("SELECT  id, name  \n FROM civicrm_worldregion \n \n \n \n \n ORDER BY id  \n")
#9 /home3/andrcdd/public_html/nueva/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2415): DB_common->query("SELECT  id, name  \n FROM civicrm_worldregion \n \n \n \n \n ORDER BY id  \n")
#10 /home3/andrcdd/public_html/nueva/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(413): DB_DataObject->_query("SELECT  id, name  \n FROM civicrm_worldregion \n \n \n \n \n ORDER BY id  \n")
#11 /home3/andrcdd/public_html/nueva/wp-content/plugins/civicrm/civicrm/CRM/Core/PseudoConstant.php(571): DB_DataObject->find()
#12 /home3/andrcdd/public_html/nueva/wp-content/plugins/civicrm/civicrm/CRM/Core/PseudoConstant.php(1202): CRM_Core_PseudoConstant::populate(NULL, "CRM_Core_DAO_Worldregion", TRUE, "name", NULL, NULL, "id")
#13 /home3/andrcdd/public_html/nueva/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/Address.php(527): CRM_Core_PseudoConstant::worldRegion("2")
#14 /home3/andrcdd/public_html/nueva/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/Location.php(267): CRM_Core_BAO_Address::getValues((Array:1), TRUE)
#15 /home3/andrcdd/public_html/nueva/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/Contact.php(851): CRM_Core_BAO_Location::getValues((Array:1), TRUE)
#16 /home3/andrcdd/public_html/nueva/wp-content/plugins/civicrm/civicrm/CRM/Contact/Page/View/Summary.php(138): CRM_Contact_BAO_Contact::retrieve((Array:4), (Array:31), TRUE)
#17 /home3/andrcdd/public_html/nueva/wp-content/plugins/civicrm/civicrm/CRM/Contact/Page/View/Summary.php(93): CRM_Contact_Page_View_Summary->view()
#18 /home3/andrcdd/public_html/nueva/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(309): CRM_Contact_Page_View_Summary->run((Array:3), NULL)
#19 /home3/andrcdd/public_html/nueva/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:14))
#20 /home3/andrcdd/public_html/nueva/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:3))
#21 /home3/andrcdd/public_html/nueva/wp-content/plugins/civicrm/civicrm.php(1243): CRM_Core_Invoke::invoke((Array:3))
#22 /home3/andrcdd/public_html/nueva/wp-includes/class-wp-hook.php(286): CiviCRM_For_WordPress->invoke("")
#23 /home3/andrcdd/public_html/nueva/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters("", (Array:1))
#24 /home3/andrcdd/public_html/nueva/wp-includes/plugin.php(465): WP_Hook->do_action((Array:1))
#25 /home3/andrcdd/public_html/nueva/wp-admin/admin.php(253): do_action("toplevel_page_CiviCRM")

```

# Answer
Looks like your table world\_region is not imported correctly. You could check in your new database whether that table exists.
> 1 votes

---
Tags: wordpress
---


# Question
Title: CiviCRM database issue with views and the definer
We have a website using CiviCRM that was recently switched from Drupal to WordPress as well as to a new server.

Everything on the website is working properly and they have had no issues with CiviCRM.

The problem: The websites and databases are backed up every night and the old backups are deleted upon completion of the backups. The CiviCRM database backup is failing because the database has 2 views (civicrm\_view\_case\_activity\_recent and civicrm\_view\_case\_activity\_upcoming) which have a "definer" which was carried over from the last server and does not exist on the new server.

The question(s): Is there a way to redefine the definer without recreating those views?

If not, is there code available to recreate those views?

Thanks!

# Answer
> 2 votes
It is possible to recreate the views using the following script. (It also recreates the triggers and stored functions that can have the same problem

```
<?php
   civicrm_initialize();
   Civi::service('sql_triggers')->rebuild(null, false);
   CRM_Case_BAO_Case::createCaseViews();

```

Run the script with `drush scr <script.php>`

---
Tags: wordpress, database
---


# Question
Title: Is it possible to assign a "custom group" to a specific roles of users?
I have a custom set of data that I wøuld like be only visible to users with specific permission. is it possible to achieve? thanks

# Answer
Use 'Access Control Lists'. You can access it by 'Administer-\>Users and Permissions'. Then go to 'Manage ACLs' to and define a ACL for a Custom Data Set.
> 2 votes

---
Tags: custom-fields, permissions
---


# Question
Title: Multiple Conditions for Scheduled Reminder
We have scheduled reminders working for us. However we need some that have multiple conditions. For example we have custom fields set up for an activity for recording wedding details and we need to send a scheduled reminder 3 months before the wedding date if the couple are not living in our parish.

Is this possible?

# Answer
I do not think you can do this with Scheduled Reminders. The CiviRules extension (https://civicrm.org/extensions/civirules) might be able to help you out. Some examples at https://docs.civicrm.org/civirules/en/latest/basic-example-introduction/

Having said so, I do not think there is a time comparison yet that will allow you to look forward as we have never encountered this. That will mean you will have to add this to CiviRules or have an expert do this for you. More information about extending CiviRules can be found here https://docs.civicrm.org/civirules/en/latest/create-your-own-introduction/.

Find yourself an expert on the CiviCRM home page if you need it, or let me know if you want me to take this on.
> 3 votes

# Answer
You might be able to use a smart group to limit who the reminder goes to https://docs.civicrm.org/user/en/latest/email/scheduled-reminders/#limiting-or-adding-to-your-recipient-list
> 2 votes

---
Tags: scheduled-reminders
---


title: Scheduled reminders and memberships

text:
# Question
Title: Scheduled reminders and memberships
Looking for a quick answer from someone who may have done this before I spend hours of testing.

I am implementing a "Family" membership where members of family will get the inherited membership of the paying member based on a relationship that I created. This works really well. The paying member shows a membership "Family". The members of the family show a membership "Family (by relationship)".

I want to schedule a reminder for the paying member to renew their family membership, but don't want to send the reminder to the members of the family (some of them are children and while they may have email addresses entered into their record, they shouldn't get emails for membership renewals).

So... if I create a scheduled reminder based on the Family membership, will the (by relationship) members get the reminder?

I'm running CiviCRM 4.7.47 on WordPress 4.9.5

# Answer
> 1 votes
You might be able to use the "Limiting or adding to your recipient" setting and use a smart group to only include primary members or some fairly complicated smart group that pulls only those that are paying members

https://docs.civicrm.org/user/en/latest/email/scheduled-reminders/#limiting-or-adding-to-your-recipient-list

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