# Question
Title: Changing sort of cases with recent activities on case dashboard?
Currently cases with recent activities are sorted oldest\>newest - i'd like the newest to be at the top.

I am guessing i could do it within Case/Page/DashboardSelector.tpl but i'm floundering from there.. is it possible? thanks!

# Answer
I don't think you can do it in the smarty template but since you might want the sorting of similar listings to be consistent anywhere it's used you could just change line 545 in CRM\_Case\_BAO\_Case::getCaseActivityQuery() so that it sorts descending.

```
      $query .= " ORDER BY case_recent_activity_date ASC ";

```

becomes

```
      $query .= " ORDER BY case_recent_activity_date DESC ";

```

Obviously editing core files directly isn't recommended, but that's where the sorting happens for this.
> 3 votes

---
Tags: civicase, sort-order
---


title: Getting Error in running contact Report

text:
# Question
Title: Getting Error in running contact Report
I am using Hostgator shared hosting for CIVI CRM and Drupal.From few days, I am getting an error that Error writing file '/var/mysqltmp/MYCckA2E' (Errcode: 28)".

I tried to change the queries and removed the order by clause.The query is working in phpmyadmin but there is an error in civi website.

**Please help me with this issue.your suggestions are most welcome.**

function query($string) {

if (strpos(trim($string), 'SELECT SQL\_CALC\_FOUND\_ROWS contact\_civireport.sort\_name as civicrm\_contact\_sort\_name, contact\_civireport.id as civicrm\_contact\_id FROM civicrm\_contact contact\_civireport WHERE ( contact\_civireport.is\_deceased LIKE 0 ) ORDER BY contact\_civireport.sort\_name ASC LIMIT 0, 10') == false) { $string=str\_replace("ORDER BY contact\_civireport.sort\_name ASC","","SELECT SQL\_CALC\_FOUND\_ROWS contact\_civireport.sort\_name as civicrm\_contact\_sort\_name, contact\_civireport.id as civicrm\_contact\_id FROM civicrm\_contact contact\_civireport WHERE ( contact\_civireport.is\_deceased LIKE 0 ) ORDER BY contact\_civireport.sort\_name ASC LIMIT 0, 10"); echo $string; return $this-\>\_query($string); } else
return $this-\>\_query($string); }

# Answer
> 1 votes
Check if `www-data` has write permissions in `/var/mysqltmp` directory.

---
Tags: civicontribute, contacts, civireport
---


title: Corporate - contact names

text:
# Question
Title: Corporate - contact names
How/ where can I add the contact name for a business?

I am about to send out an email to our corporate partners but I cannot personalise it as I do not know where to add their name in their business details. I do not want to set up a 'new' individual to then attach to each corporate as this then increases the number of contacts on the database significantly.

# Answer
> 3 votes
Adding an individual to the database and connecting it via a relationship to the organisation would be the coherent "CiviCRM-way" to do it. You should consider using this approach as a lot of CiviCRM's business logic is focussed around it (e.g. greetings, online forms etc.).

If you still want to stick to an "organizations-only-approach", you could simply add one or more custom fields for organisations and enter all relevant infoamtion (such as first and last name) in those fields.

---
Tags: contacts
---


# Question
Title: Price Set with a conditional 'Other' field
I have scanned the issue queue for any questions related to mine, and have come up empty, but apologies if there is another issue that I missed that would render this redundant!

I have a client organization that takes in money from event registrations. They would ideally like to have ~4-5 set pricing options as radio buttons for users to choose from, that would also include an 'Other' option which would allow the user to manually enter the amount they would prefer to contribute to the event, if not otherwise listed.

Now, while I know that this is certainly possible on Contribution pages, no such capability seems to exist within the Event page fee options, nor within Price Set options. Is there something that I am missing here, or is it really not possible to have an array of radio buttons to select a contribution amount for an event that includes an 'other' option?

# Answer
You can create an option in the event fees for 'Other' with a price value 0. Then create another price field with the type 'Text / Numeric Quantity' and a price of 1. Some other things you may want to consider with this method:

* Hide prices in the field setup and put them in the line item descriptions. This avoids the user seeing the $0 amount on the 'Other' option.
* In the 'Other' line item description you may want to add something like 'Enter amount below'
* With some simple jQuery you can hide the other amount field unless the 'Other' option is selected.

Hope this helps...
> 1 votes

---
Tags: civievent, price-sets
---


title: Can you invoice an event participant

text:
# Question
Title: Can you invoice an event participant
I have a few participants registered for an event that haven't paid. Is there a way to invoice them from the the event report?

# Answer
Welcome to CiviCRM SE!

You can email an invoice for any contribution type including events. You can find more information here:

https://docs.civicrm.org/user/en/latest/contributions/invoicing/

Hope this helps!
> 1 votes

---
Tags: invoice
---


title: Merge known duplicate

text:
# Question
Title: Merge known duplicate
I have two records for the same person. How do I merge them? I know there is a function to look for possible duplicates but these records are not being picked up because of spelling errors.

# Answer
> 7 votes
Welcome to CiviCRM SE.

You can merge the contacts manually via search results. Here is a link to the specifics:

https://docs.civicrm.org/user/en/latest/common-workflows/deduping-and-merging/#merging-contacts-from-search-results

You should also review the information on merging two contacts manually here:

https://docs.civicrm.org/user/en/latest/common-workflows/deduping-and-merging/#using-rules-and-merging-duplicate-contacts-manually

Hope this helps!

# Answer
> 3 votes
Another option is to find any 2 contacts via a Search, then select them and click Merge - then look at the URL and substitute the IDs of the 2 contacts you actually want to merge.

The URL will be of this format

/civicrm/contact/merge?reset=1&cid=XXX&oid=YYY

where XXX is the id of the contact that will be retained

and YYY is the ID of the duplicate contact that will go to trash.

# Answer
> 3 votes
Just run a search to get both records to show up in a list, click the two contact line check boxes and use the "actions" drop down for "merge contacts". If you need you can just temporarily change the last name of one of the duplicate records to match the other one to make getting both contacts in one search easier.

---
Tags: duplicate-contacts
---


title: Support for Apache 2.4

text:
# Question
Title: Support for Apache 2.4
I have noted that CiviCRM creates .htaccess with the `Deny from all` command in stead of the `Require all denied`. This causes security issues with my new setup at a hosting site.

Drupal has support for both:

```
# Deny all requests from Apache 2.4+.
<IfModule mod_authz_core.c>
  Require all denied
</IfModule>

# Deny all requests from Apache 2.0-2.2.
<IfModule !mod_authz_core.c>
  Deny from all
</IfModule>

```

When is CiviCRM going to support Apache 2.4?

# Answer
> 1 votes
Ok. This is my first try using Github. Changed civicrm-core/CRM/Utils/File.php and committed to master branch with a proper summary and description. Change tag 875f1c8.

Do I have to do anything else? Should I enter anything in the issue list?

---
Tags: security, webserver
---


# Question
Title: CRM_SMS_Page_Callback run method override
I am creating a new extension to add a new SMS provider. Since different parameters are passed during callback, I need to override run method of the CRM\_SMS\_Page\_Callback class. Since it is a part of CRM Core, what is the best way to do it?

> sites/all/modules/civicrm/CRM/SMS/Page/Callback.php

```
class CRM_SMS_Page_Callback {

  public function run() {
    $provider = CRM_SMS_Provider::singleton($_REQUEST);

    if (array_key_exists('status', $_REQUEST)) {
      $provider->callback();
    }
    else {
      $provider->inbound();
    }
  }

}

```

# Answer
When you say parameters do you mean http get/post parameters? You would just access those in your callback the usual way in php. Or see for example the callback function for clickatell

https://github.com/veda-consulting/org.civicrm.sms.clickatell/blob/master/org\_civicrm\_sms\_clickatell.php
> 0 votes

---
Tags: civisms
---


title: problem upgrading php

text:
# Question
Title: problem upgrading php
I updated to CiviCRM 4.7.28 (on Wordpress). However, I have not been able to update the PHP to the 5.6 version. In fact, after much searching, I don't seem to be able to come up with the correct way to update the PHP. Any help would be much appreciated.

# Answer
You would need to contact your host to check that php 5.6 is available. It very likely is in which case there is probably a facility in your cpanel or equivalent to activate this. I recently upgraded my setup to php7 on wordpress without any problems and in fact things are working quite a bit faster.

Hope this helps.
> 0 votes

---
Tags: wordpress, php, upgrade
---


# Question
Title: 4.7.28 upgrade gives false warning that my resource URL is not correct
when I upgraded a client's staging site to 4.7.28, which added in a check to verify the resource url setting, we started getting a warning that the site's resource url was incorrect.

However, the setting is correct.

# Answer
after chasing my tail for a while, I finally realized that the check for resource url is not done by the browser in a way that would pass along other validation credentials.

This led to the resource url check, which tries to load the small arrow image used in the civiCRM admin menus, to fail in my case because all non live/production sites are behind htaccess passwords.

When the update was moved to a publicly accessible url, the resource url check worked as expected.
> 4 votes

---
Tags: settings, resource-urls
---


# Question
Title: how can I change the contact type for one contact (to/from individual/household/organization)?
All contacts have a type of either "individual", "household", or "organization".

How can I change this type for an existing contact?

# Answer
The Contact Editor extension allows you to change contact types safely. It checks for potential data loss, which isn't possible with the API method or the Merge method.
> 12 votes

# Answer
Say you want to convert from an individual to a household. One very hack-ish way is as follows:

1. Create a new household with the desired household name.
2. Note the "contact id" values for the individual (INDIVIDUALID) and for the newly created household (HOUSEHOLDID). (You can find this "contact id" value at the bottom of the screen when viewing the contact where it says something like "CiviCRM ID: 2345". Also this id value is in the URL of the page where you view the contact.)
3. Manually navigate to the following URL where you will merge the two contacts. In this URL you will have to replace "HOUSEHOLDID" with the id value for your newly created household and replace "INDIVIDUALID" with the id for the individual you want to "convert" to a household.

http://example.com/civicrm/contact/merge?reset=1&cid=HOUSEHOLDID&oid=INDIVIDUALID&action=update
4. Check all boxes, except make sure "contact type" and any "name" fields are ***un****-checked*
5. Merge the individual into the household.
> 16 votes

# Answer
This is a not so trivial issue, as you might have a lot of related data around that contact that were correct with an individual but might not be compatible with a household any more. For instance is the individual had custom data that are only valid for an individual, or a relationship "child of", or attended to an event... transforming that individual into an household might lead to weird results (eg. having "smith family" being the child of John or being a speaker with gluten intolerance at your latest gala dinner.

Now that you've been warned and that you are sure you are not going to create these monsters into your database, the trick I use is to use the api:

* go to the api explorer (example.org/civicrm/api/explorer on drupal)
* choose contact create as the entity+action
* add the parameter contact type=Household
* add the parameter internal id= the contact id of your contact
* add the parameter household name= "smith family"

so the drush command generated looks like

```
drush cvapi Contact.create sequential=1 contact_type="Household" id=42 household_name="Bob's family"

```

and press execute and confirm you're ok to write to the database

And voila, it's an household. they are a few other parameters you might want to alter (addressee, the greetings), but it should get you covered, without having to attack directly the database

Api explorer is your friend, use it with moderation ;)
> 7 votes

---
Tags: contacts
---


# Question
Title: Adding barcode in Event confirmation email
We want to add Qr code in event email.

Is there any way we can add QR code in Event registration confirmation email?

# Answer
I just found this forum post : https://forum.civicrm.org/index.php?topic=23767.0 which seems to propose a solution based on a old version of CiviCRM but the method is still valid in principle :

* either using an existing service on the web (https://developers.google.com/chart/infographics/docs/qr\_codes?csw=1) or configure your own that generate a QR code image
* calling the url from within the src image in your template : `<img src="https://chart.googleapis.com/chart?cht=qr&chs=120x120&chl={$participantID}&choe=UTF-8" alt="Ticket ID: {$participantID}">`
> 2 votes

---
Tags: civievent
---


# Question
Title: Where is the mailing template for the automated membership renewal reminder
we have an email set to be sent out to members as a reminder for membership renewal 6 weeks prior to the end date of membership. I am trying to locate a specific template, as it needs the signature updated and, more importantly, has some broken links, as we've upgraded some forms on our public site. I have looked under Mailing Templates, Headers, Footers, and Automated Messages, as well as anywhere else i can think of but cannot locate the email.

Any assistance locating the automatic email would be greatly appreciated.

Thank you!

Saba SSaleem@nonprofitoregon.org

# Answer
> 3 votes
Maybe you can find it in Schedule Reminders. Go to Administer -\> Communications -\> Schedule Reminders or use `http://<server>/civicrm/admin/scheduleReminders?reset=1`

---
Tags: civimember, auto-renew
---


# Question
Title: Different membership receipts for 'New' and 'Active' members
We send our donors once a year an email and ask them to become members. The email contains a link with a contact checksum that directly leads them to a contribution page, where they can select their membership and do the payments.

And our existing members we send a similar email and ask them to renew.

Both pages generate an email receipt using the template *Memberships - Receipt (on-line)* Is it possible to make a difference between the new and the already active members?

The CiviCRM version is 4.7.26.

# Answer
> 3 votes
In the smarty template the variable `$mem_status` is assigned. So it can be used to insert different text fragments in the template. Here is an example in code.

```
 {if $mem_status eq 'New'}
 Hello, you seem to be new so this is the text fragment for new members.
 {else}
 Welcome back - not new - so here is an active member text fragment.
 {/if}

```

---
Tags: civimember, contribution-page, system-workflow-messages
---


# Question
Title: Why is my email stuck in "Scheduled" even thought I sent immediately?
Everything seems to be configured correctly from a mail server perspective. Why is my email stuck in "Scheduled" even thought I sent immediately? See screenshot... it's just an email to a group on 16.

# Answer
> 3 votes
You either need to run the job manually or have a cron that runs periodically that will execute the job that actually sends the email.

In my Drupal install, you find the place to manually execute it at http://www.yourdomain.com/civicrm/admin/job?reset=1

Or:

Civi Menu \>\> Administer \>\> System Settings \>\> Scheduled Jobs

Some links with more info:

https://docs.civicrm.org/sysadmin/en/latest/setup/jobs/

https://docs.civicrm.org/user/en/latest/initial-set-up/scheduled-jobs/

---
Tags: email
---


# Question
Title: Contribution Amounts Section does not work
On Civi 4.7.27 and Wordpress 4.9.1

On the contribution pages, if I have Membership section enabled AND Contribution Amounts section enabled, everything works fine. If I have just Membership section enabled, everything work fine. However, if I have just the Contribution Amounts section enabled, after submitting the contribution, users will land on an error 500 page. The contribution will be completed and the record will be stored in civi, but the confirmation email will not be sent.

After hours of trouble shooting I have narrowed it down to: this only happens when the Contribution Amounts section is enabled by itself. Everything was working fine, until the recent upgrades. The error logs I can find are not giving me any useful information.

Also I just installed the same version of Civi on another server and everything works fine, including the Contribution Amounts section. All the settings are the same on both pages. Both Servers are on the same host, so I don't think it is a hosting problem. I think there is something broken is civi, but I don't know how to find out where to look.
Does anyone have any ideas?

Thank you.

Errors from Logs

1 /home/oursite/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/Mail/EmailProcessor.php(104): CRM\_Core\_Error::fatal("No mailboxes have been configured for Email to Activity Processing")

2 /home/oursite/public\_html/wp-content/plugins/civicrm/civicrm/api/v3/Job.php(401): CRM\_Utils\_Mail\_EmailProcessor::processActivities()

3 /home/oursite/public\_html/wp-content/plugins/civicrm/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm\_api3\_job\_fetch\_activities((Array:1))

4 /home/oursite/public\_html/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(169): Civi\API\Provider\MagicFunctionProvider-\>invoke((Array:9))

5 /home/oursite/public\_html/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(100): Civi\API\Kernel-\>runRequest((Array:7))

6 /home/oursite/public\_html/wp-content/plugins/civicrm/civicrm/api/api.php(23): Civi\API\Kernel-\>runSafe("job", "fetch\_activities", (Array:1), NULL)

7 /home/oursite/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Core/JobManager.php(145): civicrm\_api("job", "fetch\_activities", (Array:1))

8 /home/oursite/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Core/JobManager.php(79): CRM\_Core\_JobManager-\>executeJob(Object(CRM\_Core\_ScheduledJob))

9 /home/oursite/public\_html/wp-content/plugins/civicrm/civicrm/api/v3/Job.php(99): CRM\_Core\_JobManager-\>execute(FALSE)

10 /home/oursite/public\_html/wp-content/plugins/civicrm/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm\_api3\_job\_execute((Array:2))

11 /home/oursite/public\_html/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(169): Civi\API\Provider\MagicFunctionProvider-\>invoke((Array:9))

12 /home/oursite/public\_html/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(100): Civi\API\Kernel-\>runRequest((Array:7))

13 /home/oursite/public\_html/wp-content/plugins/civicrm/civicrm/api/api.php(23): Civi\API\Kernel-\>runSafe("Job", "execute", (Array:2), NULL)

14 /home/oursite/public\_html/wp-content/plugins/civicrm/civicrm/bin/cli.class.php(113): civicrm\_api("Job", "execute", (Array:2))

15 /home/oursite/public\_html/wp-content/plugins/civicrm/civicrm/bin/cli.php(32): civicrm\_cli-\>callApi()

( \[message\] =\> Could not connect to MailStore for civicrm\_bounce@ouremail.org\<p\>Error message: \<pre\>An error occured while sending or receiving mail. The POP3 server did not accept the password: -ERR \[AUTH\] Authentication failed. .\</pre\>\<p\> \[code\] =\> ) –

# Answer
> 1 votes
I've found that almost all of our 500 errors have been server related, such as a security issue being run into with the site. I usually work with the host to see if they can find something in their logs. The only other reason I've gotten a 500 error was when something in my php settings wasn't set high enough (like memory allocated, execution time for a script, etc).

Usually my host will have me run through the steps to recreate it (making sure they have my IP address) and they will watch for any related errors.

---
Tags: civicontribute
---


# Question
Title: DataTables Warning: Cannot view Activities after upgrade to 4.7.28
I cannot view Activities on a Contact's Activities Tab, or my activities on my CiviCRM Dashboard. In both cases I receive the following error:

*DataTables warning: table id=DataTables\_Table\_0 - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1*

I am using CiviCRM 4.7.28 in Wordpress 4.9.1. I have the following Extensions active in CiviCRM:

* iATS Payments 1.6.1
* Summary Fields v. 3.1.1
* Extended Report v. 3.0
* Displays relationships in the contact summary v. 1.2
* Mailchimp v. 2.0.1

# Answer
In order to fix this regression, you need to apply this tiny patch, which wasn't merged in time for the 4.7.28 release.

Cheers, Olivier;
> 0 votes

---
Tags: wordpress, activities, upgrade
---


# Question
Title: ERROR Upgrading to CiviCRM 4.7.28 - Warning: require_once(CRM/Core/ClassLoader.php):
I am on Joomla version 3.8.2 with Php 7. I tried to upgrade to CiviCRM 4.7.28 but I received and error message (I didn't capture it) that it could not unzip the file because I have php 7. Unfortunately, I no longer have access to the administration panel as I am getting a blank screen.

These are the error messages:

```
Warning: require_once(CRM/Core/ClassLoader.php): failed to open stream: No such file or directory in /home/pastoral99/public_html/administrator/components/com_civicrm/civicrm.settings.php on line 462

Fatal error: require_once(): Failed opening required 'CRM/Core/ClassLoader.php' (include_path='.:/home/pastoral99/public_html/administrator/components/com_civicrm/civicrm:/home/pastoral99/public_html/administrator/components/com_civicrm/civicrm/packages:.:/opt/alt/php70/usr/share/pear') in /home/pastoral99/public_html/administrator/components/com_civicrm/civicrm.settings.php on line 462

```

Please HELP!

# Answer
Check if the file `ClassLoader.php` is on the file system. The location for Joomla is:

```
../administrator/components/com_civicrm/civicrm/CRM/Core/ClassLoader.php

```

Part of an upgrade procedure is to remove the old version and unpack the new version in the same place. If the unpacking fails the above error is shown.

Another reason for the same error can be the wrong value of `$civicrm_root` in the `civicrm.settings.php` file. More information in question Fails to open ClassLoader.php file .
> 1 votes

---
Tags: upgrade
---


# Question
Title: If I've set up a Financial Type of In-Kind Donation, how should I properly set up the required Payment Instrument?
I've looked at other questions and answers similar to this, but I am still unsure of the best way to proceed. I am aware that I can add a payment instrument and call it whatever I want (e.g. In-Kind Material Donation or In-Kind Volunteer Time), but I would also have to assign it a Financial Account. We have many Financial Accounts set up for managing different types of transactions, but the four that show up in the New Payment Instruments Option window are Accounts Receivable, Deposit Bank Account, Payment Processor Account, and Premiums Inventory. So my questions are: When I set up a new Payment Instrument for In-Kind Donations, which Financial Account should I link it to? Should I choose one of those 4, or should I choose the In-Kind Donation financial account that I created? If I should choose the In-Kind Donation financial account, how do I get it to show up as one of my choices on the New Payment Instruments Option Financial Account drop-down box?

# Answer
In order for the 'In-Kind' financial account to show as an option when you setup a new payment instrument it needs to be setup as an Asset account.

You should review the account relationships (under Financial Types) to make sure they meet your needs.

Depending on your accounting setup and reporting requirements I recommend looking closely at this setup to assure you get the results you require.

Hope this Helps!
> 1 votes

---
Tags: civicontribute
---


# Question
Title: Why is there private_html in my [cms.root] directory variable and is it trouble?
The *Settings - Upload Directories* screen (url `civicrm/admin/setting/path?reset=1`) makes it possible to examine the value of the `[cms.root]` variable. Just click the first help question mark.

In my case the `cms.root` path contains the directory `private_html`. That is a bit strange because I installed CiviCRM in the `public_html` directory and also added this path to the `$civicrm_root` variable.

Why is this, and does it harm?

More details: The CiviCRM version is 4.7.27 on Drupal. It runs on a VPS administered with DirectAdmin, and https is enabled.

# Answer
It starts with a peculiarity of DirectAdmin. Using a subdomain, you have to upload the files for **https** connection to `private_html` and the files for not secure **http** connection to `public_html`. For the situation these files are the same DirectAdmin offers the option to create a symbolic link from `private_html` to `public_html`. Thus when you ask for `https://<domain>/file.html` it looks for the file `/private_html/file.html` and thanks to the link this is the same as `public_html/file.html`.

The `[cms.root]` variabele is not set. It is derived from the `DRUPAL_ROOT` constant, that is calculated with `getcwd()`. At the moment you use a secure connection this functions returns the `private_html` directory.

And it causes trouble.

The directory variable `[cms.root]` is used to calculate the URL variabele `[civicrm.root]` so this is also wrong. The effect is that a lot of javascript files are not found, for example `ckeditor.js`.

My solution is adding the `[cms.root]` directly to the `civicrm.settings.php` file with the following line:

```
$civicrm_paths['cms.root']['path'] = '/home/<user>/domains/<subdomain>/public_html/crm';

```
> 1 votes

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


# Question
Title: "view contact" not updating when changes are made
I do all my backend entry for CiviCRM on my "View Contact" page, but nothing I do is visible for about a day and it is causing a lot of stress for my staff.

If we go to the Membership tab and add a new membership, it will save, but it won't show up on the Membership tab until the next day. I've tried cleaning my cache in Joomla, and setting a rule to bypass admin for caching, but no luck!

Has anyone encountered this probelm?

# Answer
Band-aid solution:

Found out that it was our web-browser's cache that was causing this problem, both in Chrome and Firefox. Chrome offers no way to turn caching off (except in development mode), so I installed a plugin to clear the cache anytime I need to confirm updated information.

I'm surprised others haven't posted about this problem since it must be fairly wide-spread
> 1 votes

---
Tags: contacts, admin, cache
---


# Question
Title: Is the free() method being called inadvertently on my DataObject?
This behaviour happens on a certain environment, but not on another. I am trying to work out why.

There is a while loop in CRM\_Mailing\_BAO\_MailingJob::deliver() that cycles through emails to be delivered.

I noticed that the loop was ending prematurely. I tracked this down to some custom code I had addes that was adding a token. In this code, I was calling MailingJob.getsingle.

It turns out that many calls to the API and it seems other methods too will cause the loop to end prematurely.

The simplest proof of concept I came up with was

```
var_dump($eq->N);
while ($eq->fetch()) {
  civicrm_api3('Contact', 'get');
  var_dump($eq->N);
  var_dump($eq->fetch());exit;

```

which outputs

```
int(50)
int(50)
bool(false)

```

which is madness, I am sure you will agree.

Do you have any ideas what is going on here?

# Answer
I was not aware that the system had been patched with https://github.com/civicrm/civicrm-core/pull/10844/files. Reversing the patch resolved the problem.
> 1 votes

---
Tags: developer
---


# Question
Title: Setting the date feature is not working in events (Added Screenshots)
I just installed Civi 4.7.27 on Wordpress 4.9.1 in a subdomain. When configuring the new install, I am noticing something strange with the date settings. The first screenshot shows what I am getting in the new install. When I click in those boxes, the Calendar does NOT pop out like it is supposed to and it is displaying two extra textareas that shouldn't be there. The second screen shot shows how it looks in my root directory as it is supposed to be. How can I fix this?

ERROR MESSAGES

Failed to load resource: the server responded with a status of 404 (Not Found) volunteer\_events.css Failed to load resource: the server responded with a status of 404 (Not Found)

volunteer\_app.css Failed to load resource: the server responded with a status of 404 (Not Found)

angular-modules.b61ce69729ca8c547f15ef2c0d2af9ae.js Failed to load resource: the server responded with a status of 404 (Not Found) volunteer.css Failed to load resource: the server responded with a status of 404 (Not Found)

volunteer\_events.css Failed to load resource: the server responded with a status of 404 (Not Found)

volunteer\_app.css Failed to load resource: the server responded with a status of 404 (Not Found)

angular.js:4692 Uncaught Error: \[$injector:modulerr\] \_http://errors.angularjs.org/1.5.11/$injector/modulerr?p0=crmApp&p1=Error%3A%20%5B%24injector%3Anomod%5D%20http%3A%2F%2Ferrors.angularjs.org%2F1.5.11%2F%24injector%2Fnomod%3Fp0%3DcrmApp%0A%20%20%20%20at%20https%3A%2F%2Fsecure.narsol.org%2Fwp-content%2Fplugins%2Fcivicrm%2Fcivicrm%2Fbower\_components%2Fangular%2Fangular.min.js%3Fr%3D54zOZ%3A6%3A426%0A%20%20%20%20at%20https%3A%2F%2Fsecure.narsol.org%2Fwp-content%2Fplugins%2Fcivicrm%2Fcivicrm%2Fbower\_components%2Fangular%2Fangular.min.js%3Fr%3D54zOZ%3A25%3A235%0A%20%20%20%20at%20b%20(https%3A%2F%2Fsecure.narsol.org%2Fwp-content%2Fplugins%2Fcivicrm%2Fcivicrm%2Fbower\_components%2Fangular%2Fangular.min.js%3Fr%3D54zOZ%3A24%3A282)%0A%20%20%20%20at%20https%3A%2F%2Fsecure.narsol.org%2Fwp-content%2Fplugins%2Fcivicrm%2Fcivicrm%2Fbower\_components%2Fangular%2Fangular.min.js%3Fr%3D54zOZ%3A25%3A20%0A%20%20%20%20at%20https%3A%2F%2Fsecure.narsol.org%2Fwp-content%2Fplugins%2Fcivicrm%2Fcivicrm%2Fbower\_components%2Fangular%2Fangular.min.js%3Fr%3D54zOZ%3A40%3A17%0A%20%20%20%20at%20q%20(https%3A%2F%2Fsecure.narsol.org%2Fwp-content%2Fplugins%2Fcivicrm%2Fcivicrm%2Fbower\_components%2Fangular%2Fangular.min.js%3Fr%3D54zOZ%3A7%3A371)%0A%20%20%20%20at%20g%20(https%3A%2F%2Fsecure.narsol.org%2Fwp-content%2Fplugins%2Fcivicrm%2Fcivicrm%2Fbower\_components%2Fangular%2Fangular.min.js%3Fr%3D54zOZ%3A39%3A382)%0A%20%20%20%20at%20fb%20(https%3A%2F%2Fsecure.narsol.org%2Fwp-content%2Fplugins%2Fcivicrm%2Fcivicrm%2Fbower\_components%2Fangular%2Fangular.min.js%3Fr%3D54zOZ%3A43%3A381)%0A%20%20%20%20at%20c%20(https%3A%2F%2Fsecure.narsol.org%2Fwp-content%2Fplugins%2Fcivicrm%2Fcivicrm%2Fbower\_components%2Fangular%2Fangular.min.js%3Fr%3D54zOZ%3A21%3A19)%0A%20%20%20%20at%20Gc%20(https%3A%2F%2Fsecure.narsol.org%2Fwp-content%2Fplugins%2Fcivicrm%2Fcivicrm%2Fbower\_components%2Fangular%2Fangular.min.js%3Fr%3D54zOZ%3A21%3A332) at angular.js:38 at angular.js:4692 at q (angular.js:325) at g (angular.js:4653) at fb (angular.js:4575) at c (angular.js:1809) at Gc (angular.js:1830) at se (angular.js:1715) at HTMLDocument. (angular.js:32616) at i (jquery.min.js?r=54zOZ:2)

volunteer\_app.css Failed to load resource: the server responded with a status of 404 (Not Found)

volunteer.css Failed to load resource: the server responded with a status of 404 (Not Found)

volunteer\_events.css Failed to load resource: the server responded with a status of 404 (Not Found)

# Answer
> 1 votes
I have just installed Wordpress 4.7.27 - I am not getting the issue. So this is not a core issue

clearing the cache and try again

else try reinstalling the wordpress again that should fix

I guess this helps !!!!

---
Tags: wordpress, civievent, configuration, dates
---


# Question
Title: Adding defaults for custom field - dependant on encounter medium civiCase/rules
Trying to speed up data entry in back end, by pre-filling 4 custom fields in the case, using rules, the defaults would vary based on encounter medium. I can only seem to update the case status using an action. I looked at creating new rule action but couldn't find any instructions I understood. Is there a better way to do this or can someone point me at some simple instructions?

# Answer
> 1 votes
depends on what you mean by simple instructions :-) As you probably know simply is subjective.........

If you mean: without programming, you can not add a new rule in CiviRules without programming. If you would like to program but find the instructions on the CiviRules cookbook https://docs.civicrm.org/civirules/en/latest/create-your-own-action/ too complicated I reckon you will need some training on CiviCRM customization as most of the terminology used is IMO fairly straightforward for CiviCRM developers?

---
Tags: civirules
---


# Question
Title: Direct Debit ACH/EFT Contribution: Asking for Banking Info Twice
When trying to complete a contribution using ACH/EFT our donation page (http://www.thewellspringfoundation.org/donate) **is asking donors to enter their banking information twice.**

The form is asking for the *Name of the Account Holder*, *Account Number*, *Bank Number + Transit Number*, and *Bank Name* in the *Direct Debit Information* section before the *Billing Name and Address* section **AND** then after the *Billing Name and Address* section it is asking for *Transit Number*, *Bank Number*, and *Account Type*. **After filling in all the info, the Contribute button is greyed out.** I believe this is because the *Bank Account Number* field is not displayed in the lower section, which I believe is generated by the iATS extension. See screenshot:

I have also noticed that the 'cheque' image is not found, as it it looking in the wrong place, the absolute path to the file, which could be due to something in my directories settings(?!?).

I upgraded to CiviCRM 4.7.28 earlier today. I am using CiviCRM in Wordpress 4.9.1. I have the following Extensions active in CiviCRM:

* iATS Payments 1.6.1
* Summary Fields v. 3.1.1
* Extended Report v. 3.0
* Displays relationships in the contact summary v. 1.2
* Mailchimp v. 2.0.1

# Answer
> 0 votes
Exactly - the broken image for the cheque display tells us that the template/js from the iATS Extension are not loading properly

First thing to do is to check your Resource Settings URL: civicrm/admin/setting/url?reset=1 specifically the Extension Resource URL

Second thing to do is to start up a browser inspector tools - and check the console -\> for javascript errors when you load the page;

---
Tags: civicontribute, payment-processor, contribution-page, iats
---


# Question
Title: Wrong email being sent for event confirmations
Until recently, the correct email was being sent out when someone registered. Recently (I don't know exactly when since I don't get a copy of them), the wrong one started going out. I can't figure out why.

The email template being sent is *Events - Registration Confirmation and Receipt (on-line)*.

It used to be that the text under this was sent out if you registered:

```
    {if $event.confirm_email_text AND (not $isOnWaitlist AND not $isRequireApproval)}

```

Now instead of it sending out that, it's sending out what is under the else that is under that.

What could have caused this? The events do not have a waitlist, nor do they require approval. Occasionally we do have ones that do have either/both of those, but none of the current events do.

Thanks!

EDIT: Sorry, forgot to add that this is CiviCRM 4.7.22 and Drupal. I don't know of any PHP updates, but those things sometimes happen via the hosting company without our knowledge. The last CiviCRM updates should have been done prior to the last time I tested the email process a couple weeks back or so.

# Answer
> 1 votes
I have just a suggestion for debugging:

1. Enable debugging at `civicrm/admin/setting/debug`.
2. Add the smarty token `{debug output="html"}` to the workflow message template.
3. Now a dump of all the smarty variables and their values are shown in the email. Better to this on a test instance because you do not want your participants to see this.
4. Examine the values of `$event.confirm_email_text`, `$isOnWaitlist` and `$isRequireApproval`. Maybe this gives some more information.

# Answer
> 0 votes
In my experience, registration (receipt etc.) emails can be very finicky, one small character "{" out of place and things can go south quickly.

Have you've customized your email language? If so, you can revert to the default email message - don't forget to keep a copy of your customizations - and run a test registration to see if the error still exists.

---
Tags: civievent, drupal, 4.7, system-workflow-messages
---


# Question
Title: Unable to Update Search Preferences After Upgrading to CiviCRM 4.7.28
I have just upgraded from version 4.7.22 to 4.7.28 (with Drupal version 7.56) and am no longer able to save changes on the Search Preferences screen. When I try to save I get an error:

"Save Failed - DB Error: Unknown Error"

This was a known issue at https://issues.civicrm.org/jira/browse/CRM-19610, but it has been marked as fixed as of version 4.7.21, so it seems like it is still causing problems.

From the Backtrace given below, it looks like Civi is trying to update the information\_schema database, but as I am on a shared server, it will not have permissions to do this.

Similar questions were also asked at Unknown DB Error When Trying to Disable the Automatic Wildcard Option and Why can't I save search preferences? Specifically 'Autocomplete Results, however none of the solutions have worked for me.

Can anyone suggest a solution. I realise I can update the DB tables directly if necessary.

The backtrace for the error is:

```
    Dec 15 10:36:47  [info] $backTrace = #0 /home/wfto/www/www/sites/all/modules/civicrm/CRM/Core/Error.php(945): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 [internal function](): CRM_Core_Error::exceptionHandler(Object(DB_Error))
#2 /home/wfto/www/www/sites/all/modules/civicrm/packages/PEAR.php(921): call_user_func((Array:2), Object(DB_Error))
#3 /home/wfto/www/www/sites/all/modules/civicrm/packages/DB.php(985): PEAR_Error->__construct("DB Error: unknown error", -1, 16, (Array:2), "\n      SELECT i.name as index_name\n      FROM information_schema.innodb_sys...")
#4 /home/wfto/www/www/sites/all/modules/civicrm/packages/PEAR.php(575): DB_Error->__construct(-1, 16, (Array:2), "\n      SELECT i.name as index_name\n      FROM information_schema.innodb_sys...")
#5 [internal function](): PEAR->_raiseError(Object(DB_mysqli), NULL, -1, NULL, NULL, "\n      SELECT i.name as index_name\n      FROM information_schema.innodb_sys...", "DB_Error", TRUE)
#6 /home/wfto/www/www/sites/all/modules/civicrm/packages/PEAR.php(224): call_user_func_array((Array:2), (Array:8))
#7 /home/wfto/www/www/sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->__call("raiseError", (Array:7))
#8 /home/wfto/www/www/sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -1, NULL, NULL, "\n      SELECT i.name as index_name\n      FROM information_schema.innodb_sys...", "DB_Error", TRUE)
#9 /home/wfto/www/www/sites/all/modules/civicrm/packages/DB/mysqli.php(933): DB_common->raiseError(-1, NULL, NULL, NULL, "1227 ** Access denied; you need (at least one of) the PROCESS privilege(s) fo...")
#10 /home/wfto/www/www/sites/all/modules/civicrm/packages/DB/mysqli.php(403): DB_mysqli->mysqliRaiseError()
#11 /home/wfto/www/www/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysqli->simpleQuery("\n      SELECT i.name as index_name\n      FROM information_schema.innodb_sys...")
#12 /home/wfto/www/www/sites/all/modules/civicrm/packages/DB/DataObject.php(2446): DB_common->query("\n      SELECT i.name as index_name\n      FROM information_schema.innodb_sys...")
#13 /home/wfto/www/www/sites/all/modules/civicrm/packages/DB/DataObject.php(1635): DB_DataObject->_query("\n      SELECT i.name as index_name\n      FROM information_schema.innodb_sys...")
#14 /home/wfto/www/www/sites/all/modules/civicrm/CRM/Core/DAO.php(369): DB_DataObject->query("\n      SELECT i.name as index_name\n      FROM information_schema.innodb_sys...")
#15 /home/wfto/www/www/sites/all/modules/civicrm/CRM/Core/DAO.php(1318): CRM_Core_DAO->query("\n      SELECT i.name as index_name\n      FROM information_schema.innodb_sys...", TRUE)
#16 /home/wfto/www/www/sites/all/modules/civicrm/CRM/Core/InnoDBIndexer.php(187): CRM_Core_DAO::executeQuery("\n      SELECT i.name as index_name\n      FROM information_schema.innodb_sys...")
#17 /home/wfto/www/www/sites/all/modules/civicrm/CRM/Core/InnoDBIndexer.php(225): CRM_Core_InnoDBIndexer->findActualFtsIndexNames("civicrm_address")
#18 /home/wfto/www/www/sites/all/modules/civicrm/CRM/Core/InnoDBIndexer.php(242): CRM_Core_InnoDBIndexer->dropIndexSql("civicrm_address")
#19 /home/wfto/www/www/sites/all/modules/civicrm/CRM/Core/InnoDBIndexer.php(131): CRM_Core_InnoDBIndexer->reconcileIndexSqls("civicrm_address")
#20 /home/wfto/www/www/sites/all/modules/civicrm/CRM/Core/InnoDBIndexer.php(96): CRM_Core_InnoDBIndexer->fixSchemaDifferences()
#21 [internal function](): CRM_Core_InnoDBIndexer::onToggleFts("0", "0", (Array:13), 1)
#22 /home/wfto/www/www/sites/all/modules/civicrm/Civi/Core/SettingsBag.php(365): call_user_func((Array:2), "0", "0", (Array:13), 1)
#23 /home/wfto/www/www/sites/all/modules/civicrm/Civi/Core/SettingsBag.php(272): Civi\Core\SettingsBag->setDb("enable_innodb_fts", "0")
#24 /home/wfto/www/www/sites/all/modules/civicrm/Civi/Core/SettingsBag.php(169): Civi\Core\SettingsBag->set("enable_innodb_fts", "0")
#25 /home/wfto/www/www/sites/all/modules/civicrm/CRM/Core/BAO/Setting.php(210): Civi\Core\SettingsBag->add((Array:10))
#26 /home/wfto/www/www/sites/all/modules/civicrm/api/v3/Setting.php(282): CRM_Core_BAO_Setting::setItems((Array:12), (Array:1))
#27 /home/wfto/www/www/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_setting_create((Array:12))
#28 /home/wfto/www/www/sites/all/modules/civicrm/Civi/API/Kernel.php(169): Civi\API\Provider\MagicFunctionProvider->invoke((Array:9))
#29 /home/wfto/www/www/sites/all/modules/civicrm/Civi/API/Kernel.php(100): Civi\API\Kernel->runRequest((Array:7))
#30 /home/wfto/www/www/sites/all/modules/civicrm/api/api.php(23): Civi\API\Kernel->runSafe("setting", "create", (Array:11), NULL)
#31 /home/wfto/www/www/sites/all/modules/civicrm/CRM/Admin/Form/Setting.php(212): civicrm_api("setting", "create", (Array:11))
#32 /home/wfto/www/www/sites/all/modules/civicrm/CRM/Admin/Form/Setting.php(171): CRM_Admin_Form_Setting->commonProcess((Array:12))
#33 /home/wfto/www/www/sites/all/modules/civicrm/CRM/Core/Form.php(447): CRM_Admin_Form_Setting->postProcess()
#34 /home/wfto/www/www/sites/all/modules/civicrm/CRM/Core/StateMachine.php(160): CRM_Core_Form->mainProcess()
#35 /home/wfto/www/www/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Next.php(61): CRM_Core_StateMachine->perform(Object(CRM_Admin_Form_Setting_Search), "next", "Next")
#36 /home/wfto/www/www/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Next->perform(Object(CRM_Admin_Form_Setting_Search), "next")
#37 /home/wfto/www/www/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Admin_Form_Setting_Search), "next")
#38 /home/wfto/www/www/sites/all/modules/civicrm/CRM/Core/Controller.php(351): HTML_QuickForm_Page->handle("next")
#39 /home/wfto/www/www/sites/all/modules/civicrm/CRM/Utils/Wrapper.php(113): CRM_Core_Controller->run()
#40 /home/wfto/www/www/sites/all/modules/civicrm/CRM/Core/Invoke.php(283): CRM_Utils_Wrapper->run("CRM_Admin_Form_Setting_Search", "Search Preferences", NULL)
#41 /home/wfto/www/www/sites/all/modules/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:15))
#42 /home/wfto/www/www/sites/all/modules/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:4))
#43 /home/wfto/www/www/sites/all/modules/civicrm/drupal/civicrm.module(448): CRM_Core_Invoke::invoke((Array:4))
#44 [internal function](): civicrm_invoke("admin", "setting", "search")
#45 /home/wfto/www/www/includes/menu.inc(527): call_user_func_array("civicrm_invoke", (Array:3))
#46 /home/wfto/www/www/index.php(21): menu_execute_active_handler()
#47 {main}

```

# Answer
> 1 votes
This is a bug that came back in CiviCRM 4.7.28. Ben and I worked through a fix, which is submitted as CRM-21568.

---
Tags: drupal, database, search
---


# Question
Title: I cannot get the installer civicrm screen
I have downloaded and unzipped the files. In wordpress when i click on the menu "install civicrm" i have no answer, the screen remains. See screencap

Thank you for help

My hosting is by 000webhost free

Marc

# Answer
Welcome to the CiviCRM community!

After enabling CiviCRM on the WordPress plugins page, you must run the CiviCRM installer. Please see the WordPress installation instructions for details.

If you still have trouble, please post a new question, indicating a) the version of WordPress and CiviCRM; b) what steps you've taken, and which aren't working.
> 1 votes

# Answer
You need to click the Plugins tab and activate CiviCRM.
> 0 votes

# Answer
I found the answer to my problem.

The download of files was incomplete, i did it again properly and completely and it works quite well.

Thank you for those who answered.

MB
> -1 votes

---
Tags: installation
---


# Question
Title: CiviEvent Listing module in Joomla not finding database table
We are working on a long-needed update of our website. I thought I would take the opportunity to also follow what many say is best practice and move our Civi db out of a db shared with our Joomla CMS. I have done this on our development site, and so far so good. Except, that when trying to create a new CiviEvent Listing Joomla module, I get this error: "*Table '\[organization\]\_dev.civicrm\_event' doesn't exist*"

It is true that doesn't exist, because it should be looking for *\[organization\]**\_dev\_civi**.civicrm\_event*. The db *\[organization\]\_dev* is the CMS only. I've reconfirmed that my database settings are correct in civicrm.settings.php in both Administrator and component. I've cleared the Joomla cache.

Any ideas what's going on? Where else can I look?

UPDATE:

In searching for possible fixes, I have made the following changes, to no avail:

Added this line in CMS config file (www/dev/configuration.php) under class JConfig:

```
public $cividb = 'username_dev_civi';

```

in www/dev/administrator/components/com\_civicrm/configure.php

```
     'dbName' => $jConfig->db,

```

changed to

```
    'dbName' => $jConfig->cividb,

```

In CiviEvent Listing module file (www/dev/modules/mod\_civievent/helper.php)

```
    $db = JFactory::getDBO();

```

Changed to

```
    $db = 'username_dev_civi';

```

# Answer
Sounds like you also need to update the settings inside your file that points to your Joomla database. I don't know exactly where that is, as I use Drupal. But mine is at /home/username/public\_html/sites/default/settings.php. That is where I tell Drupal how to connect to its database. Every CMS I've ever worked with has something similar. Inside that file is a listing of CiviCRM database tables so that your CMS can connect. If you haven't changed it there, then Joomla is still looking for the old database.

Edit:

The lines you're editing in your CMS's settings file would look similar to this below. Unfortunately it doesn't get formatted right when pasting in here, so I've only included the first dozen lines or so.

```
$databases['default']['default']['prefix']= array(
  'default' => '',
  'civicrm_acl'                              => '`username_civicrm`.',
  'civicrm_acl_cache'                        => '`username_civicrm`.',
  'civicrm_acl_contact_cache'                => '`username_civicrm`.',
  'civicrm_acl_entity_role'                  => '`username_civicrm`.',
  'civicrm_action_log'                       => '`username_civicrm`.',
  'civicrm_action_mapping'                   => '`username_civicrm`.',
  'civicrm_action_schedule'                  => '`username_civicrm`.',
  'civicrm_activity'                         => '`username_civicrm`.',
  'civicrm_activity_contact'                 => '`username_civicrm`.',
  'civicrm_address'                          => '`username_civicrm`.',
  'civicrm_address_format'                   => '`username_civicrm`.',

```
> 0 votes

---
Tags: joomla, database, cms-integration
---


title: CiviVolunteer Interest form actions

text:
# Question
Title: CiviVolunteer Interest form actions
I've installed CiviVolunteer and have a public facing interest form at http://example.org/civicrm/volunteer/join

But all this seems to do is create a contact. It doesn't put the contact anywhere that we can easily find them to tell them of volunteer opportunities. Am I missing something?

# Answer
It adds them to CiviCRM and then you can search for them. You likely need to add a group or tag (I like a group, as I use it for mailing lists) to the settings for the profile that you are using. Then anytime someone fills out that form, they are added to your Volunteer group. Then inside CiviCRM you can easily run a search to pull the entire list of everyone who has signed up on that form.

And by using a group, you can then send them emails with volunteer opportunities - just make sure you select that it's for mailings when you create the group.
> 2 votes

---
Tags: profile, activities, civivolunteer
---


# Question
Title: HTTP ERROR 500 for New Mailing after SendGrid SMTP Relay setup
I've set up SendGrid in order to better understand issues we are having with our newsletters. In the Settings -Outbound Mail, I am able to Save and Send Email. However, when I go to Mailing \> New Mailing, I get: This page isn’t working www.oursitename.org is currently unable to handle this request. HTTP ERROR 500

# Answer
More often than not, I find 500 errors to be server errors where I need my host's help with it. It could be that a php setting is not high enough, such as memory allocated or execution time on a script. I also get it when I am running into a security issue on the server. Usually tech support has me try the process while they are working with me so they can see the server logs in real time. They just need your IP address first so that they can follow along.

What CMS are you using? If it's Drupal, I can tell you real quick how to find your PHP settings. Not sure if it is in the same place in the other systems.
> 1 votes

---
Tags: mailing, smtp
---


# Question
Title: How to Insert html in custom field (type TextArea) via API
I have a custom field with data type 'Note' and field type 'TextArea'. When I insert a value using the CiviCRM interface, I can insert text via an editor, and bold text gets displayed as bold, italic etc.

Now I want to put html in this same field using the API, but the problem is that any html characters are converted to html entities when inserted.

```
  $params = array(
  'contact_id' => $contact_id,
  'entity_id' => $contact_id,
  'custom_' . $content_field_id => '<div class="note_content">' . implode('</div><div class="note_content">', $data['note_content']) . '</div>',
);
$create_note_result = $spcivi->api('CustomValue', 'create', $params);

```

html send via api:

```
<div class="note_content"><strong>Vette</strong> tekst is toegestaan!</div><div class="note_content"><em>Shuine</em> ook!</div>

```

result content in field:

```
<div class="note_content"><strong>Vette</strong> tekst is toegestaan!</div><div class="note_content"><em>Shuine</em> ook!</div>

```

Is there a way to insert html without the html characters being converted to html entities? Using the field type TextArea becomes quite useless when not html can be inserted.

# Answer
Have you tried any of the following before submitting the TextArea?

1. Highlight the code portion and Ctrl + K or Command K
2. Indent the code lines 4 spaces
3. Use backtics ' your html '
4. Use code tag `<code>your html</code>`
> 1 votes

# Answer
This appears to be unsupported in the API, which encodes all HTML values. I've created a JIRA issue to request this functionality: https://issues.civicrm.org/jira/browse/CRM-21572
> 1 votes

---
Tags: custom-fields, api, html
---


# Question
Title: Send mail when my grant status has been changed
I am try to send mail when grant status has been changed. For this I am using CiviRules . I create a rule Trigger(Grant is changed). Then I try to add my status condtion but not find it. Can anyone suggest me what I am doing wrong.

Thanks

# Answer
> 1 votes
CiviRules is a work in progress. Maybe this condition is not implemented yet. But you can do it yourself. The following manual describes how:

https://docs.civicrm.org/civirules/en/latest/create-your-own-condition/

---
Tags: civirules, civigrant
---


title: dashlet creation

text:
# Question
Title: dashlet creation
I have been asked if it is possible to create a 'team info' dashlet that can be used for getting info to everyone in the team when they log on to CiviCRM at the start of each working day. Any ideas as to how to do this would be welcome. The organisation concerned is using CiviCRM 4.6.33 and Joomla 3.8.3

# Answer
> 1 votes
When you create a dashlet, you are just giving the url or a page without any "chrome" (navigation menu, side columns, footers..) Just the content to be displayed.

If you can produce such minimal html section for your team info, you should be able to have it displayed in a dashlet.

Check out the news dashlet, it's basically what it does

---
Tags: dashboard
---


title: CiviCRM REST API Call

text:
# Question
Title: CiviCRM REST API Call
I'm new to CiviCRM and REST API Calls. I'm attempting to create a new contact using POST via Postman. I'm submitting the following:

```
http://www.mysite.com/wp-content/plugins/civicrm/civicrm/extern/rest.php?entity=Contact&action=create&api_key=(myAPIkey)&key=(mySiteKey)&json:{“contact_type":"Individual","first_name":"Tester","last_name":"Yolanda"}

```

But I get the response back:

```
     <br />
    <b>Warning</b>:  Invalid argument supplied for foreach() in
<b>/wp-content/plugins/civicrm/civicrm/CRM/Utils/REST.php</b> on line
<b>167</b>
<br />
<?xml version="1.0"?>
<ResultSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
      </ResultSet>

```

I glanced at line 167 - it seems to be about constructing the response. I know I'm getting some kind of connection - If I change a character in the site or API key, I get "failed to authenticate" - so that part seems to be working.

CiviCRM version 4.7.27, Wordpress version 4.9.1

Thanks for any pointers!

# Answer
As kainuk mentioned, you don't have the right syntax for the json field, i needs to be json= instead of json:

```
http://www.mysite.com/wp-content/plugins/civicrm/civicrm/extern/rest.php?entity=Contact&action=create&api_key=(myAPIkey)&key=(mySiteKey)&json={“contact_type":"Individual","first_name":"Tester","last_name":"Yolanda"}

```

(it needs to be post, not get for all operations like create that modify the database)

and I would strongly recommend you to do rest over an encrypted connection (https instead of http), otherwise you risk having your keys being read by someone else than civi

X+
> 4 votes

# Answer
I tried the same but not with Postman but with a different application outside civicrm - I managed to create a contact without any error message

so, Please try as below this should work

> http://www.mysite.com/wp-content/plugins/civicrm/civicrm/extern/rest.php?entity=Contact&action=create&api\_key=(myAPIkey)&key=(mySiteKey)&json=1&contact\_type='Individual'&first\_name='Tester'&last\_name='Yolanda'

I guess this helps !!!
> 0 votes

---
Tags: contacts, api, rest
---


title: Smarty Custom Variable / Token Array

text:
# Question
Title: Smarty Custom Variable / Token Array
We've written a custom token to pull a piece of custom data off of any open cases. The token works as an imploded variable. I'd like to be able to use the token as an array as well (so I can run a for each loop in an email communication.) I am having trouble accessing the array.

If I use the variable {extrainfo.namearray} the email prints "Array". I've tried a simple foreach loop

```
{foreach from=extrainfo.namearray item=value key=label}
    <tr>
    <td>{$label}</td>
    <td>{$value}</td>
    </tr>
{/foreach}

```

This prints out an "0" and "extrainfo.namearray" I can only assume that's becuase I don't have the "$" before the token name. The statement prints out nothing if I add the $ to the token name.

I know the array has content, if I use {debug} in an email, I can see that it is part of the {$contact} tokens. It prints our the array itself with the expected data:

```
extrainfo.namearray => Array (3)
97485 => "Name 1"
97486 => "Name 2"
97547 => "Name 3"

```

I also tried accessing it in this manner {$contact.extrainfo.namearray} but that prints nothing (not even "Array").

Any advice on how I can target/loop items in the {extrainfo.namearray} array?

# Answer
> 1 votes
Through further testing I found that if I FIRST include the {extrainfo.namearray} token (which simply prints 'array') and THEN run a loop through the contact array, it does in fact show all of the tokens!

In the case anyone else finds this useful, my final code:

```
{extrainfo.namearray} // hide this so not seen in email
  {foreach name=outer from=$contact key=k item=it}
     {if $k == 'extrainfo.namearray' }
       {foreach name=mid from=$it item=inn}
           {$inn}
       {/foreach}
     {/if}
  {/foreach}

```

I'm not sure why I have to include the custom array first before it will include it in the contact array so that I can properly loop through it - but alas it's a workaround that works!!!

# Answer
> 0 votes
The substitution of the email tokens is done by the `CRM_Utils_Token` class, not by smarty. But is possible to extend the smarty template variables using the following code.

```
 $template = CRM_Core_Smarty::singleton();
 $template -> assign('extrainfo',array(
   97485 => "Name 1"
   97486 => "Name 2"
   97547 => "Name 3"
 )

```

You have however to find the correct hook to add this code. A good candidate is maybe the civicrm\_postProcess hook of the form that sends the email.

Another, more generic, possibility to explore is to use `{crmApi}` smarty tag to use the Api to add more information to an email. Examples are generated by the API explorer.

---
Tags: tokens, smarty
---


# Question
Title: Submit Credit Card payment missing after update
our non-profit uses civiCRM. Recently we updated from version 4.5.5 to 4.7.16

The update caused the an important option to disappear. On the contributions category the option "Submit Credit Card contribution" was available before our update next to the line "Click Record Contribution to record a new contribution received from this contact."

Currently, we are not able to charge CC of a donor without having to go and do that via paypal. I do not think this has anything to do with "paypal pro" as the option was available to us before the civiCRM update.

# Answer
> 1 votes
I was having this issue also in Drupal, after upgrading from 4.7.15 to 4.7.27 and what I found was that it was a caching issue. I needed to delete everything *inside* the `sites/default/files/civicrm/templates_c` directory.

---
Tags: 4.7, paypal, upgrade
---


# Question
Title: Anyone else getting a webform error for a non-required date field?
I'm experiencing, in the current Webform version (7.x-4.16), an issue reported fixed last year (issue #2612844). Anyone else experiencing it?

A date field with "Hide" checked for Day and Month (only interested in the year). The hint says "A hidden day or month will be set to 1." Instead getting errors for Month missing and Day missing upon form submission.

# Answer
Yes I get this when I add a Relationship on a webform and set Day and Month to be hidden.

I expect this needs to be done as an 'improvement' to the webform\_civicrm code - you might want to open an issue at drupal.org/project/webform\_civicrm but it will probably require some effort/funding to get it added
> 1 votes

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


title: Transferring Data Out of CiviCRM

text:
# Question
Title: Transferring Data Out of CiviCRM
Some time ago we transferred data from CiviCRM to a different CRM (YourMembership). However, it has become apparent that we have not collected all of the data.

We have the web version CiviCRM 4.6.21. I am trying to export ALL of the data, but I keep getting warnings and errors that there is not enough memory in one of the lines of code.

In addition to that, even when I segment the data and export it in chunks, some of the data in each individual records appears to exist only within the record, and not in some master spreadsheet (e.g. ticket sales).

Any help would be greatly appreciated.

Thank you.

# Answer
Exporting 'all' data is not a simple process. You will need to eg

* Find all Contacts: export including all Custom Fields using for Contacts
* Find all Contribution: export including all Custom Fields using for Cont
* Find all Events: export including all Custom Fields using for Cont
> 2 votes

---
Tags: error, database, export
---


title: x_subscription_id For Authorize.net

text:
# Question
Title: x_subscription_id For Authorize.net
I am trying to test recurring transactions that were failing in production and in a dev instance.

For testing I am using the curl command from https://docs.civicrm.org/sysadmin/en/latest/setup/payment-processors/authorize-net/#online-form-testing-method.
`curl https://dev.domain.com/sites/all/modules/civicrm/extern/authorizeIPN.php -d x_amount=0.25 -d x_cust_id=9025 -d x_invoice_num=5273 -d x_trans_id=12345TEST`

This is what I am finding in my CiviCRM log. I see the form example in the book has x\_subscription\_id but not the curl command.

Dec 19 04:54:55 \[info\] Could not find an entry for x\_subscription\_id

Dec 19 04:54:55 \[info\] $error data = Array ( \[error\_code\] =\> 0 )

Dec 19 04:54:55 \[info\] $REQUEST = Array ( \[x\_amount\] =\> 0.25 \[x\_cust\_id\] =\> 9025 \[x\_invoice\_num\] =\> 5273 \[x\_trans\_id\] =\> 12345TEST )

Any help is appreciated.

Thanks, Josh

# Answer
You are missing `-d x_subscription_id=21930455` in your curl command (just change it to your subscription\_id).
> 1 votes

---
Tags: civicontribute, authorize.net
---


# Question
Title: Wordpress Shortcodes for Displaying subsets of events
I understand there is a shortcode for displaying a list of upcoming events, that is

\[civievent\_widget\]

Is there a way to display categories of events as shown below?

http://www.torontodance.com/events/categories/salsa/

Also are there ways to filter events by location and other filters? If so, how?

Thank you!

# Answer
> 2 votes
The shortcode you refer to is provided by the CiviEvent Widget plugin. It has a number of configuration options which you can read about on the plugin homepage. I would look at the `custom_filter` options to see if you can make it fit your requirements.

If the widget doesn't allow filtering by event category, I'd consider a more complex (but also more flexible) system based on Event Organiser and CiviCRM Event Organiser which will definitely do what you're after.

Have a look at the standard calendar, an event category and the list of events at a venue for the kind of things that are available out of the box.

# Answer
> 2 votes
Christian is correct. You can do this using the "Custom" tab of the CiviEvent Widget. Use a JSON code in the "Custom API filter" field like this:

{"event\_type\_id": 7}

Where "7" is the id of the event type you want.

You can even use a range of type ids like this:

{"event\_type\_id": {"\>=": 7}}

---
Tags: wordpress, civievent
---


# Question
Title: How can I disable the JQuery date widget and all just text input?
CiviCRM 4.7.3 Worpdress 4.4.2

Due to issues with the JQuery date widget (e.g. Month and year, or year only formats are not saved and date list only goes back 10 years), I would like to simply disable it to avoid any confusion.

Is there an easy way to do this?

# Answer
> 2 votes
Adding the following CSS disables the date picker widget and allows users to simply type the date into the field:-

```
#ui-datepicker-div, .ui-datepicker .ui-widget  { display: none !important; }

```

# Answer
> 1 votes
You could also set your date preferences in Administer \>\>Localization \>\>Date formats (possible you'd also need to look at Administer \> Customize Data and Screens \> Date Preferences depending on your needs.)

If it's a custom date field, you could easily set the date input preference to Month and year and increase the date range as needed.

---
Tags: dates, date-preferences
---


# Question
Title: Installed on Subdomain Civimail is blank
I just installed civi 4.7.27 on Wordpress 4.9.1 into a subdomain example.mysite.com The civimail New Mailing page is blank and the System Status page is blank. Other pages are probably blank too.

# Answer
I want to let everyone know that I have resolved this issue. Apparently when installing Civi into a subdomain, you need to configure the resource urls to absolute paths instead of relying on the short codes. See screenshot below. If you ever have this issue, try making your resource urls look like that.
> 2 votes

# Answer
Please double/triple check that the paths you have set for Directories and Resources (both under Admin \> System Settings) are correct.
> 1 votes

---
Tags: wordpress, civimail, installation
---


# Question
Title: Print PDF Letter. Image not readable or empty
When using the "Print PDF letter for Contacts" action, I tried to add an image and when I downloaded the PDF file, in place of the image, said "Image not readable or empty"

I've tried all the solutions listed here: https://stackoverflow.com/questions/25558449/dompdf-image-not-readable-or-empty and nothing.

Thks

# Answer
> 1 votes
Please try to add Image tool and upload your image using the Image tool that should work correctly - please try the same against Demo server

# Answer
> 0 votes
There were instructions here suggesting using the image path of sites/files/etc ... and yes I mean without a leading slash

I was slightly doubtful of this but it definitely fixed the problem in our case, so using

```
<img src="sites/example.org/files/logo.png">

```

worked for us.

---
Tags: pdf
---


# Question
Title: PayPal Contributions listed as Pending (Incomplete Transaction)
I'm running CiviCRM on the latest version of Wordpress and since the beginning of December, when I upgraded CivicCRM to 4.7.14 (although it is possible that it started when I upgraded to 4.7.13, I don't have the exact dates I did the upgrade), I've had an issue with PayPal standard contributions being listed as "Pending (Incomplete Transaction)". As a result, membership renewals are not being renewed and receipts are not being sent to our members.

After digging around, I was able to confirm that the Paypal IPN appears to be working. I'm able to see the IPN message logged in the civicrm\_system\_log table after every transaction. I've put an example of one such message from the system log below, with personally identifying information blocked out:

> {"page":"CiviCRM","q":"civicrm/payment/ipn/1","noheader":"1","transaction\_subject":"","payment\_date":"04:19:32 Dec 22, 2016 PST","txn\_type":"web\_accept","last\_name":"doe","residence\_country":"US","item\_name":"416-497-Membership Renew","payment\_gross":"50.00","mc\_currency":"USD","business":"organization@clubname.org","payment\_type":"instant","protection\_eligibility":"Ineligible","verify\_sign":"AqNs9DpWzUAQyDfgFPwuR482uwS5AjALjQykxLxxxxxxxxxx.xxxxxxxx","payer\_status":"unverified","payer\_email":"john@johndoe.com","txn\_id":"89J243361xxxxxxxx","quantity":"1","receiver\_email":"organization@clubname.org","first\_name":"john","invoice":"54e25fc0c32d4d259e6f0a1aaxxxxxxxx","payer\_id":"T72CDJGxxxxxx","receiver\_id":"ZHZCAVNxxxxxx","item\_number":"","payment\_status":"Completed","payment\_fee":"1.40","mc\_fee":"1.40","mc\_gross":"50.00","custom":"{\\"module\\":\\"contribute\\",\\"contactID\\":\\"416\\",\\"contributionID\\":497,\\"membershipID\\":\\"380\\",\\"contributionRecurID\\":86,\\"contributionPageID\\":\\"1\\"}","charset":"windows-1252","notify\_version":"3.8","ipn\_track\_id":"f0958f92xxxx","IDS\_request\_uri":"/membership/?page=CiviCRM&q=civicrm/payment/ipn/1&","IDS\_user\_agent":"PayPal IPN ( https://www.paypal.com/ipn )"}

However, CiviContribute never seems to update the status of the contribution. I did notice that the content of the IPN messages in the system\_log prior to December looked entirely different than the new IPN messages look.

Also, for what it is worth, I've also noticed that all contribution transactions are being marked in CiviCRM as being set to auto-renew. I was able to confirm that it is doing it without the end-user requesting it when I duplicated it in a PayPal sandbox session. After filling out a contribution form, I went and looked in CiviCRM and my test transaction was also set to auto-renew. I don't know if this is a related issue, or a separate problem entirely.

Any help or insight is greatly appreciated, as this bug has returned our membership management to an almost entirely manual operation once again!

# Answer
See this thread - I have to overwrite ipn.php with an old version after every upgrade, to get payments working again Paypal payments - Pending (Incomplete Transaction)
> 1 votes

# Answer
I used to fight this issue...

1) PayPal standard is sub-par, you donors can't do recurring donations without a paypal account. Overall, the process is clunky.

2) It seems this is a recurring issue. I'd suggest adopting a processor like authorize.net which I have not had these issues with.
> 0 votes

---
Tags: wordpress, civicontribute, paypal, ipn, 4.7.14
---


title: Making member-only websites

text:
# Question
Title: Making member-only websites
We are a small charity using CiviCRM with WordPress.

I had a look at existing question Member only page-login using civicrm database , but the answer does not address our scenario, i.e. how to integrate members-only login for contacts from CiviCRM and users from WP.

We want to provide some pages for members only.

# Answer
I use this plugin on one of me other sites but it should work on a site with Civi too. https://wordpress.org/plugins/buddypress-members-only/

In the plugin settings, you can set the login page and you can whitelist urls on your site that are open to the public.
> 1 votes

# Answer
You need to install the CiviCRM WordPress Member Sync plugin. This will allow you to sync a CiviCRM Membership or Group with a WordPress role or capability.

Once you've done this, you'll need a second WordPress plugin to restrict pages by role. There are several WordPress plugins to accomplish this; which one works best for your situation may vary.
> 1 votes

---
Tags: wordpress, civimember, user-account
---


# Question
Title: Scheduled jobs cron not working properly
We use CPanel to run crons on our sites. The cron had been working fine and then stopped some months back. I've tried every example I can find, but it still is not running properly.

I've attached a screenshot of what the cron looks like in CPanel as well as the cron in text (redacted to remove personal info). The username, password, and key are all letters/numbers - no special characters.

wget -O - -q -t 1 'https://www.DOMAIN.org/sites/all/modules/civicrm/bin/cron.php?name=USERNAME&pass=PASSWORD&key=KEY'

# Answer
> 1 votes
Since you're using a `wget`-based cron, there should be a corresponding entry in the web server log for each cron run. Look to see the Apache value - does it return `404` or `500` or maybe something else? `404` would indicate a wrong URL; `403` would indicate it's blocked, perhaps because of the user agent (iThemes Security for WordPress does this in its default configuration). A `200` or `500` would mean to check the CiviCRM log in ConfigAndLog.

# Answer
> 0 votes
I had an issue like this once. The cron was being run by logging in with a username and password and the password for that user had changed so the cron was not able to access properly.

---
Tags: cron, scheduled-job
---


title: Smarty causing contact import to fail

text:
# Question
Title: Smarty causing contact import to fail
I have CiviCRM 4.6.28 on Drupal 7.56, hosted on Pantheon.

We are trying to import lists of contacts, but anything above 250 contacts throws a timeout error, due to Pantheon's time limits. The time limit is 240 seconds, and the files vary between 14 and 30 kbs.

I've traced the resource usage back to find that the issue is that Smarty is being used during the import. Pantheon is showing Smarty as using a lot of resources, and I believe this is the issue because we can import event participants without problem, and the only difference in resource usage seems to be that event participant imports don't use Smarty.

So, now I am trying to figure out how to get it to stop using Smarty during import. I am thinking that it is using it for handling the email greetings field. Is there a way to turn off this field? We do not have special e-mail greetings for users.

# Answer
The speed you experience seems to be much slower than usual (not that contact imports are super fast, but civi can do better than 1 per second ;)

What is the field mapping you use? the less fields you import, the faster it's going to be (mostly true, some are more expensive than others, eg current employer if you import individuals)

Are the salutations one of the fields you alter?

What is the dedupe rule you use? Some of the out of the box rules are optimised, but if you create and use your own, it might end up being super slow

What is the rule you use? update data is more expensive than ignoring duplicates, skip or replace
> 1 votes

---
Tags: import, smarty, data-import
---


# Question
Title: Can't Uninstall CiviCRM from Joomla after failed civiCRM upgrade
I am on Joomla version 3.8.2 with Php 7. I tried to upgrade to CiviCRM 4.7.28 but it failed because it was partially installed and missing important files. Now, I can't get into the Joomla administration back end to reinstall it or delete it because when I log on to the admin, I'm getting a black white screen that when I turn-on debugging, shows the error message. Subsequently, I can't do anything with the site.

My question is how do I delete civiCRM or reinstall it without doing it through Joomla?

# Answer
I unzipped the civcicrm file that did not get unzipped during the upgrade process. This allowed me to get the Joomla admin area back. I downloaded an alt version of civicrm and tried the upgrade again. It didn't work but at least I can get back into my joomla admin.
> 1 votes

---
Tags: upgrade
---


# Question
Title: Can Twilio 'from' number be a text field with the organisation name?
With Clickatell it's easy to have the 'from' number of an SMS set to your organisation name - such as 'ABC NFP' rather than '01332 46000'. Several people have asked whether this can be the case for Twilio as well? (I'm asking this question because I know the answer! - see below)

# Answer
Yes, it's easy. You have to ask Twilio customer support to enable 'Alphanumeric Sender ID' in your project. Here's the link for that. Once that's done then all you need to do is to set the 'From=' in Administer/Settings/SMS Providers to whatever you want. Of course, users cannot then reply or 'STOP' etc. But it works and there's nothing to enter or change in your Twilio account once the alphanumeric send ID is enabled, just update Civi with your chosen text.
> 5 votes

---
Tags: sms, civisms, clickatell, twilio
---


# Question
Title: Scheduled Job send_reminder failing with "No such field"
We're running Civi 4.6.16 and Drupal 7. Our schedule reminders are not sending when the job triggers, or manually through an API call. The backtrace isn't seeming that helpful, to me, but maybe it'll help someone else:

```
Nov 07 11:30:02  [info] $backTrace = #
0 /www/sites/all/modules/civicrm/CRM/Core/Error.php(897): CRM_Core_Error::backtrace("backTrace", TRUE)
1 [internal function](): CRM_Core_Error::exceptionHandler(Object(DB_Error))
2 /www/sites/all/modules/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
3 /www/sites/all/modules/civicrm/packages/DB.php(976): PEAR_Error->PEAR_Error("DB Error: no such field", -19, 16, (Array:2), "\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...")
4 /www/sites/all/modules/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-19, 16, (Array:2), "\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...")
5 /www/sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -19, NULL, NULL, "\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...", "DB_Error", TRUE)
6 /www/sites/all/modules/civicrm/packages/DB/mysqli.php(929): DB_common->raiseError(-19, NULL, NULL, NULL, "1054 ** Unknown column 'Array' in 'where clause'")
7 /www/sites/all/modules/civicrm/packages/DB/mysqli.php(403): DB_mysqli->mysqliRaiseError()
8 /www/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysqli->simpleQuery("\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...")
9 /www/sites/all/modules/civicrm/packages/DB/DataObject.php(2445): DB_common->query("\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...")
10 /www/sites/all/modules/civicrm/packages/DB/DataObject.php(1637): DB_DataObject->_query("\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...")
11 /www/sites/all/modules/civicrm/CRM/Core/DAO.php(321): DB_DataObject->query("\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...")
12 /www/sites/all/modules/civicrm/CRM/Core/DAO.php(1180): CRM_Core_DAO->query("\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...", TRUE)
13 /www/sites/all/modules/civicrm/CRM/Core/BAO/ActionSchedule.php(1298): CRM_Core_DAO::executeQuery("\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...", (Array:1))
14 /www/sites/all/modules/civicrm/CRM/Core/BAO/ActionSchedule.php(1477): CRM_Core_BAO_ActionSchedule::buildRecipientContacts(4, "20171107113002", (Array:2))
15 /www/sites/all/modules/civicrm/api/v3/Job.php(186): CRM_Core_BAO_ActionSchedule::processQueue(NULL, (Array:2))
16 /www/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_job_send_reminder((Array:1))
17 /www/sites/all/modules/civicrm/Civi/API/Kernel.php(96): Civi\API\Provider\MagicFunctionProvider->invoke((Array:9))
18 /www/sites/all/modules/civicrm/api/api.php(23): Civi\API\Kernel->run("Job", "send_reminder", (Array:1), NULL)
19 /www/sites/all/modules/civicrm/CRM/Core/JobManager.php(131): civicrm_api("Job", "send_reminder", (Array:1))
20 /www/sites/all/modules/civicrm/CRM/Core/JobManager.php(83): CRM_Core_JobManager->executeJob(Object(CRM_Core_ScheduledJob))
21 /www/sites/all/modules/civicrm/api/v3/Job.php(99): CRM_Core_JobManager->execute(FALSE)
22 /www/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_job_execute((Array:2))
23 /www/sites/all/modules/civicrm/Civi/API/Kernel.php(96): Civi\API\Provider\MagicFunctionProvider->invoke((Array:9))
24 /www/sites/all/modules/civicrm/api/api.php(23): Civi\API\Kernel->run("Job", "execute", (Array:2), NULL)
25 /www/sites/all/modules/civicrm/bin/cli.class.php(111): civicrm_api("Job", "execute", (Array:2))
26 /www/sites/all/modules/civicrm/bin/cli.php(32): civicrm_cli->callApi()
27 {main}

Nov 07 11:45:02  [info] $backTrace = #0 /www/sites/all/modules/civicrm/CRM/Core/Error.php(897): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 [internal function](): CRM_Core_Error::exceptionHandler(Object(DB_Error))
#2 /www/sites/all/modules/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
#3 /www/sites/all/modules/civicrm/packages/DB.php(976): PEAR_Error->PEAR_Error("DB Error: no such field", -19, 16, (Array:2), "\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...")
#4 /www/sites/all/modules/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-19, 16, (Array:2), "\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...")
#5 /www/sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -19, NULL, NULL, "\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...", "DB_Error", TRUE)
#6 /www/sites/all/modules/civicrm/packages/DB/mysqli.php(929): DB_common->raiseError(-19, NULL, NULL, NULL, "1054 ** Unknown column 'Array' in 'where clause'")
#7 /www/sites/all/modules/civicrm/packages/DB/mysqli.php(403): DB_mysqli->mysqliRaiseError()
#8 /www/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysqli->simpleQuery("\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...")
#9 /www/sites/all/modules/civicrm/packages/DB/DataObject.php(2445): DB_common->query("\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...")
#10 /www/sites/all/modules/civicrm/packages/DB/DataObject.php(1637): DB_DataObject->_query("\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...")
#11 /www/sites/all/modules/civicrm/CRM/Core/DAO.php(321): DB_DataObject->query("\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...")
#12 /www/sites/all/modules/civicrm/CRM/Core/DAO.php(1180): CRM_Core_DAO->query("\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...", TRUE)
#13 /www/sites/all/modules/civicrm/CRM/Core/BAO/ActionSchedule.php(1298): CRM_Core_DAO::executeQuery("\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...", (Array:1))
#14 /www/sites/all/modules/civicrm/CRM/Core/BAO/ActionSchedule.php(1477): CRM_Core_BAO_ActionSchedule::buildRecipientContacts(4, "20171107114502", (Array:2))
#15 /www/sites/all/modules/civicrm/api/v3/Job.php(186): CRM_Core_BAO_ActionSchedule::processQueue(NULL, (Array:2))
#16 /www/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_job_send_reminder((Array:1))
#17 /www/sites/all/modules/civicrm/Civi/API/Kernel.php(96): Civi\API\Provider\MagicFunctionProvider->invoke((Array:9))
#18 /www/sites/all/modules/civicrm/api/api.php(23): Civi\API\Kernel->run("Job", "send_reminder", (Array:1), NULL)
#19 /www/sites/all/modules/civicrm/CRM/Core/JobManager.php(131): civicrm_api("Job", "send_reminder", (Array:1))
#20 /www/sites/all/modules/civicrm/CRM/Core/JobManager.php(83): CRM_Core_JobManager->executeJob(Object(CRM_Core_ScheduledJob))
#21 /www/sites/all/modules/civicrm/api/v3/Job.php(99): CRM_Core_JobManager->execute(FALSE)
#22 /www/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_job_execute((Array:2))
#23 /www/sites/all/modules/civicrm/Civi/API/Kernel.php(96): Civi\API\Provider\MagicFunctionProvider->invoke((Array:9))
#24 /www/sites/all/modules/civicrm/api/api.php(23): Civi\API\Kernel->run("Job", "execute", (Array:2), NULL)
#25 /www/sites/all/modules/civicrm/bin/cli.class.php(111): civicrm_api("Job", "execute", (Array:2))
#26 /www/sites/all/modules/civicrm/bin/cli.php(32): civicrm_cli->callApi()
#27 {main}

```

I appreciate any pointers.

Thanks, Rachel

# Answer
I completely forgot to come back to this. The issue turned out to be a scheduled reminder set to go to "membership", but with no membership option selected. The where claus was in fact getting an empty array.
> 1 votes

---
Tags: api, scheduled-reminders, scheduled-job
---


# Question
Title: Adding copy/code to specific donation pages
Drupal 7 site:

We need to add data to certain donation pages. For instance, it should appear on id=1 but not on id=2. This includes some code and js.

I made a Main.extra.tpl and everything works fine when it appears on all pages, but I have not been able to restrict it to be included only on page id=1.

I read that you can do: {if $contributionPageId == "yourPageId"} Your custom messaging here {/if}

but wrapping my code in
{if $contributionPageId == "1"} {/if} doesn't work.

Is there a better way to do this?

Thanks, Rachel

**Edit**: For now I've modified Drupal's page.tpl.php with:

if ((arg(0) == 'civicrm' && arg(1) == 'contribute') && ($\_GET\['id'\] == '1')):

which does the job - but I still believe there must be a better way.

# Answer
> 1 votes
There are two "better ways" you can try.

First, you can put a template override into a folder with the contribution page ID. So if the current override is at `<overrides>/templates/CRM/Contribution/Form.php`, then `<overrides>/templates/CRM/Contribution/1/Form.php` will only override page ID 1.

However, template overrides aren't very maintainable, and they're pretty hacky.

Instead, you can create an extension. You can use hook\_civicrm\_buildForm like so:

```
function myextension_civicrm_buildForm( $formName, &$form ) {
  if ($formName == 'CRM_Contribution_Form_Main' ){
    CRM_Core_Resources::singleton()->addScriptFile('org.example.myextension', 'js/myjavascript.js');
  }
}

```

This technique is covered in greater detail in the Resources Reference.

# Answer
> 1 votes
Writing an extension is a better way of packaging this type of change.

As Jon pointed out, it's fairly easy with civix to create one and inject the js/css you need

However, it soon becomes a bit of a nightmare to try to handle the contribution page ids and on the top of having to track that id 42 has that lovely towel feature while id 84 has whatever special, you have users that start cloning and replacing and reshuffling stuff...

So assuming it's more than a quick hack, I would create a custom field (eg "layout" + a list of options and modify your extension so it reads this custom field value instead of the id to decide what to inject

And if you think whatever you are changing is generic enough, please consider submit it to our extension directory, and if not, making your repository public on github or somewhere would certainly help someone else facing a problem similar to yours

X+

# Answer
> 1 votes
While I know that an extension is a preferred method using the extra templates method works for me in some situations. (I also found it a great way to get my feet wet learning the possibilities of customizing and the API).

To answer why the {if $contributionPageId == "1"} {/if} code didn't work may be you need to wrap those variables in a literal tag.

From the documentation here: https://docs.civicrm.org/dev/en/latest/framework/templates/

> One heads up … if your file contains Javascript (as it probably will), you will need to start your "extra" custom file with the Smarty {literal} tag and the tag. Then use {/literal}{$variable}{literal} if you need to use any Smarty code or variables. Finally, end the file with {/literal}.

---
Tags: drupal, civicontribute, contribution-page
---


# Question
Title: Tyring to Upgrade to civicrm 4.7.28 on Joomla but wsod error says civicrm.settings.php is missing
I', having a hard time upgrading my Joomla! 3.8.3 site on Php 7 to civiCRM 4.7.28. This is the error I'm getting when I install from directory. I looks like it's not creating the civicrm.settings.php file.

Warning: require\_once(/home/pastoral99/public\_html/administrator/components/com\_civicrm/civicrm.settings.php): failed to open stream: No such file or directory in /home/pastoral99/public\_html/tmp/com\_civicrm/admin/configure.php on line 115

Fatal error: require\_once(): Failed opening required '/home/pastoral99/public\_html/administrator/components/com\_civicrm/civicrm.settings.php' (include\_path='.:/opt/alt/php70/usr/share/pear') in /home/pastoral99/public\_html/tmp/com\_civicrm/admin/configure.php on line 115

I've researched previous topics on this and nothing has been helpful. Can anyone tell me why it's not creating the civicrm.settings.php file?

Thanks!

# Answer
> 0 votes
Since you said you're upgrading, that file should already be there. Which means it isn't creating it, but instead viewing/updating it. The four best reasons for you getting this error that I can think of:

You accidentally deleted your settings file.

You accidentally moved your settings file.

The permissions on the file are incorrect. Looking at my install, it is set to 644.

The user associated with the file is incorrect. This one usually happens if you're like me and log into your server via root so that you can work with multiple accounts on the same login. Then your file uploads as belonging to "root" instead of the actual user.

---
Tags: joomla, installation
---


# Question
Title: Customizing foreign language event confirmation email
I have been looking around for a long time, here is what I want to do: I am using Civi on Wordpress in German language. Now also the confirmation emails for event registrations are in German - great so far.

However, the German texts in the confirmation mails for the "send to a friend" are just way to formal and I would like to customize them. However, I can nowhere find the German texts. I have looked at the message templates, but there is nothing in foreign languages there. Where do I find it?

Thank you for your support in advance Dennis

# Answer
For information about how CiviCRM handles languages, see https://lab.civicrm.org/development-team/translations/wikis/home

Text strings in the templates are wrapped in `{ts} ... {/ts}` tags - that is what triggers the translation.

You could customise the German translation, or if your confirmations are only being sent in German, you could customise the confirmation message itself directly in German - see https://docs.civicrm.org/user/en/latest/email/message-templates/
> 1 votes

---
Tags: civievent, message-templates
---


# Question
Title: Rest api's Give a 302 found and redirects to Login Page
http://crmqa.org/sites/crmqa.org/modules/civicrm/extern/rest.php?json=1&entity=pax&action=fetchAddressDetails&api\_key=apikeyofcontact&key=sitekey

When I call this through ajax and check in console I see 302 found and response is the login page of my application. In some other cases the api works fine it gives the required response when it is passed as form data.
Eg: Doesn't work

```
$.ajax({
           url: weblink,
           dataType: "json",
           method: "POST",
           contentType: "application/json; charset=utf-8",
           data: '{"pincode" : "' + pincode + '"}',
           success: function(data) {
               if (data.length > 0) {
               } else {
               }
           }});

```

but this: Works

```
$.ajax({
            url: weblink,
            dataType: "json",
            method: "POST",
            data: { "event_id": event_id },
            success: function(data) {
                $('.loading').remove();
                $('.event_id').val(event_id);
                //my code
            }});

```

Please help.

# Answer
finally I got the issue. It was related to the api URL. In ubuntu we created a link folder so the url worked. In windows the symbolic link was not created and also doesn't work so based on htaccess since the api was not found at the location it was redirecting to login page . Small thing but took hours to nail it down . Thanks anyways :)
> 1 votes

---
Tags: api, rest
---


# Question
Title: Display cases in contact summary tab in reverse order (ORDER BY id DESC)
I'm trying to display cases in reverse order in contact summary Cases Tab. I tried using hook called `civicrm_searchColumns( $objectName, &$headers, &$values, &$selector )`

and changed the values using `$values = array_reverse($values);`. but some contacts got more than 100 cases split into different pages. using this hook I cant get cases in `ORDER BY id DESC` order.

I checked relevant php file `CRM_Case_Page_Tab`. Its using controller in browse function like below

```
  public function browse() {

    $controller = new CRM_Core_Controller_Simple('CRM_Case_Form_Search', ts('Case'), CRM_Core_Action::BROWSE);
    $controller->setEmbedded(TRUE);
    $controller->reset();
    $controller->set('limit', 20);
    $controller->set('force', 1);
    $controller->set('context', 'case');
    $controller->process();
    $controller->run();

```

Can anyone suggest me is there any option to add sort by to this controller object for case id in descending order?

or where to add this order by case id to the actual query?

TIA

# Answer
> 1 votes
I found quick hack to add sort in `CRM_Case_Selector_Search` class file. Though its not good practice to touch core, I could not find better option to get around this problem

```
  public function &getRows($action, $offset, $rowCount, $sort, $output = NULL) {
       //adding sort here for descending
        $sort->_vars[1] = array('name'=>'case_id',
                                'direction'=>CRM_Utils_Sort::DESCENDING,
                                'title'=>ts('Case ID')
                               );

```

---
Tags: civicase, civicrm-home, contact-view
---


# Question
Title: How to connect to REST API from remote host?
I'm trying to connect to the rest api from a remote server, and the only response I ever get back is:

*`var jsondata = {"currencySymbol":"$","is_error":true};`*

I'm able to make api calls from the site's API Explorer (within the same domain). But no matter what I do from my remote host, any calls to this site's rest.php always return that same generic response.

Is there something one must to do allow external access to the REST API? Or does this response hint at some other request filtering taking place?

# Answer
> 1 votes
We tried turning off all plug-ins except for the CiviCRM plug-in. The rest.php endpoint began working perfectly. We were able to turn back on all plug-ins except for "Recent Tweets". I'm surprised something so benign sounding as "Recent Tweets" was the culprit!

(Thanks to Ramesh for helping me look at some things earlier today!)

# Answer
> 1 votes
To get the rest API working, you need to call an url looking like that (this example to create a contact)

```
http://www.mysite.com/wp-content/plugins/civicrm/civicrm/extern/rest.php?entity=Contact&action=create&api_key=(myAPIkey)&key=(mySiteKey)&json={“contact_type":"Individual","first_name":"Tester","last_name":"Yolanda"}

```

The specific path to rest.php depends on what CMS you use

A few pointers:

* you need to set the key with the site key (from civicrm.settings.php)
* you need to create an api key on the contact that peforms the operation, and
* this contact needs to a user that has the appropriate permission (start with an admin account to rule out the permission issue)

This being said, your error message is not normal, you should get a **"Failed to authenticate key"** error message

```
https://civicrm.org/sites/all/modules/civicrm/extern/rest.php

```

it might be that you don't use the proper url to reach the rest.php file, or that something needs to be configured on your webserver so it's properly processed

What is the url you try? it's a different one from the ajax api used by the api explorer

X+

# Answer
> 0 votes
I assume you have set your site key and api key correctly. This is something the REST will need and your API explorer will not. What API are you actually calling so I can do a test locally as well?

---
Tags: api, rest
---


# Question
Title: Race condition death spiral when changing a site's domain?
Drupal 7, CiviCRM 4.6, I've just switched a site from being a directory of one domain to it's own new domain. After clearing all caches and resetting the backend configuration, it's able to load the dashboard, but other pages result in what I believe is a race condition - specifically, loading the page seems to trigger the server into calling itself for the same page (i.e. generating an outgoing request to the url being requested). So it ends up in quite the death spiral of resource use.

I know that 4.6 uses outgoing requests to itself to populate the dashboard, but that's not exactly the issue here. I also have noticed that 4.6 uses http requests to itself to identify it's own version, which is also a kind of crazy thing, and I wonder if that's what's creating the death spiral in this case.

Any clues or similar experiences?

# Answer
Not really a CiviCRM issue, but in case anyone else has a similar experience.

As Aidan correctly guessed, it was indeed due to an http/https redirect - the one that comes from CiviCRM when you tell it to use https for admin/payment pages. Which is why it was okay on some pages, and why it was spawning new php processes for each one.

The reason this site had the problem was due to my use of a separate ssl termination ("Pound") before it went to apache. When you do this, you have to tell apache how it can know if it's been through the termination (via the use of http headers). I hadn't done that for this site, so it kept redirecting itself to the same page, not aware that it was already https.

I put in a redirect from the http to https site, and added the required apache vhost line:

```
SetEnvIf X-Forwarded-Proto https HTTPS=on

```

and the issue has now been resolved.
> 2 votes

---
Tags: drupal, installation
---


title: REST API 'between' parameters

text:
# Question
Title: REST API 'between' parameters
I'm trying to make an external REST API call to rest.php. I was getting "Unable to decode supplied JSON", but then I figured out I could take the values I was stuffing into json (from the API Explorer) and then make them their own parameters (REST API without JSON just key=value).

I'm trying to request contributions between two dates. In the json style as shown in the API Explorer, it's like this:

```
&json={"receive_date":{"BETWEEN":["2017-12-01","2017-12-01"]}}

```

I'm trying this, and it's not working:

```
&received_date[BETWEEN]=2017-12-01,2017-12-02

```

Any ideas?

# Answer
I just figured it out:

```
&received_date[BETWEEN][]=2017-12-01&received_date[BETWEEN][]=2017-12-02

```
> 6 votes

---
Tags: api, rest
---