title: How to change order in billing address

text:
# Question
Title: How to change order in billing address
I'm using Civicrm 5.13.4 on Drupal 7.67.

I want to change the order of the address fields and bring "postal\_code" upper in the list when using the "pay later option". I was able to find for online payment but not for this option. It's also already set in localization/address. Is there a way to modify this?

Thanks Guillaume

# Answer
> 2 votes
If you want a quick hack, you can change it in CRM/Core/Payment/Manual.php in the getBillingAddressFields() function. Just rearrange the order in the return statement.

To do it without a hack you might be able to use the buildForm hook in an extension. You could also move it with some jquery but that's also a bit of a hack.

---
Tags: contribution-page
---


title: Number repeat events

text:
# Question
Title: Number repeat events
We have set it up so we use a drupal form to register for events. We have repeating events, and the form lets you sign up for all of them in one go.

When we go to set up the events form, our dropdown just shows the title of the event ie "after school football" six times. this is confusing as we may not select all of these or select one more than once. I am looking for some way to have it so the repeating events are numbered, or have their dates beside them.

Here is a picture to try and illustrate what I am meaning:

# Answer
> 1 votes
I'm afraid there is no code that I know off. It's certainly possible we can add an id (or date or something) to the Event listing in the admin-config page. End-user org can become an official Webform CiviCRM sponsor as of $300; send me a direct message if you're interested in learning more.

I would also be happy to review a PR if you (and/or your developer) would like to submit one - I'm a co-maintainer on https://www.drupal.org/project/webform\_civicrm

---
Tags: civievent
---


# Question
Title: Activities don't show on the profile page
This child has three activities linked to his profile, however they don't show up. The do show up if we navigate to cases, but we would like to see them from this profile view. Is there any way I can get this working?

# Answer
> 0 votes
Case activities usually don't show on the "non-case" side of things, like on their user record. As to why it shows "3" on the tab there that might be the theme since I don't see it counting them on dmaster.demo.civicrm.org. Looks like maybe shoreditch theme?

---
Tags: civicase, activities
---


# Question
Title: Restrict location types available to specific contact subtype
We have a contact subtype that needs to have location types of 'Postal' and 'Geographical'.

I can edit the location types list to create those entries, but is it possible to restrict the available location types for only that contact subtype so none of the default locations (which we still want for individual contacts) are shown to users?

It'd also be handy to restrict which location types appear in which fields as, obviously, a postal location for a phone doesn't make a lot of sense!

# Answer
As Erikh said you cannot control the location type options through CiviCRM UI but you can restrict filter them using either buildForm or fieldOptions hook.

If you are using drupal than you can use webform with conditional filtering to filter the options. HTH

Pradeep
> 2 votes

# Answer
You can not restrict location types to specific contact types in core CiviCRM. Obviously you can develop and extension that does this.
> 2 votes

---
Tags: contacts, contact-types, location-type
---


# Question
Title: Where do I create an issue on lab.civicrm?
I found a small bug in this file:

> /sites/all/modules/civicrm/templates/CRM/Contribute/Form/Contribution/Confirm.tpl

Where do I submit an issue on lab?

# Answer
Visit https://lab.civicrm.org/dev/core/issues. You might need to create an account if you don't already have an account there or a civicrm.org account. Then you'll see a new issue button. But search there first if it hasn't already been reported.
> 1 votes

---
Tags: civicontribute
---


# Question
Title: How do I bulk update organization subtypes using a profile?
I've been trying to use the 'Update Multiple Contacts' feature from within a Group using a profile. The profile field is 'Organization Subtype'

However, when I get the list of contacts to update, and click in the field, no results with the error 'none found' shows up, even though on my database there are a few different subtypes. Am I doing something wrong, or is this a bug?

# Answer
This problem sounded vaguely familiar, and I just found out why.

This is logged on the (old) CiviCRM issue tracker as CRM-17451. The answer was that someone would have to write this functionality or work with the core team to do so. However, I also see that I found a workaround back in 2016. From the page:

> In non-technical terms: Profiles secretly have a contact type they're associated with. You can see this if you try to add an organization-specific field to a profile, then an individual-specific field. You'll get the error "Cannot add or update profile field type Individual with combination of Household or Organization". That's because Civi has decided this is a profile associated with Organizations. However, when you don't have any contact type-specific fields on a profile, your profile defaults to a contact type of "Individual" for many purposes. So individual contact subtypes are loaded.
>
> The workaround: Add an organization-specific field (like "Organization Name") to your profile, and this problem goes away.
> 2 votes

---
Tags: profile
---


# Question
Title: Problem with the ical feed of the calendar
I would really like to use CiviCRM's function to create an ical feed for the calendar. But I'm having some hard times to get it working.

The event has a title, a date, a custom category and a 'long description'. When you visit the url to the ical feed: https://example.tld/civicrm?page=CiviCRM&q=civicrm%2Fevent%2Fical&reset=1

you get the following .ics file

civicrm\_ical.ics

```
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//CiviCRM//NONSGML CiviEvent iCal//EN
X-WR-TIMEZONE:Europe/Amsterdam
METHOD:PUBLISH
BEGIN:VEVENT
UID:CiviCRM_EventID_4_215ca88ba6fc880ae683205e6cd7bc8d@example.tld
SUMMARY:Test-event
DESCRIPTION:Some description
CATEGORIES:ALV
CALSCALE:GREGORIAN
DTSTAMP;VALUE=DATE-TIME:20190401T200000
DTSTART;VALUE=DATE-TIME:20190401T200000
DTEND;VALUE=DATE-TIME:20190402T030000
URL:https://example.tld/civicrm/?page=CiviCRM&q=civicrm%2Fevent%2Finfo&reset=1&id=4
END:VEVENT
END:VCALENDAR

```

But when I use the url of the feed in fastmail or google calendar for instance, an error appears, or the calendar items do not appear. What could be the problem?

I use CiviCRM 5.10.3 on Wordpress.

Kind regards,

Sam

--- edit ---

I got the following error message from Fastmail, my mailprovider.

> Syncing to your \[redacted\] calendar has been disabled: \[ad2278bd-7237-4dee-884f-4eff6f3666bc\] The calendar data was invalid: Error parsing VCalendar data: error Closed a different card name than opened at line 7 char 0:
>
> ```
> ---> ï»¿BEGIN:VCALENDAR
> VERSION:2.0
> PRODID:-//CiviCRM//NONSGML CiviEvent iCal//EN
> X-WR-TIMEZONE:Europe/Amsterdam
> METHOD:PUBLISH
> END:VCALENDAR
>  <--- at /usr/lib/x86_64-linux-gnu/perl5/5.20/Text/VCardFast.pm line 55.
>
> BEGIN:VCALENDAR
> VERSION:2.0
> PRODID:-//CiviCRM//NONSGML CiviEvent iCal//EN
> X-WR-TIMEZONE:Europe/Amsterdam
> METHOD:PUBLISH
> END:VCALENDAR
>  at /home/mod_perl/hm/ME/CalDAVTalk.pm line 1427.
>     ME::CalDAVTalk::_getEventsFromVCalendar(ME::CalDAV=HASH(0x8601578), "\x{feff}BEGIN:VCALENDAR\x{a}VERSION:2.0\x{a}PRODID:-//CiviCRM//NONSGML CiviE"...) called at /home/mod_perl/hm/ME/CalDAVTalk.pm line 2554
>     ME::CalDAVTalk::vcalendarToEvents(ME::CalDAV=HASH(0x8601578), "\x{feff}BEGIN:VCALENDAR\x{a}VERSION:2.0\x{a}PRODID:-//CiviCRM//NONSGML CiviE"...) called at /home/mod_perl/hm/ME/CalDAV.pm line 1434
>     eval {...} called at /home/mod_perl/hm/ME/CalDAV.pm line 1433
>     ME::CalDAV::syncFromIcal(ME::CalDAV=HASH(0x8601578), "b8285308-2a18-4c47-9d22-fae8d8798d21", "\x{feff}BEGIN:VCALENDAR\x{a}VERSION:2.0\x{a}PRODID:-//CiviCRM//NONSGML CiviE"..., HASH(0x89e5670), "Force", 0, "ReadUidPrefix", "913888i-") called at /home/mod_perl/hm/ME/CalDAV.pm line 1904
>     eval {...} called at /home/mod_perl/hm/ME/CalDAV.pm line 1867
>     ME::CalDAV::syncCalendar(ME::CalDAV=HASH(0x8601578), 913888, "Force", 0) called at /home/mod_perl/hm/scripts/caldav_sync.pl line 271
>     main::SyncCalendar(ME::User=HASH(0x89bea78)) called at /home/mod_perl/hm/scripts/caldav_sync.pl line 98
>
> ```

I have no idea what to make of this. There are currently no events in the calendar.

# Answer
The issue has been solved with help I got on the civiCRM repo. (https://lab.civicrm.org/dev/wordpress/issues/25).

1. First I found two files in my site that are loaded on every page that contain a BOM.

`find . -type f -printf "%p " -a -exec od -x -N 4 \{\} \; | grep "bbef 3cbf"`

2. Secondly I removed those BOMs with vim.

Edit the files (which in my case where the `functions.php` and `header.php` file of my theme) with vim. Type `:set nobomb` and save the files.

Now I can use the ical url of my site and it will load in virtual calendars.
> 0 votes

# Answer
As discussed in https://lab.civicrm.org/dev/wordpress/issues/25 and using a different grep since the grep linked to in the comments above doesn't seem to work, there were two theme files with a BOM.

This grep

`find . -type f -printf "%p " -a -exec od -x -N 4 \{\} \; | grep "bbef 3cbf"`

located

`wp-content/themes/ari/functions.php
wp-content/themes/ari/header.php`
> 0 votes

---
Tags: wordpress, civievent, calendar
---


# Question
Title: How to expose Mailing Groups in webform?
I would like to create a webform with a certin mailing group exposed to the user via the checksum link, so that they can subscribe to the mailing group.

If I select "User Select" option during webform processing the entire list of groups of civicrm gets exposed. Does anyone have an idea how to achieve this, please? thanks

# Answer
Edit the form Element -\> change live to static -\> and select the groups you would like to put on the form.
> 4 votes

---
Tags: webform-civicrm, groups
---


title: Qualification Module

text:
# Question
Title: Qualification Module
Is there an easy way to record the various qualification levels for members? We have our own internal qualification and renewal system that determines some people's membership status. It would be helpful to be able to record the date, place and trainer involved for each of our Members. There are 6 levels of training.

# Answer
> 3 votes
This can be very easily achieved using custom data –

https://docs.civicrm.org/user/en/latest/organising-your-data/creating-custom-fields/

The first decision to make is where you would like to see this information, on the contact record or at a membership level.

If a member can have multiple membership types then the custom data set should be created at the membership level. This option will then allow you to record qualification details per membership.

To record –

Date use the Data and Input Field Type option -

Place / Location use the Alphanumeric Select option -

Training level use the Alphanumeric Select option -

To record trainer level you can either use the Alphanumeric Select option or if you have the trainers as contacts in CiviCRM then you can use the Contact Reference Autocomplete option and limit list to a group

Don’t forget to mark them as searchable for reporting purposes!

The end result when viewing the membership -

# Answer
> 2 votes
As Anil said you can use Custom Fields - but assuming someone may have multiple qualifications you would probably need to set your Field group/set to be MultiRecord.

Next issue is whether you create these on the Membership record or the Contact Record. I would argue in favour of the latter.

Lastly a third option is to Create an Activity Type for this since they already have Date fields etc and are quite appropriate to use for this type of purpose

---
Tags: civimember
---


# Question
Title: How to include validation fields to find user for a contribution page to avoid duplicate?
Although we have taken many different approaches, it was always been an issue with duplicated contact records.

What I thought is, if I could include few fields like

* First Name
* Last Name
* Email
* Post Code

and once that anonymous user fills in those fields mentioned above, CiviCRM would look for matching contact and prefills the details for a contribution page.

Is it something possible to achieve? Anyone have any suggestions, please? Thanks

# Answer
Your question suggests you may need to reread https://docs.civicrm.org/user/en/stable/common-workflows/deduping-and-merging/ and then set up your matching rule as you describe and use that. if they match then it will add data to the existing contact rather than create a new one
> 2 votes

---
Tags: contribution-page, duplicate-contacts, prefilled
---


# Question
Title: What could be causing Wordpress to create user accounts for members?
We are running CiviCRM 5.13.4 on the lastest version of Wordpress. We have just moved over to Wordpress, so by rights there shouldn't be many Wordpress users registered.

We have CiviCRM Wordpress Member Sync installed. We have two types of membership - Full, and Associate. Wordpress Member Sync is setup to change the role on any matching user to either 'Full Member' or 'Associate Member'.

It is **not** set to "Create WordPress Users - Create a WordPress User for each Membership when one does not already exist."

However, bit by bit the number of users in our Wordpress system is climbing - and it's only members who are having accounts mysteriously auto-created. Yesterday there were 180 members with user accounts, today 227.

We can't think of anything we're doing that would trigger these accounts to be created, and as every account has some sort of membership attached to it we can only think that the culprit is something buggy in CiviCRM Wordpress Member Sync, but could it be anything else?

# Answer
> 1 votes
This has been answered in comments above

---
Tags: wordpress, civimember
---


title: New member gets user account

text:
# Question
Title: New member gets user account
I would like to have a similar situation to the following.

When a new member registers herself. She will automatically create a new User account for Wordpress. If the user changes the information of this user account (name/mailaddress) this is automatically synced with the information in the CRM.

The user has access to certain elements of the site for as long as they are members.

I also want to use the user accounts to make an integration with Nextcloud so that the users can login there with the same credentials. Contact groups must be synced then.

Any ideas?

# Answer
You can use a combination of CiviCRM WordPress Profile Sync (which provides 2-way sync between WordPress profiles and CiviCRM contact details) and CiviCRM WordPress Member Sync to achieve this.

Have a look at the docs for CiviCRM WordPress Member Sync to see how you can use the Groups or Members plugin to restrict access to WordPress content for your members.

A simple Membership Contribution page in CiviCRM is all that's required to enable sign-ups - with the added benefit that you *don't* have to enable the WordPress setting that means "Anyone can register".
> 3 votes

# Answer
If by "When a new member registers herself" you mean filling in a CiviMember (ie Contribution) Form - then you should be able to set 'create CMS user' on the Profile that is exposed on the form.
> 1 votes

# Answer
You need to create a page in Wordpress that has a CiviCRM Profile embedded in it, like: https://culturalenterprises.org.uk/register-as-a-user/

Update the advanced settings on the profile so that CMS account creation is mandatory, and that it is set to update the details of any matching contact it finds. For this to work your CiviCRM profile must include the field Individual \> Email \> Primary, or the user account registration option won't work. I also strongly recommend you enable recaptcha:

As for updating details, we again send people to a page with a CiviCRM profile embedded, so they update CiviCRM directly. We provide links to the Wordpress user editor screen from that page, if they want to update their password or email.

No idea what Nextcloud is though :)
> 1 votes

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


title: installation de CiviCrm

text:
# Question
Title: installation de CiviCrm
"Parse error: syntax error, unexpected '$this' (T\_VARIABLE) in C:\Program Files (x86)\EasyPHP-14.1VC9\data\localweb\wordpress\wp-content\plugins\civicrm\civicrm\CRM\Core\DAO.php on line 1124"

Résultat de (installation copier dossier civicrm dans répertoire plugins.)

ou

" le lien est expiré" résultat de (installation à partir de téléverser une extension, fichier zip.)

j'y comprends rien.

merci

# Answer
> 1 votes
Philippe, Welcome to CiviCRM SE.

It looks like your server is using older version of php. Can you please check here if your server is using any one of the ones that are incompatible? If so you will need to upgrade your php.

Cheers

Pradeep

---
Tags: wordpress
---


# Question
Title: When will MySQL utf8mb4 support be mandatory?
With recent upgrade, CiviCRM showed me this message

> Future versions of CiviCRM may require MySQL utf8mb4 support. It is recommended, though not yet required, to configure your MySQL server for utf8mb4 support. You will need the following MySQL server configuration: innodb\_large\_prefix=true innodb\_file\_format=barracuda innodb\_file\_per\_table=true

Since I am on shared hosting plan, it is likely that the host will not update these global MySQL settings. I guess that can mean for me the end of updates or a very tedious task of migrating CiviCRM elsewhere.

Is there any information when these MySQL changes will become mandatory?

# Answer
It seems like it's still under discussion as of last week. See e.g. https://lab.civicrm.org/dev/core/issues/979
> 7 votes

---
Tags: mysql
---


# Question
Title: What is stopping to update recurring payment or billing details!
Some of our donors have reported that they were not able to update the amount or cancel their recurring subscription payment using the standard email receipt that gets sent from CiviCRM. I am using Paypal pro with CiviCRM 5.13.5. When I have tried it myself, I get the following error.

However, if a link is served with checksum for that user then I was able to use UPDATE, CANCEL links! How can I fix this problem, please? Thanks.

UPDATE: this is the url I get when I click the link

https://example.com/index.php?q=civicrm/contribute/unsubscribe&reset=1&crid=173&cs=631e63d2b52b3596e18b1f3fe144afc3\_1559485259\_inf

does it seem all parameters present in the URL?

# Answer
> 2 votes
Test this patch to see if it fixes your problem? https://github.com/civicrm/civicrm-core/pull/14407

---
Tags: paypal, recurring-contributions, receipts
---


# Question
Title: Why no Member entity in the API v4 Explorer
I can't see Member or MembershipType in the API Explorer, nor can I see support for these entities in the API code. As these are pretty crucial I must be missing something - can anyone help?

# Answer
Appears that API4 is not the default API, we are still on API3. I was misled by the fact that API Explorer V4 links now appear on CIVICRM menu into believing that it was now default, however on my install there is still a

/civicrm/api

path for the API V3 explorer which allows management of a much larger set of entities, including Membership and many more.
> 1 votes

---
Tags: api
---


# Question
Title: How can I change to the Spanish language?
How can I change to the Spanish language? I want to know if it is necessary to download a package of Spanish language, where to get it and how to install it so that the whole program runs in the Spanish language.

# Answer
> 3 votes
At https://docs.civicrm.org/sysadmin/en/latest/install/drupal7/#i18n it links to some instructions at https://wiki.civicrm.org/confluence/display/CRMDOC/i18n+Administrator%27s+Guide%3A+Using+CiviCRM+in+your+own+language

The download link it mentions is a little bit hidden. When you go to https://civicrm.org/download and click on the big download button it's the last one that shows in the dropdown list.

---
Tags: language
---


title: Problem Importing Contacts

text:
# Question
Title: Problem Importing Contacts
I get the following errors while importing a contact CSV file. I hope somebody can help with the issue. Civicrm 5 latest with WP 5 latest and the error is same with both PHP 5 and 7.2.

```
"Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or service provider with more details about what action you were performing when this occurred.
DB Error: constraint violation
Error Details
Database Error Code: Cannot add or update a child row: a foreign key constraint fails (`wp_23ye3`.`civicrm_address`, CONSTRAINT `FK_civicrm_address_master_id` FOREIGN KEY (`master_id`) REFERENCES `civicrm_address` (`id`) ON DELETE SET NULL), 1452
Additional Details:
Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -3
    [message] => DB Error: constraint violation
    [mode] => 16
    [debug_info] => INSERT INTO civicrm_address (contact_id , location_type_id , is_primary , is_billing , street_address , supplemental_address_1 , city , state_province_id , postal_code , country_id , manual_geo_code , master_id ) VALUES ( 10 ,  1 ,  1 ,  0 , 'Lakhimi Nagar Hatigaon' , 'Dispur' , 'Guwahati' ,  1204 , '781006' ,  1101 ,  0 ,  0 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`wp_23ye3`.`civicrm_address`, CONSTRAINT `FK_civicrm_address_master_id` FOREIGN KEY (`master_id`) REFERENCES `civicrm_address` (`id`) ON DELETE SET NULL)]
    [type] => DB_Error
    [user_info] => INSERT INTO civicrm_address (contact_id , location_type_id , is_primary , is_billing , street_address , supplemental_address_1 , city , state_province_id , postal_code , country_id , manual_geo_code , master_id ) VALUES ( 10 ,  1 ,  1 ,  0 , 'Lakhimi Nagar Hatigaon' , 'Dispur' , 'Guwahati' ,  1204 , '781006' ,  1101 ,  0 ,  0 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`wp_23ye3`.`civicrm_address`, CONSTRAINT `FK_civicrm_address_master_id` FOREIGN KEY (`master_id`) REFERENCES `civicrm_address` (`id`) ON DELETE SET NULL)]
    [to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_address (contact_id , location_type_id , is_primary , is_billing , street_address , supplemental_address_1 , city , state_province_id , postal_code , country_id , manual_geo_code , master_id ) VALUES ( 10 ,  1 ,  1 ,  0 , 'Lakhimi Nagar Hatigaon' , 'Dispur' , 'Guwahati' ,  1204 , '781006' ,  1101 ,  0 ,  0 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`wp_23ye3`.`civicrm_address`, CONSTRAINT `FK_civicrm_address_master_id` FOREIGN KEY (`master_id`) REFERENCES `civicrm_address` (`id`) ON DELETE SET NULL)]"]
)"

```

# Answer
It sounds like you have selected one of the columns to be "Master Address Belongs To". If the record that column references doesn't exist yet you will get this error. Also FYI it looks like that column needs to be an integer.
> 2 votes

---
Tags: contacts, import
---


# Question
Title: The replacement token civicrm-user:one-time-login-url not working in Drupal Rules emails
With Drupal and Civi latest, is it possible to send an email with a one-time login url?

We have a scenario in which an admin grants a membership to a new contact. We want this new contact to automatically be given a new user account, and the correct role for their membership, and then send them an email giving them details about their new membership, as well as how to access their membership materials. (Their membership materials are on Drupal pages that are only visible to that membership's role).

So far we've succeeded in all of the above, using Drupal Rules.

However, to make their life easier I'd like to send them a one-time login so they can quickly make a password and get on with their life!

I'd prefer not to use the Drupal 'New Account' email for this purpose, since that has to be the same for all possible new users of the site. Also, we looked into not creating a user for them, and just sending them to the Drupal new user registration page. But that's clunky and these users are not internet savvy; they get lost.

In Drupal rules' 'Send HTML Email' action there is a token for the one-time user login: civicrm-user:one-time-login-url. However, it's not populated. And inspecting $civicrm\_user via php print\_r in the email shows no sign of this variable.

I did wonder if CiviRules could do all of the above, but I can't see any way to make a user from it, nor any token for a one-time user login - quite naturally since this would be a Drupal thing.

So... any ideas about how to progress this? I'm grateful for your thoughts.

# Answer
The good news is that it is possible to send an email with a one-time login URL using rules.

There is an issue on the rules module for exactly this ability: problem with mail and one-time-login-url. A patch has been created for this issue that generates a new action in rules to generate a one-time login URL variable which you can then use to insert into an email. I updated the latest version of the patch to work with the most recent dev version of rules.

You will need to access the Drupal user account details in the rule in order to generate the login.
> 2 votes

---
Tags: drupal, user-account, drupal-rules
---


# Question
Title: Unserialize error when viewing a contact
I think this has something to do with a bad database table although I'm not sure how I would go about finding out where or how it happened so any advice would be greatly appreciated!

I have seen questions about a similar error on reports but this is whenever I view a contact so I'm not sure how related they are.

This error gets flagged up several times when I go to view any contact:

```
Notice: unserialize(): Error at offset 247 of 426 bytes in Civi\Core\SettingsBag->loadValues() (line 153 of /home/vabarnsley/public_html/sites/all/modules/civicrm/Civi/Core/SettingsBag.php).

```

I'm using CiviCRM version 5.13.5 and Drupal 7 on PHP 7.1.

I apologise for being a little vague but I'm hoping it makes more sense to someone that has seen it better or knows how to help.

# Answer
> 0 votes
This would happen if you have an invalid value in your `civicrm_setting` table, if someone tried to manually edit one of the serialized values stored in there.

If you're not sure which value(s) might be problematic in that table, you can try editing the file at \`Civi/Core/SettingsBag.php and insert this right after line 153 (note this is untested):

```
if ($dao->value !== NULL && !unserialize($dao->value)) {
  CRM_Core_Error::debug('bad setting', $dao->name);
}

```

That should print the name of the bad setting on your screen.

---
Tags: drupal, contacts, error
---


title: Mandatory payments for new members

text:
# Question
Title: Mandatory payments for new members
I am looking for an elegant solution for the following. It shouldn't be very difficult but I am new to CiviCRM and I want to make the right decisions.

We only have one membership option. Members pay 10,- euro per year. This membership automatically renews until it is cancelled by the member.

If someone becomes a new member, there is a 'joining fee'. A new member pays 10,- extra. So in the first year a new member pays 20,-, in the following years they pay 10,- per year.

I want to use CiviSEPA to handle the payments.

# Answer
An elegant solution really depends on having a reliable way to detect that someone is an existing member. However, assuming you have such a method (e.g. members are logged in or can be detected via unsupervised dedupe rules), I would recommend using CiviDiscount to apply an automatic discount based on membership status.
> 2 votes

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


title: Is there any way to group cases?

text:
# Question
Title: Is there any way to group cases?
Is there any way to group cases, other than using tags? We currently need this for an implementation where case management is used to fulfill wishes for children with chronic diseases. The organization has cases where they need to organize events on a high level for a whole group of children (booking hotels, travel planning etc.) and do some of the planning individually per child with a very different set of activities (communication with parents, getting authorizations etc.). I feel that tags are not sufficient in this case and I would prefer to have a parent case with child cases assigned to it - or at least a group so we would have better selection options in the system. But groups are only available for contacts (?)

# Answer
> 0 votes
There isn't anything exactly like what you're looking for. You can set a case as related to another case, so your parent case could be related to all its child cases. On Manage Case add an activity of type "Link Case", and then on both Manage Case screens that linkage will appear.

# Answer
> 0 votes
You can add Custom Fields on Cases. It may not be a lot of hard work to have a Custom 'reference' field created that lets you link one case to another, but I haven't verified that with our tech experts

---
Tags: civicase, groups, tags
---


# Question
Title: Where is my "Address History" link disappeared?
I used to have an "Address History" link that appeared when an address was updated in CiviCRM 5.10 probably (can't remember the exact version). I have logging turned on.

But since I have updated to the latest 5.13.5 that "Address History" link has disappeared. I have checked on https://dmaster.demo.civicrm.org and it does not appear there too. Is it a bug or intentional removal? Is there a chance to get this back please, because it used to be a great feature I think. Thanks

# Answer
I see reference to Address History in the GDPR extension: https://github.com/veda-consulting/uk.co.vedaconsulting.gdpr so perhaps you saw it on a site that was using that
> 3 votes

---
Tags: issues
---


title: Problems Upgrading Mosaico 2.0 to 2.1

text:
# Question
Title: Problems Upgrading Mosaico 2.0 to 2.1
Mosaico 2.1 has just been released. When I tried to upgrade from Mosaico 2.0 to 2.1 I got several errors as follows:

```
Unable to remove directory
/sites/default/files/civicrm/ext/uk.co.vedaconsulting.mosaico/templates

Unable to remove directory
/sites/default/files/civicrm/ext/uk.co.vedaconsulting.mosaico

Failed to move /tmp/tmp-aBft2l//uk.co.vedaconsulting.mosaico to /sites/default/files/civicrm/ext/uk.co.vedaconsulting.mosaico

Error loading module file (/sites/default/files/civicrm/ext/uk.co.vedaconsulting.mosaico/mosaico.php). Please restore the file or disable the module.

```

Following the upgrade Mosaico then became unusable.

I upgraded Flexmailer at the same time and had no problems. I also checked folder permissions and these looked fine to me. I ran the upgrade process twice and had the same errors both times. has anyone had a similar error?

I thought it might be an error in the extension and posted an issue at Error Upgrading from 2.0 to 2.1, but I guess it could also be my setup, though not sure why it would upgrade Flexmailer without any problems but then have errors upgrading Mosaico.

I am on CiviCRM 5.13.5 with Drupal 7.67

# Answer
> 2 votes
I had a closer look at all the folders and saw there was a symlink in the templates folder pointing to the templates folder! This must have been preventing the upgrade. I think the symlink was there because earlier we had had problems with mailings not finding the social icons and had created a symlink to solve that problem and then forgotten about it!

Once I removed the symlink Mosaico upgraded fine.

---
Tags: extension, upgrade, mosaico
---


# Question
Title: How to add Campaign token in system contribution receipt
Trying to add the campaign name to my automatic receipts.

This works: {$formValues.campaign\_id}

But this doesn't: {$formValues.campaign\_name} or {$formValues.campaign\_title}

I need to print the campaign name and not id.

How can I add the Campaign name to my receipt

# Answer
If you can get campaign id ({$formValues.campaign\_id}) then you can use api to retrieve the Campaign Title. Use below snippet to get the Title

```
{if $formValues.campaign_id}

  {crmAPI var='campaignTitle' entity='Campaign' action='getvalue' sequential=0 return="title" id="`$formValues.campaign_id`"}
  {$campaignTitle}
{/if}

```

> **Note**: The snippet code is not tested but you can use the logic to get the title

HTH

Pradeep
> 3 votes

---
Tags: receipts
---


# Question
Title: Re-ordering search results changes results
Has anyone else seen this bug or reported it?

I ran a Participant Search with the search criteria set to the event name and event type (exhibition). The search returned 22 bookings. But if I reorder the list by clicking on any of the column headers the results change to include bookings from our differently named conference (different event name and type).

I'm using Drupal 7 and Civi 5.13.4. I have replicated the bug on https://dmaster.demo.civicrm.org

# Answer
> 2 votes
This is https://lab.civicrm.org/dev/core/issues/981 with a fix included in 5.14.0

---
Tags: civievent, drupal, search, participants, 5.13
---


# Question
Title: Can we automatically make a users Drupal account inactive when their membership expires?
We are running on Drupal 7.67 and Civi 5.13.4.

Our client wants to be able to block users whose memberships have expired and request them to contact the client to reinstate their membership.

We have been trying to build a custom module to be able to do this and are finding it challenging.

Is there any way that we would be able to use the CiviMember Role Sync or the CiviGroup Role Sync modules to help us achieve this is a simpler manner? If not, how should we proceed.

Thank you

# Answer
Making the account inactive is probably not the best user experience. You could use CiviMember Roles Sync, permission your member content appropriately and show your inactive members the renewal page.
> 6 votes

---
Tags: civimember
---


# Question
Title: How do I solve a string extractor issue?
I'm still having some English mixed with French even though these strings are translated since years in transifex. Like in this example:

> Veuillez vérifier attentivement les informations ci-dessous. Cliquez sur Retour si vous avez besoin d'y apporter des changements. To complete your contribution, click the Continue button below.

And forcing to translate in word replacement doesn't work either. Of course I cleared all caches.

The concerned file is /sites/all/modules/civicrm/CRM/Core/Payment/Manual.php line 255

Any idea?

POST : I'm getting confused. The text

> To complete your contribution, click the %1 button below.

is supposed to be translated since 8 years but should appear in

> templates/CRM/Contribute/Form/Contribution/Confirm.tpl

when it's not and is to be find in

> /sites/all/modules/civicrm/CRM/Core/Payment/Manual.php line 255

# Answer
This string has changed in core, somewhat recently, so it has broken the translation.

The short answer, is that the new string had not been yet pushed to Transifex, and this relies on a manual intervention by project admins. It has now been updated today.

This process has been somewhat problematic for a while. It was not much of an issue because user-facing strings do not change that often, but recently as we tweak more the interface, it has become more apparently. We definitely need to further automate this process.

I started restructuring the documentation on the translation wiki. Hopefully we can make the process clearer and simpler, so that we can automate it at some point.

If you would like to help improve this process, please join us in the CiviCRM translation channel.
> 2 votes

# Answer
I'm not super familiar with translation but I think the issue is the use of ts() in that file.

The string it's expecting is `To complete this transaction, click the <strong>%1</strong> button below.`

So it's expecting ts() to be used with a placeholder and second parameter, but I'm not sure how that would work here because you also want to translate the word "Continue" right?

But just to check, if you change that line to:

`return ts('To complete your contribution, click the <strong>%1</strong> button below.', array(1 => 'Continue'));`

does it work?
> 0 votes

---
Tags: translation
---


# Question
Title: How can I search for all contacts without email?
To find offline members or incomplete records, I would like to list all contacts that do not have an email address set. Is there a way to search for this?

# Answer
> 4 votes
Go to Search - Search Builder.

Choose:

* Contacts
* Email
* Primary
* Is Empty

Then on the results screen you can also from the Actions dropdown choose Groups - Create Smart Group to save this search so you can run it again in the future and because it's a Smart Group it will automatically adjust the results to be current.

---
Tags: search
---


# Question
Title: What contribution dates does the default iATS recur job process?
Does it only run recurring transactions from the current day the job is run (by default) based on the 'next contribution date' field, or does it attempt to run scheduled transactions from past dates as well?

We ran a limited trial and experienced it running a few contributions from days prior to the current date.

# Answer
The recurring contributions job will process all recurring series that have a status in progress and that are due or are past due (i.e. have a next scheduled contribution date either today or in the past).
> 1 votes

---
Tags: iats
---


# Question
Title: "Network Error Unable to reach the server" only doing certain actions
we have a CiviCRM installation under WordPress 4.9.10 and 2 MySQL db: one for Wordpress and one for CiviCRM. Actually we imported and start to manage more than 5000 contacts.

Everything operate as well, excepting the following actions, returning us a

> **Network Error** Unable to reach the server. Please refresh this page in your browser and try again.

* clicking to go on page 2 on a "Search -\> Find Contacts" or a "Search -\> Advanced Search"
* adding a meeting or phone call in the contact summary.

There are **NO ERRORS** adding contributions, registering for events, adding pledges, sending emails.

We see no errors in apache logs too. Actual PHP variables are:

```
 php_value memory_limit 256M
 php_value max_input_vars 2500
 php_value upload_max_filesize 16M
 php_value register_globals off
 php_value max_execution_time 600
 php_value output_buffering 0

```

Any ideas about to solve it? TIA -- Francesco

# Answer
disabling the **ONLY\_FULL\_GROUP\_BY** SQL mode (which it is by default in MySQL 5.7) with this command

`mysql > SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));`

solve the problem about the paging, but it must be considered a workaround.
> 1 votes

---
Tags: wordpress, contacts, error, search-results, advanced-search
---


# Question
Title: hash_equals(): Expected user_string to be a string, null given in Contact/BAO/Contact/Utils.php on line 232
Has anyone else seen this error under Joomla and CiviCRM 5.10.4 when viewing a contact via the front end?

Warning: hash\_equals(): Expected user\_string to be a string, null given in /.../administrator/components/com\_civicrm/civicrm/CRM/Contact/BAO/Contact/Utils.php on line 232

# Answer
I am also receiving this error but on Wordpress 5.2.1 and civiCRM 5.13.4. I have not found a solution to this either.
> 0 votes

# Answer
I had this problem in Wordpress 5.2.1 and CiviCRM 5.13.4 too. Changing line 232 to the following:

```
if (!hash_equals((string)$check, (string)$inputCheck)) {

```

in the file: civicrm\civicrm\CRM\Contact\BAO\Contact\Utils.php fixed the problem.
> 0 votes

---
Tags: contacts, joomla, 5.10.x
---


# Question
Title: Database Syntax Error when attempting upgrade
I have a website that is on Drupal 7 and I am attempting to upgrade the version of Civi from 5.10 to 5.13 but when I attempt to upgrade it, I'm receiving the following error:

```
Database Error Code: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '-b_before_insert' at line 1, 1064

```

I have tried doing the upgrade through drush and also through the /civicrm/upgrade URL with the same error.

It's a bit of a long shot but I was hoping that someone has seen the error before and knows of a fix or how I can determine exactly what is going on.

Taking a look at the debugging information, I can see it has something to do with triggers:

```
DROP TRIGGER IF EXISTS civicrm_saved_search-b_before_insert [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '-b_before_insert' at line 1]

```

# Answer
After a lot of digging, I realised what was happening. For some reason, there was a second `civicrm_saved_search` table in the database named `civicrm_saved_search-b` .

That hyphen `-` is an 'illegal' character unless you escape it.

To resolve the issue, all I did was change the `-` to a `_` which cleared everything up and enabled me to upgrade my site within minutes.

Hopefully, this will help someone else one day who has a similar issue!
> 1 votes

---
Tags: drupal, upgrade, error, database, trigger
---


title: Email When Scheduled Job Fails

text:
# Question
Title: Email When Scheduled Job Fails
When any scheduled job fails or throws an error is there a way to have it send out an email to me? I was thinking drupal rules but wondering if there is an easier way to do this.

# Answer
> 1 votes
Depending on what kind of failure happens this might help: https://civicrm.org/extensions/civicrm-error-report-handler

It will email you for more than just jobs but maybe you'd want that too.

---
Tags: error, scheduled-job
---


# Question
Title: How to make fields on webforms mandatory
I am registering for events through webforms. However if people do not leave their phone numbers we cannot contact them. Is there some options I am missing here to make this a mandatory field?

# Answer
Yes, you can make a field mandatory in a webform. You will need to go under Webform tab of a webform. Click on edit besides the Phone field. On Edit phone scroll down till you see 'VALIDATION'. Check the 'Required' check box and save the form.
> 3 votes

---
Tags: webform-civicrm
---


# Question
Title: wordpress Upgrade 5.2.2 to 5.14 fails with UPDATE civicrm_msg_template error
I've had this problem previously on another site going from 5.2 to 5.10 and was helped here : "Upgrade 5.2.2 to 5.10.4 fails with UPDATE civicrm\_msg\_template error" with lines to comment out from CRM/Upgrade/Incremental/MessageTemplates.php

Unfortunately MessageTemplates.php has changed quite a lot so I don't know how/if I can use the "comment out" solution.

I have no custom templates

here is the error message Jun 07 21:35:46 \[info\] $Fatal Error Details = Array ( \[callback\] =\> Array ( \[0\] =\> CRM\_Core\_Error \[1\] =\> handle )

```
[code] => -2
[message] => DB Error: syntax error
[mode] => 16
[debug_info] =>
      UPDATE civicrm_msg_template SET msg_text = '{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n{if $receipt_text}\n{$receipt_text}\n{/if}\n{if $is_pay_later}\n\n===========================================================\n{$pay_later_receipt}\n===========================================================\n{else}\n\n{ts}Please print this receipt for your records.{/ts}\n{/if}\n\n{if $membership_assign && !$useForMember}\n===========================================================\n{ts}Membership Information{/ts}\n\n===========================================================\n{ts}Membership Type{/ts}: {$membership_name}\n{if $mem_start_date}{ts}Membership Start Date{/ts}: {$mem_start_date|crmDate}\n{/if}\n{if $mem_end_date}{ts}Membership End Date{/ts}: {$mem_end_date|crmDate}\n{/if}\n\n{/if}\n{if $amount}\n===========================================================\n{ts}Membership Fee{/ts}\n\n===========================================================\n{if !$useForMember && $membership_amount && $is_quick_config}\n{ts 1=$membership_name}%1 Membership{/ts}: {$membership_amount|crmMoney}\n{if $amount && !$is_separate_payment }\n{ts}Contribution Amount{/ts}: {$amount|crmMoney}\n-------------------------------------------\n{ts}Total{/ts}: {$amount+$membership_amount|crmMoney}\n{/if}\n{elseif !$useForMember && $lineItem and $priceSetID & !$is_quick_config}\n{foreach from=$lineItem item=value key=priceset}\n---------------------------------------------------------\n{capture assign=ts_item}{ts}Item{/ts}{/capture}\n{capture assign=ts_qty}{ts}Qty{/ts}{/capture}\n{capture assign=ts_each}{ts}Each{/ts}{/capture}\n{capture assign=ts_total}{ts}Total{/ts}{/capture}\n{$ts_item|string_format:\"%-30s\"} {$ts_qty|string_format:\"%5s\"} {$ts_each|string_format:\"%10s\"} {$ts_total|string_format:\"%10s\"}\n----------------------------------------------------------\n{foreach from=$value item=line}\n{$line.description|truncate:30:\"...\"|string_format:\"%-30s\"} {$line.qty|string_format:\"%5s\"} {$line.unit_price|crmMoney|string_format:\"%10s\"} {$line.line_total|crmMoney|string_format:\"%10s\"}\n{/foreach}\n{/foreach}\n\n{ts}Total Amount{/ts}: {$amount|crmMoney}\n{else}\n{if $useForMember && $lineItem && !$is_quick_config}\n{foreach from=$lineItem item=value key=priceset}\n{capture assign=ts_item}{ts}Item{/ts}{/capture}\n{capture assign=ts_total}{ts}Fee{/ts}{/capture}\n{if $dataArray}\n{capture assign=ts_subtotal}{ts}Subtotal{/ts}{/capture}\n{capture assign=ts_taxRate}{ts}Tax Rate{/ts}{/capture}\n{capture assign=ts_taxAmount}{ts}Tax Amount{/ts}{/capture}\n{capture assign=ts_total}{ts}Total{/ts}{/capture}\n{/if}\n{capture assign=ts_start_date}{ts}Membership Start Date{/ts}{/capture}\n{capture assign=ts_end_date}{ts}Membership End Date{/ts}{/capture}\n{$ts_item|string_format:\"%-30s\"} {$ts_total|string_format:\"%10s\"} {if $dataArray} {$ts_subtotal|string_format:\"%10s\"} {$ts_taxRate|string_format:\"%10s\"} {$ts_taxAmount|string_format:\"%10s\"} {$ts_total|string_format:\"%10s\"} {/if} {$ts_start_date|string_format:\"%20s\"} {$ts_end_date|string_format:\"%20s\"}\n--------------------------------------------------------------------------------------------------\n\n{foreach from=$value item=line}\n{capture assign=ts_item}{if $line.html_type eq \'Text\'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description} {$line.description}{/if}{/capture}{$ts_item|truncate:30:\"...\"|string_format:\"%-30s\"} {$line.line_total|crmMoney|string_format:\"%10s\"}  {if $dataArray} {$line.unit_price*$line.qty|crmMoney:$currency|string_format:\"%10s\"} {if $line.tax_rate != \"\" || $line.tax_amount != \"\"}  {$line.tax_rate|string_format:\"%.2f\"} %  {$line.tax_amount|crmMoney:$currency|string_format:\"%10s\"} {else}                  {/if}   {$line.line_total+$line.tax_amount|crmMoney|string_format:\"%10s\"} {/if} {$line.start_date|string_format:\"%20s\"} {$line.end_date|string_format:\"%20s\"}\n{/foreach}\n{/foreach}\n\n{if $dataArray}\n{ts}Amount before Tax{/ts}: {$amount-$totalTaxAmount|crmMoney:$currency}\n\n{foreach from=$dataArray item=value key=priceset}\n{if $priceset || $priceset == 0}\n{$taxTerm} {$priceset|string_format:\"%.2f\"}%: {$value|crmMoney:$currency}\n{else}\n{ts}No{/ts} {$taxTerm}: {$value|crmMoney:$currency}\n{/if}\n{/foreach}\n{/if}\n--------------------------------------------------------------------------------------------------\n{/if}\n\n{if $totalTaxAmount}\n{ts}Total Tax Amount{/ts}: {$totalTaxAmount|crmMoney:$currency}\n{/if}\n\n{ts}Amount{/ts}: {$amount|crmMoney} {if $amount_level } - {$amount_level} {/if}\n{/if}\n{elseif $membership_amount}\n===========================================================\n{ts}Membership Fee{/ts}\n\n===========================================================\n{ts 1=$membership_name}%1 Membership{/ts}: {$membership_amount|crmMoney}\n{/if}\n\n{if $receive_date}\n\n{ts}Date{/ts}: {$receive_date|crmDate}\n{/if}\n{if $is_monetary and $trxn_id}\n{ts}Transaction #{/ts}: {$trxn_id}\n\n{/if}\n{if $membership_trx_id}\n{ts}Membership Transaction #{/ts}: {$membership_trx_id}\n\n{/if}\n{if $is_recur}\n{ts}This membership will be renewed automatically.{/ts}\n{if $cancelSubscriptionUrl}\n\n{ts 1=$cancelSubscriptionUrl}You can cancel the auto-renewal option by visiting this web page: %1.{/ts}\n\n{/if}\n\n{if $updateSubscriptionBillingUrl}\n\n{ts 1=$updateSubscriptionBillingUrl}You can update billing details for this automatically renewed membership by visiting this web page.{/ts}\n{/if}\n{/if}\n\n{if $honor_block_is_active }\n===========================================================\n{$soft_credit_type}\n===========================================================\n{foreach from=$honoreeProfile item=value key=label}\n{$label}: {$value}\n{/foreach}\n\n{/if}\n{if $pcpBlock}\n===========================================================\n{ts}Personal Campaign Page{/ts}\n\n===========================================================\n{ts}Display In Honor Roll{/ts}: {if $pcp_display_in_roll}{ts}Yes{/ts}{else}{ts}No{/ts}{/if}\n\n{if $pcp_roll_nickname}{ts}Nickname{/ts}: {$pcp_roll_nickname}{/if}\n\n{if $pcp_personal_note}{ts}Personal Note{/ts}: {$pcp_personal_note}{/if}\n\n{/if}\n{if $onBehalfProfile}\n===========================================================\n{ts}On Behalf Of{/ts}\n\n===========================================================\n{foreach from=$onBehalfProfile item=onBehalfValue key=onBehalfName}\n{$onBehalfName}: {$onBehalfValue}\n{/foreach}\n{/if}\n\n{if !( $contributeMode eq \'notify\' OR $contributeMode eq \'directIPN\' ) and $is_monetary}\n{if $is_pay_later}\n===========================================================\n{ts}Registered Email{/ts}\n\n===========================================================\n{$email}\n{elseif $amount GT 0 OR $membership_amount GT 0 }\n===========================================================\n{ts}Billing Name and Address{/ts}\n\n===========================================================\n{$billingName}\n{$address}\n\n{$email}\n{/if} {* End ! is_pay_later condition. *}\n{/if}\n{if $contributeMode eq \'direct\' AND !$is_pay_later AND ( $amount GT 0 OR $membership_amount GT 0 ) }\n\n===========================================================\n{ts}Credit Card Information{/ts}\n\n===========================================================\n{$credit_card_type}\n{$credit_card_number}\n{ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:\'\'|crmDate}\n{/if}\n\n{if $selectPremium }\n===========================================================\n{ts}Premium Information{/ts}\n\n===========================================================\n{$product_name}\n{if $option}\n{ts}Option{/ts}: {$option}\n{/if}\n{if $sku}\n{ts}SKU{/ts}: {$sku}\n{/if}\n{if $start_date}\n{ts}Start Date{/ts}: {$start_date|crmDate}\n{/if}\n{if $end_date}\n{ts}End Date{/ts}: {$end_date|crmDate}\n{/if}\n{if $contact_email OR $contact_phone}\n\n{ts}For information about this premium, contact:{/ts}\n\n{if $contact_email}\n  {$contact_email}\n{/if}\n{if $contact_phone}\n  {$contact_phone}\n{/if}\n{/if}\n{if $is_deductible AND $price}\n\n{ts 1=$price|crmMoney}The value of this premium is %1. This may affect the amount of the tax deduction you can claim. Consult your tax advisor for more information.{/ts}{/if}\n{/if}\n\n{if $customPre}\n===========================================================\n{$customPre_grouptitle}\n\n===========================================================\n{foreach from=$customPre item=customValue key=customName}\n{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields}\n {$customName}: {$customValue}\n{/if}\n{/foreach}\n{/if}\n\n\n{if $customPost}\n===========================================================\n{$customPost_grouptitle}\n\n===========================================================\n{foreach from=$customPost item=customValue key=customName}\n{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields}\n {$customName}: {$customValue}\n{/if}\n{/foreach}\n{/if}\n' WHERE id IN () [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1]
[type] => DB_Error
[user_info] =>
      UPDATE civicrm_msg_template SET msg_text = '{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n{if $receipt_text}\n{$receipt_text}\n{/if}\n{if $is_pay_later}\n\n===========================================================\n{$pay_later_receipt}\n===========================================================\n{else}\n\n{ts}Please print this receipt for your records.{/ts}\n{/if}\n\n{if $membership_assign && !$useForMember}\n===========================================================\n{ts}Membership Information{/ts}\n\n===========================================================\n{ts}Membership Type{/ts}: {$membership_name}\n{if $mem_start_date}{ts}Membership Start Date{/ts}: {$mem_start_date|crmDate}\n{/if}\n{if $mem_end_date}{ts}Membership End Date{/ts}: {$mem_end_date|crmDate}\n{/if}\n\n{/if}\n{if $amount}\n===========================================================\n{ts}Membership Fee{/ts}\n\n===========================================================\n{if !$useForMember && $membership_amount && $is_quick_config}\n{ts 1=$membership_name}%1 Membership{/ts}: {$membership_amount|crmMoney}\n{if $amount && !$is_separate_payment }\n{ts}Contribution Amount{/ts}: {$amount|crmMoney}\n-------------------------------------------\n{ts}Total{/ts}: {$amount+$membership_amount|crmMoney}\n{/if}\n{elseif !$useForMember && $lineItem and $priceSetID & !$is_quick_config}\n{foreach from=$lineItem item=value key=priceset}\n---------------------------------------------------------\n{capture assign=ts_item}{ts}Item{/ts}{/capture}\n{capture assign=ts_qty}{ts}Qty{/ts}{/capture}\n{capture assign=ts_each}{ts}Each{/ts}{/capture}\n{capture assign=ts_total}{ts}Total{/ts}{/capture}\n{$ts_item|string_format:\"%-30s\"} {$ts_qty|string_format:\"%5s\"} {$ts_each|string_format:\"%10s\"} {$ts_total|string_format:\"%10s\"}\n----------------------------------------------------------\n{foreach from=$value item=line}\n{$line.description|truncate:30:\"...\"|string_format:\"%-30s\"} {$line.qty|string_format:\"%5s\"} {$line.unit_price|crmMoney|string_format:\"%10s\"} {$line.line_total|crmMoney|string_format:\"%10s\"}\n{/foreach}\n{/foreach}\n\n{ts}Total Amount{/ts}: {$amount|crmMoney}\n{else}\n{if $useForMember && $lineItem && !$is_quick_config}\n{foreach from=$lineItem item=value key=priceset}\n{capture assign=ts_item}{ts}Item{/ts}{/capture}\n{capture assign=ts_total}{ts}Fee{/ts}{/capture}\n{if $dataArray}\n{capture assign=ts_subtotal}{ts}Subtotal{/ts}{/capture}\n{capture assign=ts_taxRate}{ts}Tax Rate{/ts}{/capture}\n{capture assign=ts_taxAmount}{ts}Tax Amount{/ts}{/capture}\n{capture assign=ts_total}{ts}Total{/ts}{/capture}\n{/if}\n{capture assign=ts_start_date}{ts}Membership Start Date{/ts}{/capture}\n{capture assign=ts_end_date}{ts}Membership End Date{/ts}{/capture}\n{$ts_item|string_format:\"%-30s\"} {$ts_total|string_format:\"%10s\"} {if $dataArray} {$ts_subtotal|string_format:\"%10s\"} {$ts_taxRate|string_format:\"%10s\"} {$ts_taxAmount|string_format:\"%10s\"} {$ts_total|string_format:\"%10s\"} {/if} {$ts_start_date|string_format:\"%20s\"} {$ts_end_date|string_format:\"%20s\"}\n--------------------------------------------------------------------------------------------------\n\n{foreach from=$value item=line}\n{capture assign=ts_item}{if $line.html_type eq \'Text\'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description} {$line.description}{/if}{/capture}{$ts_item|truncate:30:\"...\"|string_format:\"%-30s\"} {$line.line_total|crmMoney|string_format:\"%10s\"}  {if $dataArray} {$line.unit_price*$line.qty|crmMoney:$currency|string_format:\"%10s\"} {if $line.tax_rate != \"\" || $line.tax_amount != \"\"}  {$line.tax_rate|string_format:\"%.2f\"} %  {$line.tax_amount|crmMoney:$currency|string_format:\"%10s\"} {else}                  {/if}   {$line.line_total+$line.tax_amount|crmMoney|string_format:\"%10s\"} {/if} {$line.start_date|string_format:\"%20s\"} {$line.end_date|string_format:\"%20s\"}\n{/foreach}\n{/foreach}\n\n{if $dataArray}\n{ts}Amount before Tax{/ts}: {$amount-$totalTaxAmount|crmMoney:$currency}\n\n{foreach from=$dataArray item=value key=priceset}\n{if $priceset || $priceset == 0}\n{$taxTerm} {$priceset|string_format:\"%.2f\"}%: {$value|crmMoney:$currency}\n{else}\n{ts}No{/ts} {$taxTerm}: {$value|crmMoney:$currency}\n{/if}\n{/foreach}\n{/if}\n--------------------------------------------------------------------------------------------------\n{/if}\n\n{if $totalTaxAmount}\n{ts}Total Tax Amount{/ts}: {$totalTaxAmount|crmMoney:$currency}\n{/if}\n\n{ts}Amount{/ts}: {$amount|crmMoney} {if $amount_level } - {$amount_level} {/if}\n{/if}\n{elseif $membership_amount}\n===========================================================\n{ts}Membership Fee{/ts}\n\n===========================================================\n{ts 1=$membership_name}%1 Membership{/ts}: {$membership_amount|crmMoney}\n{/if}\n\n{if $receive_date}\n\n{ts}Date{/ts}: {$receive_date|crmDate}\n{/if}\n{if $is_monetary and $trxn_id}\n{ts}Transaction #{/ts}: {$trxn_id}\n\n{/if}\n{if $membership_trx_id}\n{ts}Membership Transaction #{/ts}: {$membership_trx_id}\n\n{/if}\n{if $is_recur}\n{ts}This membership will be renewed automatically.{/ts}\n{if $cancelSubscriptionUrl}\n\n{ts 1=$cancelSubscriptionUrl}You can cancel the auto-renewal option by visiting this web page: %1.{/ts}\n\n{/if}\n\n{if $updateSubscriptionBillingUrl}\n\n{ts 1=$updateSubscriptionBillingUrl}You can update billing details for this automatically renewed membership by visiting this web page.{/ts}\n{/if}\n{/if}\n\n{if $honor_block_is_active }\n===========================================================\n{$soft_credit_type}\n===========================================================\n{foreach from=$honoreeProfile item=value key=label}\n{$label}: {$value}\n{/foreach}\n\n{/if}\n{if $pcpBlock}\n===========================================================\n{ts}Personal Campaign Page{/ts}\n\n===========================================================\n{ts}Display In Honor Roll{/ts}: {if $pcp_display_in_roll}{ts}Yes{/ts}{else}{ts}No{/ts}{/if}\n\n{if $pcp_roll_nickname}{ts}Nickname{/ts}: {$pcp_roll_nickname}{/if}\n\n{if $pcp_personal_note}{ts}Personal Note{/ts}: {$pcp_personal_note}{/if}\n\n{/if}\n{if $onBehalfProfile}\n===========================================================\n{ts}On Behalf Of{/ts}\n\n===========================================================\n{foreach from=$onBehalfProfile item=onBehalfValue key=onBehalfName}\n{$onBehalfName}: {$onBehalfValue}\n{/foreach}\n{/if}\n\n{if !( $contributeMode eq \'notify\' OR $contributeMode eq \'directIPN\' ) and $is_monetary}\n{if $is_pay_later}\n===========================================================\n{ts}Registered Email{/ts}\n\n===========================================================\n{$email}\n{elseif $amount GT 0 OR $membership_amount GT 0 }\n===========================================================\n{ts}Billing Name and Address{/ts}\n\n===========================================================\n{$billingName}\n{$address}\n\n{$email}\n{/if} {* End ! is_pay_later condition. *}\n{/if}\n{if $contributeMode eq \'direct\' AND !$is_pay_later AND ( $amount GT 0 OR $membership_amount GT 0 ) }\n\n===========================================================\n{ts}Credit Card Information{/ts}\n\n===========================================================\n{$credit_card_type}\n{$credit_card_number}\n{ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:\'\'|crmDate}\n{/if}\n\n{if $selectPremium }\n===========================================================\n{ts}Premium Information{/ts}\n\n===========================================================\n{$product_name}\n{if $option}\n{ts}Option{/ts}: {$option}\n{/if}\n{if $sku}\n{ts}SKU{/ts}: {$sku}\n{/if}\n{if $start_date}\n{ts}Start Date{/ts}: {$start_date|crmDate}\n{/if}\n{if $end_date}\n{ts}End Date{/ts}: {$end_date|crmDate}\n{/if}\n{if $contact_email OR $contact_phone}\n\n{ts}For information about this premium, contact:{/ts}\n\n{if $contact_email}\n  {$contact_email}\n{/if}\n{if $contact_phone}\n  {$contact_phone}\n{/if}\n{/if}\n{if $is_deductible AND $price}\n\n{ts 1=$price|crmMoney}The value of this premium is %1. This may affect the amount of the tax deduction you can claim. Consult your tax advisor for more information.{/ts}{/if}\n{/if}\n\n{if $customPre}\n===========================================================\n{$customPre_grouptitle}\n\n===========================================================\n{foreach from=$customPre item=customValue key=customName}\n{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields}\n {$customName}: {$customValue}\n{/if}\n{/foreach}\n{/if}\n\n\n{if $customPost}\n===========================================================\n{$customPost_grouptitle}\n\n===========================================================\n{foreach from=$customPost item=customValue key=customName}\n{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields}\n {$customName}: {$customValue}\n{/if}\n{/foreach}\n{/if}\n' WHERE id IN () [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1]
[to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="
      UPDATE civicrm_msg_template SET msg_text = '{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n{if $receipt_text}\n{$receipt_text}\n{/if}\n{if $is_pay_later}\n\n===========================================================\n{$pay_later_receipt}\n===========================================================\n{else}\n\n{ts}Please print this receipt for your records.{/ts}\n{/if}\n\n{if $membership_assign && !$useForMember}\n===========================================================\n{ts}Membership Information{/ts}\n\n===========================================================\n{ts}Membership Type{/ts}: {$membership_name}\n{if $mem_start_date}{ts}Membership Start Date{/ts}: {$mem_start_date|crmDate}\n{/if}\n{if $mem_end_date}{ts}Membership End Date{/ts}: {$mem_end_date|crmDate}\n{/if}\n\n{/if}\n{if $amount}\n===========================================================\n{ts}Membership Fee{/ts}\n\n===========================================================\n{if !$useForMember && $membership_amount && $is_quick_config}\n{ts 1=$membership_name}%1 Membership{/ts}: {$membership_amount|crmMoney}\n{if $amount && !$is_separate_payment }\n{ts}Contribution Amount{/ts}: {$amount|crmMoney}\n-------------------------------------------\n{ts}Total{/ts}: {$amount+$membership_amount|crmMoney}\n{/if}\n{elseif !$useForMember && $lineItem and $priceSetID & !$is_quick_config}\n{foreach from=$lineItem item=value key=priceset}\n---------------------------------------------------------\n{capture assign=ts_item}{ts}Item{/ts}{/capture}\n{capture assign=ts_qty}{ts}Qty{/ts}{/capture}\n{capture assign=ts_each}{ts}Each{/ts}{/capture}\n{capture assign=ts_total}{ts}Total{/ts}{/capture}\n{$ts_item|string_format:\"%-30s\"} {$ts_qty|string_format:\"%5s\"} {$ts_each|string_format:\"%10s\"} {$ts_total|string_format:\"%10s\"}\n----------------------------------------------------------\n{foreach from=$value item=line}\n{$line.description|truncate:30:\"...\"|string_format:\"%-30s\"} {$line.qty|string_format:\"%5s\"} {$line.unit_price|crmMoney|string_format:\"%10s\"} {$line.line_total|crmMoney|string_format:\"%10s\"}\n{/foreach}\n{/foreach}\n\n{ts}Total Amount{/ts}: {$amount|crmMoney}\n{else}\n{if $useForMember && $lineItem && !$is_quick_config}\n{foreach from=$lineItem item=value key=priceset}\n{capture assign=ts_item}{ts}Item{/ts}{/capture}\n{capture assign=ts_total}{ts}Fee{/ts}{/capture}\n{if $dataArray}\n{capture assign=ts_subtotal}{ts}Subtotal{/ts}{/capture}\n{capture assign=ts_taxRate}{ts}Tax Rate{/ts}{/capture}\n{capture assign=ts_taxAmount}{ts}Tax Amount{/ts}{/capture}\n{capture assign=ts_total}{ts}Total{/ts}{/capture}\n{/if}\n{capture assign=ts_start_date}{ts}Membership Start Date{/ts}{/capture}\n{capture assign=ts_end_date}{ts}Membership End Date{/ts}{/capture}\n{$ts_item|string_format:\"%-30s\"} {$ts_total|string_format:\"%10s\"} {if $dataArray} {$ts_subtotal|string_format:\"%10s\"} {$ts_taxRate|string_format:\"%10s\"} {$ts_taxAmount|string_format:\"%10s\"} {$ts_total|string_format:\"%10s\"} {/if} {$ts_start_date|string_format:\"%20s\"} {$ts_end_date|string_format:\"%20s\"}\n--------------------------------------------------------------------------------------------------\n\n{foreach from=$value item=line}\n{capture assign=ts_item}{if $line.html_type eq \'Text\'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description} {$line.description}{/if}{/capture}{$ts_item|truncate:30:\"...\"|string_format:\"%-30s\"} {$line.line_total|crmMoney|string_format:\"%10s\"}  {if $dataArray} {$line.unit_price*$line.qty|crmMoney:$currency|string_format:\"%10s\"} {if $line.tax_rate != \"\" || $line.tax_amount != \"\"}  {$line.tax_rate|string_format:\"%.2f\"} %  {$line.tax_amount|crmMoney:$currency|string_format:\"%10s\"} {else}                  {/if}   {$line.line_total+$line.tax_amount|crmMoney|string_format:\"%10s\"} {/if} {$line.start_date|string_format:\"%20s\"} {$line.end_date|string_format:\"%20s\"}\n{/foreach}\n{/foreach}\n\n{if $dataArray}\n{ts}Amount before Tax{/ts}: {$amount-$totalTaxAmount|crmMoney:$currency}\n\n{foreach from=$dataArray item=value key=priceset}\n{if $priceset || $priceset == 0}\n{$taxTerm} {$priceset|string_format:\"%.2f\"}%: {$value|crmMoney:$currency}\n{else}\n{ts}No{/ts} {$taxTerm}: {$value|crmMoney:$currency}\n{/if}\n{/foreach}\n{/if}\n--------------------------------------------------------------------------------------------------\n{/if}\n\n{if $totalTaxAmount}\n{ts}Total Tax Amount{/ts}: {$totalTaxAmount|crmMoney:$currency}\n{/if}\n\n{ts}Amount{/ts}: {$amount|crmMoney} {if $amount_level } - {$amount_level} {/if}\n{/if}\n{elseif $membership_amount}\n===========================================================\n{ts}Membership Fee{/ts}\n\n===========================================================\n{ts 1=$membership_name}%1 Membership{/ts}: {$membership_amount|crmMoney}\n{/if}\n\n{if $receive_date}\n\n{ts}Date{/ts}: {$receive_date|crmDate}\n{/if}\n{if $is_monetary and $trxn_id}\n{ts}Transaction #{/ts}: {$trxn_id}\n\n{/if}\n{if $membership_trx_id}\n{ts}Membership Transaction #{/ts}: {$membership_trx_id}\n\n{/if}\n{if $is_recur}\n{ts}This membership will be renewed automatically.{/ts}\n{if $cancelSubscriptionUrl}\n\n{ts 1=$cancelSubscriptionUrl}You can cancel the auto-renewal option by visiting this web page: %1.{/ts}\n\n{/if}\n\n{if $updateSubscriptionBillingUrl}\n\n{ts 1=$updateSubscriptionBillingUrl}You can update billing details for this automatically renewed membership by visiting this web page.{/ts}\n{/if}\n{/if}\n\n{if $honor_block_is_active }\n===========================================================\n{$soft_credit_type}\n===========================================================\n{foreach from=$honoreeProfile item=value key=label}\n{$label}: {$value}\n{/foreach}\n\n{/if}\n{if $pcpBlock}\n===========================================================\n{ts}Personal Campaign Page{/ts}\n\n===========================================================\n{ts}Display In Honor Roll{/ts}: {if $pcp_display_in_roll}{ts}Yes{/ts}{else}{ts}No{/ts}{/if}\n\n{if $pcp_roll_nickname}{ts}Nickname{/ts}: {$pcp_roll_nickname}{/if}\n\n{if $pcp_personal_note}{ts}Personal Note{/ts}: {$pcp_personal_note}{/if}\n\n{/if}\n{if $onBehalfProfile}\n===========================================================\n{ts}On Behalf Of{/ts}\n\n===========================================================\n{foreach from=$onBehalfProfile item=onBehalfValue key=onBehalfName}\n{$onBehalfName}: {$onBehalfValue}\n{/foreach}\n{/if}\n\n{if !( $contributeMode eq \'notify\' OR $contributeMode eq \'directIPN\' ) and $is_monetary}\n{if $is_pay_later}\n===========================================================\n{ts}Registered Email{/ts}\n\n===========================================================\n{$email}\n{elseif $amount GT 0 OR $membership_amount GT 0 }\n===========================================================\n{ts}Billing Name and Address{/ts}\n\n===========================================================\n{$billingName}\n{$address}\n\n{$email}\n{/if} {* End ! is_pay_later condition. *}\n{/if}\n{if $contributeMode eq \'direct\' AND !$is_pay_later AND ( $amount GT 0 OR $membership_amount GT 0 ) }\n\n===========================================================\n{ts}Credit Card Information{/ts}\n\n===========================================================\n{$credit_card_type}\n{$credit_card_number}\n{ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:\'\'|crmDate}\n{/if}\n\n{if $selectPremium }\n===========================================================\n{ts}Premium Information{/ts}\n\n===========================================================\n{$product_name}\n{if $option}\n{ts}Option{/ts}: {$option}\n{/if}\n{if $sku}\n{ts}SKU{/ts}: {$sku}\n{/if}\n{if $start_date}\n{ts}Start Date{/ts}: {$start_date|crmDate}\n{/if}\n{if $end_date}\n{ts}End Date{/ts}: {$end_date|crmDate}\n{/if}\n{if $contact_email OR $contact_phone}\n\n{ts}For information about this premium, contact:{/ts}\n\n{if $contact_email}\n  {$contact_email}\n{/if}\n{if $contact_phone}\n  {$contact_phone}\n{/if}\n{/if}\n{if $is_deductible AND $price}\n\n{ts 1=$price|crmMoney}The value of this premium is %1. This may affect the amount of the tax deduction you can claim. Consult your tax advisor for more information.{/ts}{/if}\n{/if}\n\n{if $customPre}\n===========================================================\n{$customPre_grouptitle}\n\n===========================================================\n{foreach from=$customPre item=customValue key=customName}\n{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields}\n {$customName}: {$customValue}\n{/if}\n{/foreach}\n{/if}\n\n\n{if $customPost}\n===========================================================\n{$customPost_grouptitle}\n\n===========================================================\n{foreach from=$customPost item=customValue key=customName}\n{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields}\n {$customName}: {$customValue}\n{/if}\n{/foreach}\n{/if}\n' WHERE id IN () [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1]"]

```

)

# Answer
> 1 votes
The message template 'Memberships - Receipt (on-line)' is either missing and linked incorrectly in your database. Try running below query to fix the data before running the upgrade.

```
SELECT @option_group_id_msg_tmp := max(id) from civicrm_option_group WHERE name = 'msg_tpl_workflow_membership';
SELECT @option_option_value_id := max(id) from civicrm_option_value WHERE name = 'membership_online_receipt' AND option_group_id = @option_group_id_msg_tmp;
UPDATE civicrm_msg_template SET workflow_id = @option_option_value_id WHERE workflow_id IS NOT NULL AND msg_title LIKE "Memberships - Receipt (on-line)";

```

Cheers

Pradeep

---
Tags: upgrade, message-templates
---


# Question
Title: Display related organization information using a profile
What is the best (or recommended) way to display related organization information in a profile? I use organizational membership so after registration I have an individual record (with Drupal account) and an organization record (related to the individual).

I use Civi profiles to display stored information to my users. It's easy and straightforward when showing the individual's own data. But a profile that shows the related organization's data is what I'm looking for - right now the profile shows empty fields.

I came up with one solution: if I add `id=[org_contact_id]` to the profile view url, everything is OK. To get Drupal to generate proper link in menu, I'm planning to use `menu` hook and through CiviCRM API find user's related organization contact id. It seems complicated though (for such a simple task).

Is there an easier way to do that?

# Answer
> 1 votes
Since you are using Drupal would recommend you to build view page by using Views module where you can get organization information of an individual using relationship. This will involve no coding.

If you still want to use Civi Profile than you can over-ride id by using hooks.

Cheers

Pradeep

---
Tags: profile, relationships
---


title: Social media sharing only shows Twitter

text:
# Question
Title: Social media sharing only shows Twitter
We've had social media sharing for our events ("Allow sharing through social media?") enabled "forever".

Now it only shows the twitter birdie. Inspecting the page reveals that there is some code there for each of G+, Facebook and LinkedIN, but nothing shows.

We are running CiviCRM 5.13.4 on Joomla 3.9.6.

I can't find any indication that it should be configurable somewhere either.

How do I get my Social Media Sharing Icons/Links back?

# Answer
> 3 votes
Turned out that it was the browser's adblocker that made the icons disappear.

---
Tags: civievent, social-media
---


# Question
Title: Upgrade from CiviCRM 5.12.4 to 5.13.5 generates Sparkpost PHP fatal error
We are running Wordpress 5.2.1 with CiviCRM 5.12.4. In trying to upgrade to 5.13.5, the database runs through the updates, but then we get the message: "The site is experiencing technical difficulties. Please check your site admin email inbox for instructions." Afterwards, the bottom of the page says "Powered by CiviCRM 5.13.5", but under System Status we get the warning "CiviCRM 5.12 has reached its end of life." indicating the upgrade process didn't run through to the end. Looking at the error\_log, there is a fatal PHP error and stack trace which looks like" "PHP Fatal error: Uncaught Error: Class 'CRM\_Sparkpost' not found in /home/britstatt/test.sdcbcdream.org/wp-content/uploads/civicrm/ext/com.cividesk.email.sparkpost/settings/Sparkpost.setting.php:8, referer: https://test.sdcbcdream.org/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fupgrade%2Fqueue%2Frunner&reset=1&qrid=CRM\_Upgrade"

We have been using the Sparkpost mail extension since summer of 2016 and have never experienced an issue during the many CiviCRM upgrades since then, so I don't think this is a particular issue with that extension, although I will also ping cividesk. Since the upgrade process has always worked seamlessly, I wanted to throw this out there to find out what might be the matter.

Fwiw, I originally encountered the issue when upgrading from 5.10.3 to 5.13.5, but didn't dive into the error logs. So I ran the upgrade from 5.10.3 to 5.12.4 successfully, thinking doing the upgrade in steps might help. That worked fine, but the subsequent attempt to upgrade 5.12.4 to 5.13.5 generated the error again and I finally looked into the error log.

Our live site is running fine at 5.10.3, but I always run upgrades on a test mirror site, so this is not critical except we really want to move to 5.13.x which is supposed to be the next ESR, I thought.

# Answer
See if https://github.com/cividesk/com.cividesk.email.sparkpost/pull/77 fixes your problem. It's been merged but there has not been a release of the sparkpost extension since then so either pull from git or apply the fix manually - it's only one line of code.
> 3 votes

---
Tags: upgrade, sparkpost
---


title: How do I identify the right .php page

text:
# Question
Title: How do I identify the right .php page
Trying to modify the template and translate some hard coded Strings on Drupal 7, I couldn't really easily find the architecture of a page. With the debug mode I can read in the code which .tpl is being used but nothing for the .php files.

Is there something like that in the documentation that I haven't yet found? or somewhere else?

# Answer
Sometimes you can get clue from .tpl file form view source page. The other option is to find the page callback of the the url. Each CiviCRM url defined in menu xml file has a callback. The page callback gives the clue which file is being invoked. For eg civicrm/activity/view

If you a grep 'civicrm/activity/view' on CRM/ and open the xml file you will see something like this

```
<item>
     <path>civicrm/activity/view</path>
     <title>View Activity</title>
     <page_callback>CRM_Activity_Form_ActivityView</page_callback>
     <access_arguments>access CiviCRM</access_arguments>
  </item>

```

Which means the file CRM/Activity/Form/ActivityView.php is called in this situation.

HTH

Pradeep
> 2 votes

---
Tags: files
---


# Question
Title: Change Recurring Contribution Details from Views/Drupal
I am attempting to create a Drupal view/block to embed in a panel, so a user can see their current membership details when they log in (beginning date/end date/type) etc. I have this overriding the default user page. That's working.

What **is not** working great - is creating an "Actions" field in the view that contains links to cancel, update the card, or change the amount of the recurring series.

I ripped the URL's from the receipt template:

i.e. civicrm/contribute/unsubscribe?reset=1&coid=XXXXX

And then used a view to find the recurring contribution for the membership, and then used a 'views field view' (a child-view) to get the contribution ID, which actually creates these links.

So, I have arrived at a working link such as the above: civicrm/contribute/unsubscribe?reset=1&coid=XXXXX when I click it for myself (admin user) it works, but when I log in as a test user it will say "You do not have permission to cancel this recurring contribution".

I've gone through the checklist of permissions - enabled self-service via the iATS admin tool, as well as given the user permission to make online contributions. I've also updated the code suggested here: Only logged in users can change billing and recurring amount

Over on this exchange (Donor access to edit recurring donations) it seems like a contact checksum must also be embedded. Does this mean that my project is out of luck, that we can only generate these links from the context of civi? In views we can generate the contact hash, but that seems dangerous/not the same thing.

I am assuming the civi dashboard for users is kind of ugly and has some permissions limitations, so I was really trying to use views/drupal to generate this functionality.

Please let me know, happy to share my work! The workflow we want is - users log in, see their memberships, can do actions upon those memberships (seems obvious, right?)

I also found this - https://github.com/MegaphoneJon/com.megaphonetech.checksums but making the link from views is currently beyond my capacity.

update: It seems like the "Edit Contributions" permissions would allow them to do it. Also seems dangerous. I messsed around and put in different contact/contribution ids and tried to load various civi pages, it seemed to throw access denied..so hmm?

# Answer
> 1 votes
Hmm, this sounds similar to the access problems we once had for users not able to change amount or update details of the recur payment.

Not sure if it exactly matches with your use-case, can you try applying https://gist.github.com/jitendrapurohit/8e445fd869595411ee12e0a1345a6d12 on your site and confirm if it works for you?

---
Tags: civimember, recurring-contributions, iats
---


# Question
Title: How to restrict the Donors to have limited functions of CiviCRM?
Here is what I have in mind...

* The donor needs to have access to submit credit card donation/events and View only his historic contributions.
* He needs to access his basic contact info and edit if necessary.
* All the link needs to be at one place for easy navigation. Links like PROFILE, HISTORIC CONTRIBUTION, Historic events, CONTRIBUTION PAGES, UPCOMING EVENTS
* No access to CiviCRM Menubar and any other pages by direct links
* No access to drupal Menubar

I was thinking to create a Drupal template page where I could place all the links, not sure if that makes any sense or even realistic?!

I was wondering did anyone have this kind of situation and if yes, how did you handle it? Or do you have any suggestions on how this can be achieved? Many thanks!

# Answer
> 1 votes
It sounds like most of what you want you can do via your CMS permissions to give them access to their Dashboard but not to CiviCRM itself

---
Tags: drupal, permissions, user-dashboard, user-interface
---


# Question
Title: Conditions and Action disappeared from Civirules during upgrade
I found that the actions weren't happening in Civirules and on investigation I found that all the conditions and actions were no longer there. I'm assuming that this happened during an upgrade where I went from CiviCRM 4.7 to 5.11.0 and also upgraded Civirules 2.1 to 2.5 at the same time. Maybe the problem was that I just installed the new version of Civirules rather than installing the old version on the upgraded site and and then upgrading. Things have obviously changed (for the better).

I couldn't find any release notes for new versions of Civirules. There is a note about having to re-input conditions and actions when upgrading to 2.x but I would interpret as being when you upgrade from 1.x.

Anyway, I've sported this out by re-inputting the conditions and actions and find that some of the things that didn't work for me before now do, so it was worth the hassle. I also upgraded to 2.7 before doing this.

So only real question is where are release notes for Civirules and otherwise it is hopefully useful information for others.

# Answer
> 2 votes
If there are release notes they will be on Gitlab and in the changelog in the extension, but that was a fairly recent improvement. I have seen the problem you had, that is why the note is there. And AFAIK it applies for any version earlier than 2.2

---
Tags: upgrade, civirules
---


# Question
Title: Nothing happens on selection of “Actions” dropdown options
Can someone offer me some insight as to the possible cause of the Actions drop-down not working?

Here is my setup:

* CiviCRM 5.13.3
* Drupal 7.67
* PHP 7.2.16
* Bootstrap subtheme set to use JQuery 3.1

When I execute a search from the advanced search form, I get the following JS error:

```
TypeError: f is undefined
    mysite.org/misc/jquery.ba-bbq.js:19:115
Warn: could not find module util

```

When select contacts from search results, I get the following errors:

```
TypeError: $(...).val(...) is undefined
    mysite.org/sites/default/files/civicrm/civi_extensions/org.civicrm.shoreditch/js/main-menu.js:66:41
    Ember 2 (errors)
        isQuickSearchOnGoing
        removeCustomClassOnOutsideClick
    jQuery 2 (errors)
        dispatch
        handle

```

When I select an item from the "Actions" dropdown, I get the following errors:

```
TypeError: $(...).val(...) is undefined
    mysite.org/sites/default/files/civicrm/civi_extensions/org.civicrm.shoreditch/js/main-menu.js:66:41
Ember 2 (errors)
    isQuickSearchOnGoing
    removeCustomClassOnOutsideClick
jQuery 8 (errors)
    dispatch
    handle
    trigger
    trigger
    each
    each
    trigger
    b
<anonymous> Ember
jQuery 7 (errors)
    dispatch
    handle
    trigger
    trigger
    each
    each
    trigger
Ember 5 (errors)
    triggerChange
    onSelect
    selectHighlighted
    init
    bind
jQuery 2 (errors)
    dispatch
    handle

```

I am able to execute actions options from a contact's individual record, but not from any search results. Changing Bootstrap's settings to use a lower version of JQuery has no effect. Disabling the Bootstrap sub theme and base theme has no effect. It happens in Firefox and Chrome.

# Answer
> 1 votes
Can you try below patch on shoreditch extension to see if it fixes your problem?

```
diff --git a/js/main-menu.js b/js/main-menu.js
index c4bd2576..c87ba81d 100644
--- a/js/main-menu.js
+++ b/js/main-menu.js
@@ -63,9 +63,12 @@
    * @return {boolean}
    */
   function isQuickSearchOnGoing () {
-    var searchValue = $('#sort_name_navigation').val() || '';
-
-    return !!searchValue.trim();
+    if ($('#sort_name_navigation') && $('#sort_name_navigation').val()) {
+      return !!$('#sort_name_navigation').val().trim();
+    }
+    else {
+      return false;
+    }
   }

   /**

```

Cheers

Pradeep

# Answer
> 0 votes
Having a similar problem. Playing with different Civi admin themes and shoreditch enabled and disabled. At one point a "Go" button showed up next to the Actions drop down list. The button triggered the selected action. But this button does not show up consistently with any other theme and the combination of theme and Civi css on/off options did not display correctly.

# Answer
> 0 votes
Upgrading Shoreditch/Bootstrap to Alpha32 seems to solve the problem (thus far). Curious that Shoreditch was not selected as the theme but seems to have been interfering nonetheless. Still not sure about that Go button. Any ideas on where that comes from?

---
Tags: drupal, javascript, jquery, actions
---


title: Error With CiviCRM Volunteer

text:
# Question
Title: Error With CiviCRM Volunteer
I am getting the following error in CiviCRM:

M\_Volunteer\_Permission::check($permissions) should be compatible with CRM\_Core\_Permission::check($permissions, $contactId = NULL) in /home/xxxxx/public\_html/wp-content/uploads/civicrm/ext/org.civicrm.volunteer/CRM/Volunteer/Permission.php on line 151

No idea why.

CiviCRM Version: 5.13.4 WP Version: 5.2.1 PHP Version: 7.2

# Answer
> 4 votes
This has been fixed now but the new version is still not available. You can either apply the patch from here or replace the extension by downloading from here.

Thanks

Pradeep

---
Tags: civivolunteer
---


# Question
Title: Upgraded to PHP 7.2; no errors but Sparkpost doesn't receive and send CiviMail
I upgraded to PHP 7.2 and received the system warning stating "your SMTP password will not be stored encrypted, and if you have recently upgraded from a PHP that stored it with encryption, it will not be decrypted correctly." I updated our Sparkpost API key and everything on CiviMail's side seems to be working--all test messages go through and no errors pop up when sending email. However, when we tried to send a mass mailing, we got 100% successful deliveries but zero openings; upon further investigation, Sparkpost did not receive send any of the emails. Has anyone else encountered this or know a fix?

# Answer
> 7 votes
PHP 7.2 does not have the mcrypt module, and the Sparkpost extension needs that module. If you can install php7.2-mcrypt as a pecl module Sparkpost will work. If not, I would move to php 7.1 for the time being.

# Answer
> 7 votes
I encountered the same problem and investigated a bit further...

The SparkPost extension does not directly use mcrypt but it does use `CRM_Utils_Crypt` which makes use of mcrypt if it is available. If you upgrade to php 7.2 without mcrypt and you already have an API key saved, the result is that the extension cannot decrypt the key. That's why the instruction is to resave your API key which will store it unencrypted. (If you don't remember it, just generate a new one on the SparkPost site.) However, even having done that correctly you may still get the symptoms described.

**The basic problem is that if you have multiple versions of php installed you may end up calling the wrong one - particularly in a shared hosting environment.**

First, check that you can send a test mail successfully (create a mailing and use the test option). If that does not work, you have a different problem and the rest of this won't help. Providing that works, you have verified that the extension is working with php 7.2

The thing to look at is how you are running the scheduled jobs. There are various different methods but if you are doing that through cv/drush/wp then the version of php that those commands use is key. If they run a version of php where mcrypt is available (eg 5.6) then when the SparkPost extension runs `CRM_Utils_Crypt::decrypt()` it will 'decrypt' via mcrypt the API string - but since that was saved with 7.2 it was not encrypted with mcrypt in the first place and the result is an invalid authorization string. Unfortunately the SparkPost extension does not handle this condition properly and results in it incorrectly saying that the mails were successfully delivered.

Drush has a somewhat convoluted invocation process and even if you call the initial drush using php 7.2, the eventual php that gets run may be a different version and lead to this problem. The best solution I have currently is to use cv and explicitly run it under 7.2.

A cron script like this works:

```
#!/bin/bash

rootdir=~/www/www              # website root dir
phppath=/usr/local/bin/php72   # path to PHP 7.2 binary
cvpath=~/private/bin/cv        # path to cv script
cronuser=admin                 # login to run commands as

cd $rootdir
$phppath $cvpath --user=$cronuser api Job.execute

```

# Answer
> 1 votes
OK, the answers here finally sunk in. The key is Aidan's answer in my mind, to simply use the same PHP version in your cron job as in your CiviCRM setup. Thanks, @Aidan, this is the 2nd (unrelated) problem you solved for me today! In our case, we run CiviCRM 5.10.3 under PHP 7.2.11 with CMS WordPress 5.2.1. After updating our Sparkpost API Key at Sparkpost and pasting into "Outgoing Email (Sparkpost)" I just changed our CRON job to use the following script:

```
CIVI_ROOT="{YOUR_HOME}/sdbikecoalition/wp-content/plugins/civicrm/civicrm"
PARAMS="-j -ssdbikecoalition.org -u {YOUR_ADMIN_USER} -p {YOUR_PASSWORD} -e Job -a process_mailing"
nice -n19 /usr/local/php72/bin/php $CIVI_ROOT/bin/cli.php $PARAMS

```

Worked perfectly. We had been getting 100% delivery and 0% opens.

---
Tags: wordpress, civimail, php, mailing, sparkpost
---


# Question
Title: Error on enabling CiviMobileAPI extension
After installing the extension CiviMobileAPI, I am getting the below error when I access the contacts page. Can you please have a look and support.

Warning: Invalid argument supplied for foreach() in /home/hisadvocate/www/www/wp-content/extensions/com.agiliway.civimobileapi-3.1/com.agiliway.civimobileapi-3.1/CRM/CiviMobileAPI/ApiWrapper/Activity/Get.php on line 31

I am using the Civi CRM version 5.2.1. Any help?

# Answer
> 1 votes
I created a PR on the CiviMobileAPI that fixes this problem. See https://github.com/agiliway/com.agiliway.civimobileapi/pull/11

---
Tags: extension
---


# Question
Title: Sharing data betweeen Multiple Databases
We have a main organisation with civi multi-site build but finding it a little complex in terms of granting permissions for various sub departments. Thee are also clashes over mailings and issues with GDPR over accessing data.

Is it possible/feasable to have a main civi build and then import data from other 'seperate' civi builds through the API...?

That way each sub department can have their own database and (Drupal) website and information for 'all' the departments will also be stored on the main database. The only issue I see is the contact ID and my thought would be that this is listed as the 'external ID' on the sub (departmnent) builds.

Any thoughts on this or any suggested alternatives.

Many thanbks Robbie

# Answer
> 1 votes
Don't think there is any existing solution for this.

Though it should be possible by building an extension on your main site and pushing the data to the child sites everytime an entity is created/updated.

For eg, Create separate groups for each child sites, eg ChildA, ChildB and ChildC.

while creating a contact if Group A is selected, this contact will be pushed to the first child site.

We have done similar implementation for one of our client but it needs some pre-requisite information to be stored in the ext files, eg site key, API key, etc.

If interested to check our ext, get in touch at `jitendra@fuzion.co.nz`.

---
Tags: api, multisite
---


title: Issue with l10n update

text:
# Question
Title: Issue with l10n update
On Civicrm 5.13.4 on Drupal 7.67 I have this error when accessing to the Localization page:

> ```
> Notice : Undefined index: addLanguage dans l10nupdate_civicrm_buildForm() (ligne 53 dans /sites/default/files/civicrm/ext/com.cividesk.l10n.update-master/l10nupdate.php).
> Notice : Undefined index: lcMessages dans l10nupdate_civicrm_buildForm() (ligne 53 dans /sites/default/files/civicrm/ext/com.cividesk.l10n.update-master/l10nupdate.php).
>
> ```

How should I fix this? (.php is not my best)

# Answer
> 2 votes
Have submitted a PR to fix the notice error. Can you try applying the patch from here?

Cheers

Pradeep

# Answer
> 2 votes
Looks like the error is originating from the `com.cividesk.l10n.update` extension enabled on your site.

---
Tags: language
---


title: How do I search Contact Source?

text:
# Question
Title: How do I search Contact Source?
I am getting people added to our database from Contact Source called Get Updates. I don't know what that is.

# Answer
Go to Search \> Search Builder and do this:

I can't comment on if this is the best way to do this, or perhaps have them added to a Group called 'Get Updates' instead so it becomes a discrete search for all those records, but there you go.
> 2 votes

# Answer
Friendship Circle, Welcome to SE.

There are many ways the contact may have contact source.

1. Contacts being created from import with contact source.
2. Webform/Caldera for submissions with contact source set as default and hidden
3. Schedule job that pulls contact from external source and add's into CiviCRM like google contact sync, mailchimp sync etc
4. Contribute/Custom modules/plugin that is responsible to add contacts from a form like newsletter signup etc

Pradeep
> 0 votes

---
Tags: custom-search
---


# Question
Title: Drupal Email address ends up in Billing not Home
I am running CiviCRM 5.13.4, and have the following scenario.

• Administrator creates an Individual Contact offline, without any email address. • The User then registers for an online account through Drupal, which includes entering an email address. • The User can then log on as usual.

The system successfully deduplicates with the original contact, using the name and postcode (collected on the registration Profile). BUT the email entered by the User ends up as the Billing Email Address, not the Home address, and the Billing Email becomes the Primary email, which is not what is wanted.

It looks as if the linkage with Drupal is just picking up the first entry on the list of location types, and not taking note of the Default type which is set to Home.

This is a quite possible scenario when we migrate our existing membership database, and some of them start to use the online capability for the first time.

Is there any fix or workaround?

With thanks, Tony

# Answer
I believe this is now fixed as part this PR. Can you please try patch from here if it fixes your problem?

Cheers

Pradeep
> 1 votes

---
Tags: email, online-registration
---


# Question
Title: Network Error on Contact Search Results page change
To replicate, search all contacts, try to scroll to page 2 "Network Error Unable to reach the server. Please refresh this page in your browser and try again."

Reported by 2 clients, able to replicate. Workaround is to use the 'glossary' of first letter of display name. Pagination works fine after this. Reverting to 'All' also reverts the problem

Replicated on CiviCRM v 5.11.0 and 5.12.0 Wordpress 5.1.1 and Drupal 7 Ubuntu 16.04 PHP 7.1.24, Apache

# Answer
> 2 votes
\[SOLVED\] Yes found an answer with the help of the CiviCRM team - see https://lab.civicrm.org/dev/core/issues/963

The issue is MySQL configuration after upgrading, which adds ONLY\_FULL\_GROUP\_BY to variable sql-mode. There is a link to a patch but I found it straghtforward to remove this by adding the following line to my.cnf

sql-mode="STRICT\_TRANS\_TABLES,NO\_ZERO\_IN\_DATE,NO\_ZERO\_DATE,ERROR\_FOR\_DIVISION\_BY\_ZERO,NO\_AUTO\_CREATE\_USER,NO\_ENGINE\_SUBSTITUTION"

Hope that helps.

---
Tags: contacts, error
---


# Question
Title: Dropdowns in the admin area appear underneath the modal window
Dropdowns in the admin area appear underneath the modal window making it impossible to select a required dropdown, example: When I add new membership type I can't select Membership Organisation or Financial Type, see the screenshot:

# Answer
It was a conflict with css coming from another plugin (Slider Revolution). Its global.css has defined the following css property .ui-dialog { z-index: 1000102 !important; } which caused the behaviour described above.
> 5 votes

# Answer
on functions.php add :

```
function my_custom_fonts() {
  echo '
     .select2-drop-active{ z-index: 99999999 !important;}
';
}

```
> 1 votes

# Answer
One hack around this that works for us is:

1. Click the dropdown
2. Move drag the pop-up box to one side to see what the dropdown displays
3. Click the dropdown again to close it
4. Click the dropdown once more
5. Use the curser keys to select your dropdown option
6. Hit the Enter key on your keyboard to select the dropdown option.
> 0 votes

# Answer
This is based on what user17092013 wrote above.

```
add_action('admin_head', 'my_custom_fonts');

function my_custom_fonts() {
  echo '
     .select2-drop-active { z-index: 99999999 !important; }
     ';
}
```
> 0 votes

---
Tags: wordpress, civimember
---