title: Updating the Security

text:
# Question
Title: Updating the Security
I received a notification to update my security but am unsure on how to do this. I've went to my notifications and it didn't say how to proceed. I also looked in my menu options. I'm honestly lost.

# Answer
Whether you do this yourself or not will depend on how you are being hosted. If this is not a site that you set up, and don't have technical experience you probably need to talk to your IT support or hosting agency.
> 1 votes

# Answer
This is explained in this news : https://civicrm.org/blog/dev-team/security-release-civicrm-4726-and-4633-monthly-release-4727

Look at the paragraph "Upgrading to 4.7" to find the link to the documentation for the update.
> 0 votes

---
Tags: upgrade
---


# Question
Title: Add New Organization Option to Public Autocomplete Extension
Hey everyone we've just installed the public autocomplete extension https://civicrm.org/extensions/public-autocomplete-of-organisation-names but are having some difficulty getting it to "add new" or the "new organization" button to display (as it does when logged in as admin, editing a record and selecting "Current Employer") while also still creating the Employer-Employee relationship

(this is for anon users) also we'd like to restrict the list that displays by group and contact type

in other words, create new org similar to webform-civicrm or within civicrm.

trying acls, adding code per the video athttps://civicrm.org/extensions/public-autocomplete-of-organisation-names

but nothing works yet.

We are using civicrm 4.7 so any thoughts or feedback , greatly appreciated!

H

p.s. similar maybe not identical to Enabling 'New Organisation' button for Current Employer field in View Contact

# Answer
> 2 votes
The issue could be that you have to set the "access AJAX API" permission for the relevant roles

---
Tags: extension, autocomplete
---


title: Employer on Profile - Mismatching

text:
# Question
Title: Employer on Profile - Mismatching
I saw a few with similar questions, but not exactly the same on a major point. If moderators see value in merging this, go for it.

We have a problem where people sign up for an event which includes Current Employer on the profile. When that gets saved to their contact, it often maps to the wrong organization - one that starts the same. Even if we type out the full name of the organization exactly right, it will pair it with another organization instead. It seems like it is only able to store the first 10-20 characters and then matching to the first organization it finds starting with those characters. This happens a lot when you're dealing with a lot of organizations named starting with the city/region.

This is on Version 4.6.31 with Drupal but the client has said this has been an issue for about a year, so it's not a new version bug.

Any better ways around this than creating another custom field which they would need to manually copy into the auto-select Employer field from the back end?

# Answer
Matching to existing organisations is determined by the Unsupervised rule for Organisations - go to `Contacts > Find and Merge Duplicate Contacts` then click `Edit Rule` on the rule marked Unsupervised to see how it is currently defined. You can change the existing rule, or create a new one and set its usage to Unsupervised.

Alternatively, you might find this extension useful: https://civicrm.org/extensions/public-autocomplete-of-organisation-names
> 3 votes

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


title: API: How do I delete a custom value?

text:
# Question
Title: API: How do I delete a custom value?
I may be blind but I can't see any api call to delete a custom value?!

CustomValue entity is missing a delete action.

What am I missing?

# Answer
> 2 votes
If you have the ID of the row you want to delete and the custom group ID you can use `CRM_Core_BAO_CustomValue::deleteCustomValue`

```
$dao = CRM_Core_BAO_CustomGroup::class;
$groupID = CRM_Core_DAO::getFieldValue($dao, 'Emergency_Contacts', 'id', 'name');
CRM_Core_BAO_CustomValue::deleteCustomValue($id, $groupID);

```

Which deletes an entire row from the custom value table for this custom group.

# Answer
> 4 votes
Currently, you can't do this. If you try, you will get the notice:

> API (CustomValue, delete) does not exist (join the API team and implement it!)

This is true for CiviCRM version 4.7.7, which is current at time of writing.

# Answer
> 1 votes
API delete option for Custom value is missing in this version Please upgrade your Civicrm version to the latest version of Civicrm

please give a quick test http://d46.demo.civicrm.org/civicrm/api/explorer#explorer where you will find the delete action

# Answer
> 1 votes
Do you mean the value entered in a custom field, or an available option?

If the former, you should enter an empty string using `custom_value.create` api.

For the latter, use `option_value.delete` api.

---
Tags: api, custom-fields, developer
---


# Question
Title: Accessing Event details not possible anymore (Frontend)
Joomla 3.8.2 and CiviCRM 4.7.27

I got recently some user reply's that the event details con not be accessed anymore, thus no event regi, stration is possible.The event list is visible in the frontend, but clicking the "Event Name" or "read more" results in:

CiviCRM-001 Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or service provider with more details about what action you were performing when this occurred. API permission check failed for Event/get call; insufficient permission: require access CiviCRM and access CiviEvent and view event info

This error may be related to an update, however I can not determine which one as the feedback was not immediate. I checked the access rights for civiEvent listing and registration, they are still set to public, nothing changed there.

May be a bug... Anybody who has a suggestion where to start?

Currently I cant find the error report ... sorry

## Thanks for your input

Joomla shows in debug mode: Call stack

# Function Location

1 () JROOT/libraries/legacy/error/error.php:200 2 JError::raise() JROOT/libraries/legacy/error/error.php:277 3 JError::raiseError() JROOT/administrator/components/com\_civicrm/civicrm/CRM/Core/Error.php:468 4 CRM\_Core\_Error::handleUnhandledException() JROOT/administrator/components/com\_civicrm/civicrm/CRM/Core/Invoke.php:55 5 CRM\_Core\_Invoke::invoke() JROOT/components/com\_civicrm/civicrm.php:96 6 civicrm\_invoke() JROOT/components/com\_civicrm/civicrm.php:11 7 require\_once() JROOT/libraries/src/Component/ComponentHelper.php:381 8 Joomla\CMS\Component\ComponentHelper::executeComponent() JROOT/libraries/src/Component/ComponentHelper.php:356 9 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/SiteApplication.php:194 10 Joomla\CMS\Application\SiteApplication-\>dispatch() JROOT/libraries/src/Application/SiteApplication.php:233 11 Joomla\CMS\Application\SiteApplication-\>doExecute() JROOT/libraries/src/Application/CMSApplication.php:267 12 Joomla\CMS\Application\CMSApplication-\>execute() JROOT/index.php:49

# Answer
In CiviCRM Configuration, Access rights: CiviCRM: access CiviCRM was set to "inherited" needet to be "allowed". Now it works!
> 1 votes

---
Tags: civievent, api, joomla
---


# Question
Title: How do user permissions work for multi-level organizations?
We are currently using Action Network for our CRM (even though it is not designed for that), marketing and digital mobilising tools.

We moved to them because of their system of parent/sibling/child groups. In AN, each of our branches can have a child group (siblings of each other). Data flows up to the parent group automatically but down only if we specify.

Could we replicate this in CiviCRM? Could we connect different local/national databases together? Or use segmentation and user permissions to achieve the same effect (i.e. local leaders only accessing local data, national leaders accessing it all etc)

Many thanks, Stuart

# Answer
> 4 votes
Yes - I've done this several times. Many organizations with a chapter/branch format do this, such as IMBA, Wikimedia Foundation, the Australian Green Party, and many others.

There are several different approaches you can take.

* The "easy" approach is just to use built-in ACLs. Create groups of "staff" and "members" for each chapter, using parent/child groups to handle the hierarchy. I've done this for a union with 10 locals. I wouldn't scale this much past that.
* The "heavyweight" solution is CiviCRM Multisite You'll want the Multisite Permissions extension. Use this approach when each chapter needs its own website.
* The middle ground is to use Relationship Permission ACLs. I haven't used this, but it's helpful if you a) don't need separate sites per chapter, b) you need 3+ levels of organization (sounds like you do), c) You have enough chapters that using traditional ACLs is unwieldy.

As of November 2017, the relevant docs are being reorganized. Multisite is being separated from multi-level ACLs. However the original wiki page combining both is still online.

---
Tags: database, permissions, acl, multisite, data-model
---


title: Install Shoreditch Extension

text:
# Question
Title: Install Shoreditch Extension
Downloaded and installed Shoreditch Extension 0.1-- alpha12.zip on CiviCRM 4.7.27, WordPress 4.8.3, yet I cannot see any change in the theme.

Haven't found any evidence of installation errors so far. Tried uninstalling and reinstalling, no change.

There is now an option under Resource URLs - Custom CSS for Shoreditch, but when I select that option I lose all CiviCRM menus.

Does anyone know what else I have to do to make this extension go?

Ultimate goal is to get Mosaico extension installed.

# Answer
> 2 votes
It looks to me like a bug in the shoreditch theme. It reduces the z-index of the civicrm menu, which causes it to be hidden behind the wordpress menu.

I've found a bug report on this, and a pull-request which fixes it. Hopefully that will make it into the next version.

# Answer
> 0 votes
Per the Shoreditch extension Release table, Shoreditch is compatible only with CiviCRM 4.7.

---
Tags: wordpress, extension, shoreditch
---


# Question
Title: Using 2 payment processors with Webform CIVI intergration
I want the user to choose between two payment processors in a webform with CIVI integration. I can let the user select between PayPal and direct debit. However I want to set the value based on country. So if the user is not in the United Kingdom, payment processor is set to PayPal. However when it comes to setting conditionals, I don't know what the values of the payment processor is.

I've tried values 0, 1, 2 - i've tried the value 12 from the CIVICRM admin payment processor page, but nothing works. I've also tried just typing in PayPal Standard.

Any ideas?

CIVICRM 4.6.33 - Drupal 7

Thanks, Andy

# Answer
In general you can find out the values of any field by looking at the markup. If you visit your webform and right-click the payment processor field, select "inspect element" (if you're using a decent webbrowser) it will show you the code.

```
<option value="0">Pay Later</option>
<option value="1" selected="selected">Test Processor</option>

```

So in this example the test processor has a value of 1, pay later has a value of 0.
> 2 votes

---
Tags: webform-civicrm, payment-processor
---


# Question
Title: How to search for emails "on hold opt out" and not "on hold bounce"
We experienced a severe network problem across many ISP's this week that resulted in a bunch of email non deliveries. I now have many email addresses marked as on hold, I think because of the unusual network problems. I want to unhold these addresses, but do not want to unhold emails where addressees opted out.

Is there a way to search for emails that are on hold because of bounces, and not because they opted out. (alternatively can I search for emails that are on hold because of an opt out, and not because of bounce processing).

Thanks Davy

# Answer
> 5 votes
You can perfectly get the result you want navigating to **Search - Advanced Search** and expand the **Mailings** section, from there you can search for bounced emails or opt-out request specifying a date range.

If you cannot see the Mailings section navigate to **Administer - Customize Data and Screens - Display Preferences** and make sure you have Mailing ticked under **Contact Search**

You can do the same from **Search - Search Builder** selecting Contact as record type and On Hold or No Bulk emails(User Opt Out) as the field.

You can also bulk **Unhold Emails** from the action menu in the search result, selecting the contacts you think they shouldn't be on hold.

Hope that helps.

# Answer
> 0 votes
If you need to do some sort of 'when on earth did all our records get put 'on hold' you can do a sequel search on the 'hold\_date field eg

```
SELECT
  Year(hold_date),
  Month(hold_date),
  Count(*) As Total_Rows,
  Count(id) As Rows_With_Attribute
FROM civicrm_email
GROUP BY Year(hold_date), Month(hold_date)
```

---
Tags: civimail
---


# Question
Title: How to create a mailing based on a template with API
I'm trying to create a mailing based on a template through the CiviCRM API.

Here's my code:

```
$params = array(
  'name' => $subject,
  'msg_template_id'=> 87,
  'created_id' => 1,
  'header_id' => 1,
  'footer_id' => 17,
  'from_email' => $from,
  'groups' => array(
    'include' => array(
      '0' => 893,
     ),
  ),
  'mailings' => array(
    'include' => array(),
    'exclude' => array(),
  ),
  'options' => array(
    'force_rollback' => 1,
  ),
  'api.mailing_job.create' => 1,
  'api.MailingRecipients.get' => array(
    'mailing_id' => '$value.id',
    'api.contact.getvalue' => array(
      'return' => 'display_name',
    ),
    'api.email.getvalue' => array(
      'return' => 'email',
    ),
  ),
);

$result = civicrm_api3('Mailing', 'create', $params);

```

In mailing everything is correct, the template chosen in the settings is the correct one. But there is no content in the mail.

How to make the content of the mail automatically filled by the content of the template and not from the body\_html parameter?

# Answer
We are using a seperate api call to retrieve the required parameters for subject, body\_html and body\_text:

`$result = civicrm_api3('MessageTemplate', 'getsingle', array(
 'id' => 87,
 ));`

You could use api chaining with Mailing.create but I dont see a huge benefit.
> 2 votes

---
Tags: civimail, api
---


# Question
Title: I have no CiviCRM menu when using Shoreditch
CiviCRM 4.7.25 with Drupal 7: I have no CiviCRM menu when I use the Shoreditch Bootstrap theme in CiviCRM. Anyone else had this problem and fixed it?

# Answer
I would guess it is related to https://github.com/civicrm/org.civicrm.shoreditch/pull/90#issuecomment-343347028 and the PR seems to solve that.
> 1 votes

---
Tags: theme, bootstrap, shoreditch
---


# Question
Title: Outbound mail config in civicrm.settings.php?
Is it possible to store the outbound mail settings in civicrm.settings.php? SMTP server IP address, port, user...

# Answer
> 3 votes
In civicrm.settings.php

global $civicrm\_setting; $civicrm\_setting\['Mailing Preferences'\]\['mailing\_backend'\] = \[ 'outBound\_option' =\> 0, 'smtpServer' =\> 'localhost', 'smtpPort' =\> 1025, 'smtpAuth' =\> false \];

# Answer
> 0 votes
No. Outbound mail settings are typically configured here: civicrm/admin/setting/smtp. They can't be overridden in civicrm.settings.php apart from to disable them completely by defining CIVICRM\_MAIL\_LOG, e.g.

```
define('CIVICRM_MAIL_LOG', '/var/log/civicrm_mail');

```

or

```
define('CIVICRM_MAIL_LOG', '/dev/null');

```

If you aren't interested in them.

---
Tags: email
---


# Question
Title: How to set up recurring contributions on Webform using Stripe
I'm a little confused from other questions here as to whether setting up recurring contributions on a webform using Stripe works. They work just fine using a regular contribution page. But using a webform that points to the same contribution page the payment goes through as a one-off, even though the 'Frequency of installments' is set to 'month'. If I add either of the other 2 fields 'Number of installments' and 'Interval of installments' fields to the webform I get the message 'Mandatory key(s) missing from params array: total\_amount'. So - recurring contributions can be set up through Stripe, but does/should this work in a webform? If so, any clues as to how you get this to work?

# Answer
As webform\_civicrm only uses the contribution page to get the basic details (ie. payment processor) you'd need to configure the rest using the webform\_civicrm integration itself.

On the "Contributions" section you have the following options:

I think you will need to enable these, and also configure a "total amount" by activating the "contribution amount" parameter:

You can configure all those fields as "hidden" via the webform config once you have enabled them so they are not shown to the user.
> 1 votes

---
Tags: civicontribute, webform-civicrm, 4.7, stripe
---


# Question
Title: WYSIWYG editor not present with WordPress
I have CiviCRM 4.7.22 and WordPress 4.8.2. I don't get the WYSIWYG CKEditor for a New Mailing or the description in a new event. Both are present on the CiviCRM sandbox site.

From the documentation I think that it should be installed with WordPress and set as default. Permissions can't be an issue as I am an admin.

While WYSIWYG editor disappeared in CiviCRM 4.7.16 looks similar, the answers seem to relate to Drupal not WordPress and nothing suggested there helps.

# Answer
Well, finally managed to get CKEditor going, but this is far from an ideal solutuion. The problem is that an extra component is being put into the URL for the editor. My main site that works is mysite.org and the problem is with test.mysite.org. This has all its files in a subdirectory of the main site and this confuses things. Looking up \[civicrm.root\] in the Resource URL admin page shows an extra "/test". So work round for now is to edit CRM/Core/Resource.php to replace "\[civicrm.root\]" with "wp-content/plugins/civicrm/civicrm/" in the call to the editor. A bit of trail and error and a bit odd as that isn't logical from what I epxected \[civicrm.root\] to produce.

I would love a better solution.

Another problem How can I fix \[civicrm.root\] variable on an addon domain? was useful in confirming that \[civicrm.root\] is the problem.
> 1 votes

---
Tags: wordpress, ckeditor, wysiwyg
---


title: Cannot Assign Multiple Roles to Case

text:
# Question
Title: Cannot Assign Multiple Roles to Case
Using CiviCRM 4.6.

In CiviCase I was unable to assign a second role on a case. I need to have a Case Coordinator AND a second assignee.

In this case, an Event Rep. If I set the Case Type to use the `Case Coordinator` as the `assign To default`, my name appears in the case, but I cannot add a contact name to the Event Rep role.

If I set the Case Type to use the Event Rep as the default `Assign To`, my name shows there when I open a new case, but I cannot then assign a contact to the Case Coordinator role.

Always limited to just one Assignee. I saw some similar issues posted here late last year, but following that case they were supposed corrected.

I checked the code fix on this file: `CRM/Contact/BAO/Relationship.php` (ref "Fix for multiple role assignment between same contact cases #6439" ).

My Relationship.php file matches the updated file, so I'm guessing it is something else.

Short screen vid showing what I am experiencing (1:37 min) here:

https://youtu.be/vYLhkqB9kY8

I'd appreciate any suggestions. Thanks in advance.

# Answer
I believe the issue, certainly as per the youtube video, is because the Case Contact is not of type Individual, while the Relationship you are trying to use, Benefits Specialist, is only for Individual to Individual. This unfortunately results in a silent failure. So if there is any 'fix' required here, it would be to provide an error msg saying "this Relationships is not available due to mismatching Contact Types".

We hit a similar 'why can't we reassign a case to a new case manager' and the issue in our case was that Case Manager relationship was set to be Individual to Individual but in this case the Case Client was an organisation.

The reason we were able to create the Case Manager in the first place was because these were added via webform which seemed to create the Relationship despite the Contact Type not being appropriate.
> 1 votes

# Answer
I have tried your scenario on the demo site and I can add two roles with the same case role? You create the case and then the Case Coordinator (or any other role you set as manager) is linked. Once you have saved the case you can add more roles by clicking the 'manage' button. This will bring up the case, and if you click on the 'Roles' tab you see the current roles linked. From there you can add a role?
> 0 votes

# Answer
To reiterate the problem (Wordpress version): Roles defined in Case Types should be assignable from within the Manage Case window. But in my experience they are not; after going through the process to assign a contact to the role, the page continually displays "not assigned."

My Solution:

I have found that the way around this is to NOT add Roles in in the Case Types setup (Administer\>CiviCase\>Case Types). In fact I now delete the default Case Coordinator as well so there are no roles defined in the Case Type.

Now, after creating a new Case (Cases\>New Case) I use the Add New Role button under Roles tab on the Case Management page to add the roles I need that have been defined in Relationships (Administer\>Custom Data and Screen\>Relationship Types. This allows a contact name to be assigned in the Role section of the Case Management.

I know this is not the way it Should work, but this is the only work around I've found to solve my issue. If you've got a better way (one that works from the Case Type Roles setup), I'd love to know it. Thanks.
> 0 votes

---
Tags: civicase
---


# Question
Title: Can CiviCRM provide a warning/error if a user submits a certain organization name as their current employer?
We've had a long standing issue with our users entering in Catholic Charities as their organization name when registering for events, making donations, etc. It's caused havoc in our system as we will have many people associated with the Catholic Charities record, instead of their appropriate organization (e.g. Catholic Charities of New York). We've used the auto complete extension to show users a set list of organizations they can choose from, however we still get people simply typing in Catholic Charities, despite our best efforts (we still allow people to put other organization names, because people outside our network sometimes register for certain trainings, make donations, etc). Is there a way for the system to throw back a warning/error to the user and/or force them to change their organization name if it detects Catholic Charities was input as the value?

# Answer
> 1 votes
The exact behaviour you describe would be possible but will have to be custom development. It would be specific to your organization and website.

However I do think you will be able to achieve something like what you want with the CiviRules extension. You would be able to 'catch' the new contact as a trigger (individual is added) and use the field value comparison condition to check the value of the current employer (or alternatively catch the new relationship Employer of). CiviRules would allow you to then create an activity for a team member, alerting him/her to the problem. It is not perfect, but sounds like an alternative without custom development.

You can find the CiviRules extension here: https://civicrm.org/extensions/civirules and documentation about CiviRules here: https://docs.civicrm.org/civirules/en/latest/

---
Tags: 4.7, forms, fields, organization
---


# Question
Title: Send civicrm email receipt immediately for recurring contributions - Authorize.net
I am using drupal, civicrm version 4.7.27. I would like email receipts from CiviCRM to be sent immediately for recurring contribution, rather than waiting for Authorize.net to process the credit card overnight. In previous versions, there was code in the file CRM\Contribute\BAO\Contribution\Utils.php that I could comment out, to override the default behavior for receipt. This was the code I commented out: //Do not send an email if Recurring contribution is done via Direct Mode //We will send email once the IPN is received. //if (!empty($paymentParams\['is\_recur'\]) && $form-\>\_contributeMode == 'direct'){ // return TRUE; //}

This code no longer exists. Can anyone tell me if there is a way in version 4.7.27 to force CiviCRM to send a receipt immediately for a recurring contribution, even if it has not yet been processed by Authorize.net?

Thanks!

# Answer
> 1 votes
You could probably achieve this with the CiviRules extension? The extension can be found here: https://civicrm.org/extensions/civirules/version-113 and the documentation here: https://docs.civicrm.org/civirules/en/latest/

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


# Question
Title: Can I batch update participant role for an event for all contacts registered for an event who have a certain tag?
The scenario is this: I have an event -- we'll call it "Meeting." There are 200 contacts registered for "Meeting." All 100 have the participant role "attendee." 60 of the contacts who are registered for "meeting" are tagged as "meeting speaker." I would like to batch update so that all 60 contacts with the "meeting speaker" tag have their participant role switched to "speaker" instead of "attendee."

If I do a contact search, I can isolate the tagged participants, but not update their participant roles. It won't let me add them to the event as they are already registered.

On the other hand, if I do a participant search I can batch update registration status, but not search only registrants who have the tag.

Am I missing something or is this just not doable? I'd really rather not manually change all 60 statuses.

# Answer
This is doable with Advanced Search. You can enter your criteria (the tag) and change the Display Results As field to read "Event Participants", and then click Search. The results will be the folks tagged Meeting Speaker, but your Actions on the result screen will be geared toward Event type actions.

More info on the Display Results As option can be found on this CiviCRM blog post.
> 1 votes

---
Tags: civievent, search, batches
---


# Question
Title: WordPress plugins and themes incompatible with CiviCRM
I am looking for a way to find which plugins incompatible with CiviCRM without deactivating them and install one by one. And if you have any experience with your WordPress website please share here. I fond this (https://docs.civicrm.org/sysadmin/en/latest/integration/wordpress/incompatibilities/) link but I am looking a way to know which my plugins incompatible with CiviCRM.

# Answer
I recommend using the wiki page WordPress plugins and themes incompatible with CiviCRM.
> 2 votes

---
Tags: wordpress, plugin
---


title: Change font-family in theme

text:
# Question
Title: Change font-family in theme
I am trying to change the font and the headings in theme 2016.

Do I need to edit the code?

The code says font-family sans-serif, I want it to be times-new-roman.

# Answer
> 1 votes
My answer is assuming you are referring to WP theme Twenty-Sixteen

Your question is not a CiviCRM issue, if you have other questions that are directly related to your CMS you should find a CMS specific forum to get more detailed help.

Here is a link with the instructions your are looking for. https://www.geekypeak.com/how-to-change-fonts-for-twenty-sixteen-child-theme/ Again, you might need to find a CMS specific forum or try Google.

---
Tags: theme
---


# Question
Title: CiviCRM cron user rejected after update to 4.7.27
I've got a puzzle. After updating to CiviCRM 4.7.27 (from 4.7.23) on WordPress, suddenly the civicrm cron jobs stopped being run. With some digging, I found that the credentials for the user I had set up to run cron were being rejected ("ERROR: Invalid username and/or password").

I confirmed that the username, password and site key were all correct (none of them had changed), but I still can't get it to work. I even created a new user with a new password, but that also failed. Both users have the correct permissions to access CiviCRM, etc. as specified in the documentation. I am even able to log in directly to WP using these credentials; they are only rejected in the context of a call to run cron.php.

I use the URL method of calling cron.php, which includes the username, password and site key in the full URL.

This isn't critical - I can still run it manually from inside CiviCRM, but I have already spent a lot of time on this and don't want to spend much more.

CiviCRM 4.7.27
WordPress 4.8.3, with WordFence 6.3.21, all plugins up-to-date
CentOS 7, with the standard PHP 5.4.16 as supplied by the main CentOS repositories

Thanks in advance!

# Answer
> 0 votes
I'd try to run CiviCRM cron via the CLI. If your webhosting has CLI access, you can do this using `wp-cli` or `cv`. Both will let you execute CiviCRM's scheduled jobs. See Managing Scheduled Jobs \> Command Line Syntax for setup instructions.

I can't say why you're running into issues, and I don't know why you'd have started having issues at the upgrade of 4.7.27 - that's worth looking into (and could be worth debugging - you'd start by checking the input variables are correct when that error is thrown in `CRM_Utils_System::authenticateScript()`).

It *could* be that WordFence is playing a part in this. CiviCRM's URL cron method involves putting the username and password into GET parameters, which isn't generally a recommended practice (those details can be leaked from GET, see note here). It wouldn't surprise me if WordFence detected and removed sensitive variables in GET params; another possibility is that WordFence might block a user if it detected them logging in every few minutes (as could be happening with URL cron). This is speculation; I don't know WordFence at all.

If CLI cron is available to you, that approach might mitigate this situation, and would at least avoid the possibility of leaking your CiviCRM scheduled job user credentials. It's not a guaranteed fix and I do recommend a shot at debugging what's actually happening, especially if it means resolving some new bug that's sneaked into 4.7.27!

(This isn't a very certain answer, but I hope it helps!)

---
Tags: wordpress, error, cron
---


# Question
Title: How to Manage View Title according to Contextual Filters
I want to use one common View to list Donations to each different organization (I have a lot), manageing each different View instance via contextual filters.

e.g. mysite/myView/9/2017, where :

* 9 = Contribution Page ID (which is organization specific)
* 2017 = Contribution Year

This works fine for filtering, but, beyond this, I would like the page Title to contain the Contribution Page **Name**.

I can, of course have a Title in the form of "Contributions 9" (using %1 to override the Title), but "9" does not speak a lot.

I have tried a solution, consisting in specifying the Contribution Page Name as a 3rd Contextual Filter and overriding the Page Title with this %3 filter : when I do that, the following URL mysite/myView/9/2017/"my Contribution Page" provides me with the correct title, but then, the View displays no result.

Am I missing sth ? Any help is welcome.

# Answer
> 2 votes
I can't quite make out all your requirements from your description - but I do have an example that (possibly) comes close to this. I don't use contextual filters though - I use Exposed Filters to identify which of 150 Contribution pages - specific Donations belong to:

Note that the URL in this case is: /donations-via-group-contribution-pages?financial\_type=All&contribution\_page=43

So you could pass in that URL (or for any other contribution\_page\_id) -\> and then have a screen for a sub-organization;

Thus far I've only used contextual filters for Drupal Commerce Views -\> with a Contextual filter for Drupal userid -\> so that we can then have permissions to only show Orders that belong to a specific user;

# Answer
> 1 votes
Thank you Karin, I think I have a better understanding now :

When I want to set membership\_type (alpha-numeric) as a filter, Views interprets it as membership\_type\_id (integer) : this is the case in the URL :

If I set the alphanumeric membership\_type (alphanumeric instead) (e.g. "Catéchisme" in my case), then the View is empty : thus, I can't override the View Title with this parameter.

But it is not the case for the exposed filter in the View itself which displays the alphanumeric value of membership\_type (e.g. "Catéchisme" in my case), as suggested by Karin.

Finally I will set the alphanumeric membership\_type as :

* an exposed filter in the View ("Organisation" in the screen shot here under)
* a contextual filter in the URL (with the membership\_type\_id integer value)
* a display filter in the URL (also with the membership\_type\_id integer value)

such as : https://.../myView/56?membership\_type=56

\[!\[enter image description here\]\[1\]\]\[1\]

Doing so, if the user resets the exposed filter in the View, the filtering information is not displayed anymore, but the View remains filtered.

---
Tags: drupal-views
---


# Question
Title: Using CiviCRM for Coworking Check in tracking
One part of our nonprofit is running several co-working locations. We have members that can buy a part time membership that lets them use the facility 10 times a month.

We would need a way to have a member login page at the front of our locations where the member "checks-in." We'd want to display how many times that month they have checked in and how many more visits they have for the month.

While I'm asking, room reservations extensions/

Thanks,

Brad

# Answer
To just track them, I would be using Activities, and if you are using Drupal you could put together a small block/form on login page where they would submit the Activity. Then use Views Aggregation to count their visits (and Views Calc to show how many remaining.

There is also the civi booking extension to check out. CiviCon video here
> 1 votes

---
Tags: civimember
---


# Question
Title: How can I find the transaction date of a payment by check?
The question is double :

1. Is there a way to simply display this trxn date (not the Contribution date, but the date when the check was recorded) ?
2. The transaction is refered in civicrm\_financial\_trxn table : id, check #, trxn\_date : how can I link this id to the contribution ?

# Answer
In short, it's already linked and being used and displayed in the system. Being able to find it depends on if you used the field.

The `trxn_date` field in the `civicrm_finacial_trxn` table stores the receipt date, which shows up in the transaction detail and on the bookkeeping report. If nothing is entered for receipt date, it uses the received date automatically.

Receipt date can be used for when the contributor received the receipt and for when you received the payment, since these should be the same date.

**Received Date** comes up in the report for date received. **Receipt Date** comes up in the report and detail as the transaction date.

I did an experiment in MySQL to make sure this is correct:
> 0 votes

# Answer
trxn\_id is the common denominator on the civicrm\_financial\_trxn table and the civicrm\_contribution table

civicrm\_financial\_trxn.trxn\_id civicrm\_contribution.trxn\_id
> 1 votes

# Answer
Thank you Christia : I did not know this Bookkeeping Report, and this answers my 1st question.

Concerning the second question, I think I have found the answer :

For each contribution, with "pay later" by check, you have two Transactions, which are identified in table civicrm\_entity\_financial\_trxn, which links the Contribution to its pertaining Transactions in civicrm\_financial\_trxn table :

1. One which concerns the Contribution itself : financial\_account\_to = 7 : receivable (with the contribution date)
2. One which concerns the Check record : financial\_account\_to = 6 : deposit (with the check # & deposit date)
> 0 votes

---
Tags: contributions
---


title: LTS requirements?

text:
# Question
Title: LTS requirements?
4.6.x is the LTS version, right? Previously, before the documentation was "upgraded" I could switch to previous versions and see what their system requirements were. Now I only see "latest", which I guess would mean the 4.7.x version, right? So the only ways to find the LTS requirements are?:

* Use Web GUI install and a zero configured test server to discover all that can be missing.
* still use drush civicrm-install trial an error
* "Just" scan through the code (it's open source after all)

My task is scriptable automatical installation with composer. I don't see any of the options really attractive. If LTS is serious, please restore the essential documentation for at least that version, if you have the time for it.

# Answer
A few comments:

* We're pretty happy with our Upgraded documentation - it's much more readable/much better organized - we thank Sean for having put countless of hours into that.
* CiviCRM 4.6.x is supported (for free) by Skvare and CompuCorp; they are pretty serious and we probably don't thank them enough for taking that on;

If you have specific questions - just ask (nicely) - and you'll find help here on SE. You will actually find that there is not too much difference in requirements between 4.7.x and 4.6.x - we run them side by side on the same server;
> 3 votes

---
Tags: developer, system
---


# Question
Title: Donor personal information exposed in Google searches
We have been receiving reports of our donor's personal information (name, address, city, state, zip, phone number, CiviCrm internal contact ID#) being presented in a Google search. We are using CiviCrm 4.7.22 installed in Drupal 7.56. We must be able to assure our donor base that all personal information is not released from our database. We do use on-line contributions, event registrations, regular emails etc. to interact with our donors. There is some urgency in this request.

# Answer
**1. Find and Fix the problem:**

1a) Check your Permissions settings in admin/people/permissions Look in the Anonymous User role column -\> for permissions such as : View Any Contact in the CiviCRM database; There are a lot of settings - examine them all - and remove any checkboxes for Anonymous that are not appropriate;

1b) It's also quite possible that you've misconfigured Profile/Fields to be listed publicly; here's the documentation for that: https://docs.civicrm.org/user/en/latest/organising-your-data/profiles/#making-directories-with-profiles \- note that for every Field in a profile - you can specify it's Visibility; examine if any of the fields are set to Public (and if so - correct them to User and Admin);

**2. Address the Google Indexing:** get into your Google Webmaster Tools account (create one if you don't have one yet) - and remove the unwanted links from the Search Index.
> 3 votes

---
Tags: drupal
---


title: Format Tokens Using HTML?

text:
# Question
Title: Format Tokens Using HTML?
Is it possible to format the display results of a token? For instance, if the token is (contact.phone), is it possible to make the resulting phone number bold or a specific color?

# Answer
> 2 votes
The easiest way would be in your document. For example just make the token bold/colored in your wysiwyg editor, or if you are editing html you can do like `<strong style="color:hotpink">{contact.phone}</strong>`

---
Tags: tokens
---


# Question
Title: CiviMember Range Price: Automatically assign Membership based on $amount paid
We are looking to have ranged membership prices e.g.

$5-59 = Level 1 $60-99 = Level 2 $100-499 = Level 3

CiviCRM seems to support a "minimum price" for membership. How do we make it a range between minimum and maximum?

Also, these ranges should support recurring contributions (yearly).

Nice to have: * Ability to make a sliderfield out of the range

CiviCRM 4.7.x - drupal 7

# Answer
You can totally do this out of the box with Webform CiviCRM module!

Sorry for the swim squad references - but that's the project I was on when I read your question - here's a quick demo:

* in CiviCRM Tab -\> add Membership Type - User Select; also add Membership Fee field;
* in the Webform tab -\> ensure the Membership Type is a Listbox; Use static to only get the ones you need on this form;

Then under Webform Tab -\> Conditionals - just a quick example - but you can make this as complex as you like - and even combine statements (is greater than or equal and is less then) to cover your $ ranges.

This says -\> if we type in 25 -\> we automatically get option1 -\> which is my case is White Squad Membership; note how Webform is clever enough to grey out the Membership Type so the user can't self select anymore;

And if we type in 50 or higher -\> we automatically get option number 2 -\> in my case: a Black Squad Membership

**PS - and you're going to get that slider in D8:**
> 3 votes

# Answer
if you need this only on the front facing forms then some javascript might do the required. ie have a single field for them to put the amount in, and behind the scenes figure out which Memb Type it should be and set that to selected. sorry i can't offer a recipe.
> 0 votes

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


title: Can API Return Reverse Results?

text:
# Question
Title: Can API Return Reverse Results?
I am using the CustomValues Get API I would like to have the most recent entries listed first.

Is there a way that I can sort results in reverse when placing an API get?

For example, below I want to sort the values\['217'\] so that values\['217'\]\['10'\] is the first. Here are the results I get:

```
{
"is_error": 0,
"version": 3,
"count": 1,
"id": 217,
"values": {
    "217": {
        "entity_id": "7088",
        "latest": "2016-11-01 00:00:00",
        "id": "217",
        "1": "2016-10-25 00:00:00",
        "2": "2016-10-18 00:00:00",
        "3": "2016-01-01 00:00:00",
        "4": "2016-01-01 00:00:00",
        "5": "2016-01-01 00:00:00",
        "6": "2016-10-27 00:00:00",
        "7": "2016-10-27 00:00:00",
        "8": "2016-10-27 00:00:00",
        "9": "2016-10-27 00:00:00",
        "10": "2016-10-27 00:00:00",
    }
}
}

```

Thanks!

# Answer
Yes, you can, though it's not well-documented!

I recalled that there was some sort of "sort" option, which I confirmed by checked the Using the API documentation. However, the documentation is incomplete (I'll fix that in a minute).

Fortunately, I found the code that handles this, and saw that you can sort by various field options. See my screenshot below; I also confirmed that sorting by `last_name desc` also works. You should be able to sort by any field.
> 3 votes

# Answer
Per your comment, I see you want to know about reversing the order of *multi-value custom fields*. I don't think you can flip the return array directly. But if you're consuming it in PHP/JS/etc., you can iterate through the loop backwards. See https://stackoverflow.com/questions/10777597/reverse-order-of-foreach-list-items for a PHP example.
> 0 votes

---
Tags: api
---


# Question
Title: SOLVED is Civicrm compatible with Litespeed technology?
I just upgrade my service provider from apache to litespeed webserver and Civicrm stop to work. The error is in a lot of page: `Sorry but we are not able to provide this at the moment.
We can't load the requested web page. This page requires cookies to be enabled in your browser settings. Please check this setting and enable cookies (if they are not enabled). Then try again. If this error persists, contact the site administrator for assistance.

Gli amministratori del sito: Questo errore può indicare che gli utenti accedono a questa pagina utilizzando un dominio o URL diverso da quello configurato dall' URL di base. ESEMPIO: URL di base è http://example.org, ma alcuni utenti l'accesso alla pagina tramite http://www.example.org o un alias di dominio come http://myotherexample.org.

tipo di errore: Impossibile trovare una chiave di sessione valido.`

That is seems related to the url base configuration, but it is the same of before and it worked perfectly. I had a similar problem when used Varnish cache that solved removing that cache. But now the pages are no cached with litespeed. I cannnot also configure the backend in order to set civicrm in debug mode. Have any suggestion in order to check if the problem is related to litespeed?

Example page of error: http://www.grag.org/civicrm/?page=CiviCRM&q=civicrm/profile/create&gid=16&reset=1

Here is a hint of the problem: if I use a demo site: http://wpmaster.demo.civicrm.org/wp-login.php (user demo/demo) and then the link http://wpmaster.demo.civicrm.org/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fmember%2Fsearch&reset=1 using the search button I have in the query string the following http://wpmaster.demo.civicrm.org/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fmember%2Fsearch&\_qf\_Search\_display=true&qfKey=6709b858d58d2f669a89cae4c9d06171\_4657

but on my site after the http://www.grag.org/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fmember%2Fsearch&reset=1 pressing the searrch button I have the following link and the error http://www.grag.org/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fmember%2Fsearch the variables is missing.

Now it is solved thank to the service provider that modified the server configuration

# Answer
> 2 votes
I am using the webhosting service of Rochen, and they use a LiteSpeed Web Server. Civicrm runs inside a Joomla 3.7.5 website quit okay. (The the current Joomla version of 3.8.2 and Civicrm do not work together okay, because there are still several issues due to changes in the Joomla 3.8.\* versions.)

So as to your main question: Litespeed can be setup to accommodate Civicrm.

# Answer
> 0 votes
Not answering your main question but the question re turning on debug. If you have access to the db ther should be an entry in civicrm\_setting for debug\_enabled. The value needs to be changed from

s:1:"0";

s:1:"1";

---
Tags: configuration, cache
---


# Question
Title: List organization on individual profile signup
I am creating a join form for visitors on our site, and I'd like to give them the option of adding what school they go to.

I've imported schools as organizations, and I think I know how to link individual contacts to "Student of.." the school when I import our list, but going forward how do individuals link themselves to particular schools when they sign up?

I'd like for them to be able to type in the name of the school and be presented with suggestions (to try and avoid creating duplicates with spelling differences).

Any idea how to do it? Thanks!

I've got CiviCRM 4.7.25 and am using Wordpress.

# Answer
> 1 votes
You can add a Contact Reference field (one of the types of Custom Fields that you can create) and then display that in your profile and limit that to just the group of schools. users need to have permissions to use the autocomplete option so you need to visit /wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fadmin%2Faccess%2Fwp-permissions&reset=1 and find th permission "CiviCRM: access contact reference fields Allow entering data into contact reference fields" and give it to your anonymous visitors. (You may also need to give "CiviCRM: access AJAX API Allow API access even if Access CiviCRM is not granted")

The above won't do this as a Relationships, which is the ideal, but I don't know how that is done via Profiles for WP

# Answer
> 1 votes
We do exactly this for a Greenschools Canada project; Students select their School from a list (group) of registered Greenschools. They add their name, data they have collected and a relationship is automatically added.

It’s on Drupal w/ Webform CiviCRM - out of the box.

Keep Wordpress for other bits of your website but if you expect to be doing a lot of interactive data management consider moving your CiviCRM to a Drupal subdomain so that you can leverage many already existing tools out of the box.

# Answer
> 0 votes
I agree with petednz, ideally you should do this with a relationship between the school and the individual contact. But I have no idea how to accomplish this with Wordpress without development.

I know about the Contact 7 CiviCRM integration, but that would mean you would have to develop a CiviCRM extensions that picks up your submitted data and process that into CiviCRM. If you are interested, the extension can be found here: https://nl.wordpress.org/plugins/contact-form-7-civicrm-integration/

---
Tags: wordpress
---


title: Issues with running Joomla 3.8 and Civi

text:
# Question
Title: Issues with running Joomla 3.8 and Civi
I am not looking to be first on this - just wanted to see if anyone is running J3.8 and current release of Civi.

# Answer
The fix to the file CRM/Utils/System/Joomla.php suggested in the link https://github.com/civicrm/civicrm-core/pull/11062/files?diff=unified made the cron jobs run again for CiviCRM 4.7.25 and Joomla 3.8.1.
> 6 votes

# Answer
I took the plunge and upgraded Joomla to 3.8.0 today. I am seeing two problems with it and CiviCRM 4.7.24:

* cron jobs are not running
* In the backend, the Administer \> Directories page is broken (only loads partially). There are 3 instances of "ReferenceError: CRM is not defined" appearing in Firebug console.

I have not looked into these any further yet. Cron jobs were definitely working prior to the Joomla upgrade but I don't know if the Directories page was already broken.

UPDATE: I've posted on CRM-21203 some changes to CRM/Utils/System/Joomla.php that get cron jobs working (doesn't fix the Directories page). Joomla 3.8.0 has changed the location of some files in libraries/

Joomla 3.8.0 is a required security update for all previous versions.
> 2 votes

# Answer
I have a post-3.8 upgrade issue: I don't think it's related to the issue above but sharing in answer to the OP: Joomla 3.8 & CiviCRM 4.7.x - front-end error 500 when logged in
> 1 votes

# Answer
The issue was not fixed in 4.7.27, appears to be slated for 4.7.28. Manually applying the fix in Joomla.php file here seems to have resolved it https://github.com/civicrm/civicrm-core/pull/11062
> 0 votes

---
Tags: joomla, upgrade
---


title: Drupal 8.4 & CiviCRM Issue

text:
# Question
Title: Drupal 8.4 & CiviCRM Issue
Last evening I tried to follow along with the amazing work @david-snopek posted but I've been running into some issues with the module finding the civicrm "library".

I'm trying to get this working with a BLT generated project and feel like I'm getting pretty close but don't know enough about CiviCRM to know where to look next.

I created a more in depth question here: https://drupal.stackexchange.com/questions/247897/error-installing-civicrm-drupal-8-4-blt-composer-civicrm-must-be-downloa

Resources:

# Answer
> 2 votes
Just looping back - I did get Drupal 8.4.x and CiviCRM 4.7.x up and running - here's my live play by play steps: https://d8webform.semper-it.com/node/4

---
Tags: drupal-8, composer
---


# Question
Title: Mandrill - webhooks for two different sites?
We have a client who has two webhooks defined in Mandrillapp - both of them reacting to the same events (click, open, etc). These webhooks have a post url of two different sites(dev and live). Eg.

> Post url of dev = http://devsite.com/civicrm/ajax/mte/callback?mandrillSecret=*devkey*
>
> Post URL of live - http://livesite.com/civicrm/ajax/mte/callback?mandrillSecret=*livekey*

My guess is that - when an email is sent from the live site, these both urls are triggered(on open or click event) and dev site also gets the response which creates a mandrill activity on dev site.

This is what is happening for us - when a bulk email is sent from the live site, dev also creates a mandrill activity.

Can we conclude that we need to use two different mandrill accounts for two different sites OR there is a way to avoid this (rules, etc)?

---

UPDATE after Chris Answer -

The posted answer seems to be something which is already present in Mandrill extension?

Readme file asks user to save the secret key as a value of an option group which we've done for dev and live sites.

Problem arises when **DEV** webhook is triggered by an event(open/click) of LIVE mails(note both above URLs react on the same event). As dev secret key is same(url param and option grp value) **matches** the option value stored on the dev site, this checking of key match doesn't help us.

In short, a dev Post URL need to be avoided to be triggered after an event has occurred for emails sent from live site. Maybe this could to be done on the MandrillApp side?

# Answer
> 1 votes
If you must use the same account on both environments, Drupal/CiviCRM hooks could potentially support this? *(All of this answer is likely more work than just using the provider's supported test mode, though!)*

You can pick any hook that fires before `Mte.callback` gets fired, and trigger rejection / invalidation based on any of the incoming data including the secret key or contact details in the request.

CMS boot hooks (eg Drupal `hook_init`) or CRM config hook (`hook_civicrm_config`) happen early but on many requests so will add overhead; if possible I'd do this as late and specifically as possible - `hook_civicrm_apiWrappers` could be just the ticket if it works for this usage? Alternatively you could just throw some interception in `settings.php` / `civicrm.settings.php` / environment-specific `settings.development.php`.

If the secret keys aren't suitable, you could look for test-specific properties of the submitted contact data.

That might look like,

```
// Lives in settings.php so it's not in your committed code.
$mandrill_secrets = [
  'development' => 'devkey',
  'production' => 'livekey'
];

```

Boot time: obtain current environment, put in `$environment`:

Before CiviCRM has a chance to respond to `civicrm/ajax/mte/callback`: If the supplied secret doesn't match the current environment, unset it or make it invalid.

```
if (isset($_GET['mandrillSecret']) && $_GET['mandrillSecret'] != $mandrill_secrets[$environment]) {
  $_GET['mandrillSecret'] = 'invalid';
}

```

# Answer
> 1 votes
It sounds like what you want is to switch your dev environment to use Mandrill's Test Mode?

You can then make your site environment aware to switch the Mandrill account details each time you refresh data on your dev environment, preventing live webhooks from affecting dev environment and vice versa.

Mandrill's test mode is API key specific; on your dev site you'll need to switch the API key used, and then send emails to certain addresses to test bounce, rejection etc.

* Mandrill Zendesk: Test mode / sandbox
* `reject@test.mandrillapp.com` =\> Rejected email
* `hard_bounce@test.mandrillapp.com` =\> Hard-bounced email
* `soft_bounce@test.mandrillapp.com` =\> Soft-bounced email
* `spam@test.mandrillapp.com` =\> Spam complaint

(Your tests will also need to ensure that they are idempotent, ie reset the DB to a known state that ensures the `hard_bounce` contact is newly created or has not been marked undeliverable in CiviCRM.)

You can then use Mandrill's Rules Engine to send webhook requests to the appropriate site based on the API key in use for the generated email.

# Answer
> 1 votes
The Mandrill extension was not designed to support multiple sites.

It is a reasonable use case to enhance it to support dev and prod instances of the same site.

@Chris Burgess workarounds are likely best approach in absence of funding to do this.

Without reviewing Mandrill docs etc I think the approach needed is to figure out somehow whether the instance receiving a callback is the one that sent out the mailing. One way might be to add another field containing the baseurl of the sending instance to each email, then check that value which you can get on the webhook callback.

Note: code contributions are welcome!

---
Tags: email, mandrill
---


# Question
Title: Issues with refunds for credit card payments
This has been a long standing issue for us.

We accept event registrations and accept payments with credit cards through Authorize.net. Many of our events have multiple options using price sets.

If someone registers for the event, and later needs to change the options lowering the fee, they need a refund. We can issue the refund manually without issue, but when we change their registration in CiviCRM the contribution fee changes to the new value and the status changes to pending refund, and we can't ever change it from that.

All our refunds happen manually out of the system, and we really need the pending refund contributions to be changeable back to complete when the refund is processed.

This really messes up our reporting for the event, and throws things off in a messy way.

Is there a way to resolve this so that we can track things as they should be?

What is the logic in restricting the change in that field? Since CiviCRM can't process the refund, and we need to do it offline, we should be able to change the status once we issue the refund.

Any help, thoughts, or ideas would be wonderful.

# Answer
You don't say what version of CiviCRM you are using.

In 4.7 you need to record the refund against the registration record. This can be done at the time you alter the registration or by viewing the event registration later on.

In both case you will get a screen that clearly offers you chance to Record refund. \]
> 2 votes

# Answer
In the Civicrm Sandbox (I used the WP based sandbox which is running civicrm version 4.7.29) I registered a contact for both events (Rainforest, Fall Fundraiser) and submitted CC payment. I then set the participant status to 'Pending refund' as shown above by JoAnne, and while no button for "Record Refund" is shown in the View panel, the actions for the fee showed View, Edit, more, and under more, 'Record Refund'. I selected Record Refund but 1) the panel displayed 'New Payment' and 2) I got the error 'No payment information found for this record' (screenshots included below) - seems like a bug, right?
> 0 votes

---
Tags: contributions, authorize.net
---


# Question
Title: How to pull an event report that lists how many people bought tickets at the different level of ticket prices
I need a report for an event on Civi that lists how many guests bought tickets at the different levels we had our tickets for sale at. How can I do that? I can't figure out if it's possible with any of the 4 default reports Civi offers for events.

# Answer
You will want to use: https://civicrm.org/extensions/extended-reports extension - it gives you access to many more templates - including price set - line item ones.
> 2 votes

# Answer
we are using a 3rd party PHP-based reporting tool which lets us get reports based on SQL queries on the civicrm database - the native Civi reports are template-based and more brittle IMO. You could run the event participants list, export the results to .csv and then sort the resulting rows by participant fee, or net amount after pulling the .csv into Excel. HTH
> 0 votes

---
Tags: civievent, reports
---


# Question
Title: Trying to send my first e-newsletter with the Mosaico system
Trying to send my first e-newsletter with the Mosaico system. However, when I try to submit my mailing I get an error message (see attached) despite the fact I've put an unsubscribe token in the bottom of the mailing.

# Answer
> 1 votes
Sending of CiviMail requires both the domain.address token and the action.optOutUrl or action.unsubscribeUrl tokens

You can add these in to the bottom of your mailing. Add a text block, add the above tokens, then edit it by clicking on \< \> (source code) and put a link on to the optOutUrl token with the destination also being the token so it ends up like

```
<p>{domain.address}</p>
<p><a href="{action.optOutUrl}">{action.optOutUrl}</a></p>

```

There are some longer instructions here I wrote up yesterday. They may help

# Answer
> 0 votes
Did you also put the domain.address token in the email? If not you should try that.

As an alternative (but ptobably not, what you want), you could disabel the check for mandatory token following the link: www.yourdomain.org/civicrm/admin/setting/preferences/mailing?reset=1

# Answer
> 0 votes
I have the same issue

You will need to disable the footer (because that is what is giving the error message and I couldn't ever work out a way to make it work) as well as doing what you have already done with putting the tokens into the body of the email

---
Tags: error, missing
---


# Question
Title: CiviMail Mailing - Unable to select group, getting error of No recipients
I'm using CiviCRM 4.6.4 on Joomla 2.5.17. I'm new to Mailings so there may be something I am doing wrong, but there are several things that don't seem to work, including selecting a Group, sending an email to an address as well as to a Group. But, let me first ask about selecting a Group.

I created the Group "test" with two contacts with valid email addresses and marked the group for Mailing. The group appears in the Recipients drop down, but when I select the group, I receive an indication of "No recipients" and then the Recipients field label is highlighted in Red. What could I be doing wrong? Is this a known issue?

I primarily use Chrome, but I have tried in Firefox and Safari and get the same result, so I'm thinking that there is something misconfigured in a database setting, Javascript file or PHP file, but I wouldn't know where to look to debug. I have noticed there have been several postings regarding CiviMail and 4.6.x especially from Joomla or Wordpress users, so I don't know if someone has diagnosed this particular issue or if I am simply doing something wrong on my end.

I should also mention that I have upgraded from 4.4.x to 4.5.x over time and then recently to 4.6.2 and now 4.6.4, so I don't know if any of those upgrades broke my CiviMail configuration somehow.

Drupal 6

# Answer
I had a similar problem and went to: "Administer" -\> "System Settings" -\> "Cleanup Caches and Update Paths" and then ran "Cleanup Caches". When I went back to the mailing all my groups appeared again.
> 2 votes

---
Tags: civimail
---


title: Sending invoice from webform civicrm

text:
# Question
Title: Sending invoice from webform civicrm
Just wondering if anyone can direct me how I can configure webform and civicrm to send invoice to user when they submit the webform.

I can see from the URL (https://wiki.civicrm.org/confluence/display/CRMDOC/Webform+CiviCRM+Integration) that email receipt is possible using webform civicrm.

*Email receipt - if enabled, these will be sent from the webform just as they would be from the real contribution page*

Thanks in advance.

# Answer
> 1 votes
Have you connected a contribution page to your webform? via the civicrm tab and within that the contributions tab.

If so then you need to set up the contribution page to send a receipt.

If you don't have a contribution page connected and you don't need one then you might like to consider using Webform Emails found at /node/#/webform/emails to send your emails

---
Tags: webform-civicrm
---


# Question
Title: Extending CiviCRM Advanced search (queryObjects hook)
I am adding a Soundex featured to the advanced search. I am using the queryObjects hook to add this into the query. The documentation on this is spotty, only referencing CiviHR. I have downloaded that and gone though it, matching my code to it as closely as I can, but I am having issues getting my values to save/bind to the form.

The code adds nicely to the advanced search:

However, I fill out the fields and submit the form, the fields are not populated after the results load. I was able to bind the fields to the form in the postProcess hook (below) so the values are repopulated in the search form, but the query and qill are not affected.

There are a couple of parts to this extension:

**Query Objects Hook In my main extension main file**

```
function myextenion_civicrm_queryObjects (&$queryObjects, $type = 'Contact') {
    if ($type == 'Contact') {
        $queryObjects[] = new CRM_Myextension_BAO_Query_Soundex();
    }
}

```

**CRM/Myextension/BAO/Query/Soundex.php**

```
<?php

class CRM_Myextenion_BAO_Query_Soundex extends CRM_Contact_BAO_Query_Interface {

    public static $soundex_fields = [
        'soundex_first_name' => [
            'name'  => 'soundex_first_name',
            'title' => 'First Name Sounds Like',
            'type'  => CRM_Utils_Type::T_STRING,
        ],
        'soundex_last_name' => [
            'name'  => 'soundex_last_name',
            'title' => 'Last Name Sounds Like',
            'type'  => CRM_Utils_Type::T_STRING,
        ],
    ];

    public function &getFields() {

        $return = static::$soundex_fields;

        return $return;
    }

    public function from($name, $mode, $side) {
        return '';
    }

    public function where(&$query) {

        if (empty($query->_params)) return;

        foreach ($query->_params as $id => $param) {
            if (empty($param[0])) {
                continue;
            }

            $this->whereClauseSingle($param, $query);
        }
    }

    public function whereClauseSingle(&$values, &$query) {

        list($name, $op, $value, $grouping, $wildcard) = $values;

        $fields = $this->getFields();

        if (!array_key_exists($name,$fields)) return;

        $field = $fields[$name];
        $fieldName = substr($field['name'],8); // strip off the soundex_ at the beginning

        $query->_qill[$grouping][] = ts($field['title'])." - '$value'";
        $query->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause("SOUNDEX(contact_a.".CRM_Core_DAO::escapeString($fieldName).")", "=", soundex($value), "String");
    }

    public function getPanesMapper(&$panes) {

        $panes['Soundex'] = 'civicrm_contact';
    }

    public function registerAdvancedSearchPane(&$panes) {

        $panes['Soundex'] = 'soundex';
    }

    public function buildAdvancedSearchPaneForm(&$form, $type) {

        // echo pre($form->_formValues);

        if (in_array($type,[
            'soundex',
        ])) {
            $fields = $this->getFields();
            foreach ($fields as $name => $label) {
                $form->add('text', $name, ts($label['title']));
            }
        }
    }

    public function setAdvancedSearchPaneTemplatePath(&$paneTemplatePathArray, $type) {

        if (in_array($type,[
            'soundex',
        ])) {
            $template = ucfirst($type);
            $paneTemplatePathArray[$type] = "CRM/Contact/Form/Search/Criteria/{$template}.tpl";
        }
    }

}

```

**CRM/Contact/Form/Search/Criteria/Soundex.tpl**

```
<table class="form-layout">
  <tr>
    <td>
      <label>{ts}{$form.soundex_first_name.label}{/ts}</label><br />
      {$form.soundex_first_name.html}
    </td>
    <td>
      <label>{ts}{$form.soundex_last_name.label}{/ts}</label><br />
      {$form.soundex_last_name.html}
    </td>
    <td>
      {* <label>{ts}Use OR on Soundex (default AND){/ts}</label><br />
      {$form.soundex_or_and.html} *}
    </td>
  </tr>
</table>

```

**Post Process hook (only kinda of working)**

```
function myextension_civicrm_postProcess($formName, &$form) {

    switch ($formName) {
        case 'CRM_Contact_Form_Search_Basic':
        case 'CRM_Contact_Form_Search_Advanced':

            // Soundex
            if (!empty($_POST)) {
                foreach(CRM_Myextension_BAO_Query_Soundex::$soundex_fields as $field => $label) {
                    $filterVal = CRM_Utils_Request::retrieve($field, 'String', $form);
                    if (empty($filterVal)) continue;
                    $form->_formValues[$field] = $filterVal;
                }
                $form->set('formValues', $form->_formValues);
            }

            break;
    }
}

```

# Answer
Ok, I circled back around to this and figured it out. It was staring me right in the face.

The following function in CRM/Myextension/BAO/Query/Soundex.php needs changed. There needs to be a hidden field added to the search form for each advanced search pane. It was so simple in CiviHR example that I look right over it and went down the rabbit hole.

```
public function buildAdvancedSearchPaneForm(&$form, $type) {

    if ($type=='soundex') {

        $form->add('hidden', 'hidden_soundex', 1);

        $fields = $this->getFields();

        foreach ($fields as $name => $label) {
            $form->addElement('text', $name, ts($label['title']));
        }
    }
}

```

Also, there is no need for a postProcess hook.
> 3 votes

---
Tags: search, hooks, forms, advanced
---


title: Sparkpost disable engangement tracking

text:
# Question
Title: Sparkpost disable engangement tracking
Has anyone successfully switched off Engagement Tracking on SparkPost?

I did this at https://app.sparkpost.com/account/smtp

But all links are getting converted to http://go.sparkpostmail.com/

# Answer
> 0 votes
'options' =\> \[ 'sandbox' =\> false, "open\_tracking" =\> false, "click\_tracking" =\> false \],

---
Tags: civimail, sparkpost
---


# Question
Title: Apply Access Ajax API permission to allow Add new organization option to public autocomplete for current employer, still not works
Civicrm-4.7. Apply Access Ajax API permission to allow Add new organization option to public autocomplete(1.4 v) for current employer field, but still not works!.

# Answer
> 0 votes
Pls check the following permission is provided to users:

CiviCRM: access AJAX API Allow API access even if Access CiviCRM is not granted

---
Tags: civievent, civicontribute, civimember, contacts, custom-fields
---


title: Best Way to Track Logs

text:
# Question
Title: Best Way to Track Logs
I am running into two separate issues that I need to address with logging.

I am having trouble with the MailChimp extension and turned on logging and I do not know the best way to get the logs.

I am having an upgrade fail and I need to know where the logging for this.

Thanks, Josh

# Answer
> 1 votes
I recommend you install https://civicrm.org/extensions/civicrm-log-viewer \- it provides a way to view the main CiviCRM configandlog from within the CiviCRM GUI. Look for it under Manage Extensions -\> Add New.

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


# Question
Title: Where do I change the string "Subscription to CiviCRM..." for Stripe payment processor
I hesitated to post this as I think the field should be easily findable, but alas I've given up.

I have donation pages set up using stripe (with recurring payments). The recurring subscription works, but the description is: "Subscription to CiviCRM every 1 months $50.00"

Where can I change this description passed to Stripe?

# Answer
> 1 votes
The Answer - turn on Stripe receipts, and turn on civiCRM receipts. The item itself cannot be changed (at least that was the answer I found when I explored a long time ago).

---
Tags: stripe
---


# Question
Title: CiviCRM Shortcodes button no longer shows up on Wordpress
The CiviCRM shortcodes button on WordPress is no longer showing up on my install and I cannot determine why.

What could cause this functionality to disappear?

# Answer
> 7 votes
If you have the CiviCRM Admin Utilities plugin active, make sure you have selected the post types on which the button is allowed.

---
Tags: wordpress, button
---


title: Webform CiviCRM Integration

text:
# Question
Title: Webform CiviCRM Integration
I've found the extension "Webform CiviCRM Integration" is compatible with Drupal. But, I'm working with WordPress and need to register membership in a more flexible way than allowed by CiviCRM alone. Does anyone know whether Webform CiviCRM Integration works for WordPress?

Thanks in advance.

# Answer
No - it won't work.

I think caldera forms may be the way to go on WP as far as forms go (although others will be better informed).

civicrm-wp-member-sync may be the way forward - And Haystack (the developer) may have the best viewpoint ;)
> 1 votes

---
Tags: extension, webform-civicrm, cms-integration
---


# Question
Title: Include more than 2 profiles in Contribution Pages
I would need to know if it's possible to include more than 2 profiles in a Contribution page, extending the core functionality. Does someone of you know whether there is any extension available that adds this feature? Thank you very much in advance.

# Answer
> 0 votes
i do not think this is available. It has come up for discussion several times. CiviEvents offers it and having the same for Contributions would be a good contribution but I gather it is a reasonable effort and no one has taken it on as a community project yet, or fundraised to get it built.

---
Tags: profile, contribution-page
---


# Question
Title: creating a Smartgroup out of post held in an organization
I created an organization type called "Extension centers". Each extension center will have a post called President. I have already uploaded all the extension centers and the president details into CiviCRM. Now I would like to create a smartgroup of all the presidents. how do I go about it?

# Answer
One solution. Create a new Relationship Type of 'President is/of'. Use that relationship to link your Presidents to the Extension Centres (can be done in bulk via Actions from a Search). Then do an Advanced Search using Relationships. Then save as a Smart Group.
> 1 votes

---
Tags: groups, search, smartgroups, search-results, search-builder
---


# Question
Title: Automated contact filtering for event attendees?
Is there a way to perform automated actions when people sign up to events based on their profile info?

For example: \- if someone has already attended an event in the last month, put them on the waiting list \- if someone belongs to a particular organisation, automatically mark them as registered

I'm using Civi 4.2.27 on Wordpress.

# Answer
You can write a plugin that hooks into `civicrm_post` that will allow you to do anything you like with the newly-registered contact.

```
add_action( 'civicrm_post', 'my_do_stuff_after_registration', 10, 4 );
function my_do_stuff_after_registration( $op, $objectName, $objectId, $objectRef ) {
    if ( $op != 'create' ) return;
    if ( $objectName != 'Participant' ) return;
    $contact_id = $objectRef['contact_id'];
    // ... do anything you like with this contact
}

```
> 1 votes

---
Tags: civievent, profile
---


# Question
Title: How do I write the _spec function for my custom API?
When I run...

```
civix generate:api foo bar

```

...civix generates the following code:

```
function _civicrm_api3_foo_Bar_spec(&$spec) {
  $spec['magicword']['api.required'] = 1;
}

```

From this example, I can see how to make fields *required* when writing APIs. Cool. But *what else* can I do with this `$spec` array? Can I set default values? Can I indicate what *type* of value to accept? Can I specify an array of valid values? Or a regex pattern to test for validity?

Really, I'm not looking for answers to those specific questions, **I'm looking for a comprehensive list** of *everything* I can type in place of `'api.required'` above (and an explanation of how each one works).

# Answer
> 2 votes
After a bit of research I added documentation which explains how to write `_spec` functions:

https://docs.civicrm.org/dev/en/latest/framework/api-architecture/#spec

# Answer
> 1 votes
As per https://github.com/civicrm/civicrm-core/blob/master/api/v3/Dashboard.php#L64 you can set default values, You can also specify the type and even limit to specific options see https://github.com/civicrm/civicrm-core/blob/master/api/v3/Contribution.php#L552 also https://github.com/civicrm/civicrm-core/blob/master/api/v3/Contribution.php#L723. Also as per https://github.com/civicrm/civicrm-core/blob/master/api/v3/Contribution.php#L360 you can specify aliases or alternate field names for legacy or similar handling

---
Tags: api, developer, civix
---


# Question
Title: How to expose the civicase hashed value that gets sent in Subject when sending an email from case
Happy to be told we are going about this wrong.

SCENARIO: Case Manager gets sent an email from an external source to their private/organisational email address.

They want to forward/resend to it gets stored on the Case.

Manager goes in to Civi (or Views in our case) searches the contact, finds the relevant case, then, as i understand things, they need to include a value in the email such as

> \[case #44fec3a\]

where that value is the first 7 letters of a hashed value of the civicrm site-key plus the case id

And indeed this works, if I send an email to the 'inbound email processing email address' and have \[case #44fec3a\] it gets added to the Case. Wonderful.

But the Case Managers have no way of knowing what the hashed value should be - and we need to be able to show it on both the CiviCase page and in Views.

So do we need to find a way to 'present' this 7-character string on both the Case page, and pull it together in our Views?

Or does anyone have a simpler/better suggestion/solution?

# Answer
Here's the override code I've used to make it accept some variations of case id (with and without the word case, with and without the # sign) as well as hash, prioritizing the fanciest to the plainest. It looks like the original code hasn't changed since 4.2 so this should work against 4.7 too.

Create an override for CRM/Activity/BAO/Activity.php, and in lines 607 thru 622 replace it with this:

```
$matches = array();
$subj_to_match = CRM_Utils_Array::value('subject', $params);
if (preg_match('/\[case #([0-9a-h]{7})\]/', $subj_to_match, $matches)) {
  $key        = CRM_Core_DAO::escapeString(CIVICRM_SITE_KEY);
  $hash       = $matches[1];
  $query      = "SELECT id FROM civicrm_case WHERE SUBSTR(SHA1(CONCAT('$key', id)), 1, 7) = '$hash'";
} elseif (preg_match('/\[case #(\d+)\]/', $subj_to_match, $matches)) {
  $hash       = $matches[1];
  // this seems like an odd query but we are checking the id actually exists
  $query      = "SELECT id FROM civicrm_case WHERE id = '$hash'";
} elseif (preg_match('/\[#(\d+)\]/', $subj_to_match, $matches)) {
  // technically this is a subset of the one below, but keeping it allows a subject that had both and prioritize this one
  $hash       = $matches[1];
  $query      = "SELECT id FROM civicrm_case WHERE id = '$hash'";
} elseif (preg_match('/\[(\d+)\]/', $subj_to_match, $matches)) {
  $hash       = $matches[1];
  $query      = "SELECT id FROM civicrm_case WHERE id = '$hash'";
}
if (!empty($matches)) {
  $caseParams = array(
    'activity_id' => $activity->id,
    'case_id' => CRM_Core_DAO::singleValueQuery($query),
  );
  if ($caseParams['case_id']) {
    CRM_Case_BAO_Case::processCaseActivity($caseParams);
  }
  else {
    self::logActivityAction($activity, "unknown case hash encountered: $hash");
  }
}

```

One interesting side effect of this is that saving a non-case activity using the normal civi UI but putting \[1234\] in the subject will save it as a case activity on case 1234!
> 1 votes

---
Tags: civicase
---


# Question
Title: Check number and date fields do not appear when manually entering contributions
Since upgrading to version 4.7.27 the boxes for entering check number and date do not appear when you enter a contribution in the back end with a payment type of check. It used to be that once you selected payment type check, the options to enter this information would appear. They don't anymore.

Thanks for any help anyone can provide!

Leslie

# Answer
> 1 votes
That would definitively be a bug - but I just had a look and check number is still there:

Perhaps something other than Core (an extension, custom code) is hiding your check number field?

---
Tags: civicontribute
---


# Question
Title: Is the container cache not cleared as part of `drush cc all`?
I like being able to use the DI container in my extensions via the container hook, however I've run into the same problem a few times when switching branches that I get this error:

> You have requested a non-existent service "myserviceid"

After trying `drush cc all` I'd expect the container cache to be clearer, but it doesn't seem to be. My go-to option is to remove all files in the `sites/default/files/civicrm/templates_c/` directory, but this seems like it should be handled by the cache clear command.

I'm aware there's an option to not use a container cache, but my question is whether the failure to clear the container cache is expected, or should it be fixed?

# Answer
> 1 votes
You can clear the caches by running `drush cc civicrm`, by removing everything inside the templates\_c directory, and by running clear caches in CiviCRM \> Administer \> System Settings \> Cleanup Caches and File Paths.

In my experience, it's beneficial to run `drush cc civicrm` separately from `drush cc all`, which seems to clear only Drush and Drupal caches.

There is a bug reported about `drush cc all` not clearing CiviCRM caches: https://issues.civicrm.org/jira/browse/CRM-19206

---
Tags: core
---


title: Member Identification Card

text:
# Question
Title: Member Identification Card
Our members often receive discounts in our community as a benefit to their membership. Is there a way to pull their membership data into an online membership card or something? I am just thinking like an image that pulls member's name, membership level, current standing, and member since date. Then member could either save it to their phone or print it out.

# Answer
I have implemented membership cards, however on a custom basis. This has been from the back office side of things.

Your specification of a member printing their own card is intriguing, though that too would be a bit of custom code.

Regardless of who prints it, CiviCRM has nice abilities to generate PDF's from custom code so pretty much whatever format you want is possible. These days PDF's can even generally be sent to actual ID Card printers (ala the plastic cards). I am working on one such project now.

As a potential way around the custom formatting... you *might* be able to define a printed label in the standard CiviCRM that mirrors the badge you would like and you might be able to use that to print badges (though likely just from the back end).
> 2 votes

# Answer
Apologies. This is a Drupal answer and I know you are on Wordpress, but this ticket might attract drupal users too so thought I would outline the approach. There is a View you can download here which provides the logged in user a block with their Membership status etc, and this could be modified to include other fields including image. Using the Print module, or Views PDF this could then have a download option for the user to 'take it away'.
> 3 votes

# Answer
If you want an online membership card, then you could email it to them. You cannot use the receipt message from sign up as that is text only, but if you do a mailing template you can make a nice design with HTML and you can include the membership fields (as long as you find the records through a membership search). I think you might need the Fuzion tokens extension - can't remember now precisely what I needed it for.
> 0 votes

---
Tags: wordpress, civimember, pdf, images
---


# Question
Title: How can I extract email addresses from a Group?
I've created a Group of individuals and I would now like to extract all of their email addresses. Is there a way to do this? When I view the list of individuals in the Group I can partially view the email addresses but not the full addresses. I've set the Group up so we have a list of our current donors and I want to email them but not via CiviCRM.

# Answer
> 2 votes
After you perform a search or show the contacts in a group, you can select all contacts and go to **Actions \> Export Contacts**.

On the next screen, choose which fields you want to export with the contacts or just select "Export PRIMARY fields." Then hit "Continue" and a save dialog box will pop up and save it as a .csv which you can import into a spreadsheet.

# Answer
> 1 votes
You can export Email addresses of all Types using the fields option (where you get to select specific fields you need in the export);

https://docs.civicrm.org/user/en/latest/common-workflows/exporting-your-contacts/

---
Tags: groups
---


title: printing event confirmations

text:
# Question
Title: printing event confirmations
I'm in the process of trying to move people from paper to online, but we have to make a gentle transition and know that there are some important members who so not have email. We'd like to make the offline registration process as much like the email process as we can.

If its just one person booking by post and they do have an email, then there is an option to confirm by email and that works nicely.

If they don't have an email then it sensibly doesn't offer the email confirmation option. I can't see any way of sending a confirmation letter that includes the details of the event. If you use a PDF letter then it doesn't have any tokens for the event booking. I looked at using the Name Badges but they can't look like tickets (local politics) and that would mean a fiddle to get it out as one per page and there is no way of getting other text (like joining info) in.

I would also like something that recorded when people book multiple tickets (themselves and others) like with the online bookings but can't see any way to do that. But I will deal with that in a separate question as I have other issues with multiple bookings and there is enough in this one already.

I'm using CiviCRM 4.7.22 and WordPress 4.9

# Answer
I was going to say, "Do a search for participants (not contacts), then select PDF letter" ... but then I tried it - and there are still no event tokens.

Some work was done to add participant tokens in CRM-16734. Although the Fix Version is 4.7.15 the related PR (PR-9038) was closed without merging.

So unfortunately I don't have a solution for you but confirming this is a known gap in functionality. It would be great if you can do anything to help progress the issue.
> 2 votes

---
Tags: civievent, printing
---


# Question
Title: Drupal 7 Views Not Seeing CiviCRM fields
I've installed Drupal 7 (7.56) and installed CiviCRM (4.7.27) and the Views Module (with accompanying modules)... however, when I try creating a view... and select "Add a field" the CiviCRM fields are not appearing...

... I have added the variable from sites/all/modules/civicrm/install/index.php e.g. the :

```
$databases['default']['default']['prefix']= array(
'default' => 'drup_',
'civicrm_acl'   => '`adef_civi_`.',
... all the way to...
);

```

after the $databases line:

```
$databases = array('default' => array( 'default' => array(
'driver' => 'mysql',
'database' =>
etc...

```

In the settings.php file, which resides under /sites/default/

Also, the base url is set in the civicrm.settings.php file e.g.

```
if (!defined('CIVICRM_UF_BASEURL')) {
     define( 'CIVICRM_UF_BASEURL'      ,
     'https://www.example.com/');
}

```

Any one have any idea as to why the fields won't show up in Views?

# Answer
Here's what is in my settings.php file, although sanitized to remove actual database names, password, etc (found at the bottom of this post).

After doing that, I make sure that I do a complete cache clear in Drupal so that it picks up the changes I made.

Then I go into Views and choose to make a view that is a CiviCRM type (such as one for events or people) - see screenshot:

Once I do that and then go to the next page (to create a page, block, etc), then I have the CiviCRM fields available for what I chose. In this example, I selected CiviCRM Events, so the fields are all related to events.

Here's the code that is in my settings file:

`$databases = array (
 'default' =>
 array (
 'default' =>
 array (
 'database' => 'databasename',
 'username' => 'username',
 'password' => 'mypassword',
 'host' => 'localhost',
 'port' => '',
 'driver' => 'mysql',
 'prefix' => '',
 ),
 ),
);`

`$databases['default']['default']['prefix']= array(
 'default' => '',
 'civicrm_acl' => '`dbname_crm4`.',
 'civicrm_acl_cache' => '`dbname_crm4`.',
 'civicrm_acl_contact_cache' => '`dbname_crm4`.',
 'civicrm_acl_entity_role' => '`dbname_crm4`.',
 'civicrm_action_log' => '`dbname_crm4`.',
 'civicrm_action_mapping' => '`dbname_crm4`.',
 'civicrm_action_schedule' => '`dbname_crm4`.',
 'civicrm_activity' => '`dbname_crm4`.',
 'civicrm_activity_contact' => '`dbname_crm4`.',
 'civicrm_address' => '`dbname_crm4`.',
 'civicrm_address_format' => '`dbname_crm4`.',
 'civicrm_batch' => '`dbname_crm4`.',
 'civicrm_cache' => '`dbname_crm4`.',
 'civicrm_campaign' => '`dbname_crm4`.',
 'civicrm_campaign_group' => '`dbname_crm4`.',
 'civicrm_case' => '`dbname_crm4`.',
 'civicrm_case_activity' => '`dbname_crm4`.',
 'civicrm_case_contact' => '`dbname_crm4`.',
 'civicrm_case_type' => '`dbname_crm4`.',
 'civicrm_component' => '`dbname_crm4`.',
 'civicrm_contact' => '`dbname_crm4`.',
 'civicrm_contact_type' => '`dbname_crm4`.',
 'civicrm_contribution' => '`dbname_crm4`.',
 'civicrm_contribution_page' => '`dbname_crm4`.',
 'civicrm_contribution_product' => '`dbname_crm4`.',
 'civicrm_contribution_recur' => '`dbname_crm4`.',
 'civicrm_contribution_soft' => '`dbname_crm4`.',
 'civicrm_contribution_widget' => '`dbname_crm4`.',
 'civicrm_country' => '`dbname_crm4`.',
 'civicrm_county' => '`dbname_crm4`.',
 'civicrm_currency' => '`dbname_crm4`.',
 'civicrm_custom_field' => '`dbname_crm4`.',
 'civicrm_custom_group' => '`dbname_crm4`.',
 'civicrm_dashboard' => '`dbname_crm4`.',
 'civicrm_dashboard_contact' => '`dbname_crm4`.',
 'civicrm_dedupe_exception' => '`dbname_crm4`.',
 'civicrm_dedupe_rule' => '`dbname_crm4`.',
 'civicrm_dedupe_rule_group' => '`dbname_crm4`.',
 'civicrm_discount' => '`dbname_crm4`.',
 'civicrm_domain' => '`dbname_crm4`.',
 'civicrm_email' => '`dbname_crm4`.',
 'civicrm_entity_batch' => '`dbname_crm4`.',
 'civicrm_entity_file' => '`dbname_crm4`.',
 'civicrm_entity_financial_account' => '`dbname_crm4`.',
 'civicrm_entity_financial_trxn' => '`dbname_crm4`.',
 'civicrm_entity_tag' => '`dbname_crm4`.',
 'civicrm_event' => '`dbname_crm4`.',
 'civicrm_event_carts' => '`dbname_crm4`.',
 'civicrm_events_in_carts' => '`dbname_crm4`.',
 'civicrm_extension' => '`dbname_crm4`.',
 'civicrm_file' => '`dbname_crm4`.',
 'civicrm_financial_account' => '`dbname_crm4`.',
 'civicrm_financial_item' => '`dbname_crm4`.',
 'civicrm_financial_trxn' => '`dbname_crm4`.',
 'civicrm_financial_type' => '`dbname_crm4`.',
 'civicrm_grant' => '`dbname_crm4`.',
 'civicrm_group' => '`dbname_crm4`.',
 'civicrm_group_contact' => '`dbname_crm4`.',
 'civicrm_group_contact_cache' => '`dbname_crm4`.',
 'civicrm_group_nesting' => '`dbname_crm4`.',
 'civicrm_group_organization' => '`dbname_crm4`.',
 'civicrm_im' => '`dbname_crm4`.',
 'civicrm_job' => '`dbname_crm4`.',
 'civicrm_job_log' => '`dbname_crm4`.',
 'civicrm_line_item' => '`dbname_crm4`.',
 'civicrm_loc_block' => '`dbname_crm4`.',
 'civicrm_location_type' => '`dbname_crm4`.',
 'civicrm_log' => '`dbname_crm4`.',
 'civicrm_mail_settings' => '`dbname_crm4`.',
 'civicrm_mailing' => '`dbname_crm4`.',
 'civicrm_mailing_abtest' => '`dbname_crm4`.',
 'civicrm_mailing_bounce_pattern' => '`dbname_crm4`.',
 'civicrm_mailing_bounce_type' => '`dbname_crm4`.',
 'civicrm_mailing_component' => '`dbname_crm4`.',
 'civicrm_mailing_event_bounce' => '`dbname_crm4`.',
 'civicrm_mailing_event_confirm' => '`dbname_crm4`.',
 'civicrm_mailing_event_delivered' => '`dbname_crm4`.',
 'civicrm_mailing_event_forward' => '`dbname_crm4`.',
 'civicrm_mailing_event_opened' => '`dbname_crm4`.',
 'civicrm_mailing_event_queue' => '`dbname_crm4`.',
 'civicrm_mailing_event_reply' => '`dbname_crm4`.',
 'civicrm_mailing_event_subscribe' => '`dbname_crm4`.',
 'civicrm_mailing_event_trackable_url_open' => '`dbname_crm4`.',
 'civicrm_mailing_event_unsubscribe' => '`dbname_crm4`.',
 'civicrm_mailing_group' => '`dbname_crm4`.',
 'civicrm_mailing_job' => '`dbname_crm4`.',
 'civicrm_mailing_recipients' => '`dbname_crm4`.',
 'civicrm_mailing_spool' => '`dbname_crm4`.',
 'civicrm_mailing_trackable_url' => '`dbname_crm4`.',
 'civicrm_managed' => '`dbname_crm4`.',
 'civicrm_mapping' => '`dbname_crm4`.',
 'civicrm_mapping_field' => '`dbname_crm4`.',
 'civicrm_membership' => '`dbname_crm4`.',
 'civicrm_membership_block' => '`dbname_crm4`.',
 'civicrm_membership_log' => '`dbname_crm4`.',
 'civicrm_membership_payment' => '`dbname_crm4`.',
 'civicrm_membership_status' => '`dbname_crm4`.',
 'civicrm_membership_type' => '`dbname_crm4`.',
 'civicrm_menu' => '`dbname_crm4`.',
 'civicrm_navigation' => '`dbname_crm4`.',
 'civicrm_note' => '`dbname_crm4`.',
 'civicrm_openid' => '`dbname_crm4`.',
 'civicrm_option_group' => '`dbname_crm4`.',
 'civicrm_option_value' => '`dbname_crm4`.',
 'civicrm_participant' => '`dbname_crm4`.',
 'civicrm_participant_payment' => '`dbname_crm4`.',
 'civicrm_participant_status_type' => '`dbname_crm4`.',
 'civicrm_payment_processor' => '`dbname_crm4`.',
 'civicrm_payment_processor_type' => '`dbname_crm4`.',
 'civicrm_payment_token' => '`dbname_crm4`.',
 'civicrm_pcp' => '`dbname_crm4`.',
 'civicrm_pcp_block' => '`dbname_crm4`.',
 'civicrm_persistent' => '`dbname_crm4`.',
 'civicrm_phone' => '`dbname_crm4`.',
 'civicrm_pledge' => '`dbname_crm4`.',
 'civicrm_pledge_block' => '`dbname_crm4`.',
 'civicrm_pledge_payment' => '`dbname_crm4`.',
 'civicrm_preferences_date' => '`dbname_crm4`.',
 'civicrm_premiums' => '`dbname_crm4`.',
 'civicrm_premiums_product' => '`dbname_crm4`.',
 'civicrm_prevnext_cache' => '`dbname_crm4`.',
 'civicrm_price_field' => '`dbname_crm4`.',
 'civicrm_price_field_value' => '`dbname_crm4`.',
 'civicrm_price_set' => '`dbname_crm4`.',
 'civicrm_price_set_entity' => '`dbname_crm4`.',
 'civicrm_print_label' => '`dbname_crm4`.',
 'civicrm_product' => '`dbname_crm4`.',
 'civicrm_queue_item' => '`dbname_crm4`.',
 'civicrm_recurring_entity' => '`dbname_crm4`.',
 'civicrm_relationship' => '`dbname_crm4`.',
 'civicrm_relationship_type' => '`dbname_crm4`.',
 'civicrm_report_instance' => '`dbname_crm4`.',
 'civicrm_saved_search' => '`dbname_crm4`.',
 'civicrm_setting' => '`dbname_crm4`.',
 'civicrm_sms_provider' => '`dbname_crm4`.',
 'civicrm_state_province' => '`dbname_crm4`.',
 'civicrm_subscription_history' => '`dbname_crm4`.',
 'civicrm_survey' => '`dbname_crm4`.',
 'civicrm_system_log' => '`dbname_crm4`.',
 'civicrm_tag' => '`dbname_crm4`.',
 'civicrm_tell_friend' => '`dbname_crm4`.',
 'civicrm_timezone' => '`dbname_crm4`.',
 'civicrm_uf_field' => '`dbname_crm4`.',
 'civicrm_uf_group' => '`dbname_crm4`.',
 'civicrm_uf_join' => '`dbname_crm4`.',
 'civicrm_uf_match' => '`dbname_crm4`.',
 'civicrm_value_additional_information_1' => '`dbname_crm4`.',
 'civicrm_value_commerce_purchases_6' => '`dbname_crm4`.',
 'civicrm_value_event_information_9' => '`dbname_crm4`.',
 'civicrm_value_host_location_5' => '`dbname_crm4`.',
 'civicrm_value_hotel_information_4' => '`dbname_crm4`.',
 'civicrm_value_hotels_3' => '`dbname_crm4`.',
 'civicrm_value_member_information_2' => '`dbname_crm4`.',
 'civicrm_value_private_training_8' => '`dbname_crm4`.',
 'civicrm_value_private_trainings_7' => '`dbname_crm4`.',
 'civicrm_website' => '`dbname_crm4`.',
 'civicrm_word_replacement' => '`dbname_crm4`.',
 'civicrm_worldregion' => '`dbname_crm4`.',
);`
> 1 votes

---
Tags: drupal, drupal-views, fields
---