Problem with online registration after moving to new URL I recently replaced my multisite Wordpress site with a new one that I built on a subdomain. The new one is a simple, one domain site. Everything is working properly, including the Civicrm that I was using with my old site except for the online registration for CiviEvent.

When someone clicks on a link to register for an event, instead of going to the register page:
http://newsite/?page=CiviCRM&q=civicrm/event/register&reset=1&id=numberofevent

it defaults to the info page:
http://newsite/?page=CiviCRM&q=civicrm/event/info&reset=1&id=numberofevent

and gives this error message:
Sorry but we are not able to provide this at the moment.
You do not have permission to access this page

Hint: when I go into the Wordpress admin area of the site on a specific browser, I can get the links to take me to the registration page without a problem.

Two more points:
When it defaults to the info page with error message, the "/" turns to "%2F"

Also, the same problem occurs for profiles. when I use the "Profile Create Mode" to view the profile, it works on the browser where I am logged in, but on a browser where I am not logged in, I get an error message:

Sorry but we are not able to provide this at the moment.
The requested Profile (gid=numberofprofile) is disabled OR it is not configured to be used for 'Profile' listings in its Settings OR there is no Profile with that ID OR you do not have permission to access this profile. Please contact the site administrator if you need assistance.

Can you make sure that anonymous users have been given the permission to register for events and create/edit profiles.

On install, CiviCRM creates an anonymous user role if one currently does not exist. Ensure you have this role in your WP permissions page.


How to have form not require billing address if zero fee in priceset is selected in Event? Using CiviEvent, I have an event with a priceset that includes various prices, but also a zero fee option.  The billing block information should not be required if zero fee is selected, but I can't get it to work.

I am open to ideas for workarounds.  I am not able to upgrade the CiviCRM version at this point.

On the web event registration form, before clicking continue:

If a non-zero fee is selected, the billing block correctly appears
and shows as required to fill in if Paypal not selected.
If the zero fee is selected, the billing block correctly does not appear.

BUT

When the user clicks the continue button after selecting the zero-fee option, an Error message comes up about fields in the billing bock being required.  This is despite the billing block  not being shown to the user (correctly as there should not be shown when zero fee).

For the first-time click, it also includes billing firstname/lastname, which I would expect to be taken from the Individual firstname/lastname that were filled in

If I click the continue a second time, it no longer mentions billing firstname/lastname, but it still shows some billing block fields as being required.

Billing First Name is a required field.
Billing Last Name is a required field.
Street Address is a required field.
City is a required field.
State/Province is a required field.
Postal Code is a required field.
Country is a required field.

The second time:

Street Address is a required field.
City is a required field.
State/Province is a required field.
Postal Code is a required field.
Country is a required field.

I have version 4.6 so it might the bug below, but I am not sure.
Zero fee for a paid event

thanks,
Michele

Sounds like https://issues.civicrm.org/jira/browse/CRM-16929.
You might need to apply the 3 patch that were submitted to this issue -

https://github.com/civicrm/civicrm-core/pull/7191
https://github.com/civicrm/civicrm-core/pull/7286
https://github.com/civicrm/civicrm-core/pull/7289

The first two are pretty longer patch so not sure if they will be applied directly. Recommendation is to upgrade CiviCRM to the latest version.


Export all contacts using SQL Query I want to export all contacts with all field values through SQL.

I'm not able to export from CiviCRM, it throwing 504 Gateway timeout error.

What will be the SQL query?

It is little difficult to provide sql for contact export as it is has many tables joins. The basic query to fetch all primary details is pasted below. The output may not be same as what you get in exported file because some of the options are converted from value to label using php and also the query is not joined with the custom data table as the table name may vary because they are generated dynamically.

SELECT contact_a.id as contact_id, contact_a.contact_type as `contact_type`, contact_a.contact_sub_type as `contact_sub_type`, contact_a.sort_name as `sort_name`, contact_a.display_name as `display_name`, contact_a.do_not_email as `do_not_email`, contact_a.do_not_phone as `do_not_phone`, contact_a.do_not_mail as `do_not_mail`, contact_a.do_not_sms as `do_not_sms`, contact_a.do_not_trade as `do_not_trade`, contact_a.is_opt_out as `is_opt_out`, contact_a.legal_identifier as `legal_identifier`, contact_a.external_identifier as `external_identifier`, contact_a.nick_name as `nick_name`, contact_a.legal_name as `legal_name`, contact_a.image_URL as `image_URL`, contact_a.preferred_communication_method as `preferred_communication_method`, contact_a.preferred_language as `preferred_language`, contact_a.preferred_mail_format as `preferred_mail_format`, contact_a.hash as `hash`, contact_a.source as `contact_source`, contact_a.first_name as `first_name`, contact_a.middle_name as `middle_name`, contact_a.last_name as `last_name`, contact_a.prefix_id as `prefix_id`, contact_a.suffix_id as `suffix_id`, contact_a.formal_title as `formal_title`, contact_a.communication_style_id as `communication_style_id`, contact_a.email_greeting_id as email_greeting_id, contact_a.postal_greeting_id as postal_greeting_id, contact_a.addressee_id as addressee_id, contact_a.job_title as `job_title`, contact_a.gender_id as `gender_id`, contact_a.birth_date as `birth_date`, contact_a.is_deceased as `is_deceased`, contact_a.deceased_date as `deceased_date`, contact_a.household_name as `household_name`, IF ( contact_a.contact_type = 'Individual', NULL, contact_a.organization_name ) as organization_name, contact_a.sic_code as `sic_code`, contact_a.user_unique_id as `user_unique_id`, contact_a.employer_id as `current_employer_id`, contact_a.is_deleted as `contact_is_deleted`, contact_a.created_date as `created_date`, contact_a.modified_date as `modified_date`, contact_a.addressee_display as addressee_display, contact_a.addressee_custom as addressee_custom, contact_a.email_greeting_display as email_greeting_display, contact_a.email_greeting_custom as email_greeting_custom, contact_a.postal_greeting_display as postal_greeting_display, contact_a.postal_greeting_custom as postal_greeting_custom, IF ( contact_a.contact_type = 'Individual', contact_a.organization_name, NULL ) as current_employer, civicrm_address.id as address_id, civicrm_location_type.id as location_type_id, civicrm_location_type.name as `location_type`, civicrm_address.street_address as `street_address`, civicrm_address.street_number as `street_number`, civicrm_address.street_number_suffix as `street_number_suffix`, civicrm_address.street_name as `street_name`, civicrm_address.street_unit as `street_unit`, civicrm_address.supplemental_address_1 as `supplemental_address_1`, civicrm_address.supplemental_address_2 as `supplemental_address_2`, civicrm_address.supplemental_address_3 as `supplemental_address_3`, civicrm_address.city as `city`, civicrm_address.postal_code_suffix as `postal_code_suffix`, civicrm_address.postal_code as `postal_code`, civicrm_address.geo_code_1 as `geo_code_1`, civicrm_address.geo_code_2 as `geo_code_2`, civicrm_address.manual_geo_code as `manual_geo_code`, civicrm_address.name as `address_name`, civicrm_address.master_id as `master_id`, civicrm_address.county_id as county_id, civicrm_address.state_province_id as state_province_id, civicrm_address.country_id as country_id, civicrm_phone.id as phone_id, civicrm_phone.phone_type_id as `phone_type_id`, civicrm_phone.phone as `phone`, civicrm_phone.phone_ext as `phone_ext`, civicrm_email.id as email_id, civicrm_email.email as `email`, civicrm_email.on_hold as `on_hold`, civicrm_email.is_bulkmail as `is_bulkmail`, civicrm_email.signature_text as `signature_text`, civicrm_email.signature_html as `signature_html`, civicrm_im.id as im_id, civicrm_im.provider_id as `im_provider`, civicrm_im.provider_id as provider_id, civicrm_im.name as `im`, civicrm_openid.id as openid_id, civicrm_openid.openid as `openid`, civicrm_worldregion.id as worldregion_id, civicrm_worldregion.name as `world_region`, civicrm_website.id as website_id, civicrm_website.url as `url`,
                CONCAT_WS(',',
                GROUP_CONCAT(DISTINCT IF(civicrm_group_contact.status = 'Added', civicrm_group_contact.group_id, '')),
                GROUP_CONCAT(DISTINCT civicrm_group_contact_cache.group_id)
              )
              as groups, GROUP_CONCAT(DISTINCT(civicrm_tag.name)) as tags, GROUP_CONCAT(DISTINCT(civicrm_note.note)) as notes
FROM civicrm_contact contact_a
LEFT JOIN civicrm_address
  ON ( contact_a.id = civicrm_address.contact_id AND civicrm_address.is_primary = 1 )
LEFT JOIN civicrm_country
  ON ( civicrm_address.country_id = civicrm_country.id )
LEFT JOIN civicrm_email
  ON (contact_a.id = civicrm_email.contact_id AND civicrm_email.is_primary = 1)
LEFT JOIN civicrm_phone
  ON (contact_a.id = civicrm_phone.contact_id AND civicrm_phone.is_primary = 1)
LEFT JOIN civicrm_im
  ON (contact_a.id = civicrm_im.contact_id AND civicrm_im.is_primary = 1)
LEFT JOIN civicrm_openid
  ON ( civicrm_openid.contact_id = contact_a.id AND civicrm_openid.is_primary = 1 )
LEFT JOIN civicrm_location_type
  ON civicrm_address.location_type_id = civicrm_location_type.id
LEFT JOIN civicrm_group_contact
  ON contact_a.id = civicrm_group_contact.contact_id
LEFT JOIN civicrm_group_contact_cache
  ON contact_a.id = civicrm_group_contact_cache.contact_id
LEFT JOIN civicrm_entity_tag
  ON ( civicrm_entity_tag.entity_table = 'civicrm_contact' AND civicrm_entity_tag.entity_id = contact_a.id )
LEFT JOIN civicrm_note
  ON ( civicrm_note.entity_table = 'civicrm_contact' AND contact_a.id = civicrm_note.entity_id )
LEFT JOIN civicrm_worldregion
  ON civicrm_country.region_id = civicrm_worldregion.id
LEFT  JOIN civicrm_tag
  ON civicrm_entity_tag.tag_id = civicrm_tag.id
LEFT JOIN civicrm_website ON contact_a.id = civicrm_website.contact_id
WHERE (contact_a.is_deleted = 0) AND contact_a.is_deleted != 1
    GROUP BY contact_a.id LIMIT 0, 100000

If you getting 504 error while doing export it worth to export in batches rather doing all in one go.

HTH

Pradeep


How can I modify the Activity Report to display phone number? I have built a report off of the Activity Report template and have been able to add all the columns I need EXCEPT target contact phone number. Email and many address fields are available in the "columns" tab but I do not see phone number there.

Is there anything I can do to expose this information?

(I thought about using a Constituent Report (Detail) instead, because phone is available there--but I want to filter by activity type and include custom fields on my activities.)

Check out Lola Slade's excellent CiviCon presentations on this topic:  2015 session (download the PDF on this page); 2015 video, and the CiviCon 2012 slideshow.


Event Registration Bug On our registration page, we ask that to register, you enter the number of registrations being purchased. When you enter 1, 2, 3, etc., it multiplies that by the registration fee of $315. Which is GREAT!

The problem comes when someone enters 0.00- it allows that person to register for the event for FREE. Help!

Can you help?

Sherry Jennings

You could set up the price field to be a select drop down an make the options 1, 2, 3, 4, etc. With the corresponding price for each quantity. This is not open ended you would have to setup quantities based on how many options you want to provide people.

Another option is to use the register multiple participants option in the online registration setup.

Hope this helps.


Update from 5.4 to 5.36.1 : problem to Update smart groups to rename filters on case_from and case_to to case_start_date and case_end_date In Drupal 7, after this long update from 5.4 to 5.36.1 in a CiviCRM which I take administration, I had 2 blocking errors in the sites/all/modules/civicrm/CRM/Upgrade/Incremental/php/FiveTwenty.php file. I commented on the 2 lines that are problematic and the update could be done completely :
    $this->addTask('Update smart groups to rename filters on case_from and case_to to case_start_date and case_end_date', 'updateSmartGroups', [
  'renameField' => [
    ['old' => 'case_from_relative', 'new' => 'case_start_date_relative'],
    ['old' => 'case_from_start_date_high', 'new' => 'case_start_date_high'],
    ['old' => 'case_from_start_date_low', 'new' => 'case_start_date_low'],
    ['old' => 'case_to_relative', 'new' => 'case_end_date_relative'],
    ['old' => 'case_to_end_date_high', 'new' => 'case_end_date_high'],
    ['old' => 'case_to_end_date_low', 'new' => 'case_end_date_low'],
    ['old' => 'mailing_date_relative', 'new' => 'mailing_job_start_date_relative'],
    ['old' => 'mailing_date_high', 'new' => 'mailing_job_start_date_high'],
    ['old' => 'mailing_date_low', 'new' => 'mailing_job_start_date_low'],
    ['old' => 'relation_start_date_low', 'new' => 'relationship_start_date_low'],
    ['old' => 'relation_start_date_high', 'new' => 'relationship_start_date_high'],
    ['old' => 'relation_start_date_relative', 'new' => 'relationship_start_date_relative'],
    ['old' => 'relation_end_date_low', 'new' => 'relationship_end_date_low'],
    ['old' => 'relation_end_date_high', 'new' => 'relationship_end_date_high'],
    ['old' => 'relation_end_date_relative', 'new' => 'relationship_end_date_relative'],
    ['old' => 'event_start_date_low', 'new' => 'event_low'],
    ['old' => 'event_end_date_high', 'new' => 'event_high'],
  ],
]);

and 3 lines after, from 120 to 134 :
    $this->addTask('Update smart groups where jcalendar fields have been converted to datepicker', 'updateSmartGroups', [
  'datepickerConversion' => [
    'birth_date',
    'deceased_date',
    'case_start_date',
    'case_end_date',
    'mailing_job_start_date',
    'relationship_start_date',
    'relationship_end_date',
    'event',
    'relation_active_period_date',
    'created_date',
    'modified_date',
  ],
]);

Can anyone tell me if the 2 commented lines will pose a problem later and how to manually perform the operations left out?
I found this question but I didn't know what to do in my case : Upgrade fails with CiviCRM_API3_Exception: "API error: Could not delete payment processor type"

Those upgrade steps are updating particular fields in smartgroups.  If you don't have any smart groups using those fields, it won't matter... but if those steps are failing it suggests you do have affected smart groups and those won't work correctly.  You could delete those groups and recreate them.
But the underlying question is why is the upgrade hitting problems?  If for example the field renames have failed, that will cause you more trouble in the future.  I suggest you post the errors from the logs for the failing upgrade steps so we can diagnose the cause.


Problems adding Contribution form to a WP page I just created a new contribution page in Civi and made sure it was active. When I go to create a new wordpress page and try to insert it I have no options to choose from when I click on the CiviCRM button. The only thing it shows is the dashboard options. How do I get my Civi Contribution form into a wordpress page? Is there some sort of a setting I am missing to get active contribution pages to show up as an option to choose from?

Disable all of your plugins (except CiviCRM) and try it again. If you can now see the Civi options, you have a couple of options: a. Set up your page, reactivate your plugins and go on with life, b. Reactivate the plugins one by one to see which is the issue.

If that does not work:

Switch to a WP basic theme like Twenty Seventeen or Twenty Sixteen and try the page create again. If you can see the Civi options, I would setup the page, switch back to your theme of choice. Just switch to a basic theme when you need to see the options and then back to your theme for usage.

If you do not want to mess with either above,

Under Contributions > Manage Contribution Pages > Select the page you want > Links > Live. This will give you a link that ends in id=#  Below is an example of Civi shortcode. Replace the 2 in the shortcode below with the id# from your live link and paste it to your WP page.
[civicrm component="contribution" id="2" mode="live" hijack="0"]


Redirect URL after contribution Profiles let you direct to some odd page after submission - why do contribution pages go nowhere (or maybe they do?)?
Cheers

You might find this Fuzion extension does what you need. Front End Page options adds the ability to choose an alternate thank you page instead of standard CiviCRM thank you page


Confusing CiviMail unsubscription confirmation screen This is picking up on a topic from the old forum having to do with unsubscribe confirmation.  (This feature is present in CiviCRM 4.6.2 as well as 4.5.8.)  I agree that having to enter one's email address is an additional annoyance to someone who is probably already annoyed.

What happens next in the process is also confusing.  Once the unsubscribing user enters their email address and clicks "unsubscribe" a highlighted confirmation message appears near the top of the screen, but the original highlighted "are you sure?" message and confirmation entry form still appear just below, as if the user is being asked to confirm again.  As a workaround, I'm using only {action.unsubscribe} and avoiding {action.unsubscribeURL}.

I understand that at present there is no way to override the "enter your email address to confirm" process.  But is there any way to show the now-confirmed user a simple "you've been removed" message without repeating the original confirmation template contents?  Perhaps a second template displayed at the end of the process?

If someone could give me a hint about where to start looking in the code, I'd be willing to have a go at displaying a simple post-confirmation message and submitting a patch.

Most of the code for the actual unsubscribe process is located here:

CRM/Mailing/Form/Unsubscribe.php

Would be good to:

a. Create a site wide CiviMail setting so an admin can disable the email confirmation process.

b. Use this site wide setting to determine the behavior of the code, the new behavior or the 4.4 and prior behavior. The 4.4 code is here:

CRM/Mailing/Page/Unsubscribe.php


JPG files uploaded as notes can't be viewed I've attached some JPG files to notes in contact records, but them I can't open them and if I save them locally then most applications can't open teh saved version and say they aren't in a supported file format, though surprising, Adobe Acrobat will open them (which is not a solution for most users).

I'm using WordPress 5.3, CiviCRM 5.15.1

Any ideas what could be going on?

Eventually I found out what the problem is and it is caused by the child theme that I had created. Another problem elsewhere that had an extra blank line at the start of a news feed and Demerit's comment above suggested this as a solution. When I changed to the base theme all was fine. Going back to functions.php for the child theme I found a blank line outside  (though not at the start of the file which is why Demerit's suggestion didn't lead me to the solution before).


Using ACLs to manage access to contacts As I understand it I can use CiviCRM's Access Control Lists to to control the groups that users can see and work with. But I'm not clear on a few points about this:

If a user does not have the permission to see a given group (for example in a list of groups) can they still see and work with the contacts in that group? Or to put it another way, when the ACL refers to a "group of contacts" does the permission that is granted by the ACL apply to the group, or the contacts within that group, or both?

And following on from that, if a contact is in two groups, and a user has permission to view one group but not the other, can the user see the contact at all?

The ACLs in CiviCRM are only additive.  So assuming a user doesn't have the "View All Contacts" or "Edit All Contacts" permissions (which overrides all ACLs), the default is that a user can view zero contacts.

So to answer your second question: If you grant the user permission to access contacts in Group A, all contacts in Group A are accessible to the user - even if they're in Group B, which the user doesn't have access to.

This, in turn, should answer your first question - the ACL applies to the contacts in a group.


What are the advantages of using one of the Sparkpost extensions for Civimail? We're on Civi 4.6.21 and Drupal 7.

I've set up to use Sparkpost in Outbound email settings.

If I don't use one of the two Extensions for Sparkpost and simply enter the Sparkpost settings into Outbound e-mail settings, what are the disadvantages? Will bounces and track throughs not show in Civi, or not work correctly? Other disadvantages?

Thanks!

With sending emails there is always the sending, and the return path. If you configure the Sparkpost SMTP server settings in CiviCRM you've resolved the sending, but not the return path. So you will not get the bounces and might end-up in trouble with Sparkpost or on blacklist because of repeated mailings to bouncing email addresses. You will still get click-through and unsubscribe as Sparkpost will forward to CiviCRM all links that users click, even if it intercepts these.


Public CiviCRM forms not working for anonymous users Public CiviCRM forms (contribution pages, registration for events, mailing subscriptions, etc.) works for logged users but when we try to use for anonymous users they don't work.

For example, if we submit a registration for event the form redirects to itself without any error message.

We run CiviCRM over Drupal 7.

After a long frustrating debugging I found the answer on this two pages:

Installation and Configuration Troubleshooting

Anonymous Users Cannot Contribute

  For Drupal sites, ensure that uid = 0 exists in your Drupal users table. This is required for anonymous access to CiviCRM pages and forms to work properly.


Transactional emails, such as confirmations, are not going out I am in the process of setting up CiviCRM to send via SparkPost using the following extension - com.cividesk.email.sparkpost

CiviMail appears to be working (both using test emails and cron) but, confirmations are not being sent when people subscribe to mailing lists or to become members.

Administer > CiviMail > CiviMail Component Settings: shows that 'Enable Double Opt-in for Profile Group(s) field' is checked.

Is there something else that needs to be done such as a scheduled job?

CiviMail isn't responsible for anything other than Bulk Mailouts.

There are Scheduled Jobs required for things like Scheduled Reminders which you can find at civicrm/admin/job?reset=1

In case you hadn't spotted, there have been two SparkPost extensions released. the other is here. Not suggesting either is better, or even how relevant it is to your issue

If you just click 'Send Email' via Actions on a civi contact record, does it get sent?

And what is the outcome from send a Test Email from /civicrm/admin/setting/smtp?reset=1


Group Membership Discounts using Group Based pricing I am trying to add some functionality to membership pricing where the more people we can get to sign up at a time the bigger the discount they will get. So for instance:

1 - 4 members, $110 each, No discount, $110 - $440
5 - 10 members, $93 each, 15% discount, $465 - $930
11 - 20 members, $82 each, 25% discount, $902 - $1,640
21 - 40 members, $71 each, 35% discount, $1,491 - $2,840
40+ members, $55 each, 50% discount, $2,251 & up

How would I go about adding this to the membership sign up page?  I've installed and enabled the group-based pricing extension

To be clear it would only apply to new members (new signups). And they would need the ability to say how many memberships they want.

You can use webform_civicrm module - but it will be quite some config!

Something like:

add a Drupal field - how many members would you like to sign up?
make as as many contacts in the civicrm tab as you need (you may need to bump up a parameter in webform_civicrm code) - you can make one (add all the fields you want) then in the webform tab -> clone
use conditionals to show the correct number of contacts
make sure you have relationship to primary contact (something like Member sign-up by)
make sure your membership type filters down to inherit by relationship
the monies... will be the default $ in your Membership Type config - however - you can add your own contribution field in webform and use conditionals (or jQuery to get the grand total $ right - based on the # of members field the user selected

Good luck setting that up! Please do report back!


Send a single mail to fundraising responsible I want to send a single mail to a responsible address when a certain event occur in my extension.
I had a look to some API (Email, Mailing, MailingAB) but but none of these seem to be the right one.
There is an API or a class I can use to send mails?

The Email API extension will have example code for you to use for your extension.  Its code is available on github: https://github.com/CiviCooP/org.civicoop.emailapi


How to change or add a header to the "Print PDF Report" action I would like to add a header of my logo to "Print PDF Report" action when a search or report is generated. Is it something easily achievable? Thanks

If you go to the "Title and Format" tab on the report, you can edit the html for the Header and Footer. The default footer has an image in the footer. Its in the documentation at https://docs.civicrm.org/user/en/latest/reporting/set-up/


Sync CiviCRM Events with WordPress custom post type I want to Sync CiviCRM Events with WordPress custom post type. I.e. everytime I create/edit/delete CiviCRM Event the same happens with corresponding custom post type. This will bring new abilities (i.e. you'd have Featured image).
Is there a CiviCRM extension or WordPress plugin that provides this?

CiviCRM 4.7.7, WP 4.5.2

I haven't put it on the WordPress repo yet, but there's CiviCRM Event Organiser. Repeat events only sync properly when the event is created in Event Organiser, but most of the other elements sync as you would expect. Event registration sync, however, is not yet completed.


CiviMail: Mystery Unsubscribes I just did our first email blast and it went pretty well. I'm using the token {action.optOutUrl} in the footer, plus the domain address, but that's it. The Opt Outs appear to have worked fine and they're labeled "No Bulk Emails (User Opt Out)" in the CiviCRM database. The bounces processed properly as well.

The weird thing was that the Mail Report shows that 5 people made "unsubscribe requests". How did they do that since the token isn't there?? Plus, their records aren't flagged with any red message, tho they do show up in Advanced Search. Did these people hit the spam button on their email programs? Will they get future emails? Am I supposed to do something with them? Thanks, in advance! Jim

I had this question also and just figured it out!

Civimail always includes a List-Unsubscribe header in the messages it sends out (https://issues.civicrm.org/jira/browse/CRM-3251).

That header is invisible to most recipients and is intended as a way for mail clients to provide easy and standardized unsubscribe mechanisms (http://www.list-unsubscribe.com/).

I note that google doesn't seem to do anything with it, though they do expose the list unsubscribe option for mailman lists, or used to .. But, it appears that Windows Live does use it, so anyone using that software that receives Civimail can use it.

The only clue I had was in my apache logs - the time of the unsubscribe matched a soap request that came in via UAS/CiviSMTP that handles the bounces for this domain.

Thanks to Leyla UAS/CiviSMTP support (http://www.civismtp.com/) for confirming this idea.

For bonus points, assuming you really only want people to opt-out instead of unsubscribing, you can include this in a custom extension or module, changing 'hook' to the name of your custom extension or module.

function hook_civicrm_alterMailParams(&$params, $context) {
  if ('civimail' == $context || 'flexmailer' == $context) {
    $params['List-Unsubscribe'] = str_replace('mailto:u.','mailto:o.',$params['List-Unsubscribe']);
  }
}


Should we install CiviCRM again and import cleaned up data? I have recently joined the International Voluntary Service as Director and I am trying to understand the database - CIVI

the system was installed several years ago and has not been updated consistently. it is in quite a big mess.

I am trying to work through how to solve this. My query is this - can we set up an entirely new account with CIVI? effectively start all over again? Then merge the clean data from the old system into a new account?

By "new account" I assume you mean a new CiviCRM instance (a new install).

If yes, then yes! You can start fresh in a new CiviCRM and import the cleaned up data. If you search for "CiviCRM Import" you'll get a number of useful search results related to importing data, including tutorials.

But if you have a complicated data structure you may be better of trying to clean it up in the existing instance.


Deadlocked queries cause an instant error for end-users, but are retried in other circumstances We have a lot of smart groups, and consequently a lot of deadlocks. There's already code in Civi that detects deadlock Exceptions, and then retries the query a few times. This is really helpful - I have extra logging on this, and I can see that it prevents a lot of errors. But this code doesn't kick in for people directly using the UI - they get the 'unknown error' yellow-screen-of-death immediately. This can happen on exports, or when opening complex groups. I dug into this and sort-of know why it's happening:

When a deadlock happens, an exception is thrown if $GLOBALS['_PEAR_default_error_options'][1] is set to 'exceptionHandler'. This exception triggers the code which retries the query.
An exception is not thrown if $GLOBALS['_PEAR_default_error_options'][1] is set to 'handle'.
$GLOBALS['_PEAR_default_error_options'][1] is set to 'exceptionHandler' when you generate smart groups via the API, and in most other circumstances
But $GLOBALS['_PEAR_default_error_options'][1] is set to 'handle' in the UI in general (?) - at least, it is on exports and when using 'Manage Groups'. So in this case no exception is raised. And if there's no exception, the try-catch blocks have nothing to work with and front-end users get 'unknown error' immediately.

I am happy to fund a fix for this, but I'm not sure what I'm getting myself into. Is this a bug, or is it an unfortunate consequence of how error handling needs to work for end users?

Instead of trying to "hide" the problem when it happens, it might be safer/wiser to try to prevent it.

I like smartgroups and how powerful they are, but I found that it works better if I cache the results for a while (eg. a day) and rebuild the smart groups via the jobs.

Would it be acceptable to keep a "stalled" version of your groups for a while and avoid rebuilding them all the time in your case?

Also, you mention having a lot of smartgroups, it might be worthwhile creating a custom search that would run the queries you want when you need to use them instead of creating lots of smartgroups. We found it more performant and easier to maintain.

X+


How can I find contacts with only 1 contribution during last 12 months? How can I build a search for contacts that match two criteria?

1) The contact has contributed in the last 30 days;

AND

2) The contact has not contributed another donation within the last 12 months.

In other words, I'd like to select people who have donated for the first time during last 12 months.

Not sure how I would do that with a search, but in general you might want to use CiviRules for donor segmentation? Details can be found here:https://wiki.civicrm.org/confluence/display/CRMDOC/CiviRules+Cookbook with some examples.


Insert buttons in public registration forms I am working on a module extension which allow users to Register via different social media/oauth accounts. These login buttons need to be added below all the forms which are anonymously available.

What is the best way I can achieve this?

These buttons can be defined in a small smarty template file which can be inserted into the form.
or can be created via JavaScript, which can be inserted into the page.

Please suggest what should be the right way to do it.

You should use Smarty:

According to the CiviCRM Javascript Reference, public-facing pages should follow the principle of Progressive Enhancement.

"Front-facing pages like contribution pages and event signups should adhere to the standards of PE. All front-end pages should be fully functional with js disabled."


create user choice form and store that value into database I want create a custom form and that value into database using civicrm.

How can I create this using civiCRM and drupal.

You can create custom field for a contact and then include the custom field on drupal webform.

Below are the documentation to

Create custom field for a contact
Add CiviCRM field on webform

HTH

Pradeep


How do I embed an image into CiviMail messages? Is possible to embedd images into civimail mailings? Would be great to have a choice between loading images from the server and sending them along with the mailing. For example Acymailing have this option. Is it possible in CiviMail?

If you are referring to embedding images in the body of the email, yes, that is entirely possible in CiviMail.

Using the WYSIWYG editor, you can embed images. There is an image icon on the toolbar to do this.  The images will be stored on your server and can be referenced in the HTML email.  (Of course you could optionally just include the image hosted at a different URL as well.)

You could theoretically embed the byte stream of an image, though I don't know why you would want/need this.

If you are referring to attaching the images as attachments that is possible too.  Check the Attachments section when you are defining the email in CiviMail.


What are the core functions an extension can rely on? It's been said, quite reasonably, that all APIs should have tests, and that if a feature doesn't have tests then coders shouldn't rely on it.

This raises two three questions:

other than direct "API3" calls what can I rely on not to change in the future?
how can I know which methods have tests?
what is the strategy is for introducing new tests to "lock in" certain useful utility methods?

As one small example, specifically I am talking about the "sub-API-API" - eg these type of methods but also accessing other "system" services (like mail, http, debug logging, UF, UI messenging)

(sorry this maybe a bit wooly for SE, but it is something I have struggled with)

Yes, SE isn't designed to have three questions in one, as this leads to a knotted ball of yarn.

API calls are intended to have unchanging interfaces for the life of that version of the API, once the version is marked as stable. Currently API v2 has been retired, API v3 has long been stable, and API v4 is in development.

The nuance you note is that we can only ensure that the results returned by the API are stable if there is a test.

I should also note that if a bug is discovered, eg incorrect tax calculations, then fixing the bug may result in changes to incorrect return values from APIs.

Look through the directory for tests. Note that it can be appropriate to have multiple tests for a single method, and we would love to improve the robustness of the use cases we have tests for.
The most appropriate place to add a test to lock-in current behaviour for an API is likely https://github.com/civicrm/civicrm-core/tree/master/tests, though there are other types of tests in other directories that might be relevant. For a class like CRM_Utils_System_Base, probably add tests under https://github.com/civicrm/civicrm-core/tree/master/tests/phpunit/CRM/Utils. In terms of making utility methods like these have the 'first order' status of a public API method, this is probably something that deserves community discussion. For example, it might be that we could document somewhere a list of methods that are considered public and stable perhaps in a wiki or preferably to my mind in a docblock. Or it might be decided for consistency and improved Developer Experience to wrap the relevant utility functions in an API wrapper. Could you raise this issue in the dev channel at https://chat.civicrm.org or send a message to civicrm-api@lists.civicrm.org after adding yourself at https://lists.civicrm.org/lists ?


deduping - case sensitive? In many case, when visitors register to a public event, they use either capital case for or small case for their last name. Therefore, the deduplication engine considers both to be different. Can it be circumvent?

On workaround/better solution is to change the format of the value entered by end users so DAMIEN is converted into Damien, and the dedupe rule compares Damien=Damien and all works smoothly.

https://github.com/TechToThePeople/civicrm-normalise

X+


CiviCRM AJAX api Permissions Background

I am working on a React app for event participation management using the CiviCRM ajax API. There is a little more to this that isn't relevant.

Each user has access to their own API key, but no CiviCRM or CMS account. I have used the civitest_civicrm_alterAPIPermissions hook to expose/restrict various entities. I have given each user the "access AJAX API" permission.

Issue

Before I go looking through the code, I had a question about an issue I am having:

Users with CMS accounts and the exact same permissions (i.e. no "access CiviCRM" and cannot log into CMS) can access the API fine, but those without get the error "ERROR: No CMS user associated with given api-key"

The error is pretty self explanatory, but I was curious if there was a way to work around it that is built into CiviCRM.

Setup

Joomla 3.8

CiviCRM 4.7.22

I think you can bypass permission using permission_check hook.


How can i show the Count of Contributions in a give time period? I checked the awesome Summary Fields extension and the Advanced Fundraising Reports one but neither seem to quite offer this.

I could do this as a Drupal View but that won't give me the full suite of 'Actions' that might be required.

If Summary Fields does not have the fields you need, it's pretty easy to add your own using hook_civicrm_sumfields_definitions()

Try dropping something like this into an extension:

/**
 * Implements hook_civicrm_sumfields_definitions().
 *
 */
function myextension_civicrm_sumfields_definitions(&$custom) {
  $custom['fields']['contribution_count_twelve_months'] = array(
    'label' => 'Count of Contributions in last 12 months',
    'data_type' => 'Int',
    'html_type' => 'Text',
    'weight' => '15',
    'text_length' => '32',
    'trigger_sql' => '(
      SELECT COALESCE(COUNT(id), 0)
      FROM civicrm_contribution t1
      WHERE t1.contact_id = NEW.contact_id AND t1.contribution_status_id = 1 AND
      t1.financial_type_id IN (%financial_type_ids) AND
      CAST(receive_date AS DATE) BETWEEN DATE_SUB(NOW(), INTERVAL 12 MONTH) AND NOW()
      )',
    'trigger_table' => 'civicrm_contribution',
    'optgroup' => 'fundraising',
  );
}

Tweak the trigger_sql for your preferred time interval.

See the Readme for more info.


Does Veda Consulting's dedupe workflow extension work on 4.7? Or is it now in Core? Does Veda Consulting's dedupe workflow UI extension,which looks really cool,  work on Civi 4.7, Drupal 7?

and if so, from where and how exactly do I install/git clone it? The latest commits are at
https://github.com/veda-consulting/civicrm-core/compare/4.5...veda-consulting:dedupe-workflow-45

Or is the functionality now in Core for 4.7?

Thanks!

I think this pull request, that was merged into 4.7, contains at least some of these improvements. But not the functionality from the extension (as far as I know):

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

Check out the new functionality on the demo site, and see if it meets your expectations.

http://dmaster.demo.civicrm.org/


How to suppress columns from Manage Group search results I'm customizing a version of the Manage Groups page. Users don't want to see Description, Group Type, or Visibility. I thought I could just customize a version of Group/Form/Search.tpl .

It's easy to suppress the column headers by commenting out the  tags. I need help learning how to suppress the actual  tags though. I can't make sense of the js in that template.

I just learned how to use bVisible = false to suppress columns. I found what I needed at http://legacy.datatables.net/usage/columns, the columns documentation for datatable plugin.


How do you implement more than one "Employee of" field? How do you implement more than one "Employee of" field?

We have a number of contacts that have multiple jobs.  Ideally we would like to have the Employee Of field have multiple sub fields (primary, secondary, etc) however we are open to all implementation.  How do most people implement other Employers on an individual contact's record?

It is allowed to have multiple relationship as employee of for individual with an organization. However you can only have one as a current employer. You can create custom field for relationship with options primary, secondary etc and use it while creating relationship.

HTH

Pradeep


What are ways to make CiviCRM more user-friendly for people who prefer spreadsheets? Like many other organizations, I suspect, I work with great, dedicated organizers and other staff who prefer the relative speed and simplicity of creating and updating contact lists in spreadsheets rather than in CiviCRM.

A constant challenge is 'selling' users on the many reasons to use CiviCRM rather than creating a contact list in a spreadsheet, which I then must import. Requiring the use of CiviCRM is easy to say but, depending on the culture of an organization, sometimes difficult to do.

So: what are ways CiviCRM admins and users have used to coach/encourage such spreadsheet-preferring users to use CiviCRM?

One way that I will be promoting is using a Search View (based on a Profile) in Advanced Search with a Group previously created - this gives a 'spreadsheet-like' interface.

Thoughts appreciated!

We end up building a lot of Views - and would love to be able to improve EditableViews so that it works more like a spreadsheet which will require ensuring that Labels rather than Values are displayed


I Can't See Who Created Grant Records I cannot see who has created the grant records on any individual. Here sometimes the cancellation etc for the grant is going on in the registrations. Or you can enter more than one grant. But it is unclear who created these records. How can I get this information

For example: I created a grant for the person "A". The authorized person is checking this record. However, the data does not appear to indicate that the recording is mine or another person.

Check in the civicrm_log table in the database and if there's an entry there for it then the modified_id will be the contact_id of the person who did it. But civicrm_log only logs minimal info. If you have detailed logging turned on at administer - system settings - misc, then there'll be a log_civicrm_grant table that records every change.


How to export civievent participant list to a csv file? How can I add the ability to export to a csv file? Right now the only export option on the actions menu is to a Microsoft Excel file.

What version of Civi are you using?

Under Events > Reports > Participant List, Mine shows "Export CSV" as an Action Option

Under Search > Find Participants, it just says "Export List", But when I export it I get a CSV file.

But even if you get a .xls or other Excel file you can always save it as a .csv in Excel. If you do not have Excel, then run it through an online file converter. You can even open the Excel file in Google Sheets and then download it as a csv to convert it.


Trigger a reminder if activity has not been recorded in x amount of time Is there a way to have CiviCRM send me a scheduled reminder for any contact for whom I have not recorded an activity for in 3 weeks or more? So that if 3 weeks go by and I have not recorded an activity for Contact A, I would get an email notifying me of that.
Or is there a way to build a report showing all the people who haven't had an activity recorded for in 3+ weeks?

This isn't a current capability, though it's one I've thought about writing on multiple occasions.  Unfortunately, my clients have never deemed it something worth the time it would take.

To handle this, I think it would be best to create a custom search that searched for the latest activity.  For other use cases, searching only for activities of a particular type is helpful, but it sounds like you don't need that.

Once you have a custom search, you can create a smart group based on it.  You can then run reports and/or generate scheduled reminders limited to this group.


BCC emails not working - is there a log I can view? We're using Civi 4.7.12 on Joomla 3.6.2.
Our Society has subgroups which need to be alerted when a contribution comes in for them. We have set the group contact's email address in the bcc field of the relevant contribution page. The contribution is accepted and the donor gets an emailed receipt but the bcc isn't being received. We have tried using an inhouse address as the bcc recipient and that doesn't work either.

Our SMTP mailer does not require authentication.

Is there a log in Civi of mail being sent? Any help would be very welcome.

Regards
Claire

The Administer Screen Settings - Outbound Mail gives you the option to enable Redirect to Database. (You can navigate to the screen with Administer -> System Settings -> Outbound Email (SMTP/SendMail), or with civicrm/admin/setting/smtp?reset=1)The mail is spooled to the table civicrm_mailing_spool.

Update: In case of the use of cc: and bcc: it is a bit tricky. I just did a short search in the code and found that, when the Pear mailing library is installed, the bcc and the cc: are removed from the Headers and added to the list of recipients. CRM-19173 explains the reason. So in the spool table, they can be found in the recipient_email appended to the list of email addresses, but not in the headers.

See the code at Mail.php line 260.


Why are deleted contacts showing in search results? I just upgraded a Drupal site to 5.27.1 and am noticing that when I do a search for contacts, contacts that are in the trash are also showing up in results (which did not happen before). I was able to reproduce this on the official demo server as well (reporting 5.29.alpha1) by deleting a contact and then running a search with that deleted contact's name -- they still show up in the results.
When I click on the contact record it still does show correctly that the contact is deleted.

I think this is already reported on git lab and has fixed at https://github.com/civicrm/civicrm-core/pull/17798
The fix is available in 5.27.2 version of Civi. Try upgrading Civi to 5.27.2


CRM/Core/Config.php line 41 throwing 500 error with new require_once api/api.php Just updated our WP install from 4.7.22 to 4.7.23 -- but can't run the db update script, because whenever I rename the 4.7.23 folder to civicrm, I subsequently get 500 internal server errors while trying to load any civicrm pages. Error log indicates a problem at line 41 in CRM/Core/Config.php, which is require_once 'api/api.php'; ... so I searched the previous working iteration (it runs fine when I switch back to 4.7.22) and there is no mention of api/api.php anywhere. So I assume this line is new in 4.7.23, and I have to wonder why it's making civicrm completely unusable for our site.

Ideas?

More detail from the error message:

PHP Fatal error: require_once(): Failed opening required 'api/api.php' (include_path='.:/wp-content/plugins/civicrm/civicrm:/wp-content/plugins/civicrm/civicrm/packages:/wp-content/plugins/civicrm/civicrm/vendor/tecnickcom:/wp-content/plugins/civicrm/civicrm/vendor/phpseclib/phpseclib/phpseclib:/wp-content/plugins/civicrm/civicrm/vendor/pear/pear_exception:/wp-content/plugins/civicrm/civicrm/vendor/pear/auth_sasl:/wp-content/plugins/civicrm/civicrm/vendor/pear/net_socket:/wp-content/plugins/civicrm/civicrm/vendor/pear/net_smtp:/wp-content/plugins/civicrm/civicrm/vendor/pear/validate_finance_creditcard:.:/wp-content/plugins/civicrm/civicrm/:/wp-content/plugins/civicrm/civicrm//packages:.:/usr/lib/php:/usr/local/lib/php') in /wp-content/plugins/civicrm/civicrm/CRM/Core/Config.php on line 41

First, let the record show that I am an idiot.

After uploading 4.7.23 (the new version) to /wp-content/plugins, I neglected to copy the pre-existing civicrm.config.php into /wp-content/plugins/civicrm4.7.23/civicrm ... thereby depriving the system of (at very least) a working value for $civicrm_root.

It was suggested to me that my civicrm.config.php was probably off, and I checked it just to make sure the $civicrm_root value made sense. The value was good, but the file I was checking was located outside of the plugins directory -- this was a clue, and I missed it. As I said, I'm an idiot.

Of course, once I copied the old civicrm.config.php into the new /wp-content/plugins/civicrm/civicrm, everything worked perfectly. Except for CRON jobs, of course -- but that's another matter.


Automatically send unpaid contribution reminder I would like to send an email on the 10th of each month to "pay later" donors from the past month who did not pay their amount due.

How should I do this?

Take a look at Scheduled reminders rather than CiviMail.


Can't use activity table in join query for update In our set-up we have custom fields associated to activities, the value of which is computed periodically by scheduled job. The job executes a query that reads something like:

UPDATE civicrm_value_something sth
  JOIN (
    SELECT
      a.id, someexpression() as value
    FROM civicrm_activity a
    JOIN sometables
    WHERE somecondition
  ) r ON r.id = sth.entity_id
SET sth.somefield = r.value;

This was working fine until today when we migrated from 4.7.24 to 4.7.30, which introduces some new triggers on civicrm_activity table. The problem is that MySQL does not support executing triggers that update a table used (even just for read) in the statement that cause the trigger. So the query fails with this error:

  [nativecode=1442 ** Can't update table 'civicrm_activity' in stored function/trigger
  because it is already used by statement which invoked this stored function/trigger.]

The only solution I can see is to split the query and store the result of the sub-query in a temporary table. This is not desirable because it is less convenient, less performant (if the subquery fits in memory) and less atomic.

Has someone faced a similar problem and come up with a good solution?

An option is to disable the trigger, run your upgrade and re-create it at the end.


Server transfer CiviCRM search problems We have just transferred a Wordpress installation of CiviCRM 5.21.0 to a new server, but all of the search functions are failing. In advanced search, when I attempt to open for example, "Address", the following error appears and repeats itself on some kind of loop:

"Because your session timed out, we have reset the search page."

The Address option then just opens up another "Search Criteria" section underneath.

The parameters in the looping message are:
page    "CiviCRM"
q   "civicrm/contact/search/advanced"
reset   "1"
snippet "json"

I've checked the database connection and that seems fine, it is returning the correct numbers of results in saved search smart group lists, but when I click "contacts" on the lists it shows no results, just the same error.

I found the problem, the session save path in .htaccess was different from the one in the new CPanel.


What could $civicrm_root setting in civicrm.settings.php appears ignored? I'm running 4.7.27 and regardless of what I set the $civicrm_root to, the hints in resource URL and file path setting pages give quite unrelated values for civicrm.root. I am also unable to set the resource URL to anything but the prefilled value (editing it and submitting does nothing).

Consequently it looks like some override is at work. However, I've checked the civicrm.settings.php many times and I'm unable to find such an override.

What could be causing this? Everything displays fine, except for loading of the CKEditor js-files. But the fact that editing civicrm.settings.php doesn't do anything scares me. I've verified that the file is indeed the correct one (removing it breaks the site), and that even removing the $civicrm_root entirely does nothing.

From the settings:

global $civicrm_root;

$civicrm_root = '/foo/www/sites/abc.foo.se/current/web/app/plugins/civicrm/civicrm/';
if (!defined('CIVICRM_TEMPLATE_COMPILEDIR')) {
   define( 'CIVICRM_TEMPLATE_COMPILEDIR', '/foo/www/sites/abc.foo.se/shared/uploads/civicrm/templates_c/');
}

There might two settings defined for CiviCRM. Can look if you have any other civicrm.settings.php file located in different folder?

 The recommended location is wp-content/uploads/civicrm/civicrm.settings.php.

 The deprecated location, still supported as of April 2017, was wp-content/plugins/civicrm/civicrm.settings.php

HTH

Pradeep


Removing avaliable languages from Localization I have added some 5 to 6 languages, I want to remove few of them how can it be done.

You can't do it right now using UI. It's a known limitation. cf. https://issues.civicrm.org/jira/browse/CRM-10006

It's not a high priority bug right now (not scheduled for a fix).


Recommended process for credit card additions/'edits' to event registrations? Using CiviCRM 4.6.4 and Drupal 7.41, we have a large event set up with complex pricing (3000+ registrants each year, lots of price options). Folks forget to register for things the first time through, or they change their mind.

We haven't been able to determine a good way to process these people who need to edit their fee level choices. I can edit fee level choices just fine when there isn't any money involved, but don't see a good way to make a 'credit card 'edit' to a registration'.

To make it more difficult, we would prefer to turn 'multiple registers with same email' off, because we tend to have admin assistants and the like sign up many folks under one email and it takes a lot of staff time to sort that out.

The fee level choices must be accurate and held in a single event record (no dupes for the event) to print the correct badge onsite, so if we do need to submit a second registration we would have to create a new with all fee level choices and delete the old ones. This tends to cause the financial tally to be off and is a different admin headache, but this is the route we have taken for now.

Does anyone have a recommendation for processing these credit card edits without the admin headaches?

You're not the only one looking for this solution, but it has been unfunded so far because it would be so complex.

As an alternative, you might consider separate events, either using the Event Additional Signup extension or the new conference session features.  People who come back later and want to sign up for an additional option can just sign up for the event directly.

You'd then have a different, but much simpler, customization to build out: just getting the appropriate events onto someone's badge.


Can CiviEvent widget show thumbnails? I'm in the process of switching from Events Manager to CiviEvents so my client can integrate event registrations and payments into Civi.

However, as far as I can see there's no facility for the CiviEvents widget to show event thumbnails, which is a shame. Attached is a screenshot of the current set-up, where the Events Manager widget formatting matches the recent posts widget.

I can show an image by including it in the CiviEvent widget description field, but that's far from ideal.

For those using Drupal -> you can use Drupal Views to create such displays - here's an example of a CiviCRM Event Display - using a Bootstrap Grid (responsive display):


Unable to do "replace" in API Explorer CiviCRM 4.7.29, Wordpress 4.9.5

I am unable to do a replace in the API explorer. I can do a "get" however. The situation is that a parent registered for an event, but forgot to change the number of registrants under his registration from 1 (him) to 3 (him + 2 kids). They were under 12 yrs so I just manually entered them. However, the kids now show as Registered_by_ID = null, and I want them to be the ID of the parent.

(NOTE: Am not a developer, just a volunteer with middle level of experience.)

When I do a "get", I can find his 2 kids by participant ID. Next, in API Explorer I use Entity = Participant, Action = Replace, and I would expect that the interface would allow me to choose the Participant I want to perform the action on, followed by a field on which I want to change from one value to another. Instead, it allows me to choose 1 field and 1 value and says it is going to update the database, so I chose no. How do I know what participants this is going to change since it doesn't let me choose who? How does it know what value from -> to I want to change?

I checked the examples here but Registered_by_ID is not listed. Does that mean a replace won't work on that ?

In the end, I'm open to suggestions of either how to get the API explorer to do what I want (change the Registered_by_ID from null to the parent's ID), or else if there's some other obscure way (ie Profiles?).

Thank you.

I figured out one way using profiles.

CREATE A PROFILE

The first 4 steps that you'll only need to do once starts with going to Administer, Customize Data & Screens, Profiles. Click Add Profile.
Give it a name such as "Update Child Participant Details", add a description if you like, check "Used for" + "Standalone Form or Directory", check "Is this Profile Active". Under Advanced Settings change "Limit Listings to a specific group" to "Attendees". Leave the rest as is. Click Save.
It will now ask for a Profile Field, select Participants, Registered by ID. Check "Required" (since presumably this is the whole reason you want to create this in the first place). Leave the remaining fields as they are. If you want to update another field for the child (ie dietary restrictions, etc) then click "Save and New", else click "Save" to finish. NOTE: You cannot mix fields from other records, they all have to be from "Participants". If you try to use one from "Contacts" for instance, it will give you an error in later steps.
Click Preview (all fields) and your Registered by ID field and any others you created should appear. Click Done with Preview. You will only have to do this once, this completes the Profile steps.

CREATE A PARTICIPANT ID REPORT

You will only need to create this report once. Go to Events, Reports, Attendee List.
Checkmark Columns, add Participant ID, Registered by Participant ID, Event, Status, Role, Fee Level and Participant Fee, then click View Results. Your report should now show the parents along with their children (everyone who registered). The Fee level field should presumably identify the parents from the children assuming the fee structure is different (ie under 12 free).
Click on Title and Format, change the name to something more appropriate such as "Attendee List with IDs", then on the same screen under Actions, select "Save a copy" (not Save or it will overwrite the original), parent menu can be Events, Event Reports. This is where you'll find this report later.
Now that you've created your report showing the children with Registered_by_ID = null (blank), you will now know which child's record to edit. Keep this browser tab open to refer to, and open a second browser tab or window.

USING THE PROFILE AND REPORT TO EDIT THE CHILD RECORD

In the new browser tab or window, open CiviCRM and go to Events, Dashboard.
If you only have 1 event showing, you should see all your attendees below. If you have more than 1 event, click on "Registered" to the right of your event. You should now see all your attendees below.
With the Civi Report you left open in the previous browser tab or window, you can find the name(s) of the parent and their children. You'll be focusing on the children that do not have an ID number in the field Registered_by_ID because we will want to change this from null to their parent's ID. Make a note of the child(ren) and parent.
Switch back to your 2nd browser tab or window. Click the box next to the name(s) of the child(ren) that you want to associate with the parent that registered them.
Click on "Actions", and choose "Update Multiple Participants" which should be at the bottom of that list. Give Civi a moment, then you should see a page called "Update Multiple Participants" with a Select Profile dropdown. Choose the Profile you created in the first steps and click Continue.
The child(ren) should appear now, though unfortunately this screen does not list their participant IDs nor their parents. This is why you'll want to switch back to the other browser tab or window, obtain their parent's participant ID, and enter it into the "Registered by ID" box beside their child(ren)'s names on the 2nd browser tab or window. If you created any other fields in the profile (ie Dietary restrictions) then they will also appear here too. Click the "Update Participant(s)" button to finish.


Crediting event payments by another contact We fairly often have events where a registrant pays for part of their fee, and another contact (sometimes also a participant) pays the rest. I'd like to record the payment for the Contact and soft credit it to the appropriate participant's event fee.

Any chance this is possible? I'd be open to manipulating the database, if it's not possible in the civi interface.

You could hack the civicrm_participant_payment table which links a contribution to a participant.
You could also create an extension to link a contribution to a particpant from the user interface. This way you make it easier for the event manager to this.


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

The easiest way would be in your document. For example just make the token bold/colored in your wysiwyg editor, or if you are editing html you can do like {contact.phone}


Can I create triggers in the database? We are trying to setup CiviCRM in Wordpress.

Our Database is on GoDaddy, but we are running into a problem:

"Could not create a database trigger."

The Database Settings appear to be correct.

Any thoughts on how to fix this error?

Thanks!

If the Setup Screen tells you that the database settings are correct, it means you can login into the database with the username and password that you entered. However, it does not guarantee that the MySQL database user has enough privileges to perform all necessary database actions.
CiviCRM needs trigger support and in the System Administrator Guide at https://docs.civicrm.org/sysadmin/en/latest/requirements/#mysql-permissions is described what this entails.

If you are not able to grant the correct privileges in the control panel of your internet service provider, you have to contact their service desk.


How to solve uncaptured payment "Stripe Payments with Caldera Forms" my problem is when I pay a contribution using Stripe and Caldera forms, i receive in Stripe account the payment is not captured.
I have tried paying the contribution directly without using the caldera forms and it works.
Someone had the same problem ?

The problem is solved by using cf-civicrm developer version from github rather than the version proposed by Wordpress.
To understand more you can see this Post : https://github.com/mecachisenros/cf-civicrm/issues/185


Mailing template not picking up images Drupal: 7.59 CiviCRM 5.3.2
After Upgrading to 5.3.2 my mail temaplates are no longer showing the images (logo signature) I checked the path in the template and they are correct but the generated PDF shows 'image not found'
Also I do not get a editor for the template just the raw HTML

Any suggestions?

Thanks

The issue seemed to have been caused by an automatically created .htaccess file in the Resource Image folder. This is being automatically generated but I don't know by what. The contents of the automatically generated file was

  Order allow,deny
  Deny from all

This prevented the image file from being access. As a quick fix I renamed the file and a new file was there again in less than a minute. I edited the file to allow access and that resolved the issue.
Though I don't understand where the htaccess file is created from, this can be marked as resolved. Thanks


Should online renewals generate a Membership Renewal Activity? and how about when a Pay Later renewal is set to completed? Not sure if this is a regression, but currently (and since august at least) on civi 4.7.x when you renew online there is no Membership Renewal activity created.

I just tested this on d.46 where with a $0 membership the online renewal did create a Membership Renewal Activity.

Same thing on sandbox did not. Bug? Regression? Confused tester?

http://dmaster.demo.civicrm.org/civicrm/contact/view?reset=1&cid=207

A separate issue for both 4.6 and 4.7 seems to be that online Pay Later does not generate the Membership Renewal Activity when the payment is set to Completed.

Both of the above mean that searches based on that Activity Type as a way of figuring who renewed when do not work as far as I can tell

Seems there was a regression. Jira ticket here (now FIXED) for the lack of Membership Renewal activity creation when you renew online that was fixed for 4.7.15.

Second ticket for No Membership Renewal Activity is created when a Pay Later is set to Completed not yet fixed


Green Box in Profiles I want to remove these green boxes that appear on Civi Profiles automatically. They do not appear in the source code at all. Is there an option to remove or a place in Civi where I can disable and change the appearance of these boxes?

These boxes are intended to hold the "Pre-form help".  If you go to Administer menu » Customize Data and Screens » Profiles, and click Settings next to the affected profile, you'll see the Pre-form help option I'm referencing.
One of the following is happening:

There's some white space in the box.  Do a "Select All" on the text of the box and press Delete, and save.  See if it's fixed.  You can use the Preview option under the More menu on the Profiles screen.
If it is NOT fixed, there may be something that's adding space into that box inadvertently.  This happened in CiviCRM about 10 years ago, and occasionally happens because of some odd WordPress plugin or similar.  If you know how to look at the raw database data, look in the (unintuitively-named) table civicrm_uf_group at the help_pre field.  It should be NULL.


Unable to delete Price Field from Price Set used for Contributions Initially I had a warning that the Price Set was in use, with a useful link to the page in question.

I then removed the Price Set from the Contribution page in question, but I am now getting the same message ie

  Unable to delete the 'xxx' Price Field - it is currently in use by one or more active events or contribution pages or contributions or event templates. If you no longer want to use this price set, click the contribution page title below, and modify the Amounts or Membership tab configuration.

Price sets relating to any contribution record(apart from contribution pages) also need to be deleted before removing any fields from the priceset.

Since Contribution need this field information to show them on viewing those contribution record, it doesn't let us to delete the fields or pricesets related to them.

To know what contribution or membership record are related to pricesets - execute this query -

SELECT DISTINCT cli.entity_table, cli.entity_id
FROM      civicrm_line_item cli
LEFT JOIN civicrm_price_field cpf ON cli.price_field_id = cpf.id
WHERE     cpf.price_set_id = <your_price_set_id>


Blank screen when using versafix-1 templates This weekend I migrated my site from one server to another.  The htdocs remained the same, just the infrastructure was upgraded.  I backed up my sql database and files and restored them in the new location.  No paths locally or via the internet changed.  Only the IP address of the server.  PHP and MySQL were upgraded but only by point releases (ie. 7.3 and 8.0 were the core).
After the migration it seems that I cannot create any new mailings in Mosaico using the versafix-1 template nor can I reuse existing emails based on this template.  What is weird is I can use the template tedc15 and tutorial.  When I select versafix-1 it goes to a blank grey screen.
Console errors:
TODO error!!! Trying to set a new default value for bodyTheme longTextStyle.linksColor while it already exists (current: #3f3f3f, new: #ccc)

declarations.js:130 Model ensure path failed undefined name -ko-color value @longTextStyle.linksColor default #ccc element undefined

parser.js:403 Exception while parsing the template Exception parsing expression @longTextStyle.linksColor TypeError: Cannot read property 'longTextStyle.linksColor' of undefined

parser.js:403 Uncaught Exception parsing expression @longTextStyle.linksColor TypeError: Cannot read property 'longTextStyle.linksColor' of undefined

admin.php?page=CiviCRM&q=civicrm/mosaico/iframe&snippet=1:1 Uncaught ReferenceError: pagespeed is not defined
    at HTMLImageElement.onload (admin.php?page=CiviCRM&q=civicrm/mosaico/iframe&snippet=1:1)

Here's what I've done to troubleshoot:
Reinstalled Mosaico:

Uninstalled Mosaico
Deleted the Mosaico directory from the ext folder
of my server
Downloaded a fresh copy of Mosaico from the CiviCRM
website
Installed Mosaico

Upgraded to the latest version of ImageMagick (also made sure the extension was not commented out)
Verified file permissions (I actually set everything to 777 inside the wp-content/uploads/civicrm directory for testing)
Disabled Asset Caching
Verified Resource URLs and Directories (both set to [civicrm.files]/ext/)
Can anyone help shed some light on what's going on here?
Many thanks for your help!

For reasons that I am still unsure of, I needed to apply the mosaico-php-backend script located here:
https://github.com/markalston/mosaico-php-backend
I did change operating environments from Ubuntu to Debian so something on the backend may have been different but regardless, applying this script fixed my issue.


Unhandled Error when adding new Case Using Joomla 3.8.6, CiviCRM 5.0.0, php 7.0.29, mysql 5.6.39

The following error has occurred since upgrading to 5.0.0.

When adding a new case, I enter the minimum field data and click Save, and the window hangs, with the rotating CiviCRM symbol gif. There is an entry in the CiviCRM log, but it is so huge that I have not been able to make any sense of it. The log entry is about 3Mb big.

There is also an error in the Apache log:
File does not exist: .../media/fef/js/tabs.min.map

And this is what I'm seeing in the browser console:

POST https://...../administrator/?option=com_civicrm&task=civicrm/case/add&action=add&context=case&cid=30&snippet=json
500 (Internal Server Error)
send    @   jquery.js?r=2i4CQ:10254
ajax    @   jquery.js?r=2i4CQ:9738
fileUploadXhr   @   jquery.form.js?r=2i4CQ:346
$.fn.ajaxSubmit @   jquery.form.js?r=2i4CQ:254
doAjaxSubmit    @   jquery.form.js?r=2i4CQ:890
dispatch    @   jquery.js?r=2i4CQ:5226
elemData.handle @   jquery.js?r=2i4CQ:4878
click   @   crm.ajax.js?r=2i4CQ:466
(anonymous) @   jquery-ui.js?r=2i4CQ:12443
dispatch    @   jquery.js?r=2i4CQ:5226
elemData.handle @   jquery.js?r=2i4CQ:4878

This isn't a direct answer to the problem but definitely helps with accessing the log errors to help further diagnosis.

The excellent Log Viewer extension gives UI access to your logs.


How do you display cross-contact searches? I am trying to create a CSV using both Individual contact and Organisation contact information and I am having difficulty trying to achieve this.

As it's most basic it is to print postal labels containing:

The Individual with a specific relationship (there is only one per Organisation)
The Organisation display name
The Organisation address

The way that I thought most logical to do this is:

Open the Smart Group with all the organisations (filtered by the organisations membership status)
"Select All" and "Export Contacts"
Include field "Individual" > "Relationship (under related info for)
Include the Organisation fields

The exported file leaves the individual field blank though.

I am using Civi 4.4.14 and Drupal 7.39

Try creating a smart group of the indiviuals - you should be able to search for all individuals with that particular relationship. You can then export the contact info.

When exporting, you'll need to select 'Individual' > Relatonship (e.g. 'Employee of')' > Organisation details for each of the address fields

Actually, thinking about it, that might be the problem with your attempt - try selecting the export field 'Organisation' > Relationship (e.g. 'Employer of') > Individual details.


Can I specify a dedupe rule and import type (e.g. update) when using command line import I'm using the command line import, following info provided here:

How do I import contacts through the command line?

https://forum.civicrm.org/index.php?topic=34033.0

Since I have data that includes address, relationships and membership, I assume I'll have to import in stages.  How do I specify a dedupe (based on email address) command and do updates using the command line?

The command line import uses the default unsupervised rule for deducing.  Out of the box that's just email.

When using command line import if the unsupervised dedupe rule says the import line is a duplicate then it will do an update instead of a creating new record.


In mailing all recipients are not showing I have a problem related to 'mailings'. When I create a new mailing and select a group (for example, 'current members') in 'Recipients' then it is not showing all recipients. For example, I have 5681 total contacts, 67 of which are in 'Current Members' group, but after selecting this group in mailing it is showing only 4 recipients. I have checked there are not any blocked contacts and there are also not "Do Not Call" for any contact.

I am using following versions

CiviCRM Version 4.7.17
Wordpress Version 4.7.3

Indeed, civicrm automatically excludes from the mailing recipients contacts that:

have opted out (do not contact me)
have bounced
have said they do not want to receive emails

(I might miss a criteria or two)

Check some of your "vanished" contacts, the contact summary page should make clear why she isn't included.

Bounce emails is a common issue. It might be that you had a technical problem once and that your mail server wasn't willing to deliver the emails (eg. because you have a quota on how many emails you can send per hour) and were incorrectly flagged as bounce.


CiviCRM 5.x is storing lot of empty records while sign petition I am using Drupal 7 with CiviCRM 5.x version and I am not sure why but civicrm is storing lots of empty records(means no email, name etc) it just creates user record.

All these empty details records are created from petition page.

Is anyone faced same king of issue? any help is appreciate.

I have a same pb of "blank" contacts when a petition is signed (Form/Profile hosted on an other website).
Drupal / civicrm V4.7.31


What is the best way to override changes to CRM_Core_Config? What is the best way to override changes to CRM_Core_Config without modifying the original. Have tried through inheritance, but generates the following code:

  Fatal error: Cannot redeclare class CRM_Core_Config ....../code/sites/all/civiphp/CRM/Core/Config.php on line 854

It isn't possible to dynamically load and unload the class, so I was thinking of writing a module which modifies the object after it has loaded via a hook. At least this would survive upgrades.

• http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_config

I've come up with this function to clear cache, when file paths change.

function cacheoff_civicrm_config(&$config) {

  // 1. Get document root from the server
  // 2. Compare to a set path in the cache
  // If 2. doesn't start with 1., then regenerate cache
  // This means the file path has changed

  $templateDir = $config->customTemplateDir;
  $document_root = $_SERVER['DOCUMENT_ROOT'];

  if (!substr($templateDir, 0, strlen($document_root)) === $document_root) {

    CRM_Core_Error::debug( "Path changed: " . $document_root . " doesn't match " . $templateDir );
    CRM_Core_Config::clearDBCache();

  }
  _cacheoff_civix_civicrm_config($config);
}


Where in the DB are CiviCase timelines and sequences stored? Please can someone tell me, where in the DB are CiviCase timelines and sequences stored?

Generally, civicrm_case_type.definition

If the definition is NULL, then it will fallback and search for an XML file.

The loading logic is in CRM_Case_XMLRepository.


On line donation Thank You I would like to customize the auto TY email that is generated to a donor once a donation is made. Can I do this? If so- can you please tell me how?
Thanks so much!

There are a few places that contribute to the TY email.

On the Receipt tab of the Contribution page config you can add a message there in "Receipt Message".

Also any 'pay later' instructions will also be inserted.

The main template that sucks those bits in and adds a lot of other bits is under > Administer > Communications > Message Templates then click on System Workflow Messages and look for eg Contributions - Receipt (on-line)


Cron - Invalid key value sent Really getting frustrated trying to get cron to work.

WP 4.7 / CiviCRM 4.7.14

using via ssh:

/usr/bin/wget 'https://hbb.org.uk/wp-content/plugins/civicrm/civicrm/bin/cron.php?name=JohnB&pass=123&key=456'

Generates the error.

my settings.php has:

if (!defined('CIVICRM_SITE_KEY')) {
  define( 'CIVICRM_SITE_KEY', '456');
}

Where the two keys are identical. There are no special characters, it's a 20 char string, I've re-entered a new string into both settings.php and the wget. Each time generates a new error log file with the msg.

When I enter the url into Chrome I get "Invalid key". Yet they're identical in the wget and settings.php.

Is there some super-sekret settings file somewhere?

Site key should be defined in civicrm.settings.php, not settings.php, which isn't necessarily bootstrapped when cron is run.

If that was mis-stated in your question (likely, since you're using WordPress), you can try to troubleshoot this by debugging.

Find your CiviCRM log and your CiviCRM root.
In your CiviCRM root, find the file CRM/Utils/System.php.
Find this section (around line 553):

if ($key !== $siteKey) {
  return self::authenticateAbort(
    "ERROR: Invalid key value sent. " . $docAdd . "\n",
    $abort
  );
}

Add two debugging lines so that section now looks like:

if ($key !== $siteKey) {
  CRM_Core_Error::debug_var('key', $key);
  CRM_Core_Error::debug_var('siteKey', $siteKey);
  return self::authenticateAbort(
    "ERROR: Invalid key value sent. " . $docAdd . "\n",
    $abort
  );
}

Run your cron job again, get the same error.
Check the CiviCRM log.  At or very near the bottom of the log file, you should see lines that look like:

$key = 456;
$siteKey = 456;

...except I'm guessing that one of them looks slightly wrong!  Use that information to either fix this problem and/or update this question with more info.


Account Type Checking/Savings Disappears when making a contribution Civi 4.7.17
WordPress 4.7.3
iATS Payments Processor

We recently upgraded from 4.6.26 to 4.7.17, since the upgrade this quirk has popped up. When making an ACH contribution, one of the required fields is Account Type and our two choices are Checking or Savings. This field displays with the drop-downs on initial load. However, once you select Electronic Funds Transfer, the Account Type field disappears. When you hit Confirm Contribution, you get an error telling you "you skipped a required field." This time the Field is displayed adn you can complete the donation.  I have attached several screenshots.

I tried changing the default to Credit Card but you get the same results.
I tried switching my theme to see if it was a theme conflict, but I get the same results.
I also used the Chrome Inspector adn found that it is not a CSS issue. It is missing HTML so likely a php issue.
I could not get the demo site to display an ACH payment option to test it there.

Is this a Civi core problem or an iATS Extension problem? Who generates the contribution form? Any ideas on what I can do to correct the issue?

We recently upgraded the iATS Payments extension to 1.6 and the problem went away.


Fatal error on CiviEvent dashboard in 4.7 using PHP 5.3.5 Just tried the 4.7 upgrade and found it was giving a fatal error when I tried to acces either the event dashboard ( /civicrm/event?reset=1 ) and Manage Events ( /civicrm/event/manage?reset=1 ).

Fatal error: Can't inherit abstract function Civi\ActionSchedule\MappingInterface::createQuery() (previously declared abstract in Civi\ActionSchedule\Mapping) in C:\xampp\htdocs\switch\sites\all\modules\civicrm\Civi\ActionSchedule\Mapping.php on line 64

I can access the other CiviEvent pages (e.g. add new event, add participant, etc), and none of the other components seem affected.

Using Drupal 7.41, and upgraded to 4.7 from 4.6.10. I am running PHP 5.3.5, which the upgrade warned against but only for future versions?

Not sure if it relates, but if so it is likely your PHP version:

Bug #66818  PHP Fatal error: Can't inherit abstract function


How to use the REST API with curl Ok - it's my first time diving into REST API - First of all trying to get it to return me just the data for one specific contact. It works great in the browser but on the command line no matter what I try I keep getting the data for the first 25 contact_ids in the civicrm_contact table; it's simply ignoring my very specific attempts to just give me contact_id: 358383;

I've tried [and they all return data for the first 25 contact_ids in either json or xml - that all works fine]:

CiviCRM 4.6 LTS - and Drupal 7.x

curl -i -H "Content-Type: application/json" -X POST -d '{"contact_id":"358383"}' "https://example.org/sites/all/modules/civicrm/extern/rest.php?entity=Contact&action=get&api_key=XXX&key=XXX"

curl -i -H "Content-Type: application/json" -X POST "https://example.org/sites/all/modules/civicrm/extern/rest.php?entity=Contact&action=get&api_key=XXX&key=XXX&json={"contact_id":"358383"}"

or

curl -i -H "Content-Type: application/json" -X POST "https://example.org/sites/all/modules/civicrm/extern/rest.php?entity=Contact&action=get&api_key=XXX&key=XXX&json={contact_id:358383}"

If anyone has any examples/suggestions that would be great! I'm curl-ing on MacOSX - from what I've been reading "/%22' syntax could be important.

I just created a working example for curl and tested it on linux. Do also URL encode the curly braces. I used the this website to do that. So {"contact_id":"358383"} becomes %7B%22contact_id%22%3A%22358383%22%7D .

I used curl with different parameters. My example is

curl -X POST "http://localhost/sites/all/modules/civicrm/extern/rest.php?entity=Contact&action=get&api_key=XXX&key=XXX&json=%7B%22sequential%22%3A%221%22%2C%22id%22%3A%222%22%7D"

Update: I see I am a bit misleaded by the example generated by the api explorer. JSON for parameters is not mandatory. It is possible to use the following format.

 curl -X POST "http://localhost/sites/all/modules/civicrm/extern/rest.php?entity=Contact&action=get&api_key=XXX&key=XXX&json=1&contact_id=2"

See REST API without JSON just key=value .


In civivolunteer, is it possible to allow multiple users for 1 email? Quick info:

Wordpress: 4.7.1
CiviCrm: 4.7.15
CiviVolunteer 4.6-2.2.1

We are working with a group of often older volunteers that may only have one email address for two or more people.  Is there a way to allow them to register under this same address?  Currently, the system automatically replaces the name for anyone that has the same email address, making it difficult to sort the volunteers out.

The short answer: Yes, it's possible.

You're asking about the "Unsupervised Dedupe Rule" - that is, the test to determine whether a contact who fills out a public-facing form is a duplicate of someone already in the database.

Documentation can be found here, and I definitely suggest reading it before making changes.  However, the general idea is to make up a different dedupe rule (e.g. "same email AND same first name" might be better in your case).  Then go to Contacts menu » Find and Merge Duplicate Contacts, create the new rule, and make it the new "Individual Unsupervised" dedupe rule.


Deadlocks in Rebuild Smart Group Cache Sorry in advance for my lack of familiarity with civi, I'm not the most experienced member of the team.

We seem to be running into a problem with the Rebuild Smart Group Cache job where the cpu will completely max out every time it is run. I looked deeper into the issue in the log and have gotten the following output:

[info] $Fatal Error Details = Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => exceptionHandler
        )

    [code] => -1
    [message] => DB Error: unknown error
    [mode] => 16
    [debug_info] =>
    DELETE  g
      FROM  civicrm_group_contact_cache g
      WHERE  g.group_id = 120  [nativecode=1213 ** Deadlock found when trying to get lock; try restarting transaction]
    [type] => DB_Error
    [user_info] =>
    DELETE  g
      FROM  civicrm_group_contact_cache g
      WHERE  g.group_id = 120  [nativecode=1213 ** Deadlock found when trying to get lock; try restarting transaction]
    [to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::exceptionHandler prefix="" info="
    DELETE  g
      FROM  civicrm_group_contact_cache g
      WHERE  g.group_id = 120  [nativecode=1213 ** Deadlock found when trying to get lock; try restarting transaction]"]
)

It has also happened on the query

       [user_info] => INSERT IGNORE INTO civicrm_group_contact_cache (contact_id, group_id)
        SELECT DISTINCT id, group_id FROM civicrm_temp_group_contact_cache910
       [nativecode=1213 ** Deadlock found when trying to get lock; try restarting transaction]

Is this at all related to https://civicrm.org/blog/eileen/478-group-contact-cache-deadlocks-improvement ? And would it be alleviated by changing the caching setting mentioned in the blog post?

That pretty much sums it up. We have fixed similar problems by changing the Smart Group cache timeout via civicrm/admin/setting/search?reset=1, alongside setting a limit to the Scheduled Job so that only X groups would be considered for each job run.
In another situation we did the following (pasted from our ticket system).

set cache clearing to deterministic drush cvapi setting.create smart_group_cache_refresh_mode=deterministic
created a scheduled job to run always job.group_cache_flush

Outcome was clearing the civicrm_group_contact_cache after the 5 minute time we allow caches to be valid.
This should resolve deadlocks that occur during cache clearing. It will not resolve deadlocks that may occur during cache rebuilding

Hopefully those give you some ideas of ways to progress


Can we have a "week" option for the membership type duration unit? I'm doing some work to enable the purchase of auto-renewing memberships, using the UK-focussed GoCardless direct debit system.
So far so good. One thing we've noticed is that the GoCardless API understands intervals in weeks, months, and years (with 1 year being the maximum). However CiviCRM's membership type duration unit doesn't offer 'week' as an option.

What would be involved in order to add 'week' as an option here?

We could do an extension for you, consistent with LExIM strategy, to implement this, Graham. Ping me at joe dot murray at jmaconsulting dot biz.


questions on External ID Is External ID Unique? will it automatically check for a duplicate External ID when the attempt is made to enter into database?
Can External ID be auto incremented whenever an individual gets added?

The External ID (external_identifier) is maintained in the database with a unique index, so any attempt to enter a duplicate value will take an error.

The external_identifier itself is simply a variable character string of 64 char in length (varchar(64)).  As such it cannot auto-increment.

Remember, the external_identifier is designed to contain an identifier of the contact that might originate in a separate system.  In practice, it is most common to use it when migrating from some other CRM system into CiviCRM, wherein the other systems identifier is stored in the External ID.   This can be invaluable for audit purposes.

If you are looking for an auto-incremented identifier, you should consider using the contact_id.


Manage Groups shows no groups after server move We moved our CiviCRM install to a new server a couple of weeks ago. Everything seemed to go smoothly, but we've now noticed that the Manage Groups page is empty:

Clues that I've got so far:

This happens both with new users, and users that were moved over from the old server.
I can create a new group without errors, but obviously it doesn't show up afterwards.
Group counts show up on the contacts page tab, but no roups are shown there either.
We followed the move process outlined at https://docs.civicrm.org/sysadmin/en/latest/misc/switch-servers/.

Hopefully somebody out there's got some clues, because I'm coming up empty right now... Thanks in advance for the additional brain cells!

CiviCRM 5.11.0, Wordpress 5.2.1

Points to Aidan -- I had flushed out the caches, but hadn't cleared out the templates_c folder. Once I did that I discovered a permissions problem on the templates_c/en_US folder. With that fixed everything is working again!


How can I track donations made as a result of a particular email? I know that I can see who clicked through on the "donate" link on an email - but I don't see a way to check if the donation was made as part of that interaction.

Is there a way to determine this?

The easiest way to do this (whilst not 100% foolproof) would be to create a special donation page for the link in the email (i.e. separate from the donation page that presumably appears as link and 'proper' page on your website).

Go to Contributions >> New Contribution Page or Administer >> CiviContribute >> Manage Contribution Pages.

Then once your new contribution page is complete, simply copy the URL you get from Links >> Live Page into where you have the donate link in your emails. It will look something like https://your-site.com/civicrm/?page=CiviCRM&q=civicrm/contribute/transact&reset=1&id=2

As long as you don't link to that URL from anywhere else (like a button on your website), it should only ever be used by someone clicking on an email. You can then use a Contribution Report for that particular donation page.

It looks like you may also be able to do it with custom fields and passing URL parameters, but that's more complicated. See this entry in the wiki, from 2014: https://wiki.civicrm.org/confluence/display/CRMDOC/Update+custom+fields+in+contributions+and+events+by+passing+variables+in+a+URL


Mailchimp/Civicrm synchronization I just recently upgraded to Civicrm 5.9.1. I had used the Mailchimp extension in the past in test mode previous to our current Civicrm upgrades, and now want to implement it. I was behaving weirdly after the upgrade, so I uninstalled it and then reinstalled it.

I have the newest 2.0.1 version installed, the permissions should be correct since I've assigned all user roles to the Mailchimp: allow webhook posts, and I've verified the webhook is running (doing a Mailings -> Mailchimp settings -> Save and Test responds that the API is returning the correct information from Mailchimp). We're still running Wordpress 4.9.9.

When I attempt a manual sync in one of the Mailchimp sync choices under Mailings, I get a description screen, but no ability to do anything. Has anyone else seen this behaviour or have insights?

There's nothing in error logs that indicate anything is happening with PHP. We're running PHP 7.1.26.

I did the change suggested here to get rid of the php problems and then reset everything and that seems to have solved the problem. Not sure what was happening, but at least things are working now. mailchimp extension error, php 7.1, civi 5.10.4, drupal 7.x


passing POST payload in Content Body I'm unhappy at the prospect of passing sensitive data like contact details as URI parameters for a POST (where they will show in logs, etc.). Is it possible to pass the details in the content body instead? This is standard practice for RESTful APIs and I'm surprised that it is not the standard for civi.

Yes the civicrm extern/rest.php will merge GET and POST parameters.

Regarding security, while yes it is better to send private data in POST, it's not necessarily that much more secure since POST data can be logged too, just you're right not usually by default. See also https://security.stackexchange.com/questions/30754/is-there-a-difference-between-get-and-post-for-web-application-security. For real privacy it would need to be encrypted, and then have some way to decrypt it at the civicrm end.


is there a quick way to export the complete data from my database? I am new to civicrm, just got a job with an organisation where this is the pre-existing database. I think the data in there is in a mess and I would like to export all data to excel / csv if possible so I can check through it. Is there any way of doing this quickly?
Thanks

The short answer is "Yes" but it's not as useful as you might think.

First - consider a contact with 10 donations, 5 events attended, 3 memberships, etc.  If you exported this all in one table, it would be hundreds of columns, with data flattened to the point of uselessness.  On the other hand, if you export contacts in one table, donations in another, etc., it's quite hard to make good sense of what you're looking at since it lacks context.

My recommendation is to search for all contacts (going to Search menu >> Find Contacts and press Search without specifying any criteria).  Then from search results, select the All Contacts  radio button, and Export Contacts from the Search Actions drop-down.  Export All Primary Fields.

This is a) still information overload, b) doesn't contain quite a lot of database information, but will serve as a helpful starting place to familiarize yourself.


What tpl or php file calls/loads CRM/UF/Page/Group.tpl for the Profiles page? I trying to debug my civicrm backend Profiles page on Joomla.  Could someone backtrace the templates/CRM/UF/Page/Group.tpl when the the Profiles page is loaded?  I believe the Profiles page loads the templates/CRM/UF/Page/Group.tpl

For some reason, my setup does not load the templates/CRM/UF/Page/Group.tpl and I am unable to find the tpl or php page that is suppose to load the Group.tpl.

For the Profiles page, the templates/CRM/common/joomla.tpl template loads the Group.tpl file.  Since the production website was malfunctioning, I had to install a local copy in order to adequately debug.


How can I reference a contact's Drupal/Wordpress/Joomla account with a CiviMail token? From time to time we need to send messages through CiviMail that include a contact's CMS (Drupal/Wordpress/Joomla) username or ID. How can we add this to the available tokens?

Option 1: Use the CiviToken extension [recommended, CMS independent]:
Fuzion's CiviToken extension provides {user.name} and {user.id} tokens by default. (Pro tip: this module also makes it easy to add custom tokens in a tokens/ folder in your CiviCRM custom PHP directory; you can duplicate and modify a file from the tokens/ folder in this extension)

Option 2: Custom token in your own Drupal module [Drupal specific]:
Coleman authored a blog post some years back which outlined how to make custom tokens. The following snippet is based on that and when slipped into a custom module will make the Drupal username available as a token in CiviMail.

<?php
/* CiviCRM token addition for Drupal username */

function MYMODULE_civicrm_tokens(&$tokens) {
  $tokens['username'] = array(
    'username.drupal' => 'Drupal username',
  );
}

function MYMODULE_civicrm_tokenValues(&$values, $cids, $job = null, $tokens = array(), $context = null) {
  // Username tokens
  if (!empty($tokens['username'])) {

    civicrm_initialize();
    foreach ($cids as $cid) {
      $params = array(
        'version' => 3,
        'sequential' => 1,
        'contact_id' => $cid,
      );
      $result = civicrm_api('UFMatch', 'get', $params);
      if (!$result['is_error']) {
        $drupalinfo = user_load($result['values'][0]['uf_id']);
        $values[$cid]['username.drupal'] = $drupalinfo->name;
      }
    }

  }
}
?>

Keep in mind that this is the bare bones and doesn't include any handling of a contact without a Drupal account. (So you would want to make sure to only use this token when sending to contacts with a Drupal account.)


Is CiviCRM planning a 'cloud' version of civicrm (perhaps using AWS or Azure)? This is a question about future development of Civicrm

Yes, if by "cloud version" you mean an on-demand managed service. CiviCRM LLC is currently trialing Spark, a hosted entry-level CiviCRM offering.

https://civicrm.org/spark

This service is currently in beta, and you can sign up at the link above. From the linked page:

CiviCRM Spark — currently in Beta — allows you to get your own installation of CiviCRM up-and-running in minutes, with a specially-customized version including the new Shoreditch interface.
Spark is ideal for organizations of any size wanting to test and trial CiviCRM, or for smaller organizations and activities with up to 2000 contacts.

This offers an easy entry point to running CiviCRM, without the ongoing effort of managing a server.
Note the mentioned 2000 contact limit (as of April 2018), beyond which you could consider hosting with other providers, eg those mentioned in Erik's answer, or running your own version.