# Question
Title: Weekly Digest Email to Group (Mailing List)
What route would one take to creating an automated weekly digest for an existing mailing list group? Can this be done with a scheduled reminder along with some code in a template file somewhere? I am running Drupal and am wondering if maybe a scheduled reminder email that has some code to grab the result from a view to plop into the email body might work?

# Answer
> 1 votes
As a partial answer, we did some work to enable a View to be pulled in to a civimail as a token. The code is here but could do with some further improvements and is untested afaik in respect of Scheduled Reminders.

---
Tags: civimail, templates
---


# Question
Title: How do I schedule a mailing to run in a couple of hours time with the CiviCRM API?
I'd like a delay before sending out an automated email.

API call as per stack exchange question.

The data passed as $params seems OK. 2 hours in the future.

The database has the correct time.

The user interface says it is sending it now and the mailing actually does get sent now.

# Answer
Can you double check if the other mailings have the same time in the database and in the UI? It's quite common that one or the other is not taking into account the same timezone, ie if your UI is assuming your database at GTM and your user is at GMT+2, it's normal it starts right away (or the other way around, timezones are always confusing ;)

X+
> 1 votes

---
Tags: civimail, api, mailing
---


# Question
Title: Civisualize - getting data from a report into dataviz
I'm seeing in notes on Civizualize that some work has been done in getting reports data into a form where civisualize can deal with it.

Anyone give me a pointer to where that is?

# Answer
> 2 votes
In principle, if you get the data out of report as json or csv, it should work fine.

Let me check with sid if he remembers what was done beside fetching as csv.

---
Tags: civireport, civisualize
---


# Question
Title: Does CiviGroup Roles Sync work with bulk changes to groups?
Using CiviCRM 4.7.17 with Drupal 7.54

CiviGroup Roles sync adds and removes Drupal users from Drupal roles when changes to CiviGroup groups are done one Contact at a time from the groups tab for the Contact. So the sync is set up correctly.

But when I add or remove Contacts to/from CiviGroup groups in bulk from a list of Contacts, the changes are not synced to the Drupal roles.

These are NOT Smart groups by the way.

Am I missing something? How can I do bulk add/remove Contacts in Civi and have the Drupal roles synced accordingly?

Thanks for any suggestions.

# Answer
From what I understand CiviMember Role sync and CiviGroup Role sync auto-mapping - are evaluated at the time the User logs in.

Login -\> is user in a specific Group -\> ah yes -\> so assign role x

So there really is no need to hit the sync button - I don't think; all is well on login.
> 3 votes

---
Tags: drupal, groups, roles
---


# Question
Title: Themekey Rule to Present Theme on CiviEvent Page
This is not working for loading my theme on my CiviEvent page of civicrm/event/register?reset=1&id=29

What are the right ThemeKey rules to use?

# Answer
Use Themekey CiviCRM from Fuzion Github, it can select themes by contribution page ID or type, and event page ID or type.
> 3 votes

# Answer
You can use CiviCRM Theme module to pick a different theme for admin and for public CiviCRM pages!

(EDIT) You will find the settings on the /admin/appearance page down the bottom.

Note: you may need to enable the module on the admin/modules page!
> 1 votes

---
Tags: civievent, theme
---


# Question
Title: Is there an automated way to check if a list of extensions is compatible with a version of Civi?
I'm going to go through a list of installed extensions manually at civicrm.org/extensions and check, one by one, if each is compatible with CiviCRM 4.7.x , per the Q and A here .

However, is there any way to *automate* that tedious process, from within the Civi UI and/or on the civicrm.org website? Extensions listed here all show CiviCRM Compatibility version info.

Can a filter be added to the webpage to search by CiviCRM version compatibility, for say, just CiviCRM 4.7? A compact view created with the Extension names and a checkbox to select a subset of results?

Thanks!

# Answer
If you go to the CMS independent tab within the extensions direcotry page, there's a field to filter by "CiviCRM Compatibility". Here are the extensions compatible with CiviCRM 4.7
> 2 votes

# Answer
If you have access to a shell on the server (e.g. SSH), you can `cd` to the extensions directory and paste this command:

```
grep --recursive -l --include info.xml '<ver>4.7</ver>' *

```

This will search all the folders for files named 'info.xml' and then search the text of info.xml for the presence of the string that indicates 4.7 compatibility, returning a list of extensions.

This will NOT tell you which extensions have upgraded versions that are compatible with 4.7 - but it will cover all your extensions, including "unlisted" ones.

Of course, a great many extensions that aren't listed as 4.7 compatible still work in 4.7.
> 1 votes

---
Tags: extension
---


# Question
Title: CiviCRM upgrade from 4.2.7 to 4.7.13 fails to show any report
CiviCRM was updated from 4.2.7 and right now is even updated to 4.7.16 but when we try to get reports and even try to click on "Refresh Results" it shows nothing, not even an error about it. The original site still has CiviCRM 4.2.7 and is able to show all reports with no trouble. I've been looking for any file, database table or anything that might be missing and needs to be updated but can't find what is causing this, any ideas what might be?

Regards,

# Answer
> 1 votes
As I said to your previous post about the same topic here: What tables are used for civicrm reports?

> 4.2-\>4.7 is a huge upgrade. Swathes of tables - including Activities and Settings - have changed. If you have any custom reports or extensions these definitely will need to be upgraded without a doubt.

As ErikH said:

> Assuming you are using customized reports and do not have a CiviCRM/PHP developer in your staff, you have to find a CiviCRM expert/developer to do this for you

Upgrading these reports will require a coder to change their code to point them to the new database tables used by CiviCRM. There's no workaround. Code for custom reports will need to be changed. Tell your next developer to use the CiviCRM API if possible!

# Answer
> 1 votes
I would check the CiviCRM log files. Find them here. Also try steps listed here: How do I debug CiviCRM when I hit a blank page / white screen / fatal error?

# Answer
> 0 votes
Just a hint, the connection between the report URL and the executing report PHP class is stored in the option tables. Does following query return any results?

```
select  *  FROM civicrm_option_value v
,                  civicrm_option_group g
where   g.id = v.option_group_id
and     g.name = 'report_template'

```

---
Tags: civireport
---


title: Webform CiviCRM integration with REST

text:
# Question
Title: Webform CiviCRM integration with REST
I'd like to integrate a Drupal webform on a non-CiviCRM install with a Drupal CiviCRM install on a separate server. It seems to me that using a stripped down kind of module like webform-civicrm using a REST interface with CiviCRM might be a feasible option, stripping out some of the more complex integrations that require any native Civi code.

Has anyone tried something like this?

# Answer
Author of the module here...

Great question. I've forseen a need for this and have over the past few versions been stripping out sql queries and BAO calls when possible and replacing them with api calls. But that work is only around half done. And the low-hanging fruit has been picked. The remaining BAO/DAO calls are mostly still in there because there is no equivalent api.

The reason for this approach is that CiviCRM supports api calls over REST, so once we decoupled Webform-CiviCRM from calling internal Civi functions, it would be theoretically possible to pipe all the api calls over REST (assuming you had a nice fast connection between the two servers).

The only "quick 'n easy" way forward I see would be to install CiviCRM on your host Drupal site just so the internal function calls won't bomb, then swap the `wf_civicrm_api` function in `utils.inc` to use REST. That should more-or-less work, depending on your use-case.

The "correct" solution is probably to write a CiviCRM extension, installable on the source site, that provides an api wrapper for all required internal functions, and patch Webform-CiviCRM to use that api instead of direct DAO/BAO calls. This would, in theory, allow you to host CiviCRM on WordPress and integrate with a Drupal webform.
> 2 votes

# Answer
you may want to have a look at CiviMcRestFace (yes, that's really the name...). The project aims at providing an infrastructure for the data exchange between a public facing website with a CiviCRM system. It i still in a preliminary phase but feel free to get in contact with Erik Hommel or Björn Endres.
> 2 votes

---
Tags: webform-civicrm
---


# Question
Title: How should I go about proposing (and then possibly creating) a new CiviCRM feature?
I have an idea for a small new feature. I think this feature would be useful to a significant portion of the Civi user community. I'm willing to build it. Is there a standard process for proposing my feature, getting approval (from the community? from the Civi core team?), and then developing it?

(To give an example, I'd like to expose "Payment Processor" as a search criterion on the Find Contributions form. No change to the database schema, not a huge change to the UI, and probably not a lot of new code. This feature would probably be useful to a larger portion of the Civi community than just the client who requested it.)

Is the process any different if I won't be building the feature myself?

How is the process different for features of different sizes? (And how is it determined whether a feature is "big" or "small" -- or what constitutes a "new feature" versus an "improvement on an existing feature"?)

# Answer
Noah - hi - am sure there will be better answers for this but this might help get the ball/conversation rolling. A lot of discussion about 'is this something that can go in core' happens on https://chat.civicrm.org/civicrm/channels/dev

There is an ongoing debate about what new features should go in to core versus Extensions that ship with core, versus other Extensions.

There is a real focus on tests coming with any new PR.

If you aren't building it yourself? Well if you are commissioning the core team or one of the Partners then they will worry about such things on your behalf. If you are shipping the idea off to freelancer or some such then it is probably the same as if you are doing the dev, ie you are responsible for providing the tests and the arguments for why something should be a fix/add to core versus an extension.

Other resources that might help you answer this more yourself, but expect you have already trawled for them but may be useful for others who read this
> 1 votes

---
Tags: extension, developer, core
---


# Question
Title: Quality assurance considerations for membership signups
I'm pretty new to the CiviCRM world and am just finishing my first project using it. We are now in the process of making sure that our membership signup procedure (with contributions) works well. As I see it there are a couple of ways to increase the chance that we will have a high quality in this part of our system:

1. We can communicate with users who have used the live system
2. We can carefully monitor the stats for new users
3. We can run tests ourselves

*For the tests* I see several possible ways, for example we can *use the payment processor that we are using for the live payments but instead run it in test mode* ("preview" in the url params). KarinG suggested in her answer to this question that we create a new payment processor and run it in *live mode* but with *test credentials*. Also there is the *"dummy payment processor"* which seems to be recommended in the CiviCRM user guide ("For the purposed of testing, you can configure dummy payment processors.")

**How do we (in general) ensure that our donation procedure is working well?** And a more specific question: **Which of the options above (dummy payment processor etc) is the best way to test a membership system?**

Grateful for help and with kind regards, Tord

# Answer
I strongly prefer the approach of having a $1 membership type set up, and testing it with real cards and real money. For $2-3 I get full piece of mind that things are working. I generally only need to know it is working on one Contribution page to give me confidence that it will be working on all pages using the same Payment Processor.
> 3 votes

---
Tags: civicontribute, civimember, payment-processor, testing
---


# Question
Title: Adding another option to the Source drop down box
Using webform civicrm, how can one add another source option to the wizard?

# Answer
Since this is tagged as webform civicrm - I am guessing you mean the Source Label that you can find if you go to the CiviCRM tab on the webform and then go to Additional Options
> 1 votes

---
Tags: webform-civicrm
---


title: CiviCRM SendinBlue email integration

text:
# Question
Title: CiviCRM SendinBlue email integration
Has anyone in the CiviCRM community considered integrating CiviCRM with SendinBlue (https://www.sendinblue.com/)?

# Answer
> 1 votes
Not as far as I am aware (and a google search, which I am sure you have done) does not bring up anything significant.

Aside: I'm interested in developing marketing automation tools for CiviCRM. Similar to sendinblue and dotmailer and would be happy to chat further with you if you're interested (michaelmcandrew@thirdsectordesign.org).

# Answer
> 0 votes
I've been using Sendinblue for a while. Not using any extensions, just plugged in the SMTP credentials and emailing away

---
Tags: email
---


title: modify contribution for price set

text:
# Question
Title: modify contribution for price set
Is it possible for the admin to modify a contribution record amount for a Price Set field.

For example, if a user signs up and selects the contribution type/price, this seems static in the resulting contribution record.

# Answer
I've found updating contribution amounts as Ramesh says is pretty weird for us, since we use price sets and offer lots of different deals and partnerships on events... the contribution status usually changes itself to partially paid or pending refund, which we don't want. I believe it's for people who want to use civicrm for financial reconciliation but since we dont, it makes things a bit complicated.

For one-offs, I usually go to the API explorer (yoursite.org/civicrm/api/explorer) and do a contribution create, including the contribution ID parameter to update the amount and the status (to completed) at the same time.
> 1 votes

# Answer
I guess you are trying to change the contribution amount

If so, you can change the contribution amount on it own and this is not going to affect the price set in anyway

I guess this helps !!!!
> 0 votes

---
Tags: price-sets
---


# Question
Title: create webform that allows user to create either 1, 2 or 3 activities depending on user selection
I've created a drupal web-form that creates a household and 3 activities (each an activity type "referral" assigned to different department). I've also created conditional formatting to only show the activity details activity details for referrals to the departments that have been selected. So far so good.

The problem i'm facing is that there are always 3 activities created.
If, for example the user selects only that a new household should only have a referral only to departments 2 & 3 (ie. not to dept 1), i only want to create 2 activities, but 3 activities are created.

I think this is because in the webform-civicrm tab i've created three activities with the household members assigned. Is there a way to have a variable number of activities created?

# Answer
You can accomplish this by:

* For each activity, make the *Activity Type* field "user select".
* Edit those 3 *Activity Type* fields on the webform. For each one:
    + Deselect "list box"
    + Deselect all activity types except the one you want.
    + Rename that option to something like "Create activity"
* Add a conditional rule on the form showing/hiding other activity fields depending on the *Activity Type* field being checked.

This will present a checkbox on the form allowing users to select whether or not they will create each activity.

Note: This works in the current version of webform\_civicrm but logs an error saying "could not create activity." I've fixed that superfluous error report in -dev (as well as fixing a bug where it could not save activity details) so you may want to upgrade to the -dev version until the next release.
> 5 votes

# Answer
Ah - I've run into that as well. You'll always get the #activities as specific in the CiviCRM -\> Activities tab;

Best I could think of at the time was to bring the Assign to field as a checkbox to the Webform and say: "Reserve Seat": if checkbox checked the Activity would have an Assign to -\> else it would be n/a

\[yes we were/are using Assign to very litterally here \]

Then you can clean out the ones that you don't want.
> 2 votes

---
Tags: webform-civicrm, activities
---


title: Hard coding data during import

text:
# Question
Title: Hard coding data during import
I'm trying to import some contribution information from our payment processor and need to specify a "financial type" for the Civi Contribution (A mandatory field).

Unfortunately, this information isn't contained in the exported data. Is there any way to hard code the value that I would like to use for all imports?

I'm thinking I'll have to pre-process the exported data to add the field, but if there is a better way to do this in Civi, that would be amazing.

Thanks! Trev

# Answer
> 0 votes
you'll have to add a column -\> with Financial Type to your Exported Data before you can import it into CiviCRM; First you make the Financial Type in your CiviCRM -\> if you're not sure what these monies make a Financial Type: Legacy Monies; Then create a Financial Type column in your Exported Data -\> and fill it with: Legacy Monies. That should work - and will not take too long!

---
Tags: import, contributions
---


title: Working e2e UnitTests?

text:
# Question
Title: Working e2e UnitTests?
When I run e2e unit tests, it doesn't seem to recognise that I'm telling it to only use group e2e. This is possibly due to the default include/exclude filters in the phunit.xml file.

When I add the group e2e to the phunit.xml file, I get

CRM\_BedResourceManager\_BedResourceManagere2eTest exception `RuntimeException` with message `\Civi\Test::e2e() requires a real CMS. Found CIVICRM_UF=UnitTests.`

When I hack the tools/scripts/phpunit to contain CIVICRM\_UF='Drupal', not 'UnitTets' it then goes on to say

packages/DB/DataObject.php: "No database name / dsn found anywhere",

I tried popping some entries from civicrm\_settings in there, but it didn't work.

a) Does anyone have a working e2e unit test config?

b) What are the settings I need to put in my tools/scripts/phpunit to make it work properly? My Civi and Drupes are in the same database.

# Answer
My problem was solved by using the command `phpunit4` from inside the extension directory. Use `--group e2e` or `--group headless` as needed.
> 1 votes

---
Tags: unit-testing
---


title: Mass editing contact's birthdays

text:
# Question
Title: Mass editing contact's birthdays
Due to problem on our end we have about 13 000 contacts with "01.01.1970" as their birthday. I'd like to remove that from all those contacts, and tried doing that by using "Batch Update via Profile". I made a simple profile with only birth date, but it doesn't seem to work.

Firstly I have to manually type in the birth date (calender drop down doesn't work), and using the copy button doesn't work. Changes are not saved either.

Does anyone know of another way to mass edit birth dates, or does anyone know how to fix this bug? I'm quite new at CiviCRM so I might have done something wrong.

# Answer
With that many contacts whose records all need changing, I think I'd be inclined to let them do it themselves. You could send them each an email with an editable profile including date of birth (required). You could include a checksum to save them having to login and the profile form would then be pre-filled. This could be a good time to keep their profiles up to date.

You dont say which CMS you are using but a useful link to token checksums is at https://wiki.civicrm.org/confluence/display/CRMDOC/Tokens.

Checksum for standard Profiles (edit mode): To send people to a profile use this path where N is the ID of the Profile you want to send them to:

```
Drupal: http://www.myorganization.org/civicrm/profile/edit?reset=1&gid=N&{contact.checksum}&id={contact.contact_id}
Joomla!: http://www.myorganization.org/index.php?option=com_civicrm&task=civicrm/profile/edit&reset=1&gid=N&{contact.checksum}&id={contact.contact_id}
WordPress: http://www.myorganization.org/?page=CiviCRM&q=civicrm/profile/edit&reset=1&gid=N&{contact.checksum}&id={contact.contact_id}

```

Hope this helps.
> 2 votes

# Answer
Talk to your IT support. This can fixed in 5 minutes with some straightforward SQL (structured query language)
> 2 votes

# Answer
Thank you for the answers! The checksum thing might be helpful later.

But I figured out the problem, in the birth date field there was a checkbox crossed that said show only/read only.

Cheers
> 0 votes

---
Tags: contacts, profile, batches
---


# Question
Title: How to add options in autocomplete contact search options?
We have contacts with the same First and Last Names. It is hard to identify person when we use Quick Search or add relationships. And default options doesn't help to identify person aswell. Is there any way how can we add additional fields (e.g. Birth Date) into autocomplete contact search options?

We are using CiviCRM 4.7.14 and wordpress.

Thanks in advance.

# Answer
You can add easily add predefined fields into the autocomplete results by selecting fields under "Autocomplete Contact Search" under "Settings - Search Preferences".

Adding the Birth Date will not be as easy. Technically you could add an additional option group value to the option group contact\_autocomplete\_options, but that will be pretty much experimenting at your own risk since this is supposed to be a reserved option group.
> 2 votes

---
Tags: relationships, fields, quicksearch, option
---


# Question
Title: Assign large numbers of activities at once - Wordpress
Is there any way of doing this from the interface. I have lots of activities that need to be assigned to a small group of individuals. I want to assign these (currently unassigned ) activities to the corresponding contact. Can't do it through batch update or import, the assigned field isn't exposed.

# Answer
If there is a way, we didn't find it, and that was partly why Fuzion put a bunch of time in to making it possible to assign/unassign/reassign Activities in Drupal using CiviCRM Entity Actions which is now a submodule of CiviCRM Entities, Views and Views Bulk Operations, in order to deliver a Calling Tool that could be driven from the Drupal front end. (Is there some way I can mark these types of answer as Drupal-only info?)
> 2 votes

# Answer
Since you mention import you could try using the csvimporter Extension, which does include many other Entities such as Activities and provides fields for eg 'assignee' when doing so.
> 1 votes

---
Tags: activities
---


title: E-mailed report misses a column

text:
# Question
Title: E-mailed report misses a column
I have created Contribution report which also has one **Custom Field** column (Membership Type).

When I open the report, I see all columns.

---

---

But when I setup Email Delivery and receive the report as CSV, it lacks the Membership Type column.

Why could this be?

# Answer
> 1 votes
Figured it out finally. The Email Delivery was called by the user with different permissions that the one who was logged in. Adding Permission **CiviCRM: access all custom data** solved the problem.

---
Tags: reports
---


title: Datepicker not visible

text:
# Question
Title: Datepicker not visible
I am unable to use datepicker with popup forms enabled - calendar does not appear active on top of the form but underneath (discovered after reducing and moving the form around). It works with popup forms disabled. Help, please!

.

Using WP 4.7.3, CiviCRM 4.7.17

# Answer
> 0 votes
I suspect you have a WP plugin installed which is interfering. Note the weird double-icons in the top-right of your screenshot. Definitely something extra going on there.

Check this list of Wordpress Plugins Incompatible with CiviCRM. Your culprit may be listed. Otherwise, disable all plugins, and, assuming that solves your problem, re-enable them one-at-a-time to discover the culprit.

# Answer
> 1 votes
Candidate theme comes with 'Indeed Social Share & Locker Pro' plugin which seems to be conflicting with CiviCRM

---
Tags: forms, calendar
---


# Question
Title: Donors are receiving multiple receipts with ACH contributions
Wordpress 4.7.3 Civi 4.6.26 iATS Payments for our processor

When donors make an ACH donation they get receipt right away and then a second one when the it clears their bank and the donation in Civi is changed from Pending to Completed. Is there a way to have Civi only send one receipt?

# Answer
> 1 votes
I dug into the code:

Firstly, in my humble view, it could use splitting into separate functions. One function is almost 400 lines long, making investigation hard.

I think I've seen the problem though. If your version of civicrm is less than 4.7.12, it won't activate a lot of the logic for recurring contributions.

https://github.com/iATSPayments/com.iatspayments.civicrm/blob/a92dd620a8975469e65372b3e34c812e5130faa1/iats.php#L244

`function _iats_civicrm_use_repeattransaction() {
 $version = CRM_Utils_System::version();
 return (version_compare($version, '4.7.12') < 0) ? FALSE : TRUE;
}`

For example, line 1425, which decides if to use line 1448, which currently reads:

`$complete['is_email_receipt'] = empty($options['is_email_receipt']) ? 0 : 1;
try {
 $contributionResult = civicrm_api3('contribution', 'completetransaction', $complete);
}`

**Update** Oh, and there are also two unmerged patches from solid contributors: https://github.com/iATSPayments/com.iatspayments.civicrm/pulls

---
Tags: receipts, iats
---


# Question
Title: How do I upgrade CiviCRM on a local site that I installed with buildkit civibuild?
A while back I did

```
$ civibuild create demo.local --type drupal-demo --url http://demo.local

```

and got a working local site running CiviCRM 4.7.9. **Great.**

---

Now I'd like to upgrade this site to 4.7.17.

I tried:

```
$ cd ~/buildkit/build/demo.local/sites/all/modules/civicrm
$ git fetch
$ git checkout 4.7.17
$ cv flush
$ drush civicrm-upgrade-db

```

The last command gives `You are already upgraded to CiviCRM 4.7.9`.

What did I miss?

EDIT:

Also I have tried:

```
$ git checkout master
$ git pull

```

as well as browsing to `http://demo.local/civicrm/upgrade?reset=1` to perform the database upgrades *(Which tells me "Your database has already been upgraded to CiviCRM 4.7.9")*

# Answer
## tldr

```
cd buildkit/build/dmaster/sites/all/modules/civicrm

## Ensure that all your stuff is clean/committed.
git scan status

## Update git repos. Choose ONE of:
git scan up
./bin/givi checkout X.Y.Z

## Regenerate data. Choose ONE of:
civibuild reinstall dmaster
./bin/setup.sh -Dg && drush civicrm-upgrade-db

```

## Checking the git repos

There are multiple git repos in your build (`civicrm-core.git`, `civicrm-packages.git`, etal). Before making a major switch, I first double-check that all of these repos are in sane condition -- ie there shouldn't be any uncommitted changes, the repos should be on normal branches, etc.

```
git scan status

```

## Updating the git repos

As a developer who tracks mainline branches, my day-to-day interest is "updating to the latest revision of `master` or `4.6`". The command `git scan up` will perform a standard "fast-forward merge" (`git pull --ff-only`) across all the repos:

```
git scan up

```

(Tip: If you didn't cleanup earlier, then "fast-forward" may not be possible. It takes some judgment to decide what to do -- e.g. a "merge" versus "rebase". Rather than risk a wrong decision, `git scan` will skip these repos and display warnings instead.)

Your example uses a tag. Hopping among tags is a bit different than tracking a branch. For this, I use `givi`:

```
./bin/givi checkout 4.7.17

```

## Updating the generated code, config files, databases

As a developer who does weird things on a day-to-day basis (like manually hacking SQL records to provoke weird situations), I have trouble remembering all the weird things that I've done before -- and honestly don't care about them afterward. I just want to get back to a consistent/clean state. Reinstalling is nice because it recreates/overwrites all generated-code, config-files, and database content.

```
civibuild reinstall dmaster

```

However, that does reset all the data. If you care about the content in the database, then don't do a reinstall. Instead, update the generated-code and perform a DB upgrade:

```
./bin/setup.sh -Dg
drush civicrm-upgrade-db

```

## See also

For more discussion, see the blog post: https://civicrm.org/blogs/totten/developer-tip-managing-multiple-git-repositories
> 5 votes

# Answer
Firstly, I don't think that git checkout would overwrite files without doing a git pull, would it? Those files need to be overwritten with the new version.

The next thing is that you probably need to visit the upgrade URL:

http:///civicrm/upgrade?reset=1

Good luck!
> 0 votes

# Answer
Second try: do a git checkout -f

To force overwrite of local files!
> 0 votes

---
Tags: upgrade, civicrm-buildkit, civibuild
---


# Question
Title: Why do I have GenCodeChecksum uncommitted changes after a fresh civibuild create?
I just created a new site with buildkit:

```
$ civibuild create foo --url http://foo --type drupal-demo

```

Then I went into CiviCRM and looked at the git repo

```
$ cd ~/buildkit/build/foo/sites/all/modules/civicrm
$ git status

```

and I see:

```
    modified:   CRM/Case/DAO/Case.php
    modified:   CRM/Core/DAO/AllCoreTables.data.php
    modified:   CRM/Financial/DAO/PaymentProcessor.php

```

Why? I would expect the repo to be clean after a fresh install. The diffs for these files show a different value for `GenCodeChecksum` within the docblock header for the file, and that's the entirety of the uncommitted changes. What's going on here?

# Answer
**tldr**: It's safe but mildly annoying. Please feel free to send a pull-request to update these files.

**Longer**: DAO files are auto-generated when `civibuild` calls the script `xml/GenCode.php` with the data in `xml/schema`. However, running `GenCode` is traditionally pretty slow -- even on a fast workstation, it can add 30 seconds to the build-time.

Starting somewhere in 4.7.x, we did an optimization: if the checksum looks right, then `GenCode` keeps the DAO. (Hooray, faster!) If the checksum looks wrong, then it regenerates the DAO.

In a typical scenario, you might edit a file in `xml/schema`, then run `GenCode`, then observe several changes to your local DAO. The `GenCodeChecksum` would be one of several changes. You'd commit those changes and send them in with the PR.

Right now, I see something like what you describe -- the *only* difference between the upstream DAO and the local DAO is the checksum. This can happen occasionally (eg if there were contemporaneous PRs manipulating schema and the precise order-of-operations was unfavorable). The consequences are:

* `GenCode` spends an extra second regenerating 1-3 files.
* Your `git diff` shows something unexpected on 1-3 files.

That's mildly annoying - but you still wind up with the right code, so it's safe.

You can fix it by submitting a PR to update the DAO's with the latest `GenCodeChecksum`.
> 1 votes

---
Tags: civicrm-buildkit, civibuild
---


# Question
Title: Adding Organization filter to Event details report
I have a report that I've modified from the Attendee List report under the Event Reports, but it's missing the ability to filter by organization name. Essentially, the purpose of the report is to pull out detailed information of all employees who've attended events in a defined range. This can then be used to show the company the value they are receiving by being members. Everything I need is there except the ability to display only individuals from just one company. Is there a simple way to edit the report to filter by company?

I'm running CiviCRM 4.7.11 on Joomla 3.6.5

# Answer
"Simple" is a relative term here! This is an excellent beginner-level modification to CiviCRM's source code - but any modification requires a fair amount of knowledge.

Assuming you're using the "Current Employer" as the organization name, you're in luck. The current employer's name is stored in the "Organization Name" field on the individual's contact.

You'll need to modify the file in `CRM/Report/Form/Event/ParticipantListing.php`. Check out this session from CiviCon 2012 for a video and slides.

While it's not suitable as a learning resource, the CiviReport Reference is an excellent reference document.
> 1 votes

# Answer
Jon G points to great resources for defining custom reports, and there are many other answers on this SE that should point you correctly in that direction (customizing reports is great once you get the hang of it!).

I wanted to note you can also get at this information with an advanced search without customizing, if you do use "Current Employer", and if a search rather than report would work for your use-case...

In advanced search you can set...

* Events\>Event Name = "The events you want to filter by"
* Relationships\>Relationship type = "Employee of"
* Relationships\>Target Contact = "The Organization you'd like to filter by"

You could set "display as" to "Contacts" (1 result per contact), or "Participants" for each individual participant record (1 result per event registration, potentially many results per contact)
> 0 votes

---
Tags: civireport, custom-reports
---


title: Error on upgrade 4.7.17

text:
# Question
Title: Error on upgrade 4.7.17
> Notice: Undefined variable: alreadyInstalled in /var/www/vhosts/casem-acmse.org/subdomains/test/httpdocs/wp-content/plugins/civicrm/civicrm/install/index.php on line 274

Luckily this was on my sandbox site. I forgot that I was no longer logged in and tried to run:

> http://mysite/wp-admin/admin.php?page=CiviCRM&q=civicrm/upgrade&reset=1

Now it wants to reinstall CiviCRM.

**May I suggest that someone fix this before it happens on a live site.**

**Update 1:** Looks like I forgot to copy back the civicrm.settings.php file. After changing the version in civicrm\_domain back to 4.7.16, I ran it again and it died in 4.17.17.mysql.tpl trying to add the card\_type.

ALTER TABLE `civicrm_financial_trxn` ADD card\_type INT( 10 ) UNSIGNED NULL DEFAULT NULL COMMENT 'FK to accept\_creditcard option group values' AFTER payment\_instrument\_id, ADD pan\_truncation INT UNSIGNED NULL COMMENT 'Last 4 digits of credit card.' AFTER check\_number;

After adding the card+type manually with no errors, Civicrm refuses to continue.

**A copy of civicrm.settings.php could reside in ../uploads/civicrm. Then part one of the upgrade process would be to copy this file and stick in ../uploads/civicrm then copy it back as part one of the install if it exists?**

Either that or dump the information in the wp\_options table in WordPress and either reload them each time or recreate the file as part of the upgrade.

Given that I'm not emotionally attached to this sandbox database I'm going to get another one

# Answer
It's not completely clear the whole history of what happened to the instance, but it appears that you managed to run the upgrade script twice, and it choked the second time because the fields had already been inserted on the first run of the upgrade.
> 2 votes

---
Tags: wordpress, upgrade, 4.7
---


# Question
Title: "DB Error: unknown error" when adding (custom) field
Adding a new field to a set of fields results in an error DB Error: unknown error

In ConfigAndLog (real names are replaced by , and ):

```
Mar 16 05:19:37  [info] $backTrace = #0 /home/<domain>/public_html/sites/all/modules/civicrm/CRM/Core/Error.php(229): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 [internal function](): CRM_Core_Error::handle(Object(DB_Error))
#2 /home/<domain>/public_html/sites/all/modules/civicrm/packages/PEAR.php(921): call_user_func((Array:2), Object(DB_Error))
#3 /home/<domain>/public_html/sites/all/modules/civicrm/packages/DB.php(985): PEAR_Error->__construct("DB Error: unknown error", -1, 16, (Array:2), "CREATE TABLE `<prefix>_drupal7`.log_civicrm_value_<name>_4 (\n  `id` in...")
#4 /home/<domain>/public_html/sites/all/modules/civicrm/packages/PEAR.php(575): DB_Error->__construct(-1, 16, (Array:2), "CREATE TABLE `<prefix>_drupal7`.log_civicrm_value_<name>_4 (\n  `id` in...")
#5 [internal function](): PEAR->_raiseError(Object(DB_mysqli), NULL, -1, NULL, NULL, "CREATE TABLE `<prefix>_drupal7`.log_civicrm_value_<name>_4 (\n  `id` in...", "DB_Error", TRUE)
#6 /home/<domain>/public_html/sites/all/modules/civicrm/packages/PEAR.php(224): call_user_func_array((Array:2), (Array:8))
#7 /home/<domain>/public_html/sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->__call("raiseError", (Array:7))
#8 /home/<domain>/public_html/sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -1, NULL, NULL, "CREATE TABLE `<prefix>_drupal7`.log_civicrm_value_<name>_4 (\n  `id` in...", "DB_Error", TRUE)
#9 /home/<domain>/public_html/sites/all/modules/civicrm/packages/DB/mysqli.php(933): DB_common->raiseError(-1, NULL, NULL, NULL, "1286 ** Unknown storage engine 'ARCHIVE'")
#10 /home/<domain>/public_html/sites/all/modules/civicrm/packages/DB/mysqli.php(403): DB_mysqli->mysqliRaiseError()
#11 /home/<domain>/public_html/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysqli->simpleQuery("CREATE TABLE `<prefix>_drupal7`.log_civicrm_value_<name>_4 (\n  `id` in...")
#12 /home/<domain>/public_html/sites/all/modules/civicrm/packages/DB/DataObject.php(2438): DB_common->query("CREATE TABLE `<prefix>_drupal7`.log_civicrm_value_<name>_4 (\n  `id` in...")
#13 /home/<domain>/public_html/sites/all/modules/civicrm/packages/DB/DataObject.php(1627): DB_DataObject->_query("CREATE TABLE `<prefix>_drupal7`.log_civicrm_value_<name>_4 (\n  `id` in...")
#14 /home/<domain>/public_html/sites/all/modules/civicrm/CRM/Core/DAO.php(354): DB_DataObject->query("CREATE TABLE `<prefix>_drupal7`.log_civicrm_value_<name>_4 (\n  `id` in...")
#15 /home/<domain>/public_html/sites/all/modules/civicrm/CRM/Core/DAO.php(1297): CRM_Core_DAO->query("CREATE TABLE `<prefix>_drupal7`.log_civicrm_value_<name>_4 (\n  `id` in...", FALSE)
#16 /home/<domain>/public_html/sites/all/modules/civicrm/CRM/Logging/Schema.php(718): CRM_Core_DAO::executeQuery("CREATE TABLE `<prefix>_drupal7`.log_civicrm_value_<name>_4 (\n  `id` in...", (Array:0), TRUE, NULL, FALSE, FALSE)
#17 /home/<domain>/public_html/sites/all/modules/civicrm/CRM/Logging/Schema.php(385): CRM_Logging_Schema->createLogTableFor("civicrm_value_<name>_4")
#18 /home/<domain>/public_html/sites/all/modules/civicrm/CRM/Core/BAO/SchemaHandler.php(348): CRM_Logging_Schema->fixSchemaDifferencesFor("civicrm_value_<name>_4", (Array:1), FALSE)
#19 /home/<domain>/public_html/sites/all/modules/civicrm/CRM/Core/BAO/CustomField.php(1842): CRM_Core_BAO_SchemaHandler::alterFieldSQL((Array:6), FALSE, TRUE)
#20 /home/<domain>/public_html/sites/all/modules/civicrm/CRM/Core/BAO/CustomField.php(312): CRM_Core_BAO_CustomField::createField(Object(CRM_Core_DAO_CustomField), "add", FALSE, TRUE)
#21 /home/<domain>/public_html/sites/all/modules/civicrm/CRM/Custom/Form/Field.php(1000): CRM_Core_BAO_CustomField::create((Array:35))
#22 /home/<domain>/public_html/sites/all/modules/civicrm/CRM/Core/Form.php(435): CRM_Custom_Form_Field->postProcess()
#23 /home/<domain>/public_html/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Done.php(75): CRM_Core_Form->mainProcess()
#24 /home/<domain>/public_html/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Done->perform(Object(CRM_Custom_Form_Field), "done")
#25 /home/<domain>/public_html/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Custom_Form_Field), "done")
#26 /home/<domain>/public_html/sites/all/modules/civicrm/CRM/Core/Controller.php(351): HTML_QuickForm_Page->handle("done")
#27 /home/<domain>/public_html/sites/all/modules/civicrm/CRM/Utils/Wrapper.php(113): CRM_Core_Controller->run()
#28 /home/<domain>/public_html/sites/all/modules/civicrm/CRM/Core/Invoke.php(284): CRM_Utils_Wrapper->run("CRM_Custom_Form_Field", "Aangepast veld - Toevoegen", NULL)
#29 /home/<domain>/public_html/sites/all/modules/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:13))
#30 /home/<domain>/public_html/sites/all/modules/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:6))
#31 /home/<domain>/public_html/sites/all/modules/civicrm/drupal/civicrm.module(448): CRM_Core_Invoke::invoke((Array:6))
#32 [internal function](): civicrm_invoke("admin", "custom", "group", "field", "add")
#33 /home/<domain>/public_html/includes/menu.inc(527): call_user_func_array("civicrm_invoke", (Array:5))
#34 /home/<domain>/public_html/index.php(27): menu_execute_active_handler()
#35 {main}

```

I think the error is created in lines 9 and 10 ...

```
#9 /home/<domain>/public_html/sites/all/modules/civicrm/packages/DB/mysqli.php(933): DB_common->raiseError(-1, NULL, NULL, NULL, "1286 ** Unknown storage engine 'ARCHIVE'")
#10 /home/<domain>/public_html/sites/all/modules/civicrm/packages/DB/mysqli.php(403): DB_mysqli->mysqliRaiseError()
#11 /home/<domain>/public_html/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysqli->simpleQuery("CREATE TABLE `<prefix>_drupal7`.log_civicrm_value_<name>_4 (\n  `id` in...")

```

Searching for "1286 \** Unknown storage engine 'ARCHIVE'" i found this entry:

```
http://civicrm.stackexchange.com/questions/15218/civicrm-logging-enabled-i-am-now-getting-an-error-on-mysqldump-unknown-storage

```

Executing

```
ALTER TABLE log_civicrm_install_canary ENGINE=InnoDB

```

results in

```
#1146 - Table '<prefix>_drupal7.log_civicrm_install_canary' doesn't exist

```

In the comment: *"The civicrm\_install\_canary is a table used for installation purposes. The purpose is explained in the answer on What is the installation canary?"*

```
http://civicrm.stackexchange.com/questions/15594/what-is-the-installation-canary

```

But no information in this link how to install/create *civicrm\_install\_canary* if the table is missing.

Is the non existence of this table, the real cause of the *"DB error unknown"*? If so, how to create it?

# Answer
The error occurs when it tries to create the table \_drupal7\`.log\_civicrm\_value\__4. It is trying to create it having storage engine of ARCHIVE. You can't see the whole command from the log. It would be something like

```
create table_name ( column1, column2) Engine=ARCHIVE...

```

So do you have that engine? From mysql do a

```
show engines;

```

You should get something like

```
mysql> SHOW ENGINES;
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
| Engine             | Support | Comment                                                        | Transactions | XA   | Savepoints |
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
| MRG_MYISAM         | YES     | Collection of identical MyISAM tables                          | NO           | NO   | NO         |
| CSV                | YES     | CSV storage engine                                             | NO           | NO   | NO         |
| MyISAM             | DEFAULT | MyISAM storage engine                                          | NO           | NO   | NO         |
| BLACKHOLE          | YES     | /dev/null storage engine (anything you write to it disappears) | NO           | NO   | NO         |
| FEDERATED          | NO      | Federated MySQL storage engine                                 | NULL         | NULL | NULL       |
| PERFORMANCE_SCHEMA | YES     | Performance Schema                                             | NO           | NO   | NO         |
| ARCHIVE            | YES     | Archive storage engine                                         | NO           | NO   | NO         |
| MEMORY             | YES     | Hash based, stored in memory, useful for temporary tables      | NO           | NO   | NO         |
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+

```

I suspect you'll not see an entry for ARCHIVE or it might have a No in the Support column.

Here is some info on enabling it

https://stackoverflow.com/questions/1458122/enabling-archive-engine
> 3 votes

---
Tags: custom-fields, db-logging
---


# Question
Title: How do I examine the symfony event handlers that are active?
The API kernel uses a symfony event system at it's heart.

How on earth do I find out where all those events are going?

# Answer
This maybe not best practice but something like this will list all the events and their handlers:

```
 $kernel = \Civi::service('civi_api_kernel');
 $this->dispatcher = $kernel->getDispatcher();
 $listeners = $this->dispatcher->getListeners();
 foreach ($listeners as $event => $event_listeners) {
   echo "\n\n# $event\n";
   foreach ($event_listeners as $n => $listener) {
     echo "\n## Listener $n";
     $reflection = new \ReflectionClass($listener[0]);
     echo $reflection->getName() . "::" . ($listener[1]);
     echo "\nsource: " . $reflection->getFileName()
       . " lines: " . $reflection->getStartLine()
       . "-" . $reflection->getEndLine();
     // echo "\n Methods:" . json_encode(get_class_methods($listener[0]),JSON_PRETTY_PRINT);
   }
 }

```
> 1 votes

---
Tags: php, symfony
---


# Question
Title: Can Quick Search be set up so External ID does not have to be exact match to work?
Tested on dmaster.

Give Contact external ID eg fz123456

then set QuickSearch for External ID and enter

* fz123 - no result
* fz1234 - no result
* fz12345 - no result
* fz123456 - yay

Ah, see this applies to Internal ID too, namely

* 2 - Muller
* 20 - ah.olsen@
* 202 - demo@
* 2% - Muller

Can you reset QuickSearch so these match with wildcards?

# Answer
> 1 votes
I originally wrote it that way to avoid confusion. If you want to pull up contact id `20` you'll be overwhelmed with irrelevant results (201, 202, 203, 120, 220, 320, and so on). You'll get so many results that the one you actually wanted might not even be in the list!

That said, if someone had time and/or money for the project, I'm sure there could be something smart added to the query that made the exact match show up first in the list followed by partial matches.

---
Tags: quicksearch, external-id
---


# Question
Title: Translating salutations like "Mr." to Dutch
We are using civi 4.7.16 on Joomla with a Dutch translation; not all terms are translated.

Our problem is that we cannot change the beginning of a message: "Mr." to the dutch version "Beste {contact.first\_name}" of some of our contacts. Civi says: "sorry, we can not do that..." connection refused.

# Answer
> 1 votes
1st problem solved by typing 1957 contacts, pffff... 2nd connection problem solved by disabling geocoding

---
Tags: contacts, translation
---


title: avoiding tracking of some links

text:
# Question
Title: avoiding tracking of some links
The doc's give this example: "you may wish to avoid tracking who has clicked on the "how to deal with drug issues" link on a specific mailing".

Is there a way of specifying which link(s) are not to be tracked? If so, how?

# Answer
> 1 votes
This is only a per mailing basis: you can track all the emails in one link or none.

However, a workaround might be to add a token as a parameter you do not want to be tracked. eg:

```
<a href="https://how2deal.drug/issue#{contact.hash}">Not tracked link</a>

```

So here we put the contact hash, that is not going to mean anything and is not a private information, and you put it after the #, so the browser will not send it to the webserver and won't be in the server log. And because civimail does not track links with token, you should be good.

Let me know if it works for you.

X+

---
Tags: civimail, tokens
---


# Question
Title: Unable to Connect to MailStore for Bounce Processing
Tested on Wordpress 4.7.3 and Joomla

CiviCRM 4.7.16

We've set up a domain for all Civi-related mail processing for our CiviCRM clients for whom we provide site management. For one account we are unable to get the bounce processing job to connect to the mail account. We have no issues using the mail account to send and receive from both webmail and setup in a mail client. All ports are open and functioning. We've tried both IMAP, POP and SSL, TLS. Fails every single time.

Any ideas?

Here is the entry from the ConfigandLog directory:

```
Mar 16 17:14:22  [info] $Fatal Error Details = Array (
  [message] => Could not connect to MailStore for lemoyne_bounces@mailprocessing.org
    Error message:
    An error occured while sending or receiving mail.
    Failed to connect to the server: mailprocessing.org:143.
  [code] =>
)

Mar 16 17:14:22  [info] $backTrace = #0
/home3/pnmiinfo/public_html/lemoyne/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(331):
CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /home3/pnmiinfo/public_html/lemoyne/wp-content/plugins/civicrm/civicrm/CRM/Utils/Mail/EmailProcessor.php(177):
CRM_Core_Error::fatal("Could not connect to MailStore for
lemoyne_bounces@mailprocessing.org<p>Error...")
#2 /home3/pnmiinfo/public_html/lemoyne/wp-content/plugins/civicrm/civicrm/CRM/Utils/Mail/EmailProcessor.php(58):
CRM_Utils_Mail_EmailProcessor::_process(TRUE,
Object(CRM_Core_DAO_MailSettings))
#3 /home3/pnmiinfo/public_html/lemoyne/wp-content/plugins/civicrm/civicrm/api/v3/Job.php(361):
CRM_Utils_Mail_EmailProcessor::processBounces()
#4 /home3/pnmiinfo/public_html/lemoyne/wp-content/plugins/civicrm/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89):
civicrm_api3_job_fetch_bounces((Array:1))
#5 /home3/pnmiinfo/public_html/lemoyne/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(169):
Civi\API\Provider\MagicFunctionProvider->invoke((Array:9))
#6 /home3/pnmiinfo/public_html/lemoyne/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(100):
Civi\API\Kernel->runRequest((Array:7))
#7 /home3/pnmiinfo/public_html/lemoyne/wp-content/plugins/civicrm/civicrm/api/api.php(23):
Civi\API\Kernel->runSafe("Job", "fetch_bounces", (Array:1), NULL)
#8 /home3/pnmiinfo/public_html/lemoyne/wp-content/plugins/civicrm/civicrm/CRM/Core/JobManager.php(134):
civicrm_api("Job", "fetch_bounces", (Array:1))
#9 /home3/pnmiinfo/public_html/lemoyne/wp-content/plugins/civicrm/civicrm/CRM/Core/JobManager.php(113):
CRM_Core_JobManager->executeJob(Object(CRM_Core_ScheduledJob))
#10 /home3/pnmiinfo/public_html/lemoyne/wp-content/plugins/civicrm/civicrm/CRM/Admin/Page/Job.php(149):
CRM_Core_JobManager->executeJobById("3")
#11 /home3/pnmiinfo/public_html/lemoyne/wp-content/plugins/civicrm/civicrm/CRM/Core/Page/Basic.php(172):
CRM_Admin_Page_Job->browse(NULL, NULL)
#12 /home3/pnmiinfo/public_html/lemoyne/wp-content/plugins/civicrm/civicrm/CRM/Admin/Page/Job.php(136):
CRM_Core_Page_Basic->run()
#13 /home3/pnmiinfo/public_html/lemoyne/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(310):
CRM_Admin_Page_Job->run((Array:3), NULL)
#14 /home3/pnmiinfo/public_html/lemoyne/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(84):
CRM_Core_Invoke::runItem((Array:13))
#15 /home3/pnmiinfo/public_html/lemoyne/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(52):
CRM_Core_Invoke::_invoke((Array:3))
#16 /home3/pnmiinfo/public_html/lemoyne/wp-content/plugins/civicrm/civicrm.php(1227):
CRM_Core_Invoke::invoke((Array:3))
#17 [internal function](): CiviCRM_For_WordPress->invoke("")
#18 /home3/pnmiinfo/public_html/lemoyne/wp-includes/class-wp-hook.php(298):
call_user_func_array((Array:2), (Array:1))
#19 /home3/pnmiinfo/public_html/lemoyne/wp-includes/class-wp-hook.php(323):
WP_Hook->apply_filters("", (Array:1))
#20 /home3/pnmiinfo/public_html/lemoyne/wp-includes/plugin.php(453): WP_Hook->do_action((Array:1))
#21 /home3/pnmiinfo/public_html/lemoyne/wp-admin/admin.php(222): do_action("toplevel_page_CiviCRM")
#22 {main}

```

# Answer
A common issue is to have missing php extensions, are you sure your php has imap extension enabled?

(the command to install it depends on what OS or distrib you use).
> 0 votes

---
Tags: civimail, cron-job
---


title: Access for Blind Users to CiviCRM

text:
# Question
Title: Access for Blind Users to CiviCRM
Can you please tell me if CiviCRM is accessible by the blind using a screen reader ie; Jaws, Window Eyes or NVDA? If so were customizations required?

# Answer
I am the Director of Organizational Technology for the National Federation of the Blind (the largest and oldest consumer organization of blind people in the US). We have used CiviCRM for a few years to collect data from our website. Since October 2015 it has become our primary member, donor, subscription, and event management database.

The majority of our users (blind or sighted) access CiviCRM through a “portal” we had custom developed. Mainly, this is because we are working to provide access to our affiliates and chapters around the country and needed a way to containerize their access, but it did also provide a more accessible front end. However, myself and a couple other users do use the Civi backend with screen readers.

From the perspective of using Civi from the backend, I would say that an experienced screen reader user can learn the tricks required to use Civi. I’m a blind user and while I have encountered issues with the interface, I have successfully navigated most of them. In general, the following summarizes my experience with CiviCRM 4.6.5 and JAWS:

1. The menu bar is keyboard accessible, but awkwardly. Generally I find it best to focus on the first item then TAB (as opposed to arrowing) to the top level menu the user wants to interact with before pressing ENTER to activate the pop-up menu. You will then have to locate the HTML list element containing the menu choices. Often this element appears after the menu bar, or at the bottom of the virtual document (sometimes depending on the CMS theme, sometimes depending on, seemingly, the browser’s mood). In either case, it will not appear immediately “under” the activated menu.
2. The global contact search field has an autocomplete. While it does actually work with the keyboard, the information the screen reader reads when arrowing through the choices is the contact ID, not the name and other information that is visible on screen.
3. Accordion panels in the contact record cannot be expanded with the keyboard. In general, panels containing certain contact data (demographic information, address, etc.) are collapsed by default. It is necessary to use the mouse (JAWS) cursor in order to expand these panels.
4. Civi makes use of the Select2 library in a number of places to generate certain pop-up lists. Basically, the library creates an edit-combo box (one where you have both a pre-defined list of options, but can also type in to narrow this list). While these elements are keyboard accessible, there are occasionally focus issues. As an example, choosing a date range filter on searches offers selections like, “previous year,” but also allows the user to choose a date range. When selecting the choose a date range option edit fields appear next to the dropdown allowing the user to enter a start and end date range. However, for a screen reader user, pressing TAB after selecting this option will focus on the next group of fields, bypassing the date range fields. Although they don’t use Select2, this behavior is also observed with combo boxes that dynamically populate other combo boxes (like on the import data screens).
5. I think there are a couple places where fields lack proper labels, but I would need to hunt up specific examples.

I believe most of these issues also persist in 4.7, though we haven't upgraded our production install yet.

I do have web accessibility and development experience and ideas for fixing the issues I've identified. I'm happy to get more involved in CiviCRM development and work with anyone interested in broadening accessibility. We've been pretty focused on getting our install up and our two Civi databases merged, but I should now have more time to start contributing on the accessibility front.

In the interim I'm happy to discuss how I get around the present issues with anyone who needs that advice.

Rachel
> 10 votes

# Answer
CiviCRM is presented in the context of a CMS theme (Drupal, WordPress or Joomla) so it has to be assessed in that context. For that reason, there's no "yes/no" answer here, even having seen a11y reviews of sites we've built.

More importantly, assessing a11y requirements requires considering the context of the users - some CiviCRM installations may need only public (eg member / donor) facing frontpages to pass accessibility requirements, while others may need to consider needs of those using the CiviCRM backend as well. CiviCRM is a large project and there's a lot of interface to consider, and organisations use it differently (some have a single back-end user, some have many with varying levels of access to the system).

Currently, my answer would be that front-end forms can be configured to pass accessibility reviews for vision-impaired users, but I am not aware of any assessments of CiviCRM's backend interface. That's not a *no* \- it's a "don't know".
> 3 votes

# Answer
(Merging in info from an earlier question: CiviCRM and screen reader software)

A client of mine tried unsuccessfully to use JAWS on the back-end and is just about to undertake some JAWS scripting. I'm encouraging them to consider sponsoring some development of the core product to address this.

The topic has been raised a few times over the years, but does not seem to have a good answer yet. For example:
> 1 votes

---
Tags: accessibility
---


# Question
Title: How does the Sympa integration deal with unsubscribes
We're looking at the various listserv options, e.g. mailman, sympa, mailchimp that have some sort of integration to civi.

So if someone receives an email via Sympa integrated to civi and wants to unsubscribe, how is it handled? What is the process?

# Answer
> 2 votes
CiviCRM-Sympa Syncronization includes unsubscription pages (it was introduced with this commit). On « sympasync » configuration page (`https://example.org/civicrm/a/#/sympa/admin`), you’ll find the URL that can be added to your list’s footer. URL will look like `https://example.org/civicrm/sympa/unsubscribe?gid=1`.

Problem is that you can’t override the default unsubscription mechanism in Sympa, so you’ll need to disable the ability for users to unsubscribe in your list configuration (to force them to use sympasync’s link). If you let Sympa’s default mechanism, people will be able to unsubscribe (and it will be effective), but information won’t be pushed back to CiviCRM.

So by adding the unsubscription link at the end of each mail sent on your Sympa mailing list and by disabling the ability to unsubscribe in your list configuration, you’ll get what you want.

# Answer
> 1 votes
Which sympa extension do you want to use? The way the unsubscribe is handled is pretty much how the extension you looked at implemented it (and if you plan to use one I wrote a long time ago, it isn't handled ;(

---
Tags: email
---


# Question
Title: Upgrading CiviCRM from 4.6.25 to 4.7.15 fails on database upgrade
I am running a CiviCRM upgrade on Joomla from 4.6.25 to 4.7.15. The environment is:

Joomla : 3.6.5 PHP : 5.5.9 Database 5.5.52 Apache 2.4.7

PHP Memory 512M Execution timeout 240

Installing the upgraded component works fine. I clear out the templates\_c cache. I then run the database upgrade script and get the following error:

\[Error: Upgrade DB to 4.7.alpha1: SQL\]

Error Field Error Value Type DB\_Error

Code -1 Message DB Error: unknown error

Mode 16

UserInfo ALTER TABLE `civicrm_action_schedule` ADD COLUMN `filter_contact_language` varchar(128) DEFAULT NULL COMMENT 'Used for multilingual installation' \[nativecode=1060 \** Duplicate column name 'filter\_contact\_language'\] DebugInfo ALTER TABLE `civicrm_action_schedule` ADD COLUMN `filter_contact_language` varchar(128) DEFAULT NULL COMMENT 'Used for multilingual installation' \[nativecode=1060 \** Duplicate column name 'filter\_contact\_language'\]

PEAR\_Exception: DB Error: unknown error in unknown on line unknown

* DB\_Error: DB Error: unknown error in unknown on line unknown

Exception trace

# Function Location

0 CRM\_Core\_Error::exceptionHandler(Object(DB\_Error)) unknown:unknown 1 call\_user\_func(Array, Object(DB\_Error)) /var/www/joomla/administrator/components/com\_civicrm/civicrm/packages/PEAR.php:921 2 PEAR\_Error-\>\__construct('DB Error: unknow…', -1, 16, Array, 'ALTER TABLE `civ…') /var/www/joomla/administrator/components/com_civicrm/civicrm/packages/DB.php:985
3 DB_Error->__construct(-1, 16, Array, 'ALTER TABLE`civ…') /var/www/joomla/administrator/components/com\_civicrm/civicrm/packages/PEAR.php:575 4 PEAR-\>\_raiseError(Object(DB\_mysqli), null, -1, null, null, 'ALTER TABLE `civ…', 'DB_Error', true) unknown:unknown
5 call_user_func_array(Array, Array) /var/www/joomla/administrator/components/com_civicrm/civicrm/packages/PEAR.php:224
6 PEAR->__call('raiseError', Array) /var/www/joomla/administrator/components/com_civicrm/civicrm/packages/DB/common.php:1905
7 PEAR->raiseError(null, -1, null, null, 'ALTER TABLE`civ…', 'DB\_Error', true) /var/www/joomla/administrator/components/com\_civicrm/civicrm/packages/DB/common.php:1905 8 DB\_common-\>raiseError(-1, null, null, null, '1060 \** Duplicat…') /var/www/joomla/administrator/components/com\_civicrm/civicrm/packages/DB/mysqli.php:933 9 DB\_mysqli-\>mysqliRaiseError() /var/www/joomla/administrator/components/com\_civicrm/civicrm/packages/DB/mysqli.php:403 10 DB\_mysqli-\>simpleQuery('ALTER TABLE `civ…') /var/www/joomla/administrator/components/com_civicrm/civicrm/packages/DB/common.php:1216
11 DB_common->query('ALTER TABLE`civ…') /var/www/joomla/administrator/components/com\_civicrm/civicrm/CRM/Utils/File.php:353 12 CRM\_Utils\_File::sourceSQLFile('mysql://joomcivi…', '-- Add new colum…', null, true) /var/www/joomla/administrator/components/com\_civicrm/civicrm/CRM/Upgrade/Form.php:196 13 CRM\_Upgrade\_Form-\>source('-- Add new colum…', true) /var/www/joomla/administrator/components/com\_civicrm/civicrm/CRM/Upgrade/Form.php:387 14 CRM\_Upgrade\_Form-\>processLocales('/var/www/joomla/…', '4.7.alpha1') /var/www/joomla/administrator/components/com\_civicrm/civicrm/CRM/Upgrade/Form.php:421 15 CRM\_Upgrade\_Form-\>processSQL('4.7.alpha1') /var/www/joomla/administrator/components/com\_civicrm/civicrm/CRM/Upgrade/Incremental/Base.php:80 16 CRM\_Upgrade\_Incremental\_Base::runSql(Object(CRM\_Queue\_TaskContext), '4.7.alpha1') unknown:unknown 17 call\_user\_func\_array(Array, Array) /var/www/joomla/administrator/components/com\_civicrm/civicrm/CRM/Queue/Task.php:88 18 CRM\_Queue\_Task-\>run(Object(CRM\_Queue\_TaskContext)) /var/www/joomla/administrator/components/com\_civicrm/civicrm/CRM/Queue/Runner.php:214 19 CRM\_Queue\_Runner-\>runNext(true) /var/www/joomla/administrator/components/com\_civicrm/civicrm/CRM/Queue/Page/AJAX.php:52 20 CRM\_Queue\_Page\_AJAX::{closure}() /var/www/joomla/administrator/components/com\_civicrm/civicrm/CRM/Queue/ErrorPolicy.php:106 21 CRM\_Queue\_ErrorPolicy-\>call(Object(Closure)) /var/www/joomla/administrator/components/com\_civicrm/civicrm/CRM/Queue/Page/AJAX.php:54 22 CRM\_Queue\_Page\_AJAX::runNext() unknown:unknown 23 call\_user\_func(Array) /var/www/joomla/administrator/components/com\_civicrm/civicrm/CRM/Core/Invoke.php:276 24 CRM\_Core\_Invoke::runItem(Array) /var/www/joomla/administrator/components/com\_civicrm/civicrm/CRM/Core/Invoke.php:84 25 CRM\_Core\_Invoke::\_invoke(Array) /var/www/joomla/administrator/components/com\_civicrm/civicrm/CRM/Core/Invoke.php:52 26 CRM\_Core\_Invoke::invoke(Array) /var/www/joomla/administrator/components/com\_civicrm/civicrm.php:121 27 civicrm\_invoke() /var/www/joomla/administrator/components/com\_civicrm/civicrm.php:40 28 require\_once('/var/www/joomla/…') /var/www/joomla/libraries/cms/component/helper.php:405 29 JComponentHelper::executeComponent('/var/www/joomla/…') /var/www/joomla/libraries/cms/component/helper.php:380 30 JComponentHelper::renderComponent('com\_civicrm') /var/www/joomla/libraries/cms/application/administrator.php:98 31 JApplicationAdministrator-\>dispatch() /var/www/joomla/libraries/cms/application/administrator.php:152 32 JApplicationAdministrator-\>doExecute() /var/www/joomla/libraries/cms/application/cms.php:261 33 JApplicationCms-\>execute() /var/www/joomla/administrator/index.php:51 34 {main}

Does anyone have an ideas how to resolve this ? I notice the multilingual errors. This has been installed on the server.

Regards

Damian

# Answer
Go to the **\civicrm\civicrm\CRM\Upgrade\4.7.alpha1.msg\_template** directory

In **civicrm\_msg\_template.tpl** find the SQL statement that failed and that will indicate the problem.

I had a similar situation where I was forced to upgrade from 4.4 to 4.7.7. I was forced to make corrections and continue the upgrade by commenting out code. Not a process I recommend, but I had no choice. Not recommended for an amateur coder.
> 1 votes

---
Tags: upgrade, database
---


title: Pass message template id through URL?

text:
# Question
Title: Pass message template id through URL?
We have a unique situation where we've built a Drupal View of CiviCRM contacts and want to provide a link to send an email through CiviCRM.

This can easily be done by using: www.mysite.org.uk/civicrm/activity/email/add?action=add&reset=1&cid=\[id\]&selectedChild=activity&atype=3

which will open a CiviCRM email activity with the person. So far, so good.

However, we also want to force a specific template to be used at that point. To prevent errors in selection. Is that possible to include in the URL?

# Answer
> 1 votes
Does it have to be through CiviCRM? It sounds like you just want a customizable contact form, which can be done on the drupal side - have you looked at potential drupal modules?

If the reason for CiviCRM is that you want a copy stored in their activity list, you could set up the module to bcc to an email address, and configure the civi email processor to retrieve them.

Or if you're up for customizing then a similar suggestion to Jaap's would be customizing the email template to make the same javascript call that the dropdown does, but do it on page load if the url contains your parameter. Depends if you feel more comfortable with front-end or back-end type of customization.

# Answer
> 1 votes
Sounds like you could achieve what you want by using Views to click through to a prefilled webform, with some Conditionals so you could set the 'body' of the email based on various 'templates' (aka markup fields in webform), then provided you include the contact.id and checksum options from the civicrm tab on the webform you can fire out a checksum just as you would with civicrm.

---
Tags: email, message-templates
---


# Question
Title: Limit contact access to the user's group
I'm planning a very structured situation where each volunteer must manage only some contacts without seeing others.

My question: is it possible, for each user, to limit access (view) to only contact belonging to its group?

# Answer
> 3 votes
For some scenarios it is better to provide the ACL by using Relationships to 'join the dots', rather than using Groups, and this allows you to then create multi-level ACLs.

If someone (X) has Permissioned Relationship to Org 1 and Org 1 has permission to Org 1.1, and person Y has permission to Org 1.1 and if Org 1.1 has permissioned relationship to Z, then X will see Y and Z Y will see Z Oh, and you don't need to add any ACLs at all, this is taken care of via this Fuzion Extension

May not be quite what you need but may be useful to others who read your ticket and who could switch to having Relationships at the heart of the ACL requirements.

# Answer
> 2 votes
This types of structured permissions are managed by ACL and the following link seems to be relevant to you ur question as well: Using ACLs to manage access to contacts

Hope this helps!

---
Tags: contacts, groups
---


# Question
Title: What's the best way to fix this Drush clear cache bug?
https://issues.civicrm.org/jira/browse/CRM-20292

Hi gang,

I'd love to fix the above bug for the core. Does anyone know the best way to solve it, or where I should begin to look for anything that may cause it?

1. Create a Drupal View using custom data from CiviCRM contacts.
2. Save
3. Run drush cc all on the command line
4. Reload the admin page for the View
5. Observe that the custom fields have gone missing, and are not available in the field list.
6. Click save on the View.
7. Observe that the custom fields are now present in the list.

This is observed in an instance where Civi and Drupal share a DB on 4.7.17.

**Update 1** The bug appears to be that after drush clear CRM\_Core\_BAO\_Cache::getItem('contact fields', $cacheKeyString); isn't returning custom fields in exportableFields sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php. It does upon clicking "save" in the view, however.

Does anyone know where these are populated from, or have any guidance about where to go from here?

John

# Answer
> 1 votes
I'm going to add an answer (don't want to bury this in the comments) that for a 4.7.17 - with two separate databases - drupal and civicrm; this is NOT an issue;

My view with custom data before and after and in-between:

```
[karin@louise bin]$ sudo -u apache drush civicrm-upgrade-db
Starting with v4.7.16 -> v4.7.17 upgrade ..

```

Specifically trying to just drush cc all:

```
[karin@louise bin]$ sudo -u apache drush cc all

```

is fine - the way they were on 4.7.16 - with CiviCRM Custom field listed under Fields

---
Tags: drupal-views, drush
---


# Question
Title: Importing contributions always imports $0 in Amount
I am having a really weird problem importing Contributions.

**Background**: I am exporting data from my Drupal-Civicrm site and importing it into our new Wordpress-civicrm site. I do not want to go thru the database route because I bumped into too many issues and the civicrm became very unstable. Hence I have created wordpress-civicrm instance from scratch and I am importing data from the GUI. So far contacts and memberships have been imported successfully.

**Problem**: Now that I am importing the contributions, no matter how I setup the import the Amount is imported as $0 (even though I can clearly see in the import wizard that it is a non-zero amount). I even tried to map the Net Amount field and the Fee Amount field correctly. Yet the Total amount is always getting imported as $0. What am I missing here?

# Answer
> 3 votes
Check how you are importing your data. It is often worth doing an export to see how they data is held as this often provides a clue as to how the data needs to be structured to import.

For example you may be importing as 5 when it expects $5 or vice versa.

Also be aware that there is a very helpful extension that extends what was possible with GUI imports. github.com/eileenmcnaughton/nz.co.fuzion.csvimport

---
Tags: import, contributions
---


title: ACL with nested groups

text:
# Question
Title: ACL with nested groups
I need to config a 2 layers group structure

* GROUP 1
* -- GROUP 1.1
* -- GROUP 1.2
* GROUP 2
* -- GROUP 2.1
* -- GROUP 2.2

Enabling a user to manage GROUP 1 contacts, this user will be able also to manage the subgroups contacts (GROUP 1.1 and GROUP 1.2)?

Thank's

# Answer
This may not fit your scenario, but for others we have been able to provide this by using Relationships to 'join the dots'

* If someone (X) has Permissioned Relationship to Org 1
* and Org 1 has permission to Org 1.1,
* and person Y has permission to Org 1.1
* and if Org 1.1 has permissioned relationship to Z, then
* X will see Y and Z
* Y will see Z

Oh, and you don't need to add any ACLs at all, this is taken care of via this Fuzion Extension

May not be quite what you need but may be useful to others who read your ticket and who could switch to having Relationships at the heart of the ACL requirements.
> 2 votes

# Answer
You automatically have access to members of all child groups when you have access to the parent group: https://docs.civicrm.org/user/en/stable/organising-your-data/groups-and-tags/#visibility

However, you need additional ACL permissions for each child group if you want to see and modify their child group status.
> 0 votes

---
Tags: acl
---


# Question
Title: Webforms vs Contribution pages - workflow
On a clients site, we are using several contribution pages, and some of them are duplicated in webforms. I have a hard time deciding when to use what. I prefer the webforms, but I always end up configuring everything twice. What is the *intended* workflow ?

For a contribution, a contribution page is needed. But for a dozen similar contributions, I can use webforms pointing to the same contribution page, and configure the payment amounts there. However, since I can't 'hide' the civicrm page from the web, I do need to configure the amounts there, too. I always end up puzzling on how to sync these amounts from the contribution page to the webpage (pricesets - matrix - confusion).

On contribution pages, I can include 'profiles' to get additional information. On the webforms, I can just include the wanted fields from the contacts. since I can't 'hide' the civicrm page from the web, I would have to do both.

# Answer
> 1 votes
Install the redirect module and make the contribution page URL redirect to the webform.

# Answer
> 1 votes
If your main issue is hiding the CiviCRM contibution page you could adapt the Drupal permissions (e.g. "make online contributions") in a way that visitors are not allowed to see or use them.

# Answer
> 0 votes
Just reading this

https://wiki.civicrm.org/confluence/display/CRMDOC/Webform+CiviCRM+Integration#WebformCiviCRMIntegration-Acceptingpaymentsthroughawebform

> When creating a contribution, event or membership webform that includes payments, first set up a dedicated contribution page for the sole purpose of embedding it on one or more webforms. Most of the contribution page settings will be ignored by the webform. Only the following need to be configured:
>
> * Title: This will be displayed on the webform
> * Financial type
> * Currency
> * Payment processor
> * Email receipt - if enabled, these will be sent from the webform just as they would be from the real contribution page

So that seems to suggest to create a few generic contribution pages (membership,event registration,purchase), ignore the payments amounts, 'disable access' for those (using the suggestions from other answers here), and go wild on the webforms.

---
Tags: civicontribute, webform-civicrm, workflow
---


# Question
Title: Is there a civi way to manage API compatibility across CiviCRM versions?
Working on an extension that is aiming to be compatible with 4.6 and 4.7. The complete PCP api is only available as of 4.7 as far as I can tell.

So for 4.6 users, the extension can include the PCP api but "bypassed" for 4.7 users?

Because the api implementation in the extension is in api/*/*. So how can 4.7 ignore this?

# Answer
> 2 votes
When you call an API, Civi does a search to locate it. That typically means searching the PHP `include_path` for a file named `api/v3/{$entity}/{$action}.php` or `api/v3/{$entity}.php`. The `include_path` is typically managed via `hook_civicrm_config`.

It sounds like want to change `hook_civicrm_config` so that the effect is:

* Add `/path/to/org.example.myext/` to the `include_path` unconditionally. This contains all you're normal/common files.
* Add `/path/to/org.example.myext/backports` to the `include_path` if it's an old version (4.6). This contains only the backports/polyfills for older versions.

In most `civix`-based extensions, it does the first automatically with this snippet:

```
function {myext}_civicrm_config(&$config) {
  _{myext}_civix_civicrm_config($config);
}

```

The `_{myext}_civix_civicrm_config()` is a baseline/default implementation that unconditionally adds `/path/to/org.example.myext/` to the `include_path`. Take a look at the code in `_{myext}_civix_civicrm_config($config)` to see how it works.

Then you can write a similar function to add `/path/to/org.example.myext/backports`. Finally, call it:

```
function {myext}_civicrm_config(&$config) {
  _{myext}_civix_civicrm_config($config)
  if (version_compare(CRM_Utils_System::version(), '4.7', '<')) {
    _{myext}_config_backports($config);
  }
}

function _{myext}_config_backports(&$config) {
  ...
}

```

# Answer
> 0 votes
You can use the civicrm setting API to check which version you are working with?

```
$version = civicrm_api3('Domain', 'getvalue', array('return' => "version"));

```

---
Tags: extension
---


# Question
Title: Online Registration not able to be enabled
## Installation Details

* WordPress 4.7.3
* CiviCRM 4.7.17
* CiviVolunteer 4.6-2.2.1
* Angular Profiles 4.6-1.0.2
* SparkPost 1.1 (verified working)

## Problem Description

I have a CiviEvent set up. I check the box to Allow Online Registration, and after filling everything in, it won't allow me to save the changes. It tells me that I need to select a profile, but the section under "Include Profile (top of page)" there is no form field, no popup, nothing. I tried turning off CiviVolunteer to see if that was conflicting, but no dice. I **do** have profiles created, but none are showing. (Again, no text field, no popup, etc.)

EDIT: Added Screenshot

# Answer
@petednz-fuzion pointed me in the right direction with this link:

cannot select profile for online event registration after upgrading civi on Joomla

So it turns out it was the theme after all. I am using Ambition from ThemeHorse and when I tried switching the theme to see if it was a theme problem, I should've picked a default theme to test; I did not.

The offending chunk of code was somewhere in here, in functions.php:

```
function ambition_load_files()

```

I basically took the same approach in the link from @petednz-fuzion to prevent loading the functions.php file. The problem is that if the theme's functions.php isn't loaded on front-end pages where CiviCRM data is displayed (like on an event page) then the page doesn't load. So I prevented the functions.php file from loading only on backend pages like this:

```
function ambition_load_files()
{

    /**
     * ambition_add_files hook
     *
     * Adding other addtional files if needed.
     */
    do_action('ambition_add_files');

    /** Load functions */
    require_once (AMBITION_FUNCTIONS_DIR . '/i18n.php');
    require_once (AMBITION_FUNCTIONS_DIR . '/custom-header.php');
    require_once (AMBITION_FUNCTIONS_DIR . '/featured-content.php');
    require_once (AMBITION_ADMIN_DIR . '/ambition-metaboxes.php');
    require_once (AMBITION_FUNCTIONS_DIR . '/custom-style.php');
    require_once (AMBITION_FUNCTIONS_DIR . '/customizer.php');

    /** Load Footer Info */
    require_once (AMBITION_SHORTCODES_DIR . '/ambition-footer-info.php');

    /** Load Structure */
    require_once (AMBITION_STRUCTURE_DIR . '/header-extensions.php');
    require_once (AMBITION_STRUCTURE_DIR . '/footer-extensions.php');
    require_once (AMBITION_STRUCTURE_DIR . '/content-extensions.php');

    /** Load Widgets and Widgetized Area */
    require_once (AMBITION_WIDGETS_DIR . '/ambition-widgets.php');

    // ==========================================================================
    // We don't load functions.php if we're in the backend or else CiviCRM breaks
    $full_url = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
    $uri = (parse_url($full_url, PHP_URL_PATH));
    if($uri == '/wp-admin/admin.php') {
        ; // don't include
    } else {
        require_once (AMBITION_FUNCTIONS_DIR . '/functions.php');
    }
    // ==========================================================================

}

```

Now it's working like a charm.

Thanks everyone for your help!
> 0 votes

---
Tags: civievent, registration
---


# Question
Title: How can I search in CIviCRM for people who have got a "Full" membership less than 5 months after their "Student" membership expired?
We are looking at membership progression. So we want to find out who has a current "Full" membership who started their full membership less than 5 months after their "Student" membership expired. Anyone know how I could create a search in CiviCRM that would provide this information? Our CiviCRM is also connected to Drupal so happy to build this in Drupal views is that easier.

# Answer
How we did this in the end was to create some custom code that when a new membership was added it would check if there was a membership of the previous membership type. ie if they were purchasing a Full membership if they had a current or expired Student membership.

If there was then it would calculate the number of days between the end date of the previous membership and the start date of the new membership and store this value in a custom field. We also added a feature that if the previous membership had not yet expired we would end it because in our case you were not allow to hold more than one membership at a time.

We can now run all the searches and views we like off this value.
> 1 votes

# Answer
Best option to my knowledge would be

Go to Advance search – select all the membership which has already expired “Student” and add these contact to a group

Now in the same advance serach - select the new group and look for “Full membership” – which should give you list of contact

Even you can use date range for membership selection

I guess this helps!!!
> 0 votes

---
Tags: civimember, search
---


title: Writing ( and publishing ) Batch Job

text:
# Question
Title: Writing ( and publishing ) Batch Job
I expect this is a common problem,

Treasurer get loads on contributions in CSV format ( Contact ID / Amount / Date )

Bulk loading contributions via CSV is completely detached from membership renewal.

As memberships are set to go 'grace' on expiry I think a script like

Search membership in grace If contribution made and receipt date \> membership expiry date set membership status to current , set expiry to end next period, link contribution to membership

I don't think this is too challenging in SQL ( I haven't looked at API ing it )

So now the question, there are batch jobs - how are they created / structured ?

# Answer
I have rewritten the code found in this thread https://forum.civicrm.org/index.php?topic=19322.0 'Collins22' chicago-orienteering.org/civicrm\_code.htm

to suit my specific purposes. It isn't a civicrm extension nor uses API so far from architecturally pure, but it can be run as a php cron job so does the what is needed.

I have published the code on github https://github.com/alanef/civicrm-contribs-to-membership maybe it is of use to others - maybe some one wants to contribute and write it properly.
> 1 votes

---
Tags: civimember, contributions
---


# Question
Title: Search for contacts within Geocoded regions/borders
My organisation needs to search for contacts within the regions/borders of England, Scotland, and Wales. This is important as our communications relate to elected representatives within devolved parliaments etc.

As all contacts in the UK have country 'United Kingdom' this is not easy.

Postcodes in the UK do not correspond to the borders between England/Scotland and England/Wales, and overlap significantly in some areas.

Postcode Areas and Postcode Districts (the 'SW' and '1W' in the post code 'SW1W 0NY') also do not correspond with the country borders, so it also isn’t possible to search on these (even using ‘Range’ or ‘Regex’).

**Would it be possible to geocode the entire areas of England, Scotland, or Wales around known coordinates, and create smart groups based on these?**

These three groups alone would be incredibly helpful, but it would be even better were it possible to import coordinates from Google Maps / OpenStreetMap searches (e.g. https://www.google.co.uk/maps/place/Scotland/@56.367676,-4.9607288,8z/data=!4m5!3m4!1s0x4861e2c403f2a19f:0xe7c1fad809c30714!8m2!3d56.4906712!4d-4.2026458), that way other regions could also be quickly turned into Smart groups.

At present we are searching by postcode and excluding contacts using poorly defined 'radius' searches - so finding a better solution would make a huge difference to our work, and I'm sure to many organisation working in the UK.

# Answer
We had a similar need and used mapit: https://mapit.mysociety.org/. Every time an address is created/updated we use the mapit API to grab the associated parliamentary constituency, European region etc. It looks like the mapit API can give you England/Wales/Scotland/NI too (though it's trivial to translate from the European Region).

We did similar to @ErichBSchulz and created a custom field that is populated by this API lookup. We then have smart groups running off that.

Happy to share our somewhat hacky extension if it'd help, though you'd need to adapt it to your needs. Caveats are: it only works if you have the full postcode; currently we don't have a way to run it for imports; you'll need to populate your existing database somehow (we have a million-row excel spreadsheet we got from one of the government's open data things).

At one point Veda Consulting were working on a service that did something similar - possibly building on top of their postcode lookup service. Might be worth pinging them in case they have something more robust.

EDIT: published this extension at https://github.com/bhahumanists/bha.politicaldata
> 4 votes

# Answer
This is an oversimplification certainly but with either PostgreSQL or MySQL/MariaDB with their Spatial Extensions installed, you can perform basic geometry operations within your database quite easily. The key operation here is ST\_Intersection(). You can pass the operator a set of points and a set of polygons and it will return the common set.

See also this post for more info.
> 3 votes

# Answer
This isn't possible out of the box but would be an *awesome* extension.

Assuming google is nicely geocoding your addresses for you then the minimum steps are:

1. install a database with spatial functions (either postgres+postgis or recent MySql (looks like \>= 5.6 ought to do it)
2. populate a table with geometry
3. create a custom field (per contact probably best, rather than per address)
4. write a function that return the desired polygon ID for a point
5. write a script that loops over the null values and attempts to fill them in using your function (you will inevitably have need to do this from time to time in the future so best up front - be warned this could be a slow operation so some kind of batching approach worthwild)
6. create a smart groups based on your custom field
7. write a post update hook that captures the address changes and calls your function to update the custom field
8. crack open a cider, put feet up. You deserve it.

As I said it would be an awesome extension. Ideally it would cope with multiple layers. In order for your batch operation to run nicely it would be worth using `null` for "unknown" and some other value to represent "out of bounds".
> 2 votes

# Answer
If you are using Google Maps you should take advantage of their functionality, eg use an api call to determine if a point is within the polygon of a map layer you have defined, eg https://developers.google.com/maps/documentation/javascript/examples/poly-containsLocation
> 2 votes

# Answer
JoeMcl recommended that you take a look at this https://dc2014.civicrm.org/got-data-now-what-creating-effective-data-strategy-using-civicrm
> 1 votes

# Answer
Via SE Kurund said:

`Web Access developed an extension, that displayed the constituents on the map and you can use turf cutting functionality to create walklist or adding contacts to a group. There were several filter for map display. It was an experiemental early angular interface.`

Am waiting on link to code. will add when it comes on SE
> 1 votes

---
Tags: smartgroups, geocoding, postcode
---


title: Question for current employer field

text:
# Question
Title: Question for current employer field
This is actually a very common use case which in CiviCRM, it doesn't seems to be a way to deal with it yet.

Scenario:

* a CiviCRM integrated site that keeps both users and their employment information
* they are collecting users' employment information via event sign up form
* they have quite a field organisations with same name in their database but different postcode (or some other information)
* they don't want to publish the names of organisations they have in their database (dislike auto-complete)

Currently with only 'current employer' field, users are not able to accurately match their record with correct organisation.

Is there any implementation out there to deal with this scenario?

Maybe we need to add a postcode field for current employer in CiviCRM profile?

# Answer
> 2 votes
This will always be an issue if autocomplete isn't an option and you're dealing with user input... they will never do exactly what you want or expect :).

I think the solution will somewhat depend on the size of your organization. For our operation (events under 3k people), we display a non-editable field of Current Employer in our event registration profile so someone can see what we have on file but cannot touch it.

Just under that, we have a plain text custom field called employer update with some instructions. If they need to update what we have in the database or if it is empty, they should fill it out.

Before each event, our membership manager (or her intern, or a script but this org has lots and lots of 'special snowflakes' so I wouldn't recommend it in that case) goes through the registrants and updates people who have the "employer update" field filled in, and clears out that field as they go.

This prevents a massive number or organization duplicates from being created.

# Answer
> 1 votes
You could try out the Public Autocomplete Extensions which seems to do the job required namely provide an autocomplete for Current Employer, and control which Orgs get displayed by using Groups or Tags etc. Latter requires a bit of technical knowledge but is well explained.

Give it a try and let others know how you get on.

# Answer
> 0 votes
For those interested in deduplicating organisations with misspellings due to user input, check out https://github.com/futurefirst/uk.me.davidknoll.civicrm.orgdedupe.

This may meet your need for clean data and matching organisations without changing the form and exposing data.

---
Tags: profile
---


# Question
Title: Email was sending fine and now has stopped
Using CiviCRM 4.7.14 on WordPress 4.7.3. The configuration uses the default CiviCRM mail() mailer with a WordPress Gmail SMTP plugin.

Everything worked fine until about a week ago, but no configurations were changed. The Gmail SMTP Plugin sends mail successfully, but Civi does not. Any help on where to look would be greatly appreciated.

The error is:

Oops. Your MAIL settings are incorrect. No test mail has been sent. An error occurred when CiviCRM attempted to send an email (via SMTP). If you received this error after submitting on online contribution or event registration - the transaction was completed, but we were unable to send the email receipt. The mail library returned the following error message: mail() returned failure This is probably related to a problem in your Outbound Email Settings (Administer CiviCRM » System Settings » Outbound Email), OR the FROM email address specifically configured for your contribution page or event. Possible causes are: Your Sendmail path is incorrect. Your Sendmail argument is incorrect. The FROM Email Address configured for this feature may not be a valid sender based on your email service provider rules.

# Answer
> 4 votes
When using `mail()` as your mail delivery method, CiviCRM will hand off to PHP's `mail()` builtin, which in turn usually hands over to a local delivery agent (see also PHP's mail configuration settings).

Unless the WordPress Gmail SMTP plugin does more sleight of hand than I anticipate, it won't get a say in how emails sent via `mail()` are delivered. WordPress mail plugins typically only get to intercept email routed through WordPress's `wp_mail()` wrapper. So based on your description (and my assumptions about WP Gmail SMTP), I think what happened is that previously your webserver *was* able to deliver via `mail()`, but now it can't.

You can investigate how it *did* work in the past by comparing the delivery headers of a previous WordPress generated mail (eg new user rego or password reset) with the delivery headers of a previous CiviCRM generated email. I think you'll find that they arrived via different routes.

Why they've stopped arriving is not so obvious. I'd try, in this order -

* Check your PHP error log, which may contain more debug info about why `mail()` failed.
* Check your PHP settings (via `phpinfo()`) to ensure that the mail configuration settings are correct/appropriate.
* Check if the emails are being routed to junkmail; perhaps your mail host or the webserver config changed and the emails are being delivered but treated as spam. (Since CiviCRM says `mail()` failed, I don't think this is your problem.)
* Check if the emails are being handled at all by your webserver, by investigating your webserver's mail logs. (How to do this depends on your server / hosting environment, you may need to request access from your hosting provider or contact a technician.)
* Verify that your webserver is capable of delivering emails. (Perhaps some configuration changed, or the MTA daemon died and needs restarting.)
* Verify your SPF / email configuration. (It *looks* OK from here, but you might find that your server is routing email over IPv6 and your SPF config doesn't handle this; that could lead to you being flagged as junk.)

---
Tags: civimail, email
---


# Question
Title: Error when creating new Case: One of parameters (value: ) is not of the type Integer
I have set up some new Case types and it was all working fine until a user tried to create a case and got the above error, this is happening for all case types now and seems to be being generated by Civirules code.

The only thing I can think of which I have changed recently is I deleted some activity types (through CiviCRM's user interface) and some were likely included in some Case types as sequences or timelines. None of the deleted activity types are included on active Case types that I'm using now but could that be the reason?

Do I need to track down the tables where activity types are linked to cases and get delete rows which are orphaned?

# Answer
Not sure what was actually causing this but it has been resolved by updating Civirules.
> 2 votes

---
Tags: civicase, civirules
---


# Question
Title: Downloads at civicrm.org/download/list stopped working
Today I tried to download the latest 4.7 version of Civicrm, at the download page: https://civicrm.org/download/list

I get this as message after clicking the download button:

"Not Found The requested URL /civicrm--joomla.zip was not found on this server."

at this url None of the download links seem to work at this moment.

Did I miss something or is this a temporary error/bug?

Thank you.

Greetins, Paul

# Answer
I just tested and they seem to work now - please try again?
> 1 votes

---
Tags: upgrade
---