# Question
Title: How to create joint accounts in CiviCRM contacts
I am coming from a database that has support for joint accounts. Basically, it has First Name, Last Name fields and then a secondary First Name,Last Name for a spouse or partner in one donor record. It also has support for printing out "John and Mary Smith" in mailings and the like. I have looked at Household accounts but that seems to only have a Last name for the household. It's not clear how to have a joint account. How are couples handled in CiviCRM ?

# Answer
> 5 votes
### The short answer:

1. When you want to store information about two people (e.g. "John Smith" and "Mary Smith") together, create a new household.
2. You can name the household whatever you like (e.g. "John and Mary Smith", or "Mary Smith and John Smith", etc)
3. Add *shared* information like home phone number (land line) and home address to the household record.
4. *Also* create **individual** records for *each* of these people. Now you have three contact records.
5. Create relationships between the individuals and the household. You can also set up the individuals to use the address of their related household.
6. Add other data to the individuals which is specific to them personally (e.g. cell phone, email, birth date, gender, etc.)

### The long answer:

While you're in this phase of deciding how to store your data in CiviCRM, I would suggest first taking a step back and considering *why* you might need to store data associated with multiple people, and if it's worth it to use households at all (because some organizations choose to disable them entirely and only use individual/organization records). For example:

* **Contributions:**

+ When using households: If you receive a check with two names on it, an intuitive approach is to store this contribution on the household record.
    + When using only individuals: Another approach is to store it on one individual and soft credit the other one.
* **Event participations:**

+ Regardless of your household strategy, it's best to keep event participations on individual records.
* **Memberships:**

+ You can store memberships on household records or individual records, or some combination thereof. How you choose to do so will likely depend on your overall membership strategy
* **Relationships**

+ When using households: relationships are created between individuals and their shared household. This makes it somewhat cumbersome to navigate from individual to individual because you must first navigate through the household
    + When using only individuals: you can set up a relationship type like "Spouse" to store the connection between two people and easily navigate between their records
* **Combined solicitations:**

+ When using households: If you are sending a paper mailing, you can use CiviCRM to generate a mailing list which uses households to group contacts together and avoid duplicate mailings.
    + When using only individuals: grouping related individuals into the same mailing piece will be more difficult and probably require some custom work
    + This, in my opinion, is the biggest argument for using households
* **Keeping your data clean:**

+ When using households:
        - Creating the requisite relationships and extra records is more work
        - De-duping is somewhat more complicated
        - When two people split up, it can be a pain to figure out what to do with their household record
    + When using individuals:
        - De-duping is simpler
        - Setting up the relationships requires fewer steps
        - Relationships can be disabled (even with an end date)

# Answer
> 3 votes
Sean describes the 'text book' answer well but depending on your usage, there are other options you could consider:

1) If you want to stick closely to your old system you could add custom fields for the spouse/partner name. Customise the Addressee field as Kainuk suggests for mailings.

Assuming 'John Smith' is the main contact and 'Mary Smith' is in the custom fields, the disadvantage of this is that if Mary registers for events, creates a memberships etc then she will have her own record in addition to being mentioned on John's ... but that may not matter for your usage.

2) You could simply set the first name to 'John & Mary' and not create custom fields (assuming they share the same last name). That would get very confusing if one of them registered for an event since it would show 'John & Mary' regardless of which one was attending etc. Again, that may not be a problem if you just intend to record donations and send mail.

You mention donor records - in some jurisdictions you need to record which member of a couple/household made the donation for tax purposes. That may be a factor in deciding how to set up these contacts.

As mentioned above, think about how you will handle couples splitting up, and also how to handle two of your existing contacts pairing up.

Having said all that, even if you only intend limited usage of CiviCRM now, these systems have a tendency to grow in their desired functionality so the effort to set them up properly as individuals with relationships with or without a household is probably worthwhile in the long run but it's your system and you can do what you like with it!

# Answer
> 3 votes
Late, but thought household aggregate contribution report might be helpful to some searchers.

We use up to three records for a couple. Event info goes on individual record and gifts generally go on a household record. Some gifts will be on an individual record before we knew of spouse or for raffle ticket purchases (where our state's DOJ allows - and requires us to track - only one purchaser) for example.

To aggregate contributions to households where they exist (and to access more robust and complex first, last and largest filter sets) for solicitation segmentation, honor rolls, and accurate acquisition and retention tracking, we cleaned up all our household relationships and had this awesome report built:

Donor Detail with Contributions Aggregated for Households

I could not follow fundraising best practices without it, and am happy to share the report, the ways I use it, and the pitfalls to be aware of (like special considerations required to work with exclusion criteria, and the open issue you see on github).

# Answer
> 1 votes
If the first need is printing labels, use the field *Addressee* with a customised value.

---
Tags: contacts, households
---


title: Profile pic not displayed in civimail

text:
# Question
Title: Profile pic not displayed in civimail
As per the requirement I'm trying to get the token values of the custom fields like name, date of birth,country, profile pic etc in the civimail .But when the email is sent.The profile picture is not displayed. Since I'm working on matrimonial site. It's mandatory to get the image in the email.Please help me on this. - Yes I want profile picture to be displayed in the email like all other values. I am getting surname,date of birth and Firstname but not profile pic.I am using tokens for custom fields.

Civicrm version- 7.x-4.7.9 I'm using Drupal 7.

The email output is as follows: Singh 1969-04-04 Puneeth, \<\>profile pic is not displayed.

## Html Source of email( I am using Mailtrap)

Singh

1969-04-04

Puneeth

# Answer
Based on the content you provided, the problem I see is the src is missing from the image tag. Be sure the URL you use is fully formed including the domain, ala, `src='http://mysite.com/.....'` (Well, actually, you don't have a img tag in there.... I think you meant for the `i` tag to be the image??)

The href you have on the anchor tag has this problem, with the URL not including the actual URL.

Once you get the src set on the image, and if it's still not working, post the HTML from that source view.
> 1 votes

---
Tags: civimail, tokens
---


# Question
Title: Initial payment processor setup for PayPal
I am trying to build a form for membership. How can I initially configure PayPal for payment processing?

# Answer
> 2 votes
Take a look at https://docs.civicrm.org/user/en/stable/contributions/payment-processors/ for setup on Payment Processors, including PayPal. You can setup the Payment Processor and then create a Contribution Page for membership.

---
Tags: payment-processor, paypal, configuration
---


# Question
Title: Issue getting Email for Bounce Processing
I'm getting the following error when running the "Fetch Bounces" scheduled job:

```
Details

Parameters parsed (and passed to API method):
a:1:{s:7:"version";i:3;}

Full message:
Finished execution of Fetch Bounces with result: Failure, Error message: A fatal error was triggered: Could not connect to MailStore for ebounce@domain.com@imap.gmail.com
Error message:

An error occured while sending or receiving mail. Failed to connect to the server: imap.gmail.com:993.

```

The mailbox is a G Suite account, IMAP is configured, and I can connect to the mailbox via IMAP from an Outlook email client. The error appears in the job log immediately after running the job (there's no 30 second or longer delay that I would expect if it were timing out trying to connect to the mailbox).

Where can I look (or how can I get) some more detailed information on why this job might be failing so quickly?

As per the recommendation, we're running Wordpress 4.8 and CiviCRM 4.7.19

Thanks!

# Answer
The issue is likely at the server networking level. If you have access to that server (via SSH or similar), I would try installing the swaks utility to troubleshoot.

swaks might even be premature though. I would start by ensuring that your server's firewall isn't blocking outgoing access on port 993 and that imap.gmail.com is resolving in DNS.
> 3 votes

# Answer
Gmail likes you to go in and turn on the "Allow less secure apps" setting, if you haven't done that yet. They aren't so clear about what exactly makes the app less secure according to Google, but they are an attractive option because of the price and because gmail supports address+ processing. If you choose to do it, sign into the Google account you are trying to use, choose My Account, select Sign in and Security, scroll to the bottom, and turn on "Allow less secure apps."
> 2 votes

---
Tags: wordpress, email, bounce
---


# Question
Title: Problem with new Pay Later contributions showing as Completed
I'm a very new CiviCRm user. And pretty new to WordPress so I apologise if this is a user error. I'm doing suitability testing.

WordPress 4.8

CiviCRM 4.7.20

I have created a Contribution page to take memberships. I believe I've selected the options I need for membership types and pricing.

At the moment, I ONLY have a Pay Later option. I haven't tried yet with PayPal or similar.

So in my test I create a new user, put in the information needed. And submit it.

I then go and find that user, and look at the relevant contribution. It shows as completed, not pending.

Obviously this is incorrect.

Any thoughts on what I'm doing wrong?

Thanks, Norman

# Answer
It depends highly on the membership amount you display on the contribution page. If the amount is `0`, there is no pending state needed and contribution directly gets set to Completed.

So, I think you should check the `Minimum Fee` set for the membership type you've selected on this page.
> 2 votes

---
Tags: wordpress, civicontribute, paylater
---


# Question
Title: Southern California Civi CRM Expert Wanted
We are huge fans of Civi CRM, but in order to really understand the benefits of the platform we would like to work with a veteran. Basically, we need a consultant to point us in the right direction and keep us from making critical mistakes.

Leave your contact information and we will contact your prior to the end of the week. Thanks!

# Answer
> 2 votes
Thanks for your interest in CiviCRM. This question is likely to be closed as it doesn't really fit into the StackExchange format.

Instead, I would suggest that you look at the list of partners and contributors on the CiviCRM website and contact them directly:

Find an expert

# Answer
> 0 votes
I'm in Irvine, in Orange County. Contact info is:

Joe McLaughlin
joesmcl@gmail.com
cell: 518-405-9231

My contact info is also at my CiviCRM.org partner page and see my LinkedIn profile

---
Tags: evaluating-civicrm
---


# Question
Title: Event registration form - How to make one field appear only if another checkbox field was ticked?
In an event registration form, I have some fields which are only relevant in case the user have ticked a specific checkbox (another field). How can I make these fields appear only when he ticks this checkbox, and disappear if he unticks it?

# Answer
If you are using the regular CiviCRM event forms (utilizing profiles) this is only possible with customisations (probably using javascript). In case you are using Drupal you could set up the integration between CiviCRM and teh webform module which allows you to define such conditions (among many other settings such as paged forms, draft saving, advanced styling...).
> 0 votes

---
Tags: civievent, display, online-registration
---


# Question
Title: How can I change the way price set information is presented on a contribution page?
Contribution pages showing price set information (i'm using a radio button field with various options to choose from) show the various price option with the label text first, in bold, and then the amount, not in bold, and with a space between the currency symbol and the amount.

I'd like to have the amount first, with no space between currency symbol and figure, followed by the label text.

I'm assuming all this is in a template file somewhere? If so, where should I be looking? Anything else to look our for or take into consideration?

# Answer
You can do most/all of that with an extra CSS file. Go to `Administer > System Settings > Resource URL's` and enter a value for the `Custom CSS URL`.

In that file, you can add CSS to change the default appearance. To figure out what to put there, you'll need to examine the page and experiment with Firefox/Firebug or similar. There are lots of CSS tutorials around, but if you post a URL of the current version someone might suggest some CSS for you.
> 1 votes

---
Tags: price-sets, templates, custom-templates
---


# Question
Title: How to make event registration form fields be displayed inline
At the moment, each field specified in a profile that is related to an event online registration form, has its own line, inside its own div. I want to be able to display 2 specific fields in the same line, which are logically connected to each other. How can I do that?

# Answer
If you are on Drupal you could do the event registration using a webform with webform\_civicrm and use the webform\_layout module to place two fields on the same line.

Alternatively you could write a tiny extension to drop in some jQuery to move the fields around in the standard event registration form. There is write up of how to do that here: http://jackrabbithanna.com/articles/easy-jquery-modificaiton-civicrm-forms Note that since that was written `cj` has been deprecated in favour of `CRM.$`

If you can do the changes with CSS without needing the power of jQuery, you can also do that - see my answer to How can I change the way price set information is presented on a contribution page?
> 0 votes

---
Tags: civievent, display, online-registration
---


# Question
Title: How to prevent the accidental the deletion of contacts, when an obligation exists to keep their records?
In the Netherlands, the taxpayer can deduct gifts to charities from his income tax. The tax authorities take samples and can ask a charity to report the gifts it received from a particular contact. The length of the period they can ask this is seven years. So the records of this contact must be kept in these years. Is there an elegant way to prevent deleting, or trashing a contact that gave a contribution in the last seven years?

# Answer
> 2 votes
I assume writing a little extension that picks up the delete with the civicrm\_pre hook is a fairy elegant way?

# Answer
> 2 votes
Another way to approach this, if you're trying to avoid coding, would be to take away the "delete contacts" permission at the CMS permissions level. This would take away the ability to delete contacts unless that permission is explicitly granted by an ACL rule.

The ACL system lets you get very specific about which contacts may delete other contacts. You could create a static group "Senior Staff" which has permission to delete contacts in a smart group called "Deletables." The task of defining the criteria for inclusion in this smart group is left to the reader.

# Answer
> 1 votes
Elaborating on the answer of Erik, I created an extension with the following hook

```
function preventcontactdelete_civicrm_pre($op, $objectName, $id, &$params) {
  if ($objectName == 'Individual' && $op == 'update') {
    if ($params['is_deleted'] && CRM_Preventcontactdelete_Check::hasRecentContribution($id)) {
      throw new Exception("Delete of contact $id not allowed - it has recent contributions");
    }
  }
}

```

# Answer
> 1 votes
If I am not mistaken, CiviCRM will (at least via the UI) does not allow contacts with live finacial transactions (so everyone with a completed donation) to be permanently deleted, unless you delete the contributions first.

This way, accidental deletion would not be possible and you can always not grant users the permission to delet contributions...

---
Tags: contacts, delete
---


# Question
Title: Upcoming Birthdays custom search not working
I have followed the instructions to install the "Upcoming Birthdays" customer search from here.

However, when I run this custom search, CiviCRM gives me blank screen. Our organization is using CiviCRM 4.6.2 on Wordpress 4.1.5. Is this customer search working on 4.6?

Is there another way I could create a search for up and coming birthdays for our members?

# Answer
The easiest way to do this is via the Upcoming Birthdays Report extension.
> 2 votes

# Answer
You can now use Relative Dates (see "Date Range Filter" section) against the Date of Birth field in Advanced Search. This custom search is no longer necessary now that relative dates are available. Note that in the next version of CiviCRM (4.7), relative date filters will be configurable.

Also, as of CiviCRM 4.6, Date of Birth can now be used as a criterium for sending Scheduled Reminders.
> 1 votes

---
Tags: custom-search
---


title: Importing Contributions - Email Receipt

text:
# Question
Title: Importing Contributions - Email Receipt
When importing contributions I would like receipts to go to the contacts that made the payment. What is the best approach to make this happen?

# Answer
You could import and tag or add to a Group, then find via Adv Search (filter by Group/Tag plus date of donation) but set to 'Display as Contributions, then use the Actions to trigger Print or Email Contribution Receipt which is described thus:

> You may choose to email receipts to contributors OR download a PDF file containing one receipt per page to your local computer by clicking Process Receipt(s).
> 1 votes

---
Tags: civicontribute, import, receipts
---


title: User Log-Ins at the same time

text:
# Question
Title: User Log-Ins at the same time
Can you tell me how many people can log in at the same time with one user name? We are setting up video training in which multiple users will need to log in.

# Answer
> 1 votes
I take it the video training is not what they are logging in to, but rather the CiviCRM system. There is no 'limit' but there will be server constraints. Depending on your server config, if you have 50 users and they all click on a complex query (such as an Include/Exclude Smart Group) then you may see smoke coming out of the screen ;-)

But fundamentally there is no limit to logged in users (which is a CMS issue rather than a CiviCRM issue anyway)

---
Tags: user-account
---


# Question
Title: How to add a new entity in CiviCRM extension
As I am new to CiviCRM. I am trying to create a new entity for my extension to add some new data in `database schema`. The documentation I am following to create a new entity is: https://docs.civicrm.org/dev/en/master/extensions/civix/#generate-entity

**What I have done using the documentation till Now:**

* I have created successfully new extension under the folder `<drupalroot>/sites/.../civicrm/ext/`
* The extension is `enabled` from the **CiviCRM » Administer » System Settings » Extensions**
* I have used `civix generate:entity MyEntity` to generate a new entity.
* The entity is generated under the `ext/myextension/`.
* This command has created seketal files successfully.
* I have edited the `xml` file to add fields for entity *(table)*.
* Now, **1 - 3** points are done.

I have got stucked when following the point **4 - end**. The overflow and files and folder structure is defined in these point and how to generate or run the `DAO file` to run `sql` to create new table in `database schema` looks weird to me. **I am using** `Drupal v7`, `Civicrm v4.7.2 for drupal 7.x` and `XAMPP` on `Windows OS` envirnoment. I don't now what I have to do after it to successfully create and use entity in my `CiviCRM` extension.

Please help me to solve this problem. I am very thankful to you in advance.

Best Regards.

# Answer
You need to install civicrm using buildkit to ensure you have all the dependencies / tools / files. Then have a look here: https://docs.civicrm.org/dev/en/master/extensions/civix/

Examples of extensions that have done it (see ./bin/setup.sh for a scripted method of DAO creation): https://github.com/civicrm/org.civicrm.volunteer And https://github.com/3sd/civicrm-sms-conversations/
> 1 votes

---
Tags: drupal, extension, developer, civix
---


# Question
Title: Is there any step by step guideline to know CiviCRM for absolute beginner?
I have no idea about civicrm but I am confidant about php,wordpress. Now I am assigned the following task:

```
Overview:

Currently, when a membership is renewed in CiviCRM the “end date” field on the membership itself is extended by the length of the membership as defined in CiviCRM membership type configuration but no record of the actual length of any one period or term is recorded. As such it is not possible to see how many “terms” or “periods” of membership a contact may have had.

I.e. If a membership commenced on 1 Jan 2014 and each term was of 12 months in length, by 1 Jan 2016 the member would be renewing for their 3rd term. The terms would be:

Term/Period 1: 1 Jan 2014 - 31 Dec 2015
Term/Period 2: 1 Jan 2015 - 31 Dec 2016
Term/Period 3: 1 Jan 2016 - 31 Dec 2017

The aim of this extension is to extend the CiviCRM membership component so that when a membership is created or renewed a record for the membership “period” is recorded.

The membership period should be connected to a contribution record if a payment is taken for this membership or renewal.

Requirement:

Create a new CiviCRM extension that creates a new entity (inc database schema install) for the membership period. The membership period should have a start date, end date, should be linked to a membership and it should also be possible to display a linked contribution record.

Create an API for this new entity that can be used like a normal CiviCRM API.

Create new functionality that will populate the membership period when a membership record is created or updated. Use an appropriate CiviCRM approach for this (Hint : Check Civicrm Hooks https://wiki.civicrm.org/confluence/display/CRMDOC/Hook+Reference).

Create a simple but appropriate display somewhere on the contact record to show the membership periods with a link to contribution records if a payment was recorded for the renewal. We would suggest that either some modification of the display of memberships to show within each membership the periods, or failing that, a new contact tab would work well.

```

I am looking for a guideline to start with the assignment. Would you suggest me - is it possible for a absolute beginner to complete this assignment?. If so please give me some guidelines.

# Answer
I'd suggest you start at https://docs.civicrm.org/ You'll want to read through the User Guide to get an understanding of what CiviCRM is and what it can do. In particular, you will need to study the Membership and Contributions sections.

From there, head to the Developer Guide to learn how to create an extension, how the API works, what hooks are and how to use them, how to create a new entity etc, etc.

This is not a simple task and as a beginner you will need to invest considerable time and effort to accomplish this.

In the past we have seen companies use exercises like this as part of recruitment. Is that your situation?
> 3 votes

---
Tags: civicrm-entity
---


# Question
Title: What do you do with Pending (Incomplete Transaction)?
We currently use Paypal until we can figure out why Stripe is not working. If a user does not complete the paypal payment, CiviCRM correctly lists the transaction as Pending (Incomplete Transaction). Since most users eventually create a new transaction, we are left with a number of Pending (Incomplete Transaction) activities.

I have begun to list those activities as Expired but I then thought Cancelled may be a better fit. Then I wondered if I should just leave it alone. What do you all recommend? What do you do?

# Answer
> 1 votes
We do several things with these. In most cases we filter them out of all reports. If the user creates a new transaction we will leave them as is or delete them. Sometimes we create a special status for these in case they need to be referred to later (maybe the entries are different).

It really comes down to what works best for your internal processes.

---
Tags: civievent, civicontribute, pending
---


# Question
Title: how to configure outbound email as gmail
I want to configure my outbound email as gmail.I am new to this.Can you please tell me the steps like what should be SMTP username and password. Should I mark authenticate as yes/no?

I tried but I am getting this error. https://www.screencast.com/t/bbageClqaT

Your suggestions are most welcome.

Thanks, Mohit Thareja

# Answer
> 5 votes
Configuring CiviCRM SMTP for using Google Mail's SMTP services: `SMTP Server: ssl://smtp.gmail.com
SMTP Port: 465
Authentication: Yes
SMTP Username: <your valid Google mail username>
SMTP Password: <your valid Google mail password>`

Finally, you likely need to tell Google that you wish to allow this level of access. See here: support.google.com/accounts/answer/6010255?hl=en

---
Tags: civimail, smtp, google
---


# Question
Title: How do I export my contacts as a .csv or .txt file?
How do I export my contacts as a .csv or .txt file? I need this for my records and can not find where I can do this. Please help. Thankyou.

# Answer
You can do a search (of any kind) and the resulting screen will have an Actions select menu. Select any or all of your contacts and then you can select the Export Contacts in the Actions menu. See https://docs.civicrm.org/user/en/4.6/common-workflows/exporting-your-contacts/

You can also run any number of reports and save the result as a CSV.
> 4 votes

---
Tags: contacts, export, csv
---


title: searching custom field

text:
# Question
Title: searching custom field
I have a custom field for storing educational data. A person's degree is stored as either Btech or B.Tech or B.Tech. so what should I give in search option so that I can get all 3 in my result in a single search?

# Answer
You can use basic pattern valid in `LIKE` operator of sql where clause.

For Eg - Using `%tech%` would result in all three rows.

Similarly you can use `[`, `]`, and `_` symbols.

To find more about search strings - see Pattern Matching in MySQL (AFAIK you can use only `LIKE` patterns here not `REGEXP`).
> 1 votes

---
Tags: custom-fields, search, search-results, custom-search, search-builder
---


# Question
Title: How to enter relationship dates before 1997?
In relationship management you also want the information to be complete and include relationships that were before CiviCRM was used. This could typically be relationships older than 20 years. CiviCRM imposes a limit and I cannot find the setting to change it to our needs.

# Answer
> 6 votes
For CiviCRM 4.6+ go to Administer menu \> Customize Data and Screens \> Date Preferences. From there, change the Start Offset of SearchDate.

I found this answer in Member since date before 1995 and although it talks about Membership dates, it apparently applies to Relationship dates too.

---
Tags: relationships, 4.6, date-preferences, lts
---


title: Mapping database from Neon to Civi

text:
# Question
Title: Mapping database from Neon to Civi
Our organization is considering moving to CiviCRM after many years with Z2Systems Neon CRM and in downloading the MySQL database from Neon we note that there are 10 pages of table in the Neon database and only 4 in the Civi template. How do we map Neon to Civi?

# Answer
Another tool that folk who are moving to CiviCRM and Drupal may find interesting is the Drupal module CiviMigrate. There is a fairly historic write up of it here
> 1 votes

# Answer
Welcome to Civi! I'm not aware of an existing mapping template from Neon to Civi, but there are a number of resources for preparing for such a change. Sanjay's answer (and Jon G's comment) provide a good primer here on StackExchange for getting ready for such a move. The Civi docs also provide an excellent introduction to importing data into Civi.

Another tool you may find useful is API CSV Import GUI extension if you have data outside the standard import fields.
> 0 votes

---
Tags: database
---


title: Setting up a Green Party email

text:
# Question
Title: Setting up a Green Party email
How do I set up- what do I need to set up, a Green Party email? No one in our local party knows!

Gateshead Greens

# Answer
> 1 votes
Go to Mailings in the black Admin Menu when you are in civicrm, click on new Mailing, then select the template and target group as per the instructions here https://docs.civicrm.org/user/en/stable/email/what-is-civimail/

---
Tags: email
---


title: Organizational membership

text:
# Question
Title: Organizational membership
Using 4.7.x. I am trying to create a membership type where an Organization is the member. How do I do that? I see some references from a few years ago on the forum about selecting what contact type it's for, but I don't see that option for that in creating a membership type.

Obviously, a real person (contact) is going to do the actual signing up. Hopefully that person and other employees of the organization will inherit membership privileges.

Is all of this doable?

# Answer
Set up your Membership Type as you would expect to. Use 'inherited relationships' if you want eg Employees of that organisation to be considered members.

Then on the Contribution page, use the 'on behalf of organisation' settings on the first screen to set up so Person A can sign up on Behalf of Org B.

Check out the documentation link below. Won't be hard to find once you know to search for 'on behalf of' phrase

NOTE: a contact needs to have a Permissioned and Current 'Employee of' relationship if they are to have the Org field prefilled eg when renewing via a checksum

Documentation
> 1 votes

---
Tags: civimember, relationships
---


# Question
Title: Is there an extension for adding a custom field type calculated field?
Civi 4.6.9
Drupal 7.44

On many occasions it would be very handy to calculate the values of custom field sets and store that calculated value within Civi.

I'll use a survey for example.

I'd like to create a scored survey activity type tied to a custom field set. The field set would include multiple fields, each with select options. The final field within the set would be "Score." I'd like this field to add the values of all answers. Once we calculate the survey score we can do all kinds of fancy stuff.

I've done my due diligence but didn't find anything out there.

If there isn't one, is the extension route the most efficient method?

Ideally, I'd love to have "Calculated Field" be an option for data type when creating custom fields but that may be a pipe dream.

Thanks.

# Answer
> 5 votes
\[UPDATED FOR 2023\]

The closest equivalent is using SearchKit. You can use either Data Segmentation or text rewrites with Smarty.

At the bottom of this answer is a screenshot of a Data Segment to calculate the donor level based on amount donated. There's also a screenshot of using text rewrites to calculate the amount of time elapsed in minutes between two date/time custom fields.

What you're asking for is very similar to Computed Field for Drupal - but the nature of calculated fields is that you're writing code (or some pseudo-code formula). At that point, it's not much further to writing the code in an extension.

Furthermore, there are basic transformations available on SearchKit without rewrites (e.g. concatenate text, sum numbers).

The limitation of the approaches above is that they're only available in SearchKit. If you'd like them available as a custom field/token, there are three extensions you can investigate - Summary Fields, Synopsis and SQL Tasks.

All three extensions rely on writing SQL. Summary Fields has some options for using triggers, but is much harder to use, and you have to build a sub-extension. Synopsis and SQL Tasks let you write your SQL inside a UI. Synopsis is built for the purpose and is a better experience, but SQL Tasks can also be used in many instances.

\[2016 answer\] There are several approaches you can take:

You can write an extension and use hook\_civicrm\_pre to grab the fields in question and write to the custom field when your survey is created/updated. This is relatively quick and easy.

You can write a MySQL trigger in your database. This is good if you need very high performance. However, you will need to re-add your trigger on every upgrade - unless you put it in an extension.

#### Data Segmentation

#### Text Rewrites

# Answer
> 2 votes
Paul, very interested in this idea as well. Don't have a great answer, but here's an idea - since you're on Drupal, I wonder if this would work - using Views, Views Calc and Views Aggregator Plus (perhaps along with webform-civicrm) to do the calculation - add the survey answers to get a score - then saving that score back into Civi in a custom field?

# Answer
> 1 votes
Would it be useful to have a general extension that would allow arbitrary PHP to be associated with a View only custom field, and executed on save of the associated object, eg contact or contribution. The extension would provide a new permission that by default would be turned off for all roles. As a vector for security vulnerabilities and performance problems, it should be available only to sysadmin type users. https://www.drupal.org/documentation/modules/php

An alternative design that would have reduced usefulness, cost more to develop, yet be safer and less subject to performance concerns would make it possible to do specific arithmetic or string operations on the core or custom fields of the object associated with the view only field. Like tokens, this could include access to the core and custom fields of the associated contact if the object was something like a contribution or event registration or activity.

# Answer
> 0 votes
I had the impression that the Summary Fields extension would be a good starting point for adding additional calculated fields. To quote

> This extension provides hook\_civicrm\_sumfields\_definitions which allows you to add additional summary fields of your own. Example:

```
/**
 * Implements hook_civicrm_sumfields_definitions()
 *
 * Change "mycustom" to the name of your own extension.
 */
function mycustom_civicrm_sumfields_definitions(&$custom) {
  $custom['fields']['hard_and_soft'] = array(
    'label' => 'All contributions + soft credits',
    'data_type' => 'Money',
    'html_type' => 'Text',
    'weight' => '15',
    'text_length' => '32',
    'trigger_sql' => '(
      SELECT COALESCE(SUM(cont1.total_amount), 0)
      FROM civicrm_contribution cont1
      LEFT JOIN civicrm_contribution_soft soft
        ON soft.contribution_id = cont1.id
      WHERE (cont1.contact_id = NEW.contact_id OR soft.contact_id = NEW.contact_id)
        AND cont1.contribution_status_id = 1 AND cont1.financial_type_id IN (%financial_type_ids)
      )',
    'trigger_table' => 'civicrm_contribution',
    'optgroup' => 'mycustom', // could just add this to the existing "fundraising" optgroup
  );
  // If we don't want to add our fields to the existing optgroups or fieldsets on the admin form, we can make new ones
  $custom['optgroups']['mycustom'] = array(
    'title' => 'My group of checkboxes',
    'fieldset' => 'Custom summary fields', // Could add this to an existing fieldset by naming it here
    'component' => 'CiviContribute',
  );
}

```

Also seems a fairly solid recipe here

---
Tags: custom-fields, extension, core
---


# Question
Title: CiviMail Report - Administrator Permission Problem
I'm using CiviCRM 4.7.20, but the problem showed up at some point while I was using 4.7.11. I'm using the current version of WordPress. I'm the administrator and used this userID/password to upgrade to 4.7.20, hoping this problem would go away. WordPress Users shows that I'm the administrator. At some point, the Report links on the CiviMail Report screen, started giving me: "Sorry but we are not able to provide this at the moment. You do not have permission to access this page." I can still access the Advanced Search links on the same screen. What's going on??

I'm using the WP Members Plugin, but disabling it doesn't help. I've gone into WP Roles and made sure the Administrator is granted every permission and denied nothing. What's going on??

Here's the backTrace I get from clicking on menu item: Mailing Reports

```
#0 /home/mysite/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(374): CRM_Core_Error::backtrace()
#1 /home/mysite/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php(354): CRM_Core_Error::fatal("You do not have permission to access this page.")
#2 [internal function](): CRM_Utils_System_WordPress->permissionDenied()
#3 /home/mysite/wp-content/plugins/civicrm/civicrm/CRM/Utils/System.php(74): call_user_func_array((Array:2), (Array:0))
#4 /home/mysite/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(230): CRM_Utils_System::__callStatic("permissionDenied", (Array:0))
#5 /home/mysite/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(230): CRM_Utils_System::permissionDenied()
#6 /home/mysite/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:14))
#7 /home/mysite/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:3))
#8 /home/mysite/wp-content/plugins/civicrm/civicrm.php(1227): CRM_Core_Invoke::invoke((Array:3))
#9 [internal function](): CiviCRM_For_WordPress->invoke("")
#10 /home/mysite/wp-includes/class-wp-hook.php(298): call_user_func_array((Array:2), (Array:1))
#11 /home/mysite/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters("", (Array:1))
#12 /home/mysite/wp-includes/plugin.php(453): WP_Hook->do_action((Array:1))
#13 /home/mysite/wp-admin/admin.php(222): do_action("toplevel_page_CiviCRM")
#14 {main}

```

# Answer
I fixed it. At some point I disabled the CiviReport component of the system. I didn't know I needed CiviReport to look at that part of CiviMail. A better error message would be nice!
> 2 votes

# Answer
I don't use wordpress often but have you checked the wordpress/civicrm permissions?

on an outdated instance I have access to I found that at the following url /wp-admin/admin.php?page=CiviCRM&q=civicrm/admin/access/wp-permissions&reset=1

do you have "CiviReport: access CiviReport" permissions on the roll you are using?
> 0 votes

---
Tags: civimail, permissions
---


# Question
Title: how to automatically creates a relationship
Is there a way to automatically create a relationship if 2 or more address in the DB is exactly the same?

I want to create the relationship if two or more people are living in same house.

# Answer
You would need to write a custom extension or module. in this extension or module, implement hook\_civicrm\_post()...

Drupal module's are the simplest, if you are integrating with Drupal that is

so for example

```
function MYMODULE_civicrm_post($op, $objectName, $objectId, &$objectRef) {
  // if location type  is Home (location_type_id:1), operation is create, and object type is Address
  if ($op == 'create' && $objectName == 'Address' && $objectRef->location_type_id == 1) {
    // look for other addresses with the same street address, city, state, postal code, zip, and country
    $result = civicrm_api3('Address', 'get', array(
      'sequential' => 1,
      'street_address' => $objectRef->street_address,
      'city' => $objectRef->city,
      "state_province_id" => $objectRef->state_province_id,
      "postal_code" =>  $objectRef->postal_code,
      "country_id" =>  $objectRef->country_id,
      'contact_id' => array('!=' => $objectRef->contact_id),
    ));
    if(!empty($result['count'])) {
      foreach ($result['values'] as $value) {
        // check for existing relationship between contacts
        $result1 = civicrm_api3('Relationship', 'get', array(
          'sequential' => 1,
          'contact_id_a' => $value['contact_id'],
          'contact_id_b' => $objectRef->contact_id,
          'relationship_type_id' => 8, // change this to the id of the type of relationship you want to create
        ));
        $result2 = civicrm_api3('Relationship', 'get', array(
          'sequential' => 1,
          'contact_id_a' => $objectRef->contact_id,
          'contact_id_b' => $value['contact_id'],
          'relationship_type_id' => 8, // change this to the id of the type of relationship you want to create
        ));

        // if no existing relationship found create the relationship
        if($result1['count'] == 0 && $result2['count'] == 0) {
          $create_result = civicrm_api3('Relationship', 'create', array(
            'sequential' => 1,
            'contact_id_a' => $objectRef->contact_id,
            'contact_id_b' => $value['contact_id'],
            'relationship_type_id' => 8, // change this to the id of the type of relationship you want to create
            'is_active' => 1,
          ));
        }
      }
    }
  }
}

```
> 1 votes

---
Tags: webform-civicrm, civireport, relationships
---


title: Why is CiviCRM Upgrade so Complex?

text:
# Question
Title: Why is CiviCRM Upgrade so Complex?
Upgrading CiviCRM is a painful process (18 steps) :

Of course, I admit the necessity to previously backup, put the site offline, disable some Modules, ...

But deleting all previous civicrm code files is very long, and downloading then unpacking, then transfering the new code files is very time consuming. ... and we do this twice : one for test, and one for good.

So, why : \- not to include l10n and sql inside the upgrade ? \- not to upgrade CiviCRM just like any other Drupal Module, or, at least, reinstall CiviCRM like any Drupal Module (copy-paste the tar.gz URL) ?

# Answer
> 7 votes
I have been dealing with upgrades a lot lately, and I have the process "down" so that it is very fast. I am impressed with how fast I can do an upgrade. The key is shell access - or something that mimics it - because using sftp is very slow. That might be your problem. Once I have the data backed up it basically goes like this:

* ssh into the server and tar/gz (archive) the existing civicrm directory. One command, 15 seconds or so.
* upload the new version tar/gz. This of course will vary greatly by internet connection speed, but generally only a couple of minutes or less.
* delete the existing directory. This is what's horrendously slow via most sftp programs I've used. They usually do a recursive delete on each individual file and directory, and since there's a ton of them in CiviCRM it takes forever. It takes 1 second in the shell.
* Unarchive the new version. Usually less than a minute.
* run the upgrade script.

Very, very fast.

If you aren't a command line person - I'm not, actually - there are some ways around it. Our systems all have Webmin installed as a helpful control panel, and it's Filemin file manager deletes directories as quickly as the shell commands do. I also regularly use Cyberduck for SFTP work, and it has a built in tar function, so I can archive/unarchive just as quickly as from the command line. So, even though I don't really use the command line I am getting the benefits.

I would add that if you are concerned about security the very LAST thing you would want to do is have excessive writable directories on your server, and most built in upgrade systems require these. Don't give in. You can reduce writable directories by not using those systems and save you many troubles down the road.

# Answer
> 4 votes
The documented upgrade process is long but has to cover every eventuality. I've got it down to 11 steps - 2 of which I don't normally do. I can do an upgrade in about 10-15 minutes, but this depends on my cPanel access which makes most steps very fast. Do you have cPanel access? Here are my 11 steps:

1. Check extensions will work (don't do this if a minor update)
2. Logon as Admin
3. Backup the database (using phpmyadmin)
4. Disable extensions (I don't normally do this, never been a problem)
5. Clear Civi cache
6. Delete templates.c folder (using cPanel file manager)
7. Delete old code (ditto)
8. Upload & unpack new code (ditto)
9. Run upgrade code (/civicrm/upgrade?reset=1)
10. Enable extensions (if disabled)
11. Test

# Answer
> 4 votes
I find using Drush to upgrade CiviCRM is very quick. Here are some instructions: Is it easy to upgrade CiviCRM using drush?

# Answer
> 3 votes
Re: *why not to upgrade CiviCRM just like any other Drupal Module*

CiviCRM can be used with Wordpress or Joomla as well as Drupal, so it cannot rely on Drupal's update mechanism.

Re: *deleting all previous civicrm code files is very long, and downloading then unpacking, then transfering the new code files is very time consuming.*

This is certainly easier if you have shell access to the server.

Re: *why : - not to include l10n and sql inside the upgrade ?*

l10n is I think not included because many installations don't need it and it roughly doubles the size of the download.

Can you clarify what you mean by including sql?

# Answer
> 1 votes
Since the OP talks about 'doing this all twice' thought I would mention that using code repo eg git, can mean that the download of new codebase occurs only on dev instance, then git add/commit/push, and on live git pull, then run civi upgrade, via cli if you are happy with that, cvupdb, which isn't quite the same as 'doing this all twice'.

---
Tags: upgrade
---


# Question
Title: Is there a way to display a CMS username in a profile?
We are using Drupal 7.

We have a makeshift membership directory using profiles. That works great. But our members often forget their usernames, and we have some systems where members can uniquely identify other members by their usernames. So it would be nice to display their user name in the membership directory. Is there a way to do this?

# Answer
> 1 votes
This could be done in Drupal via Views where you can easily join the civi contact to their drupal user record and hence show both the civi 'name' and the user 'name'.

(mostly adding this for completeness as it 'is' an Answer, and SE likes answers ;-) )

---
Tags: drupal, profile, user-account
---


# Question
Title: Unable to locate folder xml under the civicrm root directory
I am new to `civicrm` and trying to build extension. The extension is build and activated. The stage where I got stocked is when I trying to add `entity` for my `civicrm extension`. I am following the Official Documentation from the `civicrm` website.

Point **4.c** has mentioned to edit the file `<civiroot>/xml/schema/Schema.xml` but I am unable to file with that name and neither the path under the `<civiroot>`

**Please Note:** my `civicrm` root directory that I am following with `Drupal7` installation is as `<DruaplRoot>/sites/default/files/civicrm`

Please help to get out of this problem as I am unable to add new entity.

I'm thankful to you in advance.

# Answer
It sounds like perhaps you are developing your extension within a normal CiviCRM installation instead of a *development* installation. If this is the case, you'll need to set up a development installation in order to get the `xml` folder (and other things too).

The best way to set up a development installation is to use the civibuild tool which you will get if you install buildkit.
> 1 votes

---
Tags: drupal, extension, developer, civix
---


title: Reporting options

text:
# Question
Title: Reporting options
So a few things, when I create a custom report display, by adding additional fields to display. Is there anyway to re-order the fields. so for example if I want lastname, then first name...or other changes?

secondly, is there a way to extend the reporting so i can have reports built? I would like to be able to add an "Action" under the action menu and be able to take the results of the query and send it to a new report?

third, is there a way to bulid a different set of filters for example, what if i want to have the person be able to select a date range or to be able to select a date before, or date after...but the user could decide.

I want to keep everything within Civi framework and not have the user have to go out to a third party app

thanks, Mark

# Answer
In Drupal Views you can

* build reports with exposed filters, with cols in any order you want, with links to exploded reports and lots more.
* use Contextual Filters or standard filters to ensure the user only sees information pertinent to them
* Civi Relationships (and Views Relationships) to expose to the user other records in civi they should be able to access.

To get started

* if your Drupal db is separate to civi DB then add the prefix required for the civi tables in to your settings.php
* add a view based on CiviCRM Contacts
* add some fields, filters etc and familiarise yourself with Views capabilities

If the above is too hard

* check some of the excellent videos tutorials around on using Views
* reach out to one of the Partners such as Fuzion to at least get you started without too much banging of heads again solid or other types of objects.
> 2 votes

# Answer
You can also try out some of the extensions that have been built by users and Partners and clients such as the one Fuzion built called Extended Report
> 0 votes

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


# Question
Title: How to link one contact's address to be the address of all contacts in a specific group via SQL?
I would like to link one contact's address to the main address of a group of many other contacts. I see how to do this manually for one contact, but I cannot find a way to to this in a bulk way for a whole group. Thank you

# Answer
> 3 votes
This is how you set the address of all people in a certain group (group id = 13), to be the address of a specific, different contact (address id 15432)

SET @InGroup:=13; SET @MasterAddress:=15432;

UPDATE civicrm\_address SET master\_id = @MasterAddress WHERE contact\_id IN (SELECT contact\_id FROM civicrm\_group\_contact WHERE status = 'Added' AND group\_id = @InGroup)

# Answer
> 1 votes
One way you can do this is to use the Advanced Search under the "Search" link on the Civi navigation bar. Expand the Address Fields tab, enter the address. This should produce a list of users with the indicated address. Now you can check all the users and use the dropdown to add them into the group.

---
Tags: contacts, groups, addresses
---


# Question
Title: Is there a way to print mailing labels from a report
Currently, reports do not have a way to print mailing labels. Our specific requirement is to make use of the "Upcoming Birthdays Report" to print mailing labels for donors so we can post them birthday cards and even just send them an email.

# Answer
> 3 votes
I found a way to print labels from the results generated by running the "Upcoming Birthdays Report" as follows:

1. First I created a group and named it "Upcoming Birthdays".
2. I then ran the Upcoming Birthdays Report".
3. Added the results of the report to the "Upcoming Birthdays" group.
4. Then went to Search-\>Find Contacts. Selected the "Upcoming Birthdays" group and clicked Search.
5. Then from the search results, selected all records, and selected "Mailing labels - print" from the actions drop down.

# Answer
> 3 votes
A couple options:

* From the report you can export to CSV and use that as a data source for a merge outside of Civi.
* If you create a smart group with the same criteria as the report you can quickly search for those who meet the criteria and print mailing labels from the search results. You can also use this smart group as a recipient list in CiviMail if you want to go the email route.

Hope this helps.

---
Tags: civireport, address-labels
---


# Question
Title: Access Denied After SSL Changes on Resource URL Admin Page
**Setup**: CiviCRM 4.6.4, Drupal 7.54, GoDaddy Shared Hosting.

**What I Did Recently**: Installed Let's Encrypt certificates, verified things still worked, created and sent out a bulk mailing, created and tested an event with online signup and payment.

**What I Did Friday (6/23/17)**: (not completely clear of exact steps here 'cause I may have blanked while banging my head on desk... note to self, glue foam on desktop) Under Administer/System Settings/Resource URLs I changed the SSL settings to Yes and then back to No.

**What Happened Next**: Access Denied error trying to access ANY Administer page, pages that access creation/editing of Events, forward facing Event pages, other pages that are less important to me right now.

**What I Need**: HELP (please)! Event is little more that 3 weeks away and I (we) need access.

Thank you.

# Answer
You can override the SSL settings in `civicrm.settings.php`, which will hopefully be enough to get you back in.

Add the following lines to `civicrm.settings.php`:

```
global $civicrm_setting;
$civicrm_setting['CiviCRM Preferences']['verifySSL'] = false;
$civicrm_setting['CiviCRM Preferences']['enableSSL'] = false;

```

Sources:
> 2 votes

---
Tags: civievent, drupal, administer, resource-urls
---


title: CiviCRM on Wamp server over lan network

text:
# Question
Title: CiviCRM on Wamp server over lan network
I want to access civiCRM in my organization's LAN network. Can anyone give a link or simplify the process to me? googling gives me many options, don't know which to try . using wamp server. Apache version 2.4.23 ; wamp server 3.0.6

# Answer
This looks like a fairly comprehensive guide to allowing network access to your Wamp sites over a LAN.
> 1 votes

---
Tags: civicrm.settings.php
---


title: How CiviCRM works when a url hits

text:
# Question
Title: How CiviCRM works when a url hits
I am new to CiviCRM. I just want to know how the back end process works in CiviCRM when a URL hits in browser.

Ex. http://localhost/test/drupal/civicrm/member?reset=1

When I am running this URL in browser what are the .tpl and php,js,css files are running

Also I don't have previous knowledge in CMS Coding and Extentions, Is there a step by step guide to understand CiviCRM

# Answer
> 4 votes
I think you are looking for CiviCRM documentation

There you will find:

In the Developer Guide you'll find pages like Codebase & Architecture which are a good starting point for your initial question.

CiviCRM Stack Exchange (this site!) is a great place to ask specific questions, and you should also join the CiviCRM community over on CiviCRM chat.

---
Tags: evaluating-civicrm, civicrm-home
---


# Question
Title: Cron failing on Update Membership Statuses and Send Renewal Reminders
We're running Civicrm 4.7.11, Drupal 7.56 on Cpanel.

I'm running cron via a custom php script that calls the url as per the civicrm cookbook.

All the jobs seem to get called except "Update Membership Statuses and Send Renewal Reminders" which fails with:

```
PHP Fatal error:  Call to a member function delete() on null in /home/sitename/public_html/sites/all/modules/civicrm/CRM/Member/BAO/Membership.php on line 659

```

Same error happens when running from drush, and when trying to execute manually via admin page I get a WSOD 500 error, which i guess is the same problem.

The issue seems to have occurred when moving to a new cpanel server which is using easyapache PHP instead of Cloudlinux.

Any ideas? PHP error? Civicrm? Drupal?

I've been holding off updating Civicrm due to a Leaflet maps issue with drupal.

Thanks Joe

# Answer
> 2 votes
I solved the issue with the help of xurizaemon on the Mattermost chat channel.

The script was failing because it was trying to delete a membership that looked like it was already deleted.

Hints below:

> so "call to member function delete() on null" means that CiviCRM expected there to be an object and called a method on it - but the object didn't exist
>
> i'd guess that here(https://github.com/civicrm/civicrm-core/blob/master/CRM/Member/BAO/Membership.php#L631) Civi tried to fetch a membership
>
> then here(https://github.com/civicrm/civicrm-core/blob/master/CRM/Member/BAO/Membership.php#L665) Civi tried to delete the membership
>
> but it didn't look to see if the first thing failed - and so when it tries to call delete on null, it falls over.
>
> IMO it makes sense to inspect the result of line 631 before it treats it as an object
>
> ie if ($membership = $memberships\[$membershipId\]) { /\* do all the stuff with $membership \*/ }
>
> or (easier to read) if (!$membership = $memberships\[$membershipId\]) { /\* bail out / throw exception \*/ }

So I downloaded a DB dump to a dev environment. Checked the error was still there.

Then ran the task from the scheduled tasks page. With a vardump in the membership.php script just after the lines noted above.

var\_dump($membership);

and then

var\_dump($membershipID);

The memberships in the dump were both linked to the same parent membership, so I deleted that parent membership and recreated it from scratch.

Membership scheduled task is now running as usual.

I think the db may have been corrupted a bit on a recent server move.

---
Tags: drupal, civimember, cron
---


title: Hide Smart groups

text:
# Question
Title: Hide Smart groups
Is there a way to hide smart groups when searching in an advanced search and everywhere else? I have a lot of smart groups that i need to make but i don't want them searchable or accessible through a contact record.

# Answer
The hidden group will only be accessible via the api.

An answer is to add a childgroup just before hiding it via the api.

All already existing childgroups of the hidden group won't be visible when adding a group to a contact, or when searching for contacts in a group. Under **Contacts » Manage Groups** the children of the hidden group won't be visible by default, but will be when you change a filter there (under Search groups). They will also be visible in an export of contacts in one of those groups. You can only view the groups contents via **Contacts » Manage Groups** or via **Search » Search Builder**.

(You can't add contacts to a children group of a hidden group, so this is only usable for smart groups.)

1. Create a group called systemhidden
2. Create a group called Hidden as child of systemhidden
3. Hide the the group systemhidden via the api -\> see answer of Jon G
4. To hide a smartgroup simply add it as a child of the group Hidden
> 1 votes

# Answer
There is an `is_hidden` flag on the `civicrm_group` table. It's used for temporary smart groups created for mailings - but I strongly suspect that you can use it for this purpose as well without meaningful side effects.

If you know how to edit your database directly, and understand the risks of doing so, you can set it that way. To do it through the web interface, you can use the API Explorer to access the hidden settings. Note that this is risky - take a backup before you do this, and test first on a test copy of your site!

* Go to **Contacts » Manage Groups**.
* Mouse over the *Settings* link next to the group you'd like to hide. At the bottom of your screen, look at the URL that appears, which will look something like: `http://example.org/civicrm/group/search?reset=1&force=1&context=smog&gid=7`. Note the number after `gid=` ("7", in my example links). This is your group ID.
* Go to **Support menu » Developer » API Explorer**.
* Set the Entity to "Group", action to "create", Group ID to your group ID, and "Group is Hidden" to "Yes". See screenshot. You can use "Add Parameter" to add the second parameter.
* Press "Execute".

That's it! Please report back here whether this meets your needs, so others can benefit as well.
> 2 votes

---
Tags: contacts, groups, smartgroups
---


title: accessing civicrm in lan

text:
# Question
Title: accessing civicrm in lan
I am running Civicrm wordpress in my PC and I want to access it through LAN. When I am trying to run the site from other machines using http://myipaddress/site, the login page opens fine. but in the next links the URL redirects to http://localhost/

Should I have to change in code in all places from localhost to my ip address? any easy way to do it without missing any files?

Using WAMP 3.0.6

# Answer
you need to update your Base URL with your IP address - because your base URL is pointing to localhost that is why your remote PC is redirecting to localhost

change the BaseURL to your IP address and that should fix the issue

I guess this helps!!!
> 2 votes

---
Tags: permissions, civicrm-home, settings, civicrm.settings.php
---


# Question
Title: Password field not displayed in contribution page
I have created a contribution page in civicrm and included profile with account creation required option enabled. But only Username field is displayed but not password and confirm password field.I'm using drupal 7 with civicrm. please suggest

# Answer
This is the default behavior of Drupal, and is by design. It works the same way if you register a new account through the "New User Account" page in Drupal - assuming you don't have a module installed that modified this such as User registration password or LoginToboggan.

When a new user registers, the account will be created, and they'll receive an email with a one-time login link. They can set their password there.

This isn't something you can modify without writing custom code. This isn't really desirable because you'll need to make sure you're respecting the password complexity rules of Drupal. Making a user deal with this while making a contribution is going to reduce your conversion rate.
> 2 votes

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


# Question
Title: How can I detect whether a form is being filled in via the admin pages, rather than via the front-end?
Is it possible to detect whether a user is filling in a form in the front-end or the back-end? I want to display a status message for the latter, but I don't want it appearing for regular users using the front-end.

I could check the URL manually, but I figure there must be a better way.

Context is: whenever an address is updated we have various lookups to external services going on. It's useful to display an error to our staff if these lookups fail. But I don't want these being shown to regular users when they update their addresses.

# Answer
> 2 votes
I'd recommend you ignore the form name/class entirely and display the message based on whether the user has an admin-type role. Then you don't care how the lookup gets invoked, you just show it to administrators, and it's tied to the service lookup rather than the way it got triggered.

# Answer
> 1 votes
It's a little difficult from your question how these checks to external services are configured - but assuming this is a hook, I would use `hook_civicrm_postProcess` rather than a database-oriented hook, since you'll get the form name right in the parameters.

---
Tags: forms
---


title: Mail error when sending to smart groups

text:
# Question
Title: Mail error when sending to smart groups
I haven't been working on the server or the website, but we are spontaneously getting the following error when sending a test mailing or scheduling a mailing:

When sending a test mailing:

> Error in call to Mailing\_send\_test : Error in call to MailingJob\_create : DB Error: unknown error

When scheduling a mailing:

> DB Error: unknown error

Here is the backtrace show with `drush ws`:

```
21021577  27/Jun 12:01  civicrm   debug     $backTrace = #0 /var/www/html/example/docroot/sites/all/modules/civicrm/CRM/Core/Error.php(229):
                                             CRM_Core_Error::backtrace("backTrace", TRUE)
                                             #1 [internal function](): CRM_Core_Error::h
 21021576  27/Jun 12:01  civicrm   debug     $Fatal Error Details = Array
                                             (
                                                 [callback] => Array
                                                     (
                                                         [0] => CRM_Core_Error
                                                         [1] => handle
                                                     )

                                                 [code] => -1
                                                 [message] => DB Error: unknown
 21021575  27/Jun 12:01  cron      notice    Cron run completed.
 21021574  27/Jun 12:01  civicrm   debug     $backTrace = #0 /var/www/html/example/docroot/sites/all/modules/civicrm/CRM/Core/Error.php(229):
                                             CRM_Core_Error::backtrace("backTrace", TRUE)
                                             #1 [internal function](): CRM_Core_Error::h
 21021573  27/Jun 12:01  civicrm   debug     $Fatal Error Details = Array
                                             (
                                                 [callback] => Array
                                                     (
                                                         [0] => CRM_Core_Error
                                                         [1] => handle
                                                     )

                                                 [code] => -1
                                                 [message] => DB Error: unknown
 21021572  27/Jun 12:01  civicrm   debug     $backTrace = #0 /var/www/html/example/docroot/sites/all/modules/civicrm/CRM/Core/Error.php(229):
                                             CRM_Core_Error::backtrace("backTrace", TRUE)
                                             #1 [internal function](): CRM_Core_Error::h
 21021571  27/Jun 12:01  civicrm   debug     $Fatal Error Details = Array
                                             (
                                                 [callback] => Array
                                                     (
                                                         [0] => CRM_Core_Error
                                                         [1] => handle
                                                     )

                                                 [code] => -1
                                                 [message] => DB Error: unknown

```

Also noted: Dashboard gives the following error:

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

Using CiviCRM 4.7.15 and Drupal 7.50

What I've tried:

* tested outbound SMTP settings *passed*
* created a new mailing to test group only and scheduled it *passed*
* recreated mailing to go out to same smart groups *failed*
* `drush cc all` *didn't take care of the issue*

# Answer
I'm embarassed to say, but though `drush cc all` (clear all caches) didn't work, once I ran `drush cc civicrm` the errors went away.
> 4 votes

---
Tags: civimail, drupal, error
---


# Question
Title: Is it possible to make groups mutually exclusive?
If yes, how do you add those constraints?

The docs for Groups and Tags suggests that it is possible by saying that it isn't for tags.

> Tags allow multiple selections - so they may not be appropriate for mutually exclusive characteristics (e.g. "Democrat", "Republican", "Green Party")

# Answer
I don't think there is any way you can do this using Tags or Groups. The alternative would be a custom field of type radio, and then build Smart Groups off those options.
> 0 votes

---
Tags: groups
---


# Question
Title: Efficient methods for flagging profile submissions from a contact form
Running Wordpress 4.8 and CiviCRM 4.7.19

As per a suggestion elsewhere on the forum, I created a profile for use on our 'Contact us' page (email, first name, last name, message as a multi-record listing). I'm trying to figure out the best way to mark/flag/indicate each new submission, so staff will be aware of needing to response and can indicate when a response has been sent for the specific issue. Right now, my thought is to create a custom yes/no field marked as "triage" that automatically gets set to 'yes' when a form is submitted, and can be set back to 'no' by our staff once the question has been addressed. From there, I figured we'd create a query for all triage=yes entries and have it appear on the Civi dashboard. From what I've read, this field could be included in the profile but hidden from the end user with Jquery.

Is there a better way to handle this in Civi? I'm only beginning to use the software and don't know if some use of tags, groups, or another tool is a more sensible path than the one I've mentioned.

Thanks all,

# Answer
Your solution to use a hidden field seems reasonable. I would suggest though, instead, you create a custom field (on the same dataset) called Triaged, with a default of 'No' (or null).

Don't even bother including it on the Profile.

Then when the contact us profile is manually processed, the staff member checks the Triaged field (or sets it to Yes) on the backend.

No jquery needed (there still are some people that don't have javascript enabled). Let the system do the most it can for you.

As @petednz points out, Drupal users have a way to handle this using Webforms. If you are ambitious, you could build a form on the WordPress side and on its submission run a bit of PHP code to call the CiviCRM API to do what you need it to. But that's way more technical than most people want.
> 0 votes

---
Tags: wordpress, profile, jquery
---


# Question
Title: civicrmHooks.php no longer invoked under Joomla and CiviCRM 4.7.20
This is related to Invoking hook\_custom\_tokens and hook\_custom\_tokenValues in Joomla which used to work. It has now appeared to have stopped working which means that the custom tokens handled by civicrmHooks.php are no longer available. It looks as though civicrmHooks.php is no longer being invoked, as deliberately introducing an error does not result in CiviCRM crashing.

What has changed recently. How can we solve this?

# Answer
> 1 votes
I've spot-checked the current `4.7.21-rc` and as well as an older version `4.7.15` -- the problem reproduces in both. The problem arises with web-based requests in which these two operations are performed in the wrong order: (a) updating the `include_path` and (b) loading the `civicrmHooks.php` from the `include_path`.

(Doing a proper audit of Joomla regressions is painful, but I'd wager the problem originates in the 4.7 alpha/beta cycle.)

Searching JIRA for `civicrmHooks.php` turns up a nearly identical issue CRM-19914, which was fixed in WordPress -- but it was incorrectly described/triaged as a "Windows" issue. (The bug actually would have applied to Joomla+WordPress, regardless of OS.)

I'll submit a similar patch for Joomla under CRM-19914.

# Answer
> -1 votes
Tim Otten did some work on trying to unify CMS Hooks and Symphony Events see CRM-19813 I'm not sure what version you were on previously but these changes came in 4.7.19 and maybe related. I know there seems to be some issues in regards to Joomla upgrades which may also be at play. I would recommend commenting on that issue or posting in #dev-postrelease in mattermost and pinging Tim @totten about the issue

---
Tags: civimail, joomla, tokens
---


title: prompted for password too often

text:
# Question
Title: prompted for password too often
I am trying to run civicrm in my machine and access it through LAN from other machines. So I made a change in word press general settings like below:

WordPress Address (URL) http://myipaddress/mysite Site Address (URL) http://myipaddress/mysite

After this, whenver I am doing a search/report/ any function in civicrm I am being prompted for password. And after that I am directed to civicrm home page and the loop repeats. Can anyone help me out?

# Answer
changed the base URL in civicrm.settings.php . now works fine .

if (!defined('CIVICRM\_UF\_BASEURL')) { define( 'CIVICRM\_UF\_BASEURL' , 'http://localhost/site/'); }

is changed to

if (!defined('CIVICRM\_UF\_BASEURL')) { define( 'CIVICRM\_UF\_BASEURL' , 'http://myipaddress/site'); }
> 2 votes

---
Tags: database, civicrm-home, settings, civicrm.settings.php
---


# Question
Title: Javascript MIME type mismatch error after server move
I have moved the installed civicrm with Drupal from windows PC to Linux PC and changed the civicrm settings file. Everything working fine but only the javascript files are not loading.

> The resource from “http://localhost/drupal/sites/all/modules/civicrm/modules/templates/CRM/Member/Form/MembershipStandalone.js?os8oog” was blocked due to MIME type mismatch (X-Content-Type-Options: nosniff).

I went to the folder paths files are exist. How to overcome this issue

# Answer
The `X-Content-Type-Options: nosniff` header is a security measure that prevents the browser from attempting to detect the MIME type of a download automatically, as this behavior can be exploited for certain kinds of attacks. The browser will block requests for stylesheets and scripts which are not delivered with a CSS or Javascript MIME type, respectively.

In practice, this means the web server is unable to load the resource for any of several reasons:

* The resource is missing
* The file permissions on the resource prevent it from being loaded by the web server
* The web server is not configured to deliver .js files using a Javascript MIME type

Please confirm that the file exists, that you have followed all the instructions for moving an existing installation, and that your server is configured correctly, including file permissions and Javascript MIME types. In particular, since this file is loaded in a custom template, you should confirm that the path has not changed.
> 2 votes

---
Tags: error, javascript, migration
---


# Question
Title: How do I redirect back to the same tab after submitting a form?
I'm creating a custom tab for events. I've used hook\_civicrm\_tabset to add a tab to the event management pages. In that tab, I have a form generated using civix. Upon saving the form, my operations are successfully completed and I'm redirected back to the event management "Info and Settings" tab. I would like to end up back on the same tab instead.

How do I end up back in my custom tab after submitting my form?

# Answer
> 1 votes
I figured it out.

When creating the array for the tab, add "ajaxForm" to the "class" index.

```
$newTab = array(
  'title' => 'New Tab',
  'link' => 'url',
  'class' => 'ajaxForm', //<---- The important part
  //etc
);

```

---
Tags: forms
---


# Question
Title: CiviCRM_API3_Exception: '3' is not a valid option for field contribution_page_id
This error is really frustrating and annoying. It only happens on the live server but works fine on the local server. I have drupal 7 site with civicrm installed. One of the key I am passing on the $params array is `$params['contribution_page_id'] = 3`. The data type that this paramer expects is an integer and I have tried casting it as an integer but does not work.

I am trying to create a contribution record but it throws the error while

```
$contribution = civicrm_api3('Contribution', 'create', $params);

```

Here it throws the error and I don't know why. The full error goes like this `CiviCRM_API3_Exception: '3' is not a valid option for field contribution_page_id in civicrm_api3() (line 45 of /home/mysite/public_html/v2/sites/all/modules/civicrm/api/api.php).`

So here is my full code

```
    $params['contact_id'] = $attendee;
    $params['event_id'] = $event_id;
    $params['register_date'] = date('YmdHis');
    $params['register_date_time'] =date('h:i A');
    $params['role_id'] =1;
    $params['status_id'] = 1;
    $params['status_id'] = 1;
    $params['fee_level'] = '';
    $params['is_pay_later'] = 1;
    $params['fee_amount'] = calculate_total();
    $params['fee_currency'] = 'GBP';
    $bao =  new CRM_Event_BAO_Participant();
    $participnt = $bao->create($params);

    //add Contribution
    $non_deductible_amount = round(calculate_total(),2);
    $total_amount = round(calculate_total(),2);
    $tax_amount = round(calculate_total_vat(),2);

    if($non_deductible_amount == 0) {
        $non_deductible_amount = 0;
    }
    if($total_amount == 0) {
        $total_amount = 0;
    }
    if($tax_amount == 0) {
        $tax_amount = 0;
    }

    $bao =  new CRM_Contribute_BAO_Contribution();
    $params = array();
    $params['contact_id'] = $attendee;
    $params['financial_type_id'] = 4;
    $params['contribution_page_id'] = 3;
    $params['currency'] = $params['currencyID'] = 'GBP'; /**/
    $params['non_deductible_amount'] = $non_deductible_amount; /**/
    $params['total_amount'] = $total_amount; /**/
    $params['Source'] = 'Event Registration';
    //$params['is_pay_later'] = 1;
    $params['tax_amount'] = $tax_amount;
    $params['contribution_status_id'] = 'Pending';
    $params['skipLineItem'] =1;
    //$contribution = $bao->create($params);

    $params['invoice_id'] = md5(uniqid(rand(), TRUE));

    $params['payment_processor'] = 1;

    $params['is_test'] = 0;

    $params['description'] = 'Event Registration payment';

    $params['qfKey'] =  md5(uniqid(rand(), TRUE));

    $params['email'] = 'sanjok@hotmail.com';

    //This is where it fails.
    $contribution = civicrm_api3('Contribution', 'create', $params);

```

That is where if fails and spits out the error.

# Answer
> 0 votes
The fact that this works on a local server but not a production server sounds fishy. My guess is that your local server is a different platform and/or php version.

You can likely fix the issue by setting the contribution\_page\_id to the string "3".

But I'd suggest you're probably going in the wrong direction for this project - that's a lot of custom code, most of it kind of funky (e.g. the unused bao object, and setting the qfKey), which suggests you've been trying to reverse engineer and/or copy paste stuff. If you simplify your code and only use the api as intended, you'll likely hit fewer oddities like this. I'd also question why you want to set the contribution\_page\_id anyway, since this isn't getting set via the contribution page, i.e. you're kind of tricking it into an unpredictable state. You'd likely do better categorizing your contributions using other mechanisms (or maybe you don't need to categorize this any further that you already have).

# Answer
> 0 votes
On the face of things, I don't see any glaring problems. As @Alan Dixon points out the code is a bit cluttered.

I do see a number of entries that are not part of the API call for Contribution/Create, such as email address, qfkey, description. While they shouldn't matter, I wouldn't include them... just in case.

I think the best approach is to use the API explorer (on the live server - /civicrm/api#explorer) to debug what the issue is. Enter in your API call there and see if an error occurs; you possibly would want to try it after entering just a few params at a time. This will also provide you with the best PHP code to use, that you can drop right into your code.

The only other comment is just questioning your use of the BAO. You are best served using the API if possible.

---
Tags: civicontribute
---


# Question
Title: Mosaico template editing not loading consistently
I am using CiviCRM 4.6.28 and Joomla 3.7.2 with Mosaico 1.0 enabled. I have created a new template and edited it but am finding that the editing page only loads about 50% or less of the time. When it does not load I get a red screen (the Mosaico background colour) and the template blocks do not load. There seems to be not predictable reason for this. The site is hosted by Siteground and they have checked the server for problems. has anyone else had loading problems?

# Answer
> 2 votes
After using Mosaico from some time, I've noted that you need to make sure you've correctly installed this extension as per the steps mentioned in the doc, i.e,

1. Doc mentions you need to install shoreditch theme, flexmailer and then Mosaico **in order**.
2. Make sure you've downloaded all the dependencies it needs to be included by executing `./bin/setup.sh -D` from your terminal.

After these steps, it worked fine for me on around 4-5 sites.

---
Tags: mosaico
---


title: Drupal User ID Token

text:
# Question
Title: Drupal User ID Token
In civicrm contact summary we see Contact ID / User ID, where User ID refers to the drupal. I will need to customize a token for this User Id which I am supposed to use in civimail. Here in this link https://wiki.civicrm.org/confluence/display/CRMDOC/Customized+%28and+Custom%29+Tokens ,drupal username can be fetched. But I need it for Drupal Id. Please suggest.

# Answer
The example calls `$result = civicrm_api('UFMatch', 'get', $params);` to get the Drupal user id that it passes to `user_load()` to get the rest of the user info.

If you just want the id then it is the value being passed to `user_load()`:

```
$result['values'][0]['uf_id'])

```
> 1 votes

---
Tags: civimail, tokens
---


# Question
Title: l10n Translations does not show in settings
I'm using Civicrm v4.7.19 on Drupal,

for using another language (like ES/DE) I've been creating directory: /public\_html/sites/all/modules/civicrm/l10n

And the "mo" files placed in these addresses \[both for testing\]: /public\_html/sites/all/modules/civicrm/l10n/es\_ES/civicrm.mo /public\_html/sites/all/modules/civicrm/l10n/de\_DE/LC\_MESSAGES/civicrm.mo

But the Localization settings page don't show the languages.

# Answer
> 1 votes
Can you check:

* Go to Administer \> System Settings \> Option Groups
* Then search for "Languages" and click on its "Options" link.
* Double-check that the language is enabled.

Otherwise, it might be a file permission issue: can you check to make sure that the web server has permission to read the l10n directory and files?

---
Tags: drupal, localisation, translation
---


# Question
Title: Problem submitting payment on webform gift membership
I have set up a webform to receive gift membershipsso that one individual can purchase a membership for another. Although the instructions seem relatively straightforward (see here andhere), the payment page/form does not display an area to actually submit credit card information.

Any insight would be appreciated.

Some details: The problem is not specific to gift memberships, but webforms. The webforms on our site integrate fine with civiCRM, EXCEPT for accepting payment. So for example, I use webforms for non-paying memberships and everything works fine. I have tried setting up just a webform that links to a contribution page and it does not work.

So, per the civiCRM webform documentation, "Using Webforms, you can accept online payments for contributions, events and memberships or any combination of these on a single form."

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

On the backend, all of this makes sense. I have set up a dedicated contribution page and configured each of the items listed above (title, etc). I have tested the dedicated contribution page, and it works fine. The problem seems to be in how the page connects to the webform. But I do not see anything wrong on the backend, nor have I found someone discussing a similar problem.

I've included three images: (1)Purchase gift membership contact info screen: this is the initial webform that takes an individual's information. Everything appears ok here.

(2)Purchase gift membership payment screen: note that there is not a way to fill in a credit card, nor is membership amount listed.

(3)Finally, the edit screen for the webform. This is where the webform is instructed to connect to a contribution page.

: https://i.stack.imgur.com/lKSWu.png

# Answer
Resolved: module needed to be updated
> 1 votes

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


title: How to include buttons in Civimail

text:
# Question
Title: How to include buttons in Civimail
I want to include two buttons in civimail template Accept and Decline. If the user clicks on accept/ decline button, It should notify the administrator with an email.However I can add buttons using HTML.But how do I make this to notify the administrator with an email?Please suggest.

# Answer
How about link your two buttons to two different URLs (confirmation pages) "Thank you for voting yes"; "Thank you for voting no" and use the CiviMail track open/click through feature to see which Contacts clicked which buttons.
> 6 votes

# Answer
Create "Accept" and "Decline" landing pages and link your template to them. Use the Mailing Report to track who has accepted or declined.

---
> 1 votes

---
Tags: civimail, custom-templates
---


title: CiviCRM for political campaign

text:
# Question
Title: CiviCRM for political campaign
We have a custom application which has been used in to election cycles. We are thinking of converting to the CiviCRM platform. Can CiviCRM be configured to run a political campaign?

# Answer
Yes. CiviCRM can manage

* fundraising
* volunteer management
* phone banking
* door knocking
* Get Out The Vote
* event management (think fundraising events, or getting folk for a door-knocking bash).

As per my comment above though, what really matters is what you need to achieve your political goals.
> 3 votes

---
Tags: evaluating-civicrm, civicampaign
---


# Question
Title: Couldnot create an event in civicrm 4.7.20
Whenever I try creating a new event, I am facing " The page not working" error with wordpress and "The site can't be reached" error in Drupal. Not sure what is the issue. Running CiviCRM 4.7.20 my problem seems the server is not sending any response for this request to create event

# Answer
> 1 votes
As Jitendra says, this could be a bug that has already been resolved. If not, you may need to dig in to your ConfigAndLog to see more errors.

---
Tags: civievent
---


title: Saving User Preferences

text:
# Question
Title: Saving User Preferences
Does anyone know how I can turn off this improvement?

https://issues.civicrm.org/jira/browse/CRM-11761

> Save user preferences for filtering Activities tab listings
>
> The requirement is to persist the last used values for the two activity type filters on the contact Activities tab =\> "Filter by Activity Type" form (activity\_type\_filter\_id and activity\_type\_exclude\_filter\_id) for the logged in user.
>
> The filter values would need to be saved onChange since there is no search form POST, and loaded from the DB when that tab is accessed.

It's causing a lot of problems for users

# Answer
> 1 votes
Up until now the answer has been no. However this improvement is now available with the PR from this JIRA issue.

---
Tags: activities, user-experience
---


# Question
Title: Can't send or test bulk mail, but test mail succeeds in System Settings / Outbound email / SMTP
Civi 4.7.20 / WP 4.8

For the past several weeks, we've been unable to send out any emails or test mails through CiviMail. No errors are logged, and even with backtrace displayed and error debugging enabled, there's no indication of any error. Yet every time we submit a mailing, every recipient email address bounces and is switched to On Hold. The There are no messages in the bounce email inbox (it's a conventional address, same domain name as the website), so it seems those emails never went out from the mail server.

Sending test email in System Settings / Outbound Email / SMTP succeeds, so we know the outbound email settings are correct.

Someone suggested the problem may be VERP is no longer supported on the mail server, so I contacted the hosting provider. I now know for certain that VERP was deprecated, and worse yet, catch-all email accounts are not permitted for shared hosting accounts.

In my limited understanding of CiviMail mechanics, I think we're supposed to either have VERP support or a catch-all email account. But we have neither. Is there a work-around?

Any ideas?

**ADDENDUM:** Though we're also experiencing buggy behavior in Reports, I did manage to coax Bounce Reasons out of our system. Syntax errors seem to be the culprit, and they all look like "`Failed to add recipient: {email address redacted} [SMTP: Invalid response code received from SMTP server while sending email. This is often caused by a misconfiguration in Outbound Email settings. Please verify the settings at Administer CiviCRM >> Global Setting`"

Also, per Chris' suggestion below, I looked at the "Track replies using VERP" option, and discovered it's already deselected. So while my original question was *Can't send or test mail, neither VERP nor catch-all supported*, I am changing it to *Can't send or test bulk mail, but test mail succeeds in System Settings / Outbound email / SMTP*.

# Answer
The symptom as you describe it seems to be that any mail sent via CiviMail will fail immediately and will cause the recipient to be marked as bounced. CiviMail knows when the remote mail system rejects an email, so if that remote system doesn't work as configured, this is the expected behaviour (frustrating as it must be).

You need to understand why CiviMail is not able to deliver ANY messages but regular "Send Email" delivery works for you in CiviCRM.

Probably the most accessible option is to try a **replacement mail provider**. A few of those listed in this CiviCRM wiki page on mail providers offer a free tier, but everything has its price.

The more complex option is to **debug what's actually happening** when those mails get sent. This will involve understanding the code that communicates with your mail system as configured, and making the response from the SMTP server visible. I believe you want to start in `civicrm/packages/Net/SMTP.php`, CiviCRM fetches this from PEAR's Net\_SMTP with this patch applied.

The latter option gives you more insight into the issues you're experiencing and might help some future CiviCRM sites who hit the same issue on your hosting environment. If you are confident at debugging, or can find someone to work with through CiviCRM community, that's what I'd try to do. If you just want to get the client live again, you should probably try a replacement provider (or two).
> 3 votes

# Answer
From https://docs.civicrm.org/user/en/stable/advanced-configuration/email-system-configuration/#verp-support

> If your mail delivery system does not support sending via VERP addresses, you may see an "Invalid address" error when sending mails. Either switch to a mail provider which does support this, or disable VERP.
>
> * There are plenty of mail services which fully support CiviCRM features \- consider using one!
> * VERP can be disabled via the option Track replies using VERP in Reply-To header at **Administer \> CiviMail \> CiviMail Component Settings**. This will reduce CiviCRM's ability to correctly match bounced messages.

I recommend as a first step, you try disabling VERP (bullet two above), then see if your CiviMails start being delivered.

From there, you should review whether the current mail delivery method CiviCRM is using is suitable for your site. If it is, and you can live without VERP, then you're sorted! If not, there are plenty of alternatives to choose from.

In that case, before deciding on a replacement provider I'd recommend trying a web search for "\[providername\] CiviCRM" - you might find other stackexchange questions or previous questions that help inform your decision.
> 0 votes

---
Tags: civimail, bounce, mailserver
---


title: How to create entity in CiviCRM

text:
# Question
Title: How to create entity in CiviCRM
I am trying to create the Entity in CiviCRM with my extension. But I am struck here. Unable to find the XML folder in my CiviCRM installation. After running the below command `civix generate:entity MyEntity` nothing to do in the installed CiviCRM

I read the document and followed the steps. I strut in the below steps https://docs.civicrm.org/dev/en/master/extensions/civix/

```
enter preformatted text here

```

I read these questions also none of the solutions helped

How to automatically generate DAO classes for my DB tables

How do I add a new table to my extension?

Please let me know is there any alternative way to create entity while creating an extension

# Answer
It looks like like perhaps you are developing your extension within a normal CiviCRM installation instead of a *development* installation. If this is the case, you'll need to set up a development installation in order to get the `xml` folder (and other things too).

The best way to set up a development installation is to use the civibuild tool which you will get if you install buildkit.
> 1 votes

---
Tags: extension, developer, civix, civibuild
---


# Question
Title: CiviCRM Entities module makes error 500 to site
I'm doing a drupal installation 7.56 with CiviCRM. When I install the CIVICrm Entity module the site starts getting error 500. DOes anyone knows what to do?

best regards Eduardo Catarino

# Answer
> 1 votes
Hi to all and thanks for the ones that gave some clues that helped me to solve the problem.

I was using the drupal and CIVICRM with 2 diferent databases. For that reason after installing the CIVICrm entity module everithing seem not to work.

I checked the civicrm bitnami installation and realized that it was working only with one comon database.

I'm able advance with the project.

Best regards Eduardo

---
Tags: drupal, civicrm-entity
---


title: How to add Contribution By column

text:
# Question
Title: How to add Contribution By column
My use case is that I want users to be able to pay for another user's Event Participation.

Currently, the display name is baked into the source:

I'm hoping to add a column "Contribution By" to record a link to this person instead.

How can I add a column into this table?

# Answer
> 1 votes
I'd wager that the template you're looking at calls hook\_civicrm\_searchColumns. Despite the name referring to "search", it's designed to let you change the values of the columns in tables like the one you display.

I just pushed a simple extension that demonstrates how it's used: https://github.com/PalanteJon/org.takethestreets.campaignincontributiontab/blob/master/campaignincontributiontab.php

# Answer
> 0 votes
I am not sure I am totally following your question. But... have you looked at Soft Credits? https://docs.civicrm.org/user/en/4.6/contributions/soft-credits/

---
Tags: civievent
---


# Question
Title: Getting Custom field values via API using chaining
I am trying to use the API to get membership data, including some custom fields. I have the general idea, I think. I can successfully retrieve the memberships, chained in the contact data, and now I need to include some data in custom fields. The table the custom data is stored in is called "college\_data\_1" and one of the custom fields is called "enrollment\_3". So I believe I want entity 1 and field 3. I didn't find documentation that confirms how to find these IDs. So what I current have in API explorer is:

rest.php?entity=Membership&action=get&api\_key=userkey&key=sitekey&json={"sequential":1,"membership\_type\_id":"Membership Name","api.Contact.get":{},"api.CustomValue.get":{"id":3,"entity\_id":1}}

however this doesn't work. Help?

I will need to include website data too, next.

# Answer
I don't think you need to chain the calls, you simply need to specify the fields (return custom\_xxx) you want to fetch from the membership.

On the API explorer, try to set the return fields you want, and check you can include the custom fields you want
> 2 votes

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


title: Contact Search Column & Data Mismatch

text:
# Question
Title: Contact Search Column & Data Mismatch
We're running Civi 4.7.20 on Wordpress 4.8. When searching for contacts, it appears that the column headers do not match with the data type for the fields. However, when looking at an individual record, values appear in the proper fields.

This behavior was also observed in the demo sandbox.

# Answer
This has been fixed at https://github.com/civicrm/civicrm-core/pull/10556 and is included in 4.7.21 version.

You can apply the PR on your site if you don't wish to upgrade now.
> 3 votes

---
Tags: wordpress, issues, search-results
---


# Question
Title: Are there any pre-conditions or required settings to print/merge documents in 4.7?
Since CiviCRM 4.7 it is possible to print/merge documents not only as a pdf-file but also as an odt, docx or html file.

Does the function to create odt or docx files require any particular setting, installed libraries etc? I did not find any documentation and wanted to ask before I start debugging.

I have a "fresh" CiviCRM 4.7.16 instance and I am able to create pdf and html files but not docx or odt (File not found error).

# Answer
I had a similar issue on an installation with PHPOffice.

PHPOffice is automatically installed via composer in CiviCRM, but apparently composer fails to check for needed PHP extensions. In my case php-zip was missing, and after installing that everything went fine.

I am not sure if composer should check the requirements, or if they aren't properly configured. Eli's comment helped a lot debugging this for me!
> 2 votes

---
Tags: error, core
---


title: Where I have to write my hook

text:
# Question
Title: Where I have to write my hook
I am new to civicrm.

I have created a module; say com.ex.myextention. and created a page its working fine.

But in my module where I have to write a hook and how to ensure the defined hook is working.

# Answer
> 3 votes
"To implement a hook, add a function to the module's main .php file created earlier with civix generate:module" - the developer guide.

However, if you've created your own page class, you may not need to use a hook at all, since you have complete control of the code.

If I haven't answered your question, please update your question with a bit more detail about what you're trying to do.

---
Tags: webform-civicrm, hooks
---