title: Civihr and time tracking?

text:
# Question
Title: Civihr and time tracking?
I want to use CiviCRM to track volunteer hours and allocate rewards. My question is, how do I use CiviCRM to automatically report on volunteer hours?

Time tracking is used for these reasons:

* 12+ hours: full time staff member.
* 24+ hours:eligible for going to the staff after-party.

I work with a Japanese Art and Culture Society. Fancy name for anime convention. We have a major event once a year and a couple of smaller ones.

It would be nice if whatever system we end up, we can use it to:

* Track contact information for our volunteers across all events.
* Track volunteer hours per event.

We have been getting hitting a snag when it comes to the time keeping. I was reading up on civihr. I haven't seen anything about time keeping, but it does look to be able to handle volunteer info for departments, managers, admins, staff, etc. That may be one part of the solution.

I hear CiviVolunteer may be the time tracking part of the solution.

For the time tracking: Can anyone think of a way where we could either have a staff member self punch in and out when they work a shift, or an easy way where we could maybe use the QR codes or ID numbers on our staff badges where supervisors could ideally use their phone to scan a staff members badge to start or end someone's shift?

I know in the past with some version of a check in an out system, we had issues if for some reason someone happened to miss checking out, though this shouldn't really be an issue if we could use phones instead of having to type in data.

To recap, we are looking to create a system that, ideally, would be able to:

* Store a volunteer's info(Personal Data, Department, Contact Info)
* Track different staffers' hours.
* Make reports that show the total hours of each staff member in each department.
* Have different access levels (Volunteer, Department Head, HR Overlord, etc.).
* Make reports with goals.

To expand on that last point, it seems like if there is a way to track time, it should be very easy for our organization's HR Overlord to be able to log in and, with a couple of clicks, be able to pull up a list of all people who qualify for the staff dinner (in this case, they worked 24+ hours between 2017-04-07 08:00:00 and 2017-04-09 17:00:00).

At this point, I'm guessing I would use:

* CiviHR to track Volunteer information, departments, and access permissions.
* CiviVolunteer to track Volunteer hours and to be able to make quick reports.

Can CiviHR and CiviVolunteer even work together in this way?

# Answer
CiviVolunteer might be a better fit for your requirements than CiviHR. See also Volunteer Timesheet
> 2 votes

# Answer
I agree with Aidan that CiviHR may not be quite right for your use case (yet!).

If you are a little more technical I think you could create a solution using:

Drupal webforms (and CiviCRM webform integration) CiviCRM CiviVolunteer module

You could create a public webform which you staff can fill in to record their time. This form can be integrated to CiviCRM to create an activity to record the data against their contact record. On the form you could have a field which is the "duration" of time worked (and the date worked) which would be recorded on the activity.

You could then create a report (use the activity summary report) in CiviCRM which sums up the duration of time worked based on various filters.
> 0 votes

# Answer
We built some jiggery pokery stuff so that a user would click a 'start' which would store the data in an Activity field, then would click an 'end' button which would finish that 'session' and hence record the data to calculate the time spent, and do the rest of the summarising of data via Views. Not in a packageable form, but may give you some ideas to work on, or chase us if you want to fund us packaging it up somehow.
> 0 votes

---
Tags: activities, civivolunteer, civihr
---


# Question
Title: What's the purpose of adding a campaign when enrolling a membership
When you enrol a contact into a membership, you can add a campaign for them so that there's a link between their membership and a campaign. But that seems to be it - any donations they make not automatically linked to the campaign and the same goes for member dues. So what's the point of this link? My use case would have been a good fit for this linking of membership to a campaign, where people have one membership type but are linked to different campaigns depending on how much they give.

# Answer
I don't have this use case and am not sure how you want to engage your constituents with this information linkage, but one possible use is in reporting. You can filter on campaigns, so if you want a list of members that have a differentiator not based on amount or date of membership, then you might assign them to specific campaigns. Similarly, "campaign" can be selected in Advanced search and used to create a smart group that can be used for mailings.
> 1 votes

---
Tags: civicontribute, civimember, civicampaign
---


title: One CiviCRM for multiple sites

text:
# Question
Title: One CiviCRM for multiple sites
Which approach would you recommend for integrating CiviCRM into an existing ecosystem of 3 Wordpress installations, each residing on its own server with its own domain, where at the moment users, event-registrations and newsletters are being managed separately?

Ideally changes in one of the clients would update the central CiviCRM database (via REST et al.) and vice versa.

# Answer
I would always recommend to have CiviCRM on a separate server from the public facing website (privacy, security and updates) even thought it is more cumbersome and more expensive.

So I assume you will have 3 WP websites, and one central CiviCRM (in a dummy Drupal or WP). I would use CiviProxy to ensure only whitelisted API calls are accepted (check https://github.com/systopia/CiviProxy for a little more info) and then there are a few options I think:

1. Ensure your WP sites can process the data and prepare an API call to CiviCRM using the core API's
2. Use the work done on Gravity Forms with CiviCRM although I am not sure that will work with REST
3. Just throw all the data on a Wordpress form to CiviCRM and create a customized extension that provides specific API calls to process the data. We have done this with the CiviCRM Contact Form 7 plugin and specific API's.
> 1 votes

---
Tags: wordpress, multisite
---


# Question
Title: Changing our contact email address in Event Templates
When I create a new event template, which has an email address other than that used in other events we have, changing the email automatically also changes the email address in the other existing events.

We run several events but the contact people can be different. How can I create a new event template without this changing the email address in existing events?

Can anyone help? Thanks in advance.

Best wishes, Minna Baffled in Liverpool

# Answer
I assume the email address you are referring to is on the location tab. If so, the assumption is a location has a fixed email address. When you change the email address on a location it changes it everywhere that location is used.

So you need to create a new location. Unfortunately, location appears to only look at the address part so if you create a new location with the same address as another but a different email or phone number, it doesn't create a new address. It just updates the existing address.

The work around is to make the address part different. I'd suggest using the Supplemental Address 1 to indicate who the coordinator is. You could simply put their name there or something like Event Coordinator: Name or Attn: Name.
> 1 votes

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


title: how to access nested array

text:
# Question
Title: how to access nested array
how can I access the values in a nested array, e.g. when using get for contact entity e.g. how can I adjust the following to get the first name? (not working for me at the moment)

```
$result = civicrm_api3('Contact', 'get', array(
   'sequential' => 1,
   'return' => array("first_name", "last_name", "email"),
   'id' => 28296
));
echo $result['values'][0]['first_name'];

```

if I use var\_dump ($result) I get the following so the results are there:

array(5) { \["is\_error"\]=\> int(0) \["version"\]=\> int(3) \["count"\]=\> int(1) \["id"\]=\> int(28296) \["values"\]=\> array(1) { \[0\]=\> array(6) { \["contact\_id"\]=\> string(5) "28296" \["first\_name"\]=\> string(8) "Thirteen" \["last\_name"\]=\> string(4) "Test" \["email\_id"\]=\> string(5) "27750" \["email"\]=\> string(25) "thirteen.test@artigma.com" \["id"\]=\> string(5) "28296" } } }

thanks much!

# Answer
> 1 votes
You could just use something like $contactData = $result\['values'\]\[0\] for your var\_dump to test. Your echo should be right, in theory.

---
Tags: api
---


# Question
Title: Joomla loadmodule or loadposition inside CiviCRM
please how can I use {loadmodule xxx} or {loadposition xxx} inside: \- an event description \- a profile intro field

Thank you

# Answer
I don't think that you can do that, at least not without programming. Event descriptions and profile intro fields are rendered by CiviCRM, not Joomla, and CiviCRM does not process Joomla plugins.

If you have the event page linked to a Joomla menu item then of course you can display a module elsewhere on the page (outside of the CiviCRM-generated content).
> 1 votes

# Answer
You can use the Modules Anywhere extension - see an example in action on this event registration page (the yellow box prompting users to log in is a module). I'm not the developer - just a happy user.
> 0 votes

---
Tags: civievent, profile, joomla
---


title: One email, adapted to membership status

text:
# Question
Title: One email, adapted to membership status
I frequently send emails to a large mailing list. In this mailing list there a roughly two categories of contacts: 1) members 2) non members

Ideally all would receive the same email, but I'd like to include a block/message ("the block") in the email for non members that encourages them to either renew their membership or sign up for membership.

I currently use mailchimp to design my emails. If I were to create "the block" in mailchimp, I'd have to create a second version of the mail that doesn't include "the block" and split my mailing list in two parts so that everyone receives what I want them to receive. To me this sounds like a sub optimal solution and one that is prone to go wrong at some point.

Would it be possible to optimise this using CiviCRM? I know that Civi currently copies my organisations address details at the end of each email. Would it be possible to create a block such as described above that Civi automatically inserts in emails to non-members, but leaves out in emails to members without having to send multiple emails?

If so, is it possible to make such a block look nice? (Currently the address details that Civi inserts look really bare). My website is a drupal website.

Thanks in advance for your help. I'm also open to any other suggestions you might have!

Elise

# Answer
> 2 votes
We have a setup like this. It's possible if you're comfortable with the smarty template language. If you enable the smarty email setting, you can put limited code into your email template that, say, does an API call to see if someone is a member. Then display the appropriate 'block' depending on the result. This works, but is vulnerable to users breaking it if they edit the template. I'm certainly interested to see what other suggestions people have.

---
Tags: civimail, email, smartgroups
---


title: WP CiviCRM shortcodes gone?

text:
# Question
Title: WP CiviCRM shortcodes gone?
I am running CiviCRM 4.7.18 in WordPress 4.7.4. For some time, the shortcode button has been gone. Even after re-installing CiviCRM/deactivating all other plugins I can't get it to show anymore. Has that feature been removed? Cheers!

# Answer
Are you using this plugin too by any chance: https://wordpress.org/plugins/civicrm-admin-utilities/

If so, there are settings for what post type the shortcode should appear on.
> 0 votes

---
Tags: wordpress
---


# Question
Title: Error when trying to connect to civicrm from gmail using civigmail chrome extension by vedaconsulting: Error unsupported response type
I am having trouble getting the civicrm gmail chrome extension to work. I am using the intructions here https://vedaconsulting.co.uk/civigmail-chrome-extension. When I click on the "connect civi" button that is added to my gmail page I get an oauth login page for my site but after entering in the correct information the following error flashes across the top of my screen.

* CiviCRM 4.7.17
* Civicrm ext: Gmailapi 1.0-alpha1
* Chrome: 57.0.2987.133
* Chrome ext: CiviGmail 0.2.1

Error message

* error: unsupported response type
* error description: implicit grant type not supported
* state: null

Any help on this would be appreciated

Regards Steven

# Answer
I was able to get the oauth login to work by checking "Allow the implicit flow" on the basic settings for the oauth2 server I setup.

/admin/structure/oauth2-servers/manage/\[server-name\]
> 1 votes

---
Tags: extension
---


title: Error with Views + VBO

text:
# Question
Title: Error with Views + VBO
I want to give organizations administrators the ability to update events or memberships contributions payments by check, without having to do an Advanced Search based upon pending statuses to such or such event or membership.

As far as I know, I cannot store such searches to replay them.

So, I am testing an approach using Views with a VBO operation field which enables Contribution edition : enclosed screen capture

When I tick a line of the report, and then confirm the item (Edit Contribution) I get the following error :

*Une erreur HTTP AJAX s'est produite. Code de statut HTTP : 200 Informations de débogage ci-dessous. Chemin : /batch?id=6940&op=do StatusText: OK ResponseText : Add CiviCRM Contribution | BAPA (Paroisse de La Celle Saint Cloud) @import url("https://xxxx.com/modules/system/system.base.css?ook5dq"); @import url("https://xxxx.com/modules/system/system.menus.css?ook5dq"); @import url("https://xxxx.com/modules/system/system.messages.css?ook5dq"); @import url("https://xxxx.com/modules/system/system.theme.css?ook5dq"); @import url("https://xxxx.com/modules/contextual/contextual.css?ook5dq"); @import url("https://xxxx.com/modules/comment/comment.css?ook5dq"); @import url("https://xxxx.com/modules/field/theme/field.css?ook5dq"); @import url("https://xxxx.com/modules/node/node.css?ook5dq"); @import url("https://xxxx.com/modules/search/search.css?ook5dq"); @import url("https://xxxx.com/modules/user/user.css?ook5dq"); @import url("https://xxxx.com/sites/all/modules/views/css/views.css?ook5dq"); @import url("https://xxxx.com/sites/all/modules/ckeditor/css/ckeditor.css?ook5dq"); @import url("https://xxxx.com/sites/all/modules/advuser/css/advuser.css?ook5dq"); @import url("https://xxxx.com/sites/all/modules/ctools/css/ctools.css?ook5dq"); @import url("https://xxxx.com/sites/all/modules/l10n\_client/l10n\_client.css?ook5dq"); @import url("https://xxxx.com/modules/shortcut/shortcut.css?ook5dq"); @import url("https://xxxx.com/modules/toolbar/toolbar.css?ook5dq"); @import url("https://xxxx.com/themes/bartik/css/layout.css?ook5dq"); @import url("https://xxxx.com/themes/bartik/css/style.css?ook5dq"); @import url("https://xxxx.com/sites/default/files/color/bartik-8a90baaf/colors.css?ook5dq"); @import url("https://xxxx.com/themes/bartik/css/print.css?ook5dq"); ...*

Depending upon context, ?ook5dq can change to ?oonnv5 (and maybe others (?))

I am not familiar with Views ; Am I missing something ?

# Answer
> 1 votes
if i was testing this, i would

a/ confirm vbo works for you for normal drupal process (eg node based view, can you use vbo to publish/unpublish), then if that works,

b/ set up a civi contact based VBO that uses other entities. if it fails,

c/ export the view and attach here so someone else can confirm if it is an issue on their set up

---
Tags: drupal-views
---


# Question
Title: Is there Constant Contact integration for CiviCRM in WordPress?
I don't see Constant Contact on the list of Extensions.

# Answer
There's an extension to sync them here: https://github.com/cividesk/com.cividesk.sync.constantcontact
> 2 votes

# Answer
Not that I am aware of, all of the organizations we work with use CiviMail or MailChimp. But I am sure it can be created if you are willing to provide the funding :-)
> 0 votes

---
Tags: wordpress, extension
---


# Question
Title: Detect price group term period on CRM_Member_Form_MembershipRenewal or CRM_Member_Form_Membership
I have a price set which has the same membership with different terms i.e. 1 year, 2 year, etc.

When using the x\_civicrm\_postProcess($formName, &$form) hook, I can't find the term selected in the $form dump data. I need this term for a custom calculation. How do I retrieve this value from this $form when using this hook?

# Answer
> 0 votes
Use this function:

There is a field price\_ which contains the ID of the price set selected

Iterate through price sets to find this ID, and if membership matches, use this number of terms

Be sure to set membership type ID as $membership\_type\_id

```
                $membership_num_terms = 1;

                if (isset($form->_values['fee'])) {

                    foreach ($form->_values['fee'] as $index => $values) {

                        if (isset($form->_params['price_' . $index])) {
                            $id = intval($form->_params['price_' . $index]);
                        } else {
                            $id = null;
                        }

                        foreach ($values['options'] as $option_index => $option_values) {
                            if (($option_index == $id) && ($option_values['membership_type_id'] == $membership_type_id)) {
                                $membership_num_terms = $option_values['membership_num_terms'];
                            }
                        }
                    }
                }

```

---
Tags: civimember, forms
---


# Question
Title: Does Email Signature extension work on CiviCRM 4.7?
Is anyone successfully using Email Signature extension on CiviCRM 4.7?

https://civicrm.org/extensions/email-signature

# Answer
> 1 votes
Current usage is 8 - that may include some old dev/stage installs by the authors - and almost certainly are 4.5 installs by current CiviCRM users (latest stable release for that extension).

---
Tags: email
---


# Question
Title: CiviEvent: Event info and registration form on one page?
Right now, when I create an event, there is one web page for the info about the event, with buttons to click to get to the online registration page with a form where they fill in their name and email and actually register for the event. Is it possible to have the event info and registration form on one page, so they don't have to click a button and go to a different page, but can just fill in their name and email and click "register" one time and be done? This is a free event, so payment is not a concern.

I'm running CiviCRM in WordPress 4.7.4, if that matters.

# Answer
What you can do is skip the Event info page. You can link directly to: /civicrm/event/register?id=1&reset=1

For the info: In Drupal you'd add a block on the register page to show the Event info/details. I'm all but certain that Wordpress has a concept similar to Drupal's 'blocks'.
> 1 votes

# Answer
Under the Online Registration tab, there is a section called Registration Screen. Under the Introductory Text field, you can put your event information there. It accepts full HTML so you can format and style how you want. As KarinG mentioned, you'd then just link directly to the registration page. We have started to do this with our events as we found having the user go through multiple pages just to get to a registration page is cumbersome.

Drupal also has a CiviCRM-Webform Integration module that gives you more control where you can add everything to one page -- it looks like there was discussion about a Wordpress equivalent a couple years ago: Webform-civiCRM equivalent for Wordpress?. Not sure what the status of that is now.
> 1 votes

---
Tags: wordpress, civievent, registration, online-registration
---


# Question
Title: Search custom fields with multiple records
I'm not really sure how to describe this but hopefully I can describe it clear enough.

I created a custom field set that holds borrowing information for items (like tools, equipment, etc.). It has 3 fields (actually more, but here 3 is enough to describe the problem): Item name, Date borrowed, Date returned.

A contact can borrow multiple items at once.

Is there a way to search for contacts who have not borrowed *any* item in the last 6 months?

Thank you.

# Answer
> 3 votes
One way is to do an exclude search.

Create a smart group that has all the people who have borrowed a tool in the last 6 month. Create another smart group that contains everyone.

Under Search =\> Custom Searches you should find the custom search "Include / Exclude Contacts in a Group / Tag".

Include your group that contains everyone.
Exclude your group that contains the people who have borrowed.
This should result in the people who haven't borrowed.

---
Tags: custom-fields, search, multi-record
---


# Question
Title: Invalid Date with Contribution API and Custom Date Field
Using the API, I try to create a contribution record. One of my custom fields is a date field. If I set the date to more than 20 years or so past the current date, I get the following error:

> \[error\_message\] =\> custom\_154 is not a valid date: 2038-01-19 08:00

If I lower this date by one month, even by one day, using the same format, it works fine. One day past the 19th, it fails.

What's odd is that any date I put in, even 100 years out, works great on my dev box. This is only happening on our production site. And my dev box was a copy of production's DB and files (same Civi version, etc). So I'm not sure what might be causing this.

I have modified the custom field and set the "Dates may be up to" to 100 years, but that doesn't help (tried other numbers as well, no use).

Is there some environmental or PHP setting that is causing this?

# Answer
Sounds like you are running into the Year 2038 problem.

You have different behavior on different machines, which makes sense, and also probably will make this problem easier for you to troubleshoot. *(I couldn't reproduce the error message in my environment, which makes this tricky to diagnose.)*

I'm not positive what the *exact* culprit is for you, but here are some guesses...

## Different architecture

I *think* the most likely explanation for your different behavior is *different architecture*.

Assuming both machines are unix-based, you can run `uname -i` to see your system architecture on each.

* A result of `x86_64` means you are running a 64 bit system (good)
* A result of `i386` (or similar) means you are running a 32 bit system (bad)

If your dev box shows `x86_64` and your production server shows `i386`, I would guess that upgrading your server to a 64 bit OS would solve this problem.

## Different software

I think it's also *possible* that your two systems have the *same* architecture, but some difference in *system software* that would lead to this problem, since many software projects are still in the process of mitigating against Y2k38.

I recommend comparing the versions of MySQL and PHP running on each machine and troubleshooting from there.

**Please post a comment when you figure out what the culprit was for you!**

## Other notes

* Again, I'm not certain what *exactly* is causing this problem, but I would say it's very unlikely to be an issue within CiviCRM.
* Even for custom fields, CiviCRM stores dates as a `DATETIME` data type in MySQL which will continue to work until we hit the Y10k problem.
* MySQL still has some Y2k38-related problems, like this one, but based on the fact that you and I are both able to use large dates on our dev boxes, I'm guessing your're not running into that
> 3 votes

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


# Question
Title: How can I fix an incorrect SQL field in Recurring Contribution View?
I'm trying to create a view that will tell our logged-in Drupal users when their next scheduled contribution is slated to happen. Everything is working well until I add the field "CiviCRM Recurring Contributions: Next Contribution Date". When that happens, my preview gives the error:

> SQLSTATE\[42S22\]: Column not found: 1054 Unknown column 'civicrm\_contribution\_recur.next\_sched\_contribution' in 'field list'

The Views SQL query shows this field being called:

```
civicrm_contribution_recur.next_sched_contribution AS civicrm_contribution_recur_next_sched_contribution

```

That is the correct table, but the field name is incorrect. It should be `next_sched_contribution_date`. I've tried searching in the CiviCRM Entity Github repo, but I can't find where the (incorrect) field name is being generated. Where would I look to find the error? Or am I looking in the wrong place entirely and it's not a CiviCRM Entity issue at all? I want to help, I just don't know where to correct it.

We're using Drupal 7, CiviCRM 4.6.21, CiviCRM Entity module 7.x-2.0-beta3. The type of view is "CiviCRM Recurring Contribution profile."

# Answer
I just ran into this - got it working - (4.6 line numbers) - just need to update the field names (see below). After applying the patch clear caches (the views cache in particular).

I do not have CiviCRM Entity installed for this project - this is a straight up CiviCRM Views integration/fix.

```
diff --git a/drupal/modules/views/components/civicrm.contribute.inc b/drupal/modules/views/components/civicrm.contribute.inc
index e666a45..1b4a20f 100644
--- a/drupal/modules/views/components/civicrm.contribute.inc
+++ b/drupal/modules/views/components/civicrm.contribute.inc
@@ -1023,7 +1023,7 @@ function _civicrm_contribute_data(&$data, $enabled) {
     ),
   );
   //Recurring Contribution End Date
-  $data['civicrm_contribution_recur']['next_sched_contribution'] = array(
+  $data['civicrm_contribution_recur']['next_sched_contribution_date'] = array(
     'title' => t('Next Contribution Date'),
     'help' => t('The Next Contribution Date.'),
     'field' => array(
@@ -1040,7 +1040,7 @@ function _civicrm_contribute_data(&$data, $enabled) {
   );
   civicrm_views_add_date_arguments($data['civicrm_contribution_recur'], array(
     'title' => 'Recurring Contribution Next Date',
-      'name' => 'next_sched_contribution',
+      'name' => 'next_sched_contribution_date',
     ));
   //How many times has the contribution failed
   $data['civicrm_contribution_recur']['failure_count'] = array(

```
> 1 votes

# Answer
That particular table is exposed to Views by the Core CiviCRM module, not CiviCRM entity. I haven't exposed that entity to Drupal yet, but its on the todo list.

I have added some code to CiviCRM Entity to fix this...

Its available in the latest -dev release from the CiviCRM Entity project page and will be in beta7 when it is released
> 2 votes

---
Tags: drupal, drupal-views, recurring-contributions, civicrm-entity
---


# Question
Title: How can I download CiviCRM tar file with Drush?
Is there a way I can automatize this download in order to use `drush civicrm-install`

I'm trying to automatize deployment of CiviCRM in Drupal 7

# Answer
> 2 votes
Mathieu a.k.a @bgm (who runs much of the CiviCRM project's infrastructure) wrote this:

https://forum.civicrm.org/index.php?topic=30003.msg128559#msg128559

To summarize: \[I checked the link to that example makefile - still works\]!

```
I deploy with "Drush make":

* deploy from my git repos or from the civicrm standard ones (drush make example.make)
* run GenCode.php

Example makefile: https://gist.github.com/mlutfy/5310366

```

---
Tags: drupal, drush
---


# Question
Title: Drush civicrm-install failing with 'undefined function module_enable'
I'm using Drush 8, Drupal 7 and CiviCRM 4.7.18

The `civicrm.drush.inc` file that comes with CiviCRM (and is moved to `~/.drush/`) has a call to a function called module\_enable() which is not defined anywhere.

```
Error: Call to undefined function module_enable() in drush_civicrm_install() (line 367 of /root/.drush/civicrm.drush.inc) #0               [error]
phar:///usr/local/bin/drush/includes/command.inc(422): drush_civicrm_install()
#1 phar:///usr/local/bin/drush/includes/command.inc(231): _drush_invoke_hooks(Array, Array)
#2 phar:///usr/local/bin/drush/includes/command.inc(199): drush_command()
#3 phar:///usr/local/bin/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#4 phar:///usr/local/bin/drush/includes/preflight.inc(66): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#5 phar:///usr/local/bin/drush/includes/startup.inc(458): drush_main()
#6 phar:///usr/local/bin/drush/includes/startup.inc(365): drush_run_main(false, '/', 'Phar detected. ...')
#7 phar:///usr/local/bin/drush/drush(114): drush_startup(Array)
#8 /usr/local/bin/drush(10): require('phar:///usr/loc...')
#9 {main}.
Error: Call to undefined function module_enable() in /root/.drush/civicrm.drush.inc on line 367 #0 phar:///usr/local/bin/drush/includes/command.inc(422): drush_civicrm_install()
#1 phar:///usr/local/bin/drush/includes/command.inc(231): _drush_invoke_hooks(Array, Array)
#2 phar:///usr/local/bin/drush/includes/command.inc(199): drush_command()
#3 phar:///usr/local/bin/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#4 phar:///usr/local/bin/drush/includes/preflight.inc(66): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#5 phar:///usr/local/bin/drush/includes/startup.inc(458): drush_main()
#6 phar:///usr/local/bin/drush/includes/startup.inc(365): drush_run_main(false, '/', 'Phar detected. ...')
#7 phar:///usr/local/bin/drush/drush(114): drush_startup(Array)
#8 /usr/local/bin/drush(10): require('phar:///usr/loc...')
#9 {main}
Error: Call to undefined function module_enable() in drush_civicrm_install() (line 367 of /root/.drush/civicrm.drush.inc).
Drush command terminated abnormally due to an unrecoverable error.

```

Changing it to drush\_module\_enable ends in another error:

```
Drupal\Core\Extension\MissingDependencyException: Unable to install modules civicrm due to missing modules civicrm. in                     [error]
/opt/compucorp/core/lib/Drupal/Core/Extension/ModuleInstaller.php:85
Stack trace:
#0 /opt/compucorp/core/lib/Drupal/Core/ProxyClass/Extension/ModuleInstaller.php(83): Drupal\Core\Extension\ModuleInstaller->install(Array,
true)
#1 phar:///usr/local/bin/drush/commands/core/drupal/environment.inc(131): Drupal\Core\ProxyClass\Extension\ModuleInstaller->install(Array,
true)
#2 phar:///usr/local/bin/drush/commands/core/drupal/environment.inc(198): drush_module_install(Array)
#3 /root/.drush/civicrm.drush.inc(367): drush_module_enable(Array)
#4 phar:///usr/local/bin/drush/includes/command.inc(422): drush_civicrm_install()
#5 phar:///usr/local/bin/drush/includes/command.inc(231): _drush_invoke_hooks(Array, Array)
#6 phar:///usr/local/bin/drush/includes/command.inc(199): drush_command()
#7 phar:///usr/local/bin/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#8 phar:///usr/local/bin/drush/includes/preflight.inc(66): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#9 phar:///usr/local/bin/drush/includes/startup.inc(458): drush_main()
#10 phar:///usr/local/bin/drush/includes/startup.inc(365): drush_run_main(false, '/', 'Phar detected. ...')
#11 phar:///usr/local/bin/drush/drush(114): drush_startup(Array)
#12 /usr/local/bin/drush(10): require('phar:///usr/loc...')
#13 {main}

```

# Answer
Are you *certain* you're looking at Drupal 7? `module_enable()` is a core function in that version, but was removed in Drupal 8. Files like `core/lib/Drupal/Core/Extension/ModuleInstaller.php` also indicate a Drupal 8 codebase, not Drupal 7.

As of April 2017, CiviCRM is not yet fully functional on Drupal 8, so I'd suggest you try again with Drupal 7 if you want a working solution today, or get involved with the effort to make Drupal 8 happen (see previous link for how).
> 0 votes

---
Tags: drupal, drush
---


# Question
Title: Form not displaying on front page of twenty seventeen
I'm having problems getting the form we set up for contributions to show up on the front page (using the twenty seventeen wp template) -- have resorted to using a the 'page links to' plugin, but it's just a temp fix. These were the instructions my hubs sent me, which don't seem to work. THANKS!

Go to Contributions \> Manage Contribution Pages \> click Links next to your membership sign-up/renewal page \> click Live Page. Copy the URL and insert it into an HTML link or menu.

Or click the Wordpress shortcode icon to insert a form into any page or post.

# Answer
> 2 votes
For the TwentySeventeen theme to add content to the Home page we have a few options:

* Set the static front page option in Customizer to a page
* We can then have a widgetized front page controlled by the Theme Options in the Customizer

I tested this and I can add the Page with the CiviCRM shortcode and set it to be the front page. https://civi47.tadpole.cc/ shows an example of this.

However, if you are trying to set this as the second piece of content via the Theme Options - that does not work for me as well. I suspect this is due to the way the theme is implementing its home page.

# Answer
> 0 votes
According to the documentation, you can do this as follows:

> You can easily embed your contribution page in a post or page on your WordPress front-end site.
>
> 1. Login to the administration dashboard of your WordPress site.
> 2. Click on Pages or Posts \> Add New
> 3. Click on the CiviCRM icon next to Upload / Insert
> 4. Select Contribution Page as your Frontend Element
> 5. Select the desired contribution page
> 6. Save the page or post, and your contribution page will automatically be embedded within your site's theme on that page.

Read more at: Online contributions

---
Tags: wordpress
---


title: Scheduled Jobs not running

text:
# Question
Title: Scheduled Jobs not running
I can only get scheduled jobs to run manually, with the "Execute now" button. Hourly won't work let alone with an external method like php.cli method. Is there a way to troubleshoot this? I just started logging civi errors to drupal watchdog....so hopefully I'll have more info soon.

Thank you

# Answer
> 2 votes
The PHP CLI method is one of several ways to run all scheduled jobs automatically. If you haven't configured a cron job, the scheduled jobs will not run on their own. Because nothing is actually happening, there will be no log entries to say that your cron isn't set up.

Select one of the methods for triggering scheduled jobs from the command line. Since you're on Drupal, you might try the Drush method because it's fairly easy. Regardless, if for some reason your command fails, you should get some sort of message that you can use for finding more specific help.

(A tip for testing: make sure you have at least one scheduled job enabled and set to run "Always". If everything's hourly or daily, it's hard to test if it has executed.)

Once you find a command that works, set it up as a cron job so it runs every 5-15 minutes. At that point, you'll be able to go back and check if the scheduled jobs are working as expected.

# Answer
> 0 votes
If you are on Linux and using Drush you can set a cron job:

Example, create a file as root under `/etc/cron.d/run-civi-jobs`

With contents:

```
*/15 * * * * www-data cd path/to/drupal && /usr/local/bin/drush --quiet civicrm-api -u 1 job.execute

```

---
Tags: cron-job
---


title: Integrate Views3 with Drupal 7

text:
# Question
Title: Integrate Views3 with Drupal 7
I was told to integrate Views 3 with Drupal 7 following this tutorial:

https://wiki.civicrm.org/confluence/display/CRMDOC/Views3+Integration

However, I do not have this:

```
You should see a page with output that begins with: "$databases['default']['default']['prefix']= array("

```

So I'd like to know if that tutorial doesn't apply anymore or what I need to do to get that PHP config to show.

This is a fresh installation so I'm using latest versions of Drupal and CiviCRM

Thanks!

# Answer
> 2 votes
If you don't see that screen in Karin's answer, here are some reasons why you might not (source):

* You aren't using Drupal at all! Views and its integration won't work on your site at all then
* You have CiviCRM and Drupal in the same database. With a shared DB, no aliasing is required in `settings.php`, it'll work out of the box.
* You don't have Views enabled in Drupal yet. The screen won't show up until Views is enabled.

# Answer
> 2 votes
Navigate to CiviCRM -\> Administer -\> System Settings -\> CMS Database Integration:

Copy all of that... into the Drupal settings.php file for your site!

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


title: Activity monitoring

text:
# Question
Title: Activity monitoring
I want to use Civi to monitor support time organisations have bought from us. Ideally for Civi to alert me when organisations are in the negative and need to purchase more support time? whats would be the best functions to get this info ?Thanks

# Answer
> 1 votes
There is quite a bit of software out there that does time-tracking already. For example - I use https://www.jetbrains.com/youtrack/ \- I can run time reports that show me how many hours an organization has left in their IT bundle at any time.

That's certainly not the only one out there - Other CiviCRM partnes use many other time tracking software instances but I don't know anyone who does this in CiviCRM.

---
Tags: activity
---


# Question
Title: Civi Reporting - where's the preview tab?
I am building activity reports and the preview tab is missing from the top , likewise I am unable to access the report title tab. is this something that can be added in , if so, how ? thanks in advance

# Answer
> 1 votes
If you have an older version of extended reports extension, or the advanced reports extension installed this can happen. Assuming you are on 4.7 make sure that if you have those extensions they are up-to-date

---
Tags: civireport
---


title: I can't install CiviCRM on Wordpress

text:
# Question
Title: I can't install CiviCRM on Wordpress
I have two instances of WordPress (both running 4.7.4).

I have tried on one to install CiviCRM 4.6.27 and the other, CiviCRM 4.7.18. But, I get the same error: I try to install, I get all clear for the test to the DB and FileSystem, but after clicking on the « Check Requirements and Install CiviCRM » button, the browser just keep on loading the page with no success nor error messages.

I've install the plugin « Error Log Monitor » but I see nothing. Also, the file civicrm.settings.php in the upload/civicrm folder doesn't exists.

I get this in my apache error log file:

```
2017-04-24 01:44:09.900 [INFO] [24.114.88.1:53124] Connection idle time: 91 while in state: 10 stream flag: 0,close!
2017-04-24 01:44:09.900 [NOTICE] [24.114.88.1:53124] Content len: 215, Request line: 'POST /wp-admin/options-general.php?page=civicrm-install HTTP/1.1'
2017-04-24 01:44:09.900 [INFO] [24.114.88.1:53124] Cookie len: 522, wordpress_efc9291620b9675fe124bc49dffdbee0=admin%7C1494220081%7Co5FUUWceWVXphjqDGUCDRikjuFvBeiZ9HSUbfxuKt7r%7Cf2762fb5071fa7a4a6f9dcc220b8402c3852569d55f33b951e942f84912bd462; _ga=GA1.2.118246024.1491536971; PHPSESSID=a81gmdbmehahoikdne82n1ehv2; wordpress_test_cookie=WP+Cookie+check; wordpress_logged_in_efc9291620b9675fe124bc49dffdbee0=admin%7C1494220081%7Co5FUUWceWVXphjqDGUCDRikjuFvBeiZ9HSUbfxuKt7r%7C1f32a1947ae120408e5bd791386098b6fd1d01e0c86ab85ca52f7b885b6c2a1b; wp-settings-time-1=1493012558;wp-settings-1=deleted
2017-04-24 01:44:09.900 [INFO] [24.114.88.1:53124] HttpExtConnector state: 8, request body sent: 215, response body size: -1, response body sent:4529, left in buffer: 0, attempts: 0.
2017-04-24 01:44:09.900 [INFO] [24.114.88.1:53124] Lsapi connection state: 3, watching event: 25, respState: 5, m_iTotalPending:0, m_iPacketLeft:0, m_iCurRespHeader:8, req sent for 91 seconds,Total processing time: 91.
2017-04-24 01:44:09.900 [INFO] [24.114.88.1:53124] Abort request processing by PID:410255, kill: 1, begin time: 91, sent time: 91, req processed: 0

```

I'm on a provider's machine, a CentOS 6.0 64 bit. WordPress seams to work fine.

Issue? Where to look?

Regards, Antoine

# Answer
In your php.ini, what is your max\_execution\_time? I think the default may be 30 (sec) you may want to increase that. Also I think at least with Civi 4.7 the install will try to install in the WP database, are you 1) selecting a different database (and user) or 2) using the WP one? Are ANY tables ending up installed for Civi?
> 1 votes

---
Tags: wordpress, installation
---


title: unable to add price sets?

text:
# Question
Title: unable to add price sets?
I am trying to set up registration for an event that requires price sets. When I press Price Set I'm unable to add any. Has anyone else experienced this? Is there something I need to do first?

here's all I see:

# Answer
> 1 votes
That's CiviCRM 4.1.6 - it's unlikely you'll find anyone here who can help you with that version.

It's possible that upgrading to 4.6 or 4.7 itself will solve the issue - lots has changed since. And if any issues remain you'll be on a version that's currently supported by the community.

# Answer
> 0 votes
When you do 'manage price sets' or 'new price set' you see NO input text boxes, where you can enter the price-set name? I can't see your URL but presumably you'd see the textboxes to allow you to input the name, financial type, etc. Can you verify your user permissions? (presumably you're an admin).

---
Tags: price-sets
---


# Question
Title: Can not add soft credit to an organization
Has anyone seen an instance where a contribution can not be edited to add a soft credit to an organization?

I can add individuals, and it's only happening on the contributions from some contribution (donation) pages but not others. I've not been able to replicate on demo, but since it's only happening on some contribution pages I'm not sure exactly how to replicate.

Environment: Drupal 7.32 CiviCRM 4.6.15

# Answer
> 1 votes
I just came across this as well. I'm running Wordpress 4.4.4 and Civi 4.6.4. I can add soft credits to individuals all I want but I cannot mix individuals and organizations soft credits in the same donation. Or so I thought, after messing around for a bit I found that if I removed the campaign that was set and the contribution page that was set (and saved the record). Then went back in I could add the organization soft credit.

I could then go back into the donation and add back in the campaign or the online fundraising page. This part was wonky and most successful when I added the campaign first, saved then went back and added the online page.

I was also successful mixing soft credits on a fresh donation when I only had the campaign set and no online fundraising page.

My take away, online fundraising pages in the set in the donation have something to do with it.

# Answer
> 1 votes
CiviCRM added a validation step in 4.7.4 to prevent attributing soft credits to organizations if the contribution is tied to a contribution page using the "Honoree" section: Contribution soft credit does not save for differenty contact type

However as of 4.7.18 at least, there's an issue in which validation errors on the soft-credit "Contact" field are not correctly displayed to the user. This is explained here: Soft credit "contact" field validation errors do not display

---
Tags: civicontribute, soft-credit
---


# Question
Title: Can I use CiviCRM to print mailing labels etc?
I'm using MS Access now, which works admirably for our simple purposes: keeping track of 140 or so members, creating the odd phone list, and printing mailing labels quarterly and sending a personalized (merged) letter once a year. It's a standalone database, not connected to a website at this point.

Is CiviCRM suitable for this sort of activity? What would be the advantages?

It looks to me as if this app is meant to be used in conjunction with a website, which I suppose might be useful in our future.

Thanks.

Doug

# Answer
While I'm as big a proponent of CiviCRM as anyone - it's worth considering why you're looking to switch if your current tool is working for you.

CiviCRM opens up many possibilities that aren't available with Access - from mass e-mailing to allowing members to sign up/renew online to offering members-only content on your site and more. However, it won't make you an expert in membership management or plan your renewal campaign.

If you're looking to make your organization more effective by growing membership or making better use of your member data, you'll need a strategy to do so. That might include upgrading your database. However, organizations who adopt fancier tools without a strategy often have buyer's remorse, even for a free tool.
> 4 votes

# Answer
Yes I reckon CiviCRM would be very suitable for this kind of activity.
> 3 votes

# Answer
You don't need to expose the database to anyone outside your organisation if you don't want to - you will need to 'encase' it in a website - some providers like civihosting provide that pre-installed I think
> 1 votes

---
Tags: civimember, evaluating-civicrm
---


# Question
Title: How can I have a repeating activity in a case standard timeline?
I am currently exploring CiviCase. I like to setup an activity that tracks the progress of the client every 6 months. Is this possible with a case standard timeline? I can't predict how many times this tracking activity should be entered, until the case is closed. I'm thinking of adding the timeline:

Open Case Tracking Activity #1 (6 months) Tracking Activity #2 (12 months) ...

Can I have the Tracking Activity #2 appear only after the Tracking Activity #1 is completed? Is this where the Reference Onset comes into play?

# Answer
> 0 votes
I have tried a set up as attached and it works for me with 4.7

# Answer
> 0 votes
I have done this once but it is a long time ago :-) As far as I know it is possible, and you have to set up the activity in the timeline. Just checked, the client in question solved it by having 'follow up 1', 'follow up 2' etc as activities and planning each one for a set period after the previous one. Does that help?

---
Tags: civicase, activities
---


# Question
Title: How can I bulk update a collection of recurring contributions to set the next scheduled contribution to a specific date?
If you're using the iATS Payments Extension you control the schedules of recurring contribution from within your CiviCRM. You can already edit a given recurring series and change the next scheduled date. Can this be done in bulk?

# Answer
Since yesterday you can now do that if you're using Drupal! @jackrabbithanna (Mark) added some code to CiviCRM Entity Project, which now exposes civicrm\_contribution\_recur as an Entity in Drupal so that you can manipulate it in Drupal like any other Entity. Will post some steps/screenshots here:

1. git clone https://github.com/jackrabbithanna/civicrm\_entity.git
2. Enable modules: views, views bulk operations (VBO) and CiviCRM Entity **-\> also Enable the CiviCRM Entity Actions submodule**
3. Clear caches twice!
4. Add a view: Show: Recurring Contributions Profile; you will want it to Format: Show: Fields and Create a page for it.
5. Add Field: Bulk Operations: CiviCRM Contribution Recur

6. Select Modify Entity Values (as we're going to want to update values)

7. In action - go to your page

8. Hit Execute
9. Select Next Scheduled Contribution Date and assign the new value for it (this is the date/time/format that CiviCRM uses): **2017-05-01 00:00:00**
10. Next and Confirm! And check that it worked: it did - will transact on May 01, 2017:
> 5 votes

---
Tags: drupal-views, recurring-contributions, civicrm-entity
---


# Question
Title: Non-deductible contribution amounts are always $0
Create an event with a price set which contains two price fields. One price field contains items of financial type "Event Fee" which is defined as non-deductible. The other price field contains items of financial type "Donation" which is defined as deductible.

The Financial Type of the Event, specified on the Fees page, is Donation (although setting it to Event does not change the result).

When a participant registers and selects for example a $30 Event Fee option and a $100 Donation option, a contribution is created which shows the two line items with a net amount of $130 as expected. The non-deductible amount, however, is shown as $0, rather than $30 as I would have expected.

Am I doing something wrong? Is this a bug?

I'm running 4.6.14 and confirmed the same issue exists on the demo site (4.7.5).

# Answer
This is an old ticket; just wanted to add a note that I'm 99% sure we fixed this in 4.6 and 4.7 - and also added a PHP Unit test for it - so that makes it harder to break in future. I've not had any of our client reporting this issue anymore - however if you still experience this in a later version of either 4.6 or 4.7 - please do let us know.

Found the PRs: https://github.com/civicrm/civicrm-core/pull/6895 https://github.com/civicrm/civicrm-core/pull/6896

**UPDATE:** 1% it is! I just quickly tried to reproduce your exact scenario - and sigh... it is still an issue in 4.7.18 - will get this fixed. Slightly different pathway than the one we fixed above. In the screenshot below - non-deductible should be $0.30
> 1 votes

# Answer
Please create an issue on JIRA and assign it to me so I can have my staff look into this.
> 0 votes

# Answer
For now you can use the API csv Import to update the non\_deductible\_amount column of the civicrm\_contributions table.
> 0 votes

---
Tags: civievent, contributions
---


# Question
Title: Where can our small non-profit find assistance with CiviCRM?
Looking for an individual in Michigan, USA, to assist with understanding a civicrm database that was created for our non-profit. Many bugs and errors in the system, and training on system needed for staff. Recommendations needed ASAP. Thanks M Janes

# Answer
> 4 votes
Best place to look for a CiviCRM Partner/Contributor is here: https://civicrm.org/partners-contributors \- there are many Partners/Contributors in the US - even if you can't locate one in Michigan - with today's tools like GoToMeeting so much can be done online;

# Answer
> 0 votes
I agree with KarinG. Another option that could potentially produce some local results is Craigslist.

---
Tags: developer
---


# Question
Title: Fundraising event - can I sell tickets AND collect donations?
My organization is hosting a fundraising event at which the tickets are not expensive and participants can contribute an additional amount as well. How would you set this up? Currently I have a price list for the tickets, but I'm unsure how to do the write-in additional contribution. Linking to the donate page could be done, but isn't ideal. Thoughts?

# Answer
> 4 votes
one way you could do this is to create one field in your priceset for the ticket (probably making it required to ensure that they actually purchase tickets), and then another field (not required) that's a text field with a value set to 1 (which will multiply by the amount they enter), e.g., https://www.screencast.com/t/Db1nHAWfA (You can also set the financial type to something besides Event Fee for the additional contribution, if desired.)

Lesley

---
Tags: civievent, civicontribute, contributions, contribution-page, price-sets
---


# Question
Title: Update user Tags direct from civiMail link
We'd like to let existing civiCRM Contacts tell us what they are interested in by following a link in a civiMail email, which takes them to a form with a few checkboxes. They check a few boxes, then press enter, which automatically updates their profile without making them login.

We are thinking we may need to use a checksum Token that links to a Petition or a Survey.

I thought I'd ask what the best practice is on this.

Thanks!

# Answer
One approach is to create a custom field with check boxes for the subjects you wish to gather info on. Then create a profile that includes the custom field and any other info you might want to have them provide. Then use a link with a checksum token to this profile for editing in the email.

Hope this helps.
> 2 votes

---
Tags: civimail, contacts, tags
---


title: How to troubleshoot CiviRules triggers?

text:
# Question
Title: How to troubleshoot CiviRules triggers?
I have just installed CiviRules 1.12 on CiviCRM 4.7.14. I tried to create a few simple test rules, but none of them worked. I suspect I might have to look for solution somewhere else.

```
Trigger: Contribution is changed
Linked Condition: Contact in group TEST
Linked Action: Remove contact from group: TEST

```

I also tried a few similar Rules, e.g.:

* IF Contribution is added THEN remove from Group.
* IF Tag is added THEN remove from Group.
* IF contact is removed from group THEN display the Message.

All were set to run IMMEDIATELY without delay.

What might have gone wrong? Something with setup or configuration? I did not see anything unusual.

---

## UPDATE:

Upon further tests the issue was narrowed down to a single CiviRules action, namely, **Remove contact from group**.

# Answer
> 4 votes
I would as a test forget about the display message first, and start only with adding to and removing from group. I would expect those to work.

I have just tested a rule on my CiviCRM 4.7.15 local install as in the screen print that I have attached, and that works fine? Can you test with the same rule?

---
Tags: civirules
---


# Question
Title: Error message given after membership confirmation screen
Hello more established users of Civi. I am currently having this happen after a member signs up for a membership. I am very new to Civi and work at a small nonprofit (ie: we have no I.T. Dept). Please help if you can walk me through the steps.

"Sorry but we are not able to provide this at the moment. The membership cannot be saved because the status cannot be calculated for start\_date: null end\_date null join\_date null as at 2016-12-07 12:01:48"

# Answer
> 1 votes
I received a similar message when trying to create a 'Provides Membership to' relationship. If you go in the civicrm\_membership table for that contact ID, you will see that the join\_date, start\_date and end\_date fields are all NULL. Set them to the correct values and it should work.

This does not answer how you got into the situation in the first place, but in several months of running our site I have only seen this once, so I have to believe it's an intermittent problem.

# Answer
> 0 votes
Yes I have noticed this too for new memberships. Saving the membership after creation creates these fields, however initial signup does not. The membership status check relies on these fields to be present, to determine the membership status, but as they were never created at signup, it fails when performing a status check

i.e.

$result = civicrm\_api3('Membership', 'create', array( 'sequential' =\> 1, 'membership\_type\_id' =\> "xxx", 'contact\_id' =\> xxx, 'id' =\> xxx, 'skipStatusCal' =\> 0, // Force status calculation ));

```
"error_message": "The membership cannot be saved because the status cannot be calculated for start_date: null end_date null join_date null as at 2017-03-16 20:07:53"

```

Running 4.7.16

---
Tags: civicontribute, error, error-page
---


# Question
Title: Does CiviMail have an upper limit for total recipients in an email blast?
I have a client that would like to create an email blast to 50,000 or so constituents, and we are currently evaluating CiviCRM to handle this. I've noticed the documentation says that CiviMail is good for email blasts sent to over 50 constituents, but I can't find any mention of whether or not there is an upper limit.

# Answer
Absolutely - that can be done - the 50 is just a reference to the Search -\> Find Contact screen -\> Search -\> Select -\> Actions -\> EMail send now (to 50 or less) option.

When sending out lots of CiviMail to lots of CiviContacts best to use an external SMTP service to help you with the Email delivery - and to minimize the risk that your webserver will be blacklisted.

**UPDATE** an actual number from one of my clients' civicrm tables -\> intended recipients: **89419** And I'm sure there were larger mailings.
> 2 votes

---
Tags: civimail, email, evaluating-civicrm
---


# Question
Title: Auth.net completed transactions showing as Pending (Incomplete Transaction) - sometimes
CiviCRM: 4.7.17 Joomla 3.6.5

This does not happen every time, seems random. New Member Online registration - Contribution goes through to Auth.Net and is marked there as successful/completed, but the contribution record in Civi is marked as Pending (Incomplete Transaction) and the Membership stays in the status of pending. Following is an example of what I find in the civi error logs each time this occurs. Could somebody help me determine what the cause of this could be?

```
Log 1:

```

Apr 10 15:28:31 \[info\] Contribution record updated successfully

Apr 10 15:28:35 \[info\] Receipt sent

Apr 10 15:28:35 \[info\] Success: Database updated

```
Log 2:

```

Apr 10 15:28:31 \[info\] Could not find an entry for x\_subscription\_id

Apr 10 15:28:31 \[info\] $error data = Array (

```
[error_code] => 0

```

)

Apr 10 15:28:31 \[info\] $REQUEST = Array (

```
[x_response_code] => 1

[x_response_reason_code] => 1

[x_response_reason_text] => This transaction has been approved.

[x_avs_code] => Y

```

...

)

# Answer
> 1 votes
There were some issues with Authorize.net transactions failing due it not managing to send an email- could that be related? Is email always required on the page? I think there are a.net fixes in both 4.7.18 & 4.7.19 (still in rc) so it might be worth checking if a point upgrade changes anything (4.7.19 is due out first Wed next month)

---
Tags: contribution-page, authorize.net, pending
---


# Question
Title: Error when processing Pay later contribution
Using Drupal 7.44 and CiviCRM 4.7.8.

When using CiviCRM 4.6.18 a Pending (Pay Later) contribution can be completed by editing the Membership that it relates to, checking the box 'Update Payment Status' and completing the payment. When this is done in a copy of the (upgraded) database in version 4.7.8 an error is displayed 'Please enter the financial type'.

This is almost certainly an error of the database upgrade or the application itself.

# Answer
> 2 votes
I'm relatively new to CiviCRM and realize this is an old thread, but I just got the same error on Wordpress 4.7.4 and CiviCRM 4.7.15. I was trying to record a update a membership based on a cash payment. Screen shot below shows the error received. I unchecked "Update Payment Status" and was able to save and continue. I had to add a new contribution for this person after saving the the membership changes.

# Answer
> 0 votes
Glad I could help - regarding "Update Payment Status" - there is an action that allows you to "Update pending contribution status", but I don't recall seeing a check box anywhere - if you do happen to see it again (assuming you are not drinking), send a screen shot.

Thanks!

---
Tags: civicontribute, civimember, paylater
---


title: CiviHosting and MySQL 5.7

text:
# Question
Title: CiviHosting and MySQL 5.7
CiviHosting has sent a notice to all their customers that they are upgrading all their servers to MySQL 5.7, despite their acknowledgement that CiviCRM prior to version 4.7.7 "may fail". They plan on performing this upgrade in one week, August 17.

For those customers that are not able to upgrade to a compatible CiviCRM version at this time (due to various customizations), what are the various issues that can be expected?

I know of the lock name length issue (When upgrading from 4.7.7 to 4.7.8 I get error "Specified key was too long") which appears to be an upgrade process issue. (Does this problem extend back to prior to 4.7?)

What else is there to be concerned with, particularly with versions 4.4.x, 4.5.x, and 4.6,x?

# Answer
IMO the only way to answer this with confidence is empirically: request a trial upgrade in the proposed new hosting environment (or equivalent), and test whether the system upgrades then functions as expected. Most effectively done when you have some tests that you can run on your newly upgraded site to ensure things function.

Fuzion host on MySQL 5.5 and 5.6, so I can't speak to what you should expect on MySQL 5.7. (This is not because we don't approve of 5.7, we just have had no reason as of today to move there.)

You might also see variation between Percona / MariaDB / MySQL, or between various OS or distribution packages ... Your best bet is to try it and see! Just not in production ;)
> 1 votes

# Answer
I'm aware of 2 issues.

There is a lock length issue, but it is a different one: https://issues.civicrm.org/jira/browse/CRM-17846. You may need to backport that patch.

Additionally there is https://issues.civicrm.org/jira/browse/CRM-18439. While it is patched for core 4.7.10, self-developed queries might violate that restriction. You do get away with disabling the default SQL mode only\_full\_group\_by.
> 1 votes

# Answer
CiviHosting has posted this message on their website:

> **CiviCRM Bug With MySQL 5.7**
>
> As you can read in MySQL's site:
>
> MySQL 5.7.5 and later enforces a maximum length on lock names of 64 characters. Previously, no limit was enforced.
>
> The problem is that CiviCRM sometimes generates "lock names" longer than 64 characters. When that happens, CiviCRM will not work at all with MySQL 5.7.
>
> The fix is here:
>
> https://issues.civicrm.org/jira/browse/CRM-17846
>
> and so CiviCRM 4.7.7 and later versions and also CiviCRM 4.6.16 and later "LTS" versions have this fix.
>
> (Please note that this issue https://issues.civicrm.org/jira/browse/CRM-18439 is not relevant at all--our servers do not have this problem of sql\_mode=only\_full\_group\_by".)
> 0 votes

# Answer
All affected CiviCRM installs on CiviHosting's servers were patched following the MySQL upgrade. Sometimes there are conflicts between server-side software security and functionality of **old** CiviCRM versions and a judgment call must be made to determine what is most important.

CiviHosting's policy is to put security first, always.

CiviCRM users are always encouraged to keep their installs up to date.
> 0 votes

---
Tags: mysql
---


title: How do I use profiles to update records

text:
# Question
Title: How do I use profiles to update records
I have 100 surveys filled out by people already on my database. I want to enable a volunteer to be able to enter these by making available to them only the fields they need to do the data entry. I have created a profile which has a listings view and which is searchable; I have limited the profile to the group in which the 100 contacts are found. So I can find the contact and I get the option to view just the fields I am interested in, but there is no edit option and no inline editing available. Is it possible to do what I want? If yes how would I go about it? Thanks

# Answer
If you have the profile created, you are nearly there. You need the `Update Multiple Contacts` search action. (In 4.6 the action is `Batch update via Profile`). The action has a limit of 100 contacts so you can update all your surveys in one go, but if you have more than 100 you need to do multiple passes.

In more detail:

* Go to Search \> Find Contacts
* Select your Group in the 'in' box
* Search
* Scroll to the bottom, change Rows per page to 100, enter
* Click the tickbox next to the Name header to select all the records on that page
* In the Actions box, select 'Update Multiple Contacts'
* On the next screen, select your profile
* Continue
* You should now have your fields editable
* Note that you can copy the value in the first row to all the others by clicking the symbol in the column header

When you're done with that 100, go back to the search, go to the next page and repeat for the next 100 etc

FYI, for these purposes, the profile does not need to be marked as a listings view, or searchable or be limited to your group. Those options are for other uses of profiles.
> 4 votes

---
Tags: profile
---


# Question
Title: How do I turn off the "Contribution amounts section" for a membership only contribution page?
Using 4.7.18 and Wordpress 4.7.4, on my contribution page that I want to configure as a membership only sign-up page, I untick the checkbox labelled "Contribution Amounts section enabled" on the 'Amounts' tab of the contribution page set-up wizard. However, after saving the page, if i then go pack in I see that this field is once again ticked.

I've just repeated this on http://wpmaster.demo.civicrm.org and got the same result. It looks like this is a bug.

Update: now logged as an issue here: https://issues.civicrm.org/jira/browse/CRM-20495

# Answer
> 1 votes
I see the same thing on Drupal/CiviCRM 4.7.18 - but it looks like the checkbox only gets checked again -\> when you go into the Config. That is you can still uncheck it and Save it and have a Membership only Contribution form with no additional amounts. For some reason it defaults to ON now on edit of the contribution form config. Definitively a bug - and a regression \[this was for sure working previously\].

---
Tags: wordpress, civicontribute, civimember
---


# Question
Title: Need help upgrading 4.4.5 to 4.7.18 0n Ubuntu 16.04 server with PHP 7 on Drupal 7
The VPS host running Drupal/CiviCRM was upgraded from Ubuntu 14 LTS to 16 LTS. That ran without error. However, that upgrade came with PHP7. immediately after the upgrade all three CiviCRM sites experienced The following Drupal Log error:

"ParseError: syntax error, unexpected 'clone' (T\_CLONE), expecting '(' in require\_once() (line 1 of /var/www//sites/all/modules/civicrm/packages/DB/DataObject.php(207) : eval()'d code)."

After disabling CiviCRM on all three sites the error cleared.

Per CRM-17789 PHP 7 compatibility comes with CiviCRM 7.12. Upgrade of 4.4.5 site tto 4.7.18 was attempted. However, now "http://www..com/civicrm/upgrade?reset=1" produces the following: "ERROR: The website encountered an unexpected error. Please try again later."

Apparently, the installation with the CiviCRM module enabled was not a fix. This was tried several times after clearing the browser cache ... and in more than one browser with an open admin session set-up before the upgrade.

Is there a way around short of a new install of CiviCRM?

The other two sites are currently running 4.1.2 and 4.2.8. No CiviCRM upgrade has been attempted on these

Thanks,

TJH43

# Answer
Does your VPS let you choose the version of PHP? If so, downgrade the version of PHP, upgrade CiviCRM, reset the PHP version.

Alternatively you could copy your installation to another server with older PHP, upgrade CiviCRM there and then transfer back to your VPS.

Since you have attempted an upgrade your system may be in a partially upgraded state. You should start from the database dump and software tree that was backed up before the Ubuntu upgrade.

If you want to copy to another server, be sure to follow the instructions at Moving an Existing Installation to a New Server or Location. You may want to get some help if those instructions look daunting.
> 2 votes

---
Tags: upgrade, php, php7
---


# Question
Title: Migrate Wordpress installation to new server
I am having crazy trouble moving my CiviCRM/Wordpress installation from one server to another.

I don't have many customizations, and we are a young organization, so I am OK with whatever solution gets my contacts and contributions to the new server, whether it's a complete copy or a fresh install and some sort of import. I think I would even be fine migrating to Drupal if it makes things easier (I have experience with Drupal sites as well), since that seems to be the most popular setup.

I have followed the instructions on the wiki, and read a few dozen other articles and threads, but everything I find relates to Drupal and the steps don't seem to line up to Wordpress...something always goes wrong.

I am able to get a new working copy of CiviCRM going but when I import my DB it breaks, and I get errors like this:

> Sorry but we are not able to provide this at the moment. DB Constraint Violation - dashboard\_id should possibly be marked as mandatory for DashboardContact,get API. If so, please raise a bug report.

I tried exporting using phpMyAdmin, including "disable foreign key constraint checks" and "Add drop table" and other combinations of options...nothing seems to work.

I'm not sure what I'm doing wrong, and would appreciate a little hand.

Some details: \- My current install is at 4.7.7 \- CiviCRM shares a database with Wordpress

# Answer
The instructions here how to back up databases using phpMyAdmin used to work for me. The author wrote:

> “Disable foreign key checks” isn’t always necessary. I do a lot of CiviCRM work. Restoring a CiviCRM database will fail unless this option is enabled in your export.
> 1 votes

# Answer
In one instance when I hit this, it was a site that had been copied over but not fully configure and then ignored for a while, during which time the live site had an upgrade, and hence the code had changed. To bring it back to life I then did a git pull.

I then started getting the above error. And finally clicked that I needed to run civicrm/upgrade.

Just posting in case it helps others some head scratching.

Have asked one of our team if we can get the error message modified to include the 'check if you need to run a database update' in case the helps too.
> 0 votes

---
Tags: wordpress, migration
---


# Question
Title: CiviCRM 4.7 - DB Constraint Violation - possibly dashboard_id should possibly be marked as mandatory for this API
We have moved our hosting to new hosting provided (CiviHosting). CiviHosting installed a fresh installation of CiviCRM 4.7. We then imported our previous sql dump from our old site which also had been upgraded to 4.7. The import was done via c-panel. After the import, we get this error when running CiviCRM:

CiviCRM\_API3\_Exception: "DB Constraint Violation - possibly dashboard\_id should possibly be marked as mandatory for this API. If so, please raise a bug report."

```
#0 /home/iskcon/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/Dashboard.php(125): civicrm_api3("DashboardContact", "get", (Array:5))
#1 /home/iskcon/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/Dashboard.php(158): CRM_Core_BAO_Dashboard::getContactDashlets()
#2 /home/iskcon/www/www/wp-content/plugins/civicrm/civicrm/CRM/Contact/Page/DashBoard.php(47): CRM_Core_BAO_Dashboard::getContactDashletsForJS()
#3 /home/iskcon/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(312): CRM_Contact_Page_DashBoard->run((Array:2), NULL)
#4 /home/iskcon/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:13))
#5 /home/iskcon/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:2))
#6 /home/iskcon/www/www/wp-content/plugins/civicrm/civicrm.php(1227): CRM_Core_Invoke::invoke((Array:2))
#7 [internal function](): CiviCRM_For_WordPress->invoke("")
#8 /home/iskcon/www/www/wp-includes/plugin.php(524): call_user_func_array((Array:2), (Array:1))
#9 /home/iskcon/www/www/wp-admin/admin.php(222): do_action("toplevel_page_CiviCRM")
#10 {main}

```

How do we go about importing our previous database to the new installation? I would appreciate a simplified explanation of the steps to resolve this.

# Answer
> 7 votes
Maybe you can try to run the upgrade script again to go from 4.7.10 to 4.7.12

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

```

Documented on the Wiki Upgrading CiviCRM for Wordpress .

# Answer
> 0 votes
This wiki page https://wiki.civicrm.org/confluence/display/CRMDOC/Moving+an+Existing+Installation+to+a+New+Server+or+Location explains how to move to a new server.

You should use exactly the same version of civi on your old and new servers and then upgrade after you have completed all the steps in the above article.

# Answer
> 0 votes
As mentioned on another ticket this error can happen if you haven't run civicrm/upgrade

---
Tags: upgrade, import, database
---


# Question
Title: CiviCRM cron job failing under Joomla 3.7
I updated to Joomla 3.7 and shortly thereafter, my CiviCRM cron job started failing. When I hit the URL in a browser, I get:

> Fatal error: Call to a member function get() on null in /home/public\_html/libraries/joomla/session/handler/joomla.php on line 71

That's PHP 5.6.30 and it's a little different on PHP 7.0.16 (with max reporting on):

> Error displaying the error page: Application Instantiation Error: Call to a member function get() on null

I'm using CiviCRM 4.7.18. This looks like a CiviCRM issue since my other cron job works fine.

# Answer
It is not a civi issue - it is a joomla issue that impacts other modules as well the fix is in j 3.71 It is a 6 line patch and 1 line deletion

I have tested it and it works if you want to patch it yourself

https://github.com/joomla/joomla-cms/pull/15605
> 3 votes

---
Tags: joomla
---


# Question
Title: Are other Joomla users having problems with the Pay Later options?
This was reported as fixed in either 4.7.8 or 4.7.9, but has not worked for me on a Joomla site since 4.7.10 at least. I've had to revert to creating two separate menu items for membership, one with Pay Later, and one with credit card processing in order to provide a method of payment for those who do not wish to use PayPal or any online payment system.

Now that its time for the annual convention, I've had to create two separate events to allow for the same issue.

I reported this back in February on JIRA as CRM-20057, but nothing has been done and evidently there has been no verification of the issue. I can't test this on the Joomla demo site as the Joomla demo is running 4.6.18, and also shows other issues.

So ... IS anyone else having problem with Pay Later ???

AND ... WHY can't someone update the Joomla demo to the latest 4.7 release so we can verify whether its a local issue or not.

# Answer
I'm not going to say Joomla is a second rate citizen, but it is by far, the least used cms of the three big ones, by people that use CiviCRM. It is the only one I use on a regular basis, so don't get me wrong, I'm not talking it down. I think the answer though is basically going to come down to if you what the demo site updated, you are going to need to ask how you can update it for others to be able to use. I tend to find that, while there are a could of us that use Joomla a lot and try to support it, if I want an integration with Joomla or a feature or whatever, I need to own that and make it happen.

As for the pay later, I don't think I've used that in 4.7, but I do have it installed, so if I can test something out, I'd be happy to. even if you just wanted me to create a blank Joomla 3.7 (just dropped today) and install the latest CiviCRM for you to be able to test on, I'd be willing to do that. In MatterMost, you can reach me @rtobias81, or just comment here and eventually I'll get an alert.
> 1 votes

# Answer
Nope having this same problem on Drupal and civi as well. civi 4.7.16 and Drupal 7.52 I had to turn off PAyLater - I am using stripe as well
> 0 votes

---
Tags: joomla, paylater
---


# Question
Title: CiviCrm Custom Fields - Random Number Generation
Is there anyway to generate a random number using Custom Fields in Civi. any Ideas would be greatly appreciated

# Answer
There is no built-in way to do that, but it would be an easy extension. Could you give a bit of background about how you would use the random numbers?
> 1 votes

---
Tags: custom-fields, civicrm-home
---


title: What is the Path for LTS? 4.7?

text:
# Question
Title: What is the Path for LTS? 4.7?
We have our production site on 4.6, the current LTS. I'd like to know what the thoughts are on the next version of LTS. Will it eventually be 4.7? Approximately when might that switch happen?

If there is a page already sharing this information, apologies, I couldn't find it.

# Answer
> 6 votes
The LTS as you know it is the last one!

Eileen explained the details here: https://civicrm.org/blog/eileen/the-lts-going-forwards

Essentially the idea is that through better release/QA/testing we can make the current 4.7 the Long Term Stable release. In combination with the fact that innovative ideas / new features are going to be housed in extensions.

---
Tags: upgrade, lts
---


# Question
Title: Profiles list not showing in dropdown list in Online Registration tab of Configure Event
When we configure a new event, we add a profile (create) that has fields selected from the Individual list of fields. We give the profile a name, save it.

In the Include Profile (top of page) dropdown list, we can see the name of the profile and everything is OK.

We save the event and want to edit it again and go back to the Online Registration tab.

Now we don't see the name of the profile linked to this event. We can click on the dropdown list and there is nothing in it. If we click preview on the right, we can see the profile and the fields. We can also edit it.

We use civicrm 4.7.18 with Joomla 3.6.5.

Anyone knows why we would have this behavior.

The reason it is a problem is that we can't create an event and use a previous profile so we have to create a new one each time which is time consuming. A save as in the profile creation or edit there would help.

It looks like civicrm 4.7.18 has completely changed the tables linked to profiles and event management.

# Answer
After more investigation, the problem is solved using the fix from agh1 (thanks to him by the way).

It looks like a problem in the civicrm code using jquery.

Here is the url of the fix. We tested it and it works.

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

I hope this will be in the next civicrm release code.
> 1 votes

---
Tags: civievent, profile, joomla
---


# Question
Title: Form to partially pay for Event Attendance
I want to create a payment form to allow users to pay towards someone's event attendance.

Given a Contribution ID, how can I create a link to a page that will accept payments towards that Contribution?

Do I have to do this through Personal Campaign Pages, or is there a way without that overhead?

JohnFF

# Answer
> 0 votes
To add a Payment to an existing Event Registration:

URL = /civicrm/payment?action=add&reset=1&component=event&id=88&cid=101

where cid = contact\_id; and id=participant

There is a tiny button -\> submit credit card payment -\> but I don't think it's a public link (perhaps you can work the permissions)

# Answer
> 1 votes
You could use *Line Items*. Create a *Price Set* with the Attendee Name(s)/Contribution Id(s) that you would like to have available for people to help pay. Donors can enter the amount they want to give toward specific attendee(s). You will have to manually apply these contributions to the attendee's event fee. We do this for tuition here https://radiusinternational.org/paytuition/

The other way to do this is to use *Contribution Notes* via *Profiles*. Then the donor would just write in the name that they want to have the money applied to. The downside here is the limited placement of Profiles on the contribution page. Neither of the 2 placement options really puts the *Notes* anywhere logical in relation to giving form. The *Notes* are not next to the contribution label so then you have to add a description telling donors where to find the Notes further down the page.

# Answer
> 0 votes
I think that since you are asking about having A pay for B's attendance, then yes PCP is the way to go. Will depend on just how many As and how many Bs you expect to be using the system

---
Tags: civievent, personal-campaign-pages, payment
---


# Question
Title: Is an SPF Record required to get CiviCRM to work with Amazon SES? (1and1 hosting)
The Amazon SES account is verified. I have sent emails from gmail using an alias that is the same address I'm using in CiviCRM, and the emails originating from gmail were delivered. But when I send a test email from Administer \> System Settings \> Outbound Email I consistently get a timeout error, like this:

```
Mail Not Sent
  Sending test email. FROM: info@mysite.org TO: verified@gmail.com.
  No test mail has been sent.

  An error occurred when CiviCRM attempted to send an email (via SMTP).

  The mail library returned the following error message:
  Failed to connect to ssl://email-smtp.us-west-2.amazonaws.com:587 [SMTP:
  Failed to connect socket: Connection timed out (code: -1, response: )]

```

Trying to figure out what the problem might be. I'm wondering if I might need an SPF record for my domain (mysite.org in the example above)?

# Answer
An SPF record is recommended, but not the cause of the above error.

That error message indicates failure to make a network connection from CiviCRM's mail library to the configured SMTP server.

According to http://docs.aws.amazon.com/ses/latest/DeveloperGuide/smtp-connect.html, port 587 is for STARTTLS connections. ("TLS" is an overloaded term used in a confusing sense here, don't sweat it.)

It looks like you currently have a value of `ssl://email-smtp.us-west-2.amazonaws.com:587` in your Admin \> System Settings \> Outbound Email \> SMTP Server field.

I suggest you try using the following - please report back if one or both work?

* `tls://email-smtp.us-west-2.amazonaws.com:587`
* `ssl://email-smtp.us-west-2.amazonaws.com:465`

I see that for optimal performance, Palante recommend using a local Postfix MTA which then routes email to Amazon SES. Make special note of the SMTP throttling warning at the bottom of that page.
> 1 votes

---
Tags: smtp, amazon-ses
---


title: typo in packages/Net/SMTP.php

text:
# Question
Title: typo in packages/Net/SMTP.php
I think there is a typo on line 692 of wp-content/plugins/civicrm/civicrm/packages/Net/SMTP.php

`mMethod` should be `method` in the last line below, yes?

```
if (is_array($callback)) {
            if (!is_object($callback[0]) || !is_string($callback[1]))
                return PEAR::raiseError('Bad mMethod callback array');
        }

```

Should I fork the `civicrm-packages` repository, make the change there and submit a pull request?

Or is CiviCRM getting this code from elsewhere, and it would be more useful to make the change in the original source repo?

# Answer
Yes you should fork the repo and create a pull request against the Master branch which i assume is the branch with the issue. Please see this documentation on contributing to CiviCRM https://wiki.civicrm.org/confluence/display/CRMDOC/Contributing+to+CiviCRM+using+GitHub
> 2 votes

---
Tags: wordpress, smtp
---


title: Civireport vs Views

text:
# Question
Title: Civireport vs Views
What is the best practice between CiviReport and Views ? (Except the fact than Views enables to order the columns, which CiviReport does not)

Why and when should we use one rather than the other ?

# Answer
A basic difference is that CiviReport is CMS-independent whereas Views is a Drupal module so those running WordPress or Joomla don't have that choice. (Yes, OP knows that ... some readers might not!)

In part, it depends on who is setting up the reports/views:

* For end-users, using the configuration tabs to adjust the output is easier than adding fields and filters via the Views UI. But the simplicity has limitations - you can't determine the order of fields in a report, you can only select the fields that have made available by the report author etc.
* For site-builders, Views offer more configurability without code.
* For developers, custom reports can make it easier for end-users to tweak their own reports and code-level data manipulation allows more complex presentation of data.
> 4 votes

---
Tags: civireport, drupal-views
---


# Question
Title: Where is the exact path to the ConfigAndLog log *file*?
In the latest awesome pattern we can now locate our log service easily:

```
Civi::log()->info('Hello, log!');

```

And then we can tail the log which is in our `ConfigAndLog` directory. Chris has enumerated the other log files around and Jon has described where to find the directory in different CMS's but I need to have a one liner to point me directly at the current log file.

For me, right this second, it is:

`/opt/buildkit/build/dmaster/sites/default/files/civicrm/ConfigAndLog/CiviCRM.e6449e3815b7721f267195e2.log`

How do I find this next time without having to go hunting around? Ideally I'm after a `cv` based one-liner.

# Answer
> 1 votes
Found it!

The log file is named by `CRM_Exception::generateLogFileName($prefix);` in `civicrm/CRM/Core/Error.php`.

# Answer
> 0 votes
Based on your comment,

```
cv ev 'CRM_Core_Error::createDebugLogger(); return \Civi::$statics['CRM_Core_Error']['logger_file'];'

```
* Might run into trouble with bash treating the square brackets as wildcards when using double quotes as above?
* `CRM_Core_Error` not `CRM_Exception` worked for me.

Not sure what you're using this for, but an easier path might be to use wildcards. When developing I tend to just

```
tail -f sites/*/files/civicrm/ConfigAndLog/*log

```

and similar when collecting logfiles to some central service.

---
Tags: php, logs, debugging
---


# Question
Title: Configuring CiviCRM for 1and1 email limits
1and1 hosting says: Using the 1&1 mail server, you can send a message with no more than 100 recipients at one time and no more than 200 within five minutes. Please allow 10 seconds between sending e-mail messages.

The 100 batch can be configured in CiviMail, but is there a way to configure "no more than 200 within five minutes" ?

# Answer
At **Administer \> CiviMail \> Mailer Settings** (`civicrm/admin/mail`) you can configure how many mail go out in each mail run. Limit the batch to 100 per run.

Combining your cron schedule with **Administer \> Settings \> Scheduled Jobs** (`civicrm/admin/job`), you can control the **Run Frequency** for task **Send Scheduled Mailings**. The options for the this are "every time" or "hourly" (or larger intervals), so you probably want to set "every time" here, and then configure the cron task to be called every three minutes or more.

Scheduled jobs in CiviCRM (documentation) are triggered by an external task, for 1and1 customers via SSH to the hosting account. This is where you'll most likely dictate the frequency at which your scheduled jobs may be run.

With all that done, your CiviMail should stay under the limits ... unless additional emails are generated as well. What happens if you hit that limit - say if your CRM is partway through a mailout - and a donor's receipt or password reset email gets trashed for being email number 101 or 102? It might not be likely, but only your org can decide if it's acceptable, and you'll never know for sure how much buffer to allow.

So, the above configuration can mostly avoid hitting 1and1's limits. But ... please see my other answer :)
> 1 votes

# Answer
*Disclosure: my employer offers hosting, so I have a horse in this race. But I'm not here to sell you our services.*

**Get a hosting environment which supports what you want to do.** Rather than adjusting your CRM to fit your hosting environment, you should adjust your hosting to fit your needs. I've genuinely seen people spend thousands of dollars on development and tweaking trying to make budget hosting environments work, and it's painful to watch.

It's possible 1and1 do have a plan that supports using CiviMail, so do ask what your options are with your existing host. If they don't, there are plenty of hosting environments that do, and there's a list of them on the civicrm.org website: https://civicrm.org/hosting-providers
> 1 votes

---
Tags: civimail, email
---


# Question
Title: Exception: Serialization of 'Closure' is not allowed in serialize() using CiviCRM with Omnipay & Mollie
I run into an error I cannot explain (I lack the skils) where I can use the help of the community.

I;m trying to get the Mollie payment provider working with Omnipay Multiprocessor extension.

When I submit a paid event registration I get a fatal error with:

```
Exception: Serialization of 'Closure' is not allowed in serialize()
(line 156 of CRM/Core/BAO/Cache.php).

```

The line from that file it stumbles upon is:

```
public static function setItem(&$data, $group, $path, $componentID = NULL) {
(...)
$dataSerialized = serialize($data);

```

When I put some debug code into that file I get the content of $data:

```
Array
(
    [defaults] => Array
        (
        )

    [constants] => Array
        (
        )

    [values] => Array
        (
            [Register] => Array
                (
                    [qfKey] => 60b217c8aa3b27fef940a9e5e9b7fb55_7233
                    [entryURL] => https://www.ourdomain.nl/civicrm/event/register?reset=1&id=1
                    [first_name] => iemand
                    [last_name] => eennaam
                    [email-Primary] => user@localhost.net
                    [hidden_processor] => 1
                    [scriptFee] =>
                    [scriptArray] =>
                    [additional_participants] =>
                    [priceSetId] => 7
                    [price_8] => 16
                    [payment_processor_id] => 3
                    [bypass_payment] =>
                    [_qf_default] => Register:upload
                    [MAX_FILE_SIZE] => 134217728
                    [_qf_Register_upload] => Continue
                )

            [Confirm] => Array
                (
                    [qfKey] => 60b217c8aa3b27fef940a9e5e9b7fb55_7233
                    [entryURL] => https://www.ourdomain.nl/civicrm/event/register?reset=1&id=1
                    [_qf_default] => Confirm:next
                    [_qf_Confirm_next] => Continue
                )

            [ThankYou] => Array
                (
                )

        )

    [valid] => Array
        (
            [Register] => 1
            [Confirm] => 1
            [ThankYou] =>
        )

    [_qf_button_name] => _qf_Confirm_next
)

```

I lack the skills and knowledge to understand why this throws the 'Exception: Serialization of 'Closure' is not allowed' error. Anyone who spots the problem or has a clue to find an answer?

(php 7.0 but also with 5.6 / civicrm 4.7.14 / drupal 7.53)

# Answer
The answer appears to be that something is getting put in the session by the omnipay code that the CiviCRM caching code doesn't like. Here's the issue that describes the full details:

https://github.com/eileenmcnaughton/nz.co.fuzion.omnipaymultiprocessor/issues/17

And here's a patch Eileen includes that seems to have solved the issue:

https://github.com/eileenmcnaughton/nz.co.fuzion.omnipaymultiprocessor/commit/933806960e1a4c5968e9e6145feffb79eb77b415

FWIW - most of the thread is involved in getting good debug info.
> 3 votes

---
Tags: civievent, omnipay, mollie
---


# Question
Title: How can I customise site search settings to use a wildcard for a specific entityRef field?
Is it possible to override the site search settings with respect to the wildcard search, for a specific entityRef field?

We have the site search setting configured with wildcard search disabled. On a particular custom form I'm injecting an entityRef field using the API to filter by Individual and group. I'd like to override that site setting and allow this to use a wildcard search.

# Answer
Currently no, it cannot be overridden on a per-field basis. But I could add a core patch to do so if your organization can fund a couple hours work.
> 1 votes

---
Tags: api, entityref
---


title: Can't set 'Force Secure URLs'

text:
# Question
Title: Can't set 'Force Secure URLs'
Civi 4.4 still w/WP 4.7 (which is using https/secure URLs w/a plugin 'https') - I tried setting base url to 'www.mysite.org' as opposed to 'mysite.org' and saving but my change isn't saved. FYI I am using https: in effect for all civi pages, but I can't seem to set this in Admin settings. My .htaccess file allows for www or not

# Answer
You almost certainly want to upgrade your version of CiviCRM at least to 4.6, due to security concerns.

If you're already forcing https for all Civi pages via WP (or via apache/.htaccess, or any other mechanism), then there's no point in setting it in CiviCRM.

The base url setting is likely hard-coded into your civicrm.settings.php file, you'll want to change it there.

In general, having a consistent version of your domain is a good thing, for lots of reasons (SEO and caching are the two main ones).
> 1 votes

---
Tags: admin
---


# Question
Title: Adding a contact profile to a contribution page (user registration)
I have been searching the database for this kind of error but was unbale to get it solved thus far.

I am trying to add a contribution page for users to sign up. I have defined two main user groups: members and administrators. Contact types as in the picture:

And I want to add a profile "basic profile" to the sign-up including some custom set of fields, which I have defined as follows:

If I want to add it to the contribution page, not even the drop down is visible, and it seems like a display error, but I have tried it on multiple browsers and the problem persists. I reckon it must be some sort of definition error which makes no profile pop up in my contribution page. But where is the faulty definition?

Thank you very much for your help, appreciate it! I am using wordpress 4.12.1

Best regards Joël

# Answer
It sounds like the problem is the one described here: Backbone isn't loading on Civi 4.6.11/WP 4.4.1

Please try changing your theme to the default theme, which doesn't conflict with Backbone. If you find that this solves the problem, you can follow the instructions on the other question on dequeuing Backbone from your WordPress theme.
> 1 votes

---
Tags: wordpress, civimember, profile, contribution-page, registration
---


title: Install Mosaico in Windows

text:
# Question
Title: Install Mosaico in Windows
I would like to install the Mosaico extension in a Windows server. It's possible? If yes there is a windows equivalent to setup.sh batch? Thanks

# Answer
> 2 votes
Is it possible? Yes, Mosaico is a client-side Javascript library that runs in the browser. It needs a PHP backend that runs on Windows.

Is it easy? No. Your starting point the setup.sh script runs only on Unix. However, it is not very complicated so that you can try executing the actions manually. But it is dependent on tools like git, npm and grunt, which are not standard on Windows. I expect they can al be installed on Windows, which is in a way make the machine more like Unix (you can even install Cygwin if you want to run the setup script.

Maybe the best way start with a Unix machine and get it working. The next step is to copy the extensions and the package directory to your Windows deployment server.

# Answer
> 3 votes
The setup.sh is only necessary to build Mosaico, since it's still in beta. You don't need it to actually run Mosaico. Just download a pre-built version here: http://dist.civicrm.org/extension/uk.co.vedaconsulting.mosaico/latest/uk.co.vedaconsulting.mosaico-latest.zip

---
Tags: mosaico
---


# Question
Title: Send an Email When Tag is Applied - or When Added Automatically to a Smart Group
I'm looking to set up a series of drip emails once a contact is tagged. Unfortunately, the rules around tagging are convoluted to the point where I'm afraid to use them since I have the potential to send an email out to many people who I don't wish to receive the email. There are also no instructions regarding how to trigger an action using tags.

Because of this, I created a rule indicating that when a contact is added to a smart group, which occurs when they are tagged, that they will receive an email. And an email is sent when I add a contact manually, but not when it is done automatically via the smart group rules.

Goal: to send a contact an email once they've been tagged.

# Answer
You should be able to do what you're describing using CiviRules. However, to be safe, I would start by testing with an action other than sending email - or at least do it on a test server that redirects emails to the logs rather than sending live emails.

Here's a screenshot that shows how to set up what you're describing. Note the trigger ("Tag added to entity") and linked condition ("Contact has tag").
> 2 votes

# Answer
Not sure if the best approach, but you could probably set up a cron job with a script that checks all activities for the past 5 minutes (whatever time interval you set your cron job to run). But that approach would definitely take some scripting. I don't know of any build in options yet (though maybe someone created an extension to do something similar?).
> 0 votes

---
Tags: smartgroups, civirules, tags
---


# Question
Title: Using data from CiviCRM to change filename
Here is what I need to do:

The user uploads an image, and I need to change the filename of the image to be firstname\_lastname.filtype.

The first and lastname are stored within CiviCRM, but the upload is occuring in Drupal 7.

I'm thinking I need to write some PHP that pulls in the data from CiviCRM, and then sets it as the file name.

I'm still pretty new to Civi, can anyone give me some guidance on how I could go about doing this? How can I pull in the data from CiviCRM?

Or, is there a way to use CiviCRM tokens inside of Drupal?

# Answer
I am assuming that you are a drupal coder (because the upload starts in Drupal). Information from CiviCRM can be used in Drupal by using the CiviCRM. This is documented in the Developer Guide.

An example for finding the first and last name of the current user in drupal is

```
$uid = $GLOBALS['user']->uid;   // get id current user

civicrm_initialize(); // needed for classloading

/* find the CiviCRM contact id using the drupal user
$contact_id = civicrm_api3('UFMatch', 'getvalue', array(
  'return' => "contact_id",
  'id' => $uid,
));

/* use contact id to find contact details */
$result = civicrm_api3('Contact', 'getsingle', array(
  'id' => $contact_id,
));

/* create the file name */
$file_name=$result['first_name'].'_'.$result['last_name'];

```
> 2 votes

---
Tags: drupal, api, php
---


# Question
Title: Unable to add Event Participants backend
I am trying to add event participants back end through Events-\>Register Event participants. I am getting this error,

"Profile search, view and edit are not supported for Profiles which include fields for more than one record type." Civicrm version 4.6.8.

There are two profile fields configured in the event with fields of type 'individual' and 'contact'.

Any help can be appreciated. Thanks in advance.

# Answer
That sounds familiar, I recall some issues similar to what you are reporting (i.e. that message coming up in a misleading way).

I'd try upgrading to a more recent 4.6.x to see if that fixes it (you're going to want to do that for security reasons in any case). The 4.6.x series is reasonably stable, there isn't usually any reason not to upgrade.
> 1 votes

---
Tags: civievent, profile, registration
---