Multi-records Custom Field i have a simple Custom Field set that has 2 text field to capture "Year" and "Class".  This custom field is set to keep multiple records/values.  The idea is to track the person's class information over years.

It seems that I can do a batch update of this custom field through a profile, but instead of updating the existing records, it goes ahead and add new records/value.

Just to confirm that this is the behavior for batch-update of custom field with multiple records, and currently the interface does not allow batch-update of existing values.  Thanks.

Updating a contact via profile with multivalue custom field will always create new entry for those custom set. The only way you can update is using the contact edit form.

Cheerz

Pradeep


4.6.2 on Joomla: Entering Contribution under single contact times out What log information is best to post for this issue?
When I manually enter a contribution under the Contribution tab of a contact's record, the process times out with a blank white screen. When I enter it as a "New Contribution" under the Contributions menu item, it works flawlessly.

I did test this in the Demo Joomla and it does work. My database has over 30k contacts.

I am not knowledgeable of the process flow so I am probably wrong about this but could the problem be a contact_id search issue since with a "New Contribution" a search of the contact is required/retrieved first rather than the process having to go out and search for the contact under the in-record process?

To debug a PHP timeout issue, locate your PHP error log and check the last line or last few lines.

This should reveal what code is exhausting your allocated time - and also the time you're hosting environment allows.

Add that information to your question and the community may be able to better identify the underlying issue.


CiviCRM - Contribution page profiles JavaScript error before you send me to check already solved similar questions, this is not the same case.

Common problem is conflict with installed plugins -> disable/enabled them all, none, different order = nothing (I dont have jetpack, google dashboard, wp cards)

Another cause is template -> changed template, no difference but if I add Civi into blank Wordpress instalation it works.

Does anyone have same experience that it cannot be fixed with the "common" way ? And if yes did you manage to fix it ?

Try using one of the basic WordPress Themes like Twenty Seventeen or Twenty Sixteen. If it works with one of these themes, pick a new theme that you like.

You probably have to pick a theme from another company altogether. The theme designer probably has a base package that he/she uses and the problem will follow from theme to theme in their suite.


how do I set up the Moneris mpgClasses.php file to work with my wordpress install http://java-prod.civicrm.osuosl.org:8090/confluence/pages/viewpage.action?pageId=124813669

This is what I've been using, I have the php file placed in the packages/services folder, but Moneris is not showing up as an option for Payment Processors still.

rchapman

I haven't used it myself, but a quick search pulled up this extension by Alan Dixon and this related post: Does the core Moneris payment processor work?

Also, have you looked at the documentation?

Setting up Moneris Hosted Payment Processor for CiviCRM
Moneris Configuration Guide

I hope that helps.


Remove the "-none-" option in Price Set choices? When using price sets, at least with radio, it adds an automatic - none - option. Why is that and how can I remove or hide it?

Sample screenshot

If you set the price set field to REQUIRED, the -none- option should be suppressed automatically.


Online receipt not being send to donors we are creating two contribution pages for both new members and donnors and we are experiencing some problems with email receipts. We would be very grateful with any ideas on where to look or what to try next as we've ran out of them.

The issue is that receipts (emails) for donnors are not being sent when a donation is complete (new member emails are beign sent). We have checked the following:

Send receipt is checked on Thanks and Receipt emails on the admin page for contribution
It is not a problem of the payment processor (we've tried with 2 different ones, and the donation is marked as complete but the email is not beign send)
The log says no email is beign sent. Meaning, is not a problem of the email getting lost on its way, but rather, that it is not sent at all.
Email template is the default one.

Something odd is, new members who choose pay later get the New member email, where new members who use a payment processor get the Contribution mail.

Ideas? Thanks!

You should check CRM-15629 and see if it sounds like the problem you're having.


CiviEvent Cannot Find Event/Register Page CiviCRM 4.6.3 and Drupal 7.38.  I have gotten past credit card and CVV checks, verified info on Confirmation page, submitted the event registration, but browser comes back with "Page Not Found - The requested page '/civicrm/event/register' could not be found."  When I check the CiviEvent Dashboard I see that the individual and any guest have been properly registered.  CiviEvent is just not finding/displaying the Thank You page.  That address seems strange.  As a test I set up a CiviContribution page and ran through a contribution without a hitch.  So I don't understand what is happening with CiviEvent.  Ideas?

please try to update civicrm to latest version - I did made a quick test and it works correctly displaying the Thank you page

Even after updating, if you are getting the error message then please let me know the payment process which you are using so i will give a quick test


Is there a way for Memberships to be non-time dependant? educational course progress type? I am new to CiviCRM, but really impressed so far!  However, am currently building out an educational franchise site that along with time based or session based (the rolling & fixed) memberships they also require a more open-ended and non-time based membership type.
For instance a membership that is active for as long as the student is moving through the educational course, and once they pass the final of that course and advance to the next level (or the next stage: group of course levels) they would then need to renew their membership for that next section of material (renew for the next course or set of courses).  Because the classes are ongoing and students move at their own pace, and also allow open enrollment, this is a critical piece for them.  They also have online courses, which also require membership to access that content.

We are using Drupal, and was planning on using drupal commerce module for these purchases prior to getting into Civi, however, we REALLY like the additional features of the Membership components of Civi, and also want to track/manage the users and their memberships through civi.

I have looked around a little, but unable to find reference on this kind of use case.
Any help on or direction would be MUCH APPRECIATED!!!
Thanks!

Any reason that the following wouldn't suffice:

set them to 'Lifetime' and then have a process eg via Webform_civicrm (or Rules) to close them off and start the new one when they move up a level


Personalize workflow message "Contributions - Receipt (on-line)" Using the action "Confirmation receipt - print or email" in a list of contributions, the message sent to the donateur seems to be "Contributions - Receipt (on-line)".

When adding manually a contribution and checking the "Automatically send a confirmation?" button, the workflow message is "Contributions - Receipt (off-line)".

We personalized the "off-line" message. How to copy this to the "on-line" message? Simply copy and paste does not give a good result. Other form/database values are used.

You can't just copy it to the on-line message.  You will need to start with the current on-line message and customise it in the same way that you did the off-line one.  Those are awkward templates to work with but if you just make small changes you should be ok.


Smart Group Features Extension to Memberships, Events, Contributions, Activities, I have a lot of Organisations, each having their own Administrator(s) who manage their own memberships, events, contributions, activities, ... (that I predefine for them)

I would like those Administrators to be able to make "Multiple Updates" to those (e.g. payments by checks) ; but I don't want them, for security reasons, to use the standard Search features to do that.

As far as I know (am I wrong ?), there is currently no possibility to predefine and store Searches, except for Contacts, via Smart Groups.

My idea would be : since we have the same search possibilities for members, participants, contributions, activities, ..., as for Contacts, it should not be too costly to develop the ability to extend the Smart Group features (including Multiple Update) to those.

What is the best way to have this ability developped (I am not personally a programmer) ?

Edited May 25 to give an example :

I have defined an Event with an associated Contribution Page.

People register on line (Webform) and pay either on line or by check.

When I receive the checks, I want to record them to manage the Event balance :

I Search for Contributions, based on the Contribution Page + Pending Status :
In the contacts List, I then select those who have sent their check and I select Action > Update multiple Contributions :

Then I select a Contribution Profile which contains Total Amount, Payment mode (check or cash), check #, status :

I can then record all the checks that I have received

I would use the same process to update memberships custom fields (Search for memberships + Membership Profile, instead of Contribution) or for Event or Activities.

I can make those Searches because I am the general Administrator, but I don't want my organizations Administrators to have this permission : too dangerous and uneasy : this is why I ask for this Search storage (in the form of Groups), that I could predefine for them.

If you are using Drupal then I would consider building Views and Webforms to give you the flexibility you need without sending users deeply in to civicrm itself. If that sounds useful then get in touch for a more fleshed out explanation.


Drupal views, show 'add to cart' button instead of ''Register now' I would like show 'add to cart' button instead of ''Register now' for a drupal views I have created for upcoming events, is it possible?

Yes, you can rewrite the register now link  to or add custom text field with rewrite link as

https://domain.org/civicrm/event/add_to_cart?reset=1&id=[event_id]

to remove from cart

https://domain.org/civicrm/event/remove_from_cart?reset=1&id=[event_id]

Thanks

Pradeep


Keeping track of membership history of an organization once a member has been removed? I know relationships can be disabled, but it does not seem to preserve the time they were part of the organization.

Has anyone else had a similar use case where historical data of members within an organization has to be preserved and the best way to go about this?

You might check MembershipRenewal Extension.

This creates a new record when a user renew its membership, so that the older/removed/expired membership remain unaffected to let know when the user was a part of the org.


CiviDiscount that is dependent on status as of event date? I've enabled CiviDiscount and currently have it set up to offer member rates to a conference. However, it applies the member rate if the individual is a member at the time of registration.

Is there a way to apply the automatic discount after checking to see if the individual will be a member at the time of the event? That is, the end date of the membership must be after the event (or after a date of my choosing) in the CiviDiscount options. That way, if the individual's membership expires in between registration and the conference, they will need to renew their membership before registering for the conference.

EDIT: In terms of what I've tried, I have added "Membership" in the "Specify entity for advanced autodiscount" box and "{"end_date":{"$gt":"2017-02-05"}}" in the "Specify API string in the advanced filter" box. This causes the discount to fail to apply. When I blank those boxes, the discount applies correctly based on the test user's current membership (whose end date is in January 2017).

EDIT 2: I looked at the code on Github, and it looks like CiviDiscount is looking at the string using json_decode, so I changed the string to {"end_date":{">":"2017-02-17"}}. However, when looking at the form after saving it, the > is escaped to ">". I feel like that may be the problem, any advice would be appreciated.

Figured it out by manually editing the database and seeing how it was represented in the CiviCRM UI, so here's a guide in case anyone has the same need as me:

In order to automatically apply a discount if the contact has a membership that is active as of a specified date (example is February 18, 2017):

In the specify api string for advanced filter box, type {"end_date":{"\u003E":"2017-02-17"}}


Set Default View for Views For Display Contacts in Advanced Search Form I want to change the columns that are shown in the advanced search results.

I have created a Search Views Profile and this shows up in the dropdown list of the Search Views on the Advanced Search Form. This works fine. Is it possible for me to make this Search View Profile the default Search View?

I looked in the admin screen for customising search preferences (civicrm/admin/setting/search?reset=1), and there is a dropdown for the Default Contact Search Profile, but my Search Views Profile does not show up in it.

It would be helpful if I could make my search view the default so that users do not have to select it each time they do a search.

I guess you trying to use a profile which has Contact, Contact Type and Contact Sub Type Fields. The search preference allows you to choose profiles that have fields of contact and contact type. I have logged the issue at CRM-21655. You can apply patch to make it work or wait for 4.7.31.


Word Replacement won't replace deceased on contact profile We are using the deceased function for both contacts that are deceased or no longer employed. In word replacements we changed "Deceased" to "Terminated or Deceased" - however, on the contact profile page (deceased) still appears, so we added a word replacement that makes "(deceased)" replaced by "(Terminated or Deceased)" but that still didn't change it. I was able to replicate on the D7 Demo Master.
Thoughts?

It's case-sensitive, so if you want to do exact match you can make two entries in word replacements:

deceased => Terminated or Deceased
Deceased => Terminated or Deceased

(without the brackets)


How are CiviCase Case ID numbers generated? I've assumed that CiviCRM simply allocates the next available Case ID number when a new case is created. Certainly it has always looked that way. However, on one site I work with where cases are used extensively, we are seeing case numbering that suggests something else is happening:

Case ID numbers started at 1 and run pretty consistently up to 86, then a jump to 164, then a second jump from 167 to 249, then straight to 332, then from 372 to 617, from 620 to 747, and from 766 to 1059. (Taken from the civicrm_case table in the DB).

On another site, with a comparable number of cases, the case IDs run from 1 up to about 255 (last time I checked) without a break.

I'm concerned that the non-sequential numbering might be indicative of a problem.

What might be happening to make CiviCase create non-sequential case ID numbers?

I am not 100% sure, but there are some peculiarities within the case process. One of them is that the complete set of data is saved at the end of the overall case transaction, and for CiviCRM purposes it is a rather long transaction. And if there is either an error or a cancel somewhere during the whole sequence it might be that a record was created in civicrm_case (allocating an ID) which is then removed later on, but the ID is gone.

If you look at the table it does mention that ID is auto increment, meaning it is sequencing. As a test you might want to try creating a case but then not completing the open case activity and see if it allocated a case ID (if you catch my drift...) We certainly encountered some un-characteristic stuff when creating custom extensions for CiviCase :-)


profile email notifications: can CiviCRM indicate what information has changed? Members on our site can update their own profiles, using a custom profile that is set to send notification emails to administrators when an update is submitted.

The notification email contains all the data now in the profile -- but it would be great if the data that was changed was indicated by a different color, or maybe just some indication of which fields have a changed value.

I have no idea how CiviCRM handles versioning (if it even does), so I have no idea if this is even possible without significant custom development.

Anybody have any ideas? Thanks!

I think what you want is Logging.

In the Civi menu, go to Administer > System Settings > Misc (Undelete, PDFs, Limits, Logging, Captcha, etc.)

Enable logging, and from then on all changes to contact records will be recorded. You can view them by visiting the "Change Log" tab on the contact summary screen.


I want to list civievents in a civimail Is there some way to provide a list of events in civimail?  Or failing that generate a custom listing (just the fields I want) of my events so I can copy and paste it into civimail?

Yes, you can achieve this by installing the Fancy Tokens extension.


Is there a way to create a Membership Status for memberships that have recently been renewed? We currently use the membership status "NEW" to identify recent membership signups.  For various reasons, we also need a membership status to identify those who have recently renewed.  As a workaround, I'm creating a smart group for the activity "Membership Renewal" but it seems that a status would be better.  Anyone know how to do this or if it is possible?

Well, it's not really possible to have a status for the Renew state because the Start event used for status rules is based on one of the following date :

start date : this date is updated only when there is a gap between the last end date and the new renewal date... if there is no gap, which is the most frequent case, there will be no update
end date : updated any time the membership is successfully renewed / mainly used for "grace" / "expired" status
member since : this date is not updated by the system at all so it is used for new membership

So, without development, the only way i can think of having this kind of status is to manually update the start date every time you renew (which probably defeat the purpose).

Then, you can define :

Start Event to start date
Start Event Adjustment to be 0 (start at the renewal date)
End Event to be start date again
End Event Adjustment to be 1 month or the period you'd like it to lasts
Current Membership should be checked because obviously, membership with those status are valid

Please put the new Renew rule above the Current status by changing the Order because CiviCRM test the rules one by one and stop at the first matching item.


Why would a hosting company not provide ImageMagick on a shared server? My hosting company (vidahost.com) have always been good about providing a Civi friendly environment for a reasonable cost & performance.  However having moved some domains to a different server (to avoid a problem - see this problem) they now tell me that ImageMagick is now not available on their shared servers. This is a real problem as one client has developed some great e-newsletterws using the Mosaico extension.  I'm puzzled why this should be the case - except perhaps to force people to a more expensive VPS solution.  Are there other reasons why ImageMagick should be excluded from a shared server?

I use Stablehost's shared server services and have access to all PHP options including ImageMagick.  Some hosts choose to restrict access to these functions in order to reduce the number of "complex" websites on their server so they can cram more websites on their server. Most reputable shared hosts provide resource usage limits that they define as acceptable for their service.  Restricting what libraries you can use is a poor business choice.

While this isn't a CiviCRM question - I think questions around webhosts and what they offer are important. I hope you get VidaHost to enable it for you - if they don't - take your business elsewhere.


How do I add CiviCRM Activity attachment to View Trying to set up an activity view that displays attachments uploaded to activities.

I can't seem to find the field to add.

Any ideas?

I attended a session yesterday at CiviCon (https://denver2015.civicrm.org/sessions/civicrmdrupal-integration-showcase; the slides are up already) about exposing more Civi tables to Views.

CiviCRM Entity 1.x might display the table you need.  CiviCRM Entity 2.x-dev most definitely will.  (https://www.drupal.org/project/civicrm_entity)  The session slides have lots of details on installation and use.

A sandbox module is also available to expose the Civi tables to Views (https://www.drupal.org/sandbox/markusa/2474103).

The inherent (edited) difference is the sandbox module is just exposing the data to Views. The CiviCRM Entity module will make Civi data available to all of Drupal as entities.


How do you create a Smart Group with participants from multiple events I'm trying to create a smart group for all registered users in any 2019 event. There are 5 events I'm trying to pull participants from into a smart group.

The process I am trying to use is:

Click "Events" -> Click "Find Participants"
Add the 5 events in the Event Name field
Choose the Participant Status of "Registered"
Click "Search"
Click the "All 214 records" radio button (214 Results are found)
Click the "Actions" drop down and select "Group - create smart group"
Enter a name in the "Name" field
Enter a description in the "Description" field
Click "Save Smart Group"

The result is an error message that returns:
72,74,76,80,75 is not of the type Int

The error itself is not that confusing to me. A comma separated list of event ID's is obviously not an Int.

However, I am not sure how to get around this issue.

How do you create a smart group containing participants from multiple events?

I found out that going through almost the same process under "Search" -> "Advanced Search"
allows you to create a smart group of people from multiple events.


Where can I find CiviCRM 5.26 for WordPress? I'm stuck in a conundrum, trying to update CiviCRM 5.22.1 to 5.28.3, but the database upgrade fails, possibly related to wordpress 5.5 already being installed, but also possibly due to requiring the PHP Internationalization extension (PHP-Intl), which is required after 5.27.
I want to try updating to 5.26 (or any 5.26.x) to see if I can at least get our donations pages to work again while sorting out the PHP-Intl extension, but I can't seem to find where I can dl it.

Sourceforge has the files: https://sourceforge.net/projects/civicrm/files/civicrm-stable/
You can also just change the url manually for the "official" download, i.e. the current is https://download.civicrm.org/civicrm-5.28.3-wordpress.zip but you can manually type https://download.civicrm.org/civicrm-5.26.2-wordpress.zip


Report on Cases and Activities I need a dashlet for a user which lists scheduled activity details filtered on the 'case type' the activity sits in.   I can find these in search but cant seem to get a report to work - closest I can get is extended report  - Activity Pivot Chart (CiviCase)

If I can perform a straight forward query in search with regard to finding an “activity type’ within a specified ‘case type’  would it not be a significant progression for the CRM to be able to perform this as a report.

As an implementor I finally got around the problem using smart groups, but ..  seeing as the table join is already part of the ‘extended report’ functionality would it not be a massive progression for Civi report to offer this in a more direct way.

Many thanks to the suggestions to make a view and incorporate as a block, I can do this, I appreciate the power of the views module, should it be necessary.  The push to make civiCRM a software capable of case management  and it being really useful to organisations who wish to manage actual case requirements means that a fairly simple code change could offer significant Implementor level advancement.

I really don’t want to try and remember how to code, yours in eternal laziness x


Add Custom CSS to Civi Email How can i add some custom css to a message template? I want to add it to the header. Is there a file I can edit?

I just saw, all I need to do is click on the source button in the message editor and paste my code in there as described here


How do you move SSL to non-SSL? [ Wordpress 4.6.1 + CiviCRM 4.7.14] I responded to a question re: using Let's Encrypt SSL certs at this comment. I now need to go in the other direction because I made a mirror of our live site on my laptop in an xampp environment (win 10). There I don't have, nor do I want to use, an SSL certificate.

First, I removed the https redirect in .htaccess. Then, I was able to "simply" deactivate the Really Simple SSL plugin by following https://really-simple-ssl.com/knowledge-base/uninstall-websitebackend-not-accessible. This made our local Wordpress site work and I could also get into the back-end. However, CiviCRM does not work from either the back-end or front-facing pages. From the back-end, it generates an error trying to bring up the CiviCRM dashboard. Both give the same error:
"Parse error: syntax error, unexpected end of file in C:\vhost\sdbikecoalition\wp-content\uploads\civicrm\civicrm.settings.php on line 450"

[edit] And, of course, I checked the civicrm.settings.php file and found nothing suspicious [/edit]

I suspect it is because, on our live SSL site, I went to Administer > System Settings > Resource URLs and checked Yes on "Force Secure URLs (SSL)". Is there somewhere I can change this by just directly editing a record in the CiviCRM MySQL database?

I suspect that will solve my issue as that was the only thing I did within CiviCRM that was specific to SSL.

Verify the file which is being reported as having a syntax error. PHP has a syntax check mode with -l (for "lint").

php.exe -l C:\vhost\sdbikecoalition\wp-content\uploads\civicrm\civicrm.settings.php

If civicrm.settings.php is not valid PHP, CiviCRM will not function - SSL or no SSL.

Note that your local PHP install may differ in version and therefore syntax from the PHP installed on your server.


How do you filter by campaign from the volunteer listing page in civivolunteer? On the regular volunteer listing page (/civicrm/vol/#/volunteer/opportunities) is there a way to filter by campaign like there is within Manage Volunteer Projects?

I'd like to be able to filter within the URL with campaignid or something like that.

In our case, we have a volunteer event that happens at multiple locations with different and different opportunities at each location.  All are on the same day and all are related to one theme.  I'd like to be able to link to just those opportunities in a list.

Pretty sure the code needs to be modified a little bit to allow you to do it by URL param. Shouldn't take but an hour or two.


DB error: Already Exists Using Civi 5.20.3
Contacts are getting an error (DB error: Already Exists) when filling out a profile form.
This is what I saw on the Drupal Watchdog. What does it mean?

$Fatal Error Details = Array ( [callback] => Array ( [0] => CRM_Core_Error [1] => handle ) [code] => -5 [message] => DB Error: already exists [mode] => 16 [debug_info] => UPDATE civicrm_cache SET data = .....

created_date = FROM_UNIXTIME(1581961411), expired_date = FROM_UNIXTIME(1581983012) WHERE group_name = "contact-20fields" AND path = "exportableFields All_0_0_0_" [nativecode=1062 ** Duplicate entry 'contact-20fields-exportableFields All_0_0_0_-2020-02-17 11:43:31' for key 'UI_group_path_date'] [type] => DB_Error [user_info] => UPDATE civicrm_cache SET data

While it's hard to tell without the entire error message it looks like given that the query appears to be an update to a cache table I'd recommend clearing your caches.

drush cc all or via /civicrm/admin/setting/updateConfigBackend?reset=1


Blank Screen When Clicking on CiviCRM in Wordpress - No Administer Panel I successfully installed CiviCRM to my wordpress site at josephcommunitycenter.org. When I click on CiviCRM on the left side of the WP Admin panel, it takes a while for the page to load and then I see the following:

When I click on Configure Your Dashboard, it goes nowhere. I also don't see the Administer Dashboard for CiviCRM. What is causing this problem? I'm running on php version 5.6 and have the latest version of wordpress and CiviCRM. I can also tell there are some images missing from the CiviCRM Home screen.

Thank you.

I was able to get it to work by placing this code after the initial

global $civicrm_setting;
$civicrm_setting['Directory Preferences']['customTemplateDir'] = 'public_html/wp-content/plugins/civicrm/civicrm/templates/';
$civicrm_setting['Directory Preferences']['customPHPPathDir'] = 'public_html/wp-content/plugins/civicrm/civicrm/php/';
$civicrm_setting['Directory Preferences']['extensionsDir'] = 'public_html/wp-content/plugins/civicrm/civicrm/extensions/';
$civicrm_setting['URL Preferences']['extensionsURL'] = 'https://www.example.com/wp-content/plugins/civicrm/civicrm/extensions/';
$civicrm_setting['URL Preferences']['imageUploadURL'] = 'https://www.example.com/wp-content/uploads/civicrm/persist/contribute/';
$civicrm_setting['URL Preferences']['userFrameworkResourceURL'] = 'https://www.example.com/wp-content/plugins/civicrm/civicrm/';


Can I track grants against contributions? Is there a way with CiviGrant to match money received as Contributions with money disbursed?

E.g. if I receive a donation for $100K for a scholarship fund, and I give out 3 scholarships of $20K each, is there a report that can show me that I have $40K left in the fund?

CiviGrant is not sync'd with CiviContribute in current CiviCRM version. You will need to build an entity that will link CiviGrant with CiviContribute or use Financial Accounts(linked with Financial type).

This look like nice feature. I am happy to build an extension for this if you willing to sponsor.


Storing Personally Identifiable Information Is anyone storing Personally Identifiable Information (PII), such as Social Security Numbers (SSN), in their database?  How would I encrypt such a field in the database?  I'm expecting that it would be a custom field that is part of a Custom Data Set attached to a contact.  However, I've not seen a way to simply encrypt the stored data in the database.

Encrypting the whole database wouldn't be a bad idea, and any ideas about that would be great too, but it seems like these types of fields need their own key sets in addition to anything else.

Yes, I'm aware of CiviHR, but having a completely separate install and database means a lot more complexity than seems feasible.

We're in Canada - but no we don't store SINs for any of our projects. We don't store Credit Card numbers (PCI compliance dictates that) - and one could argue that having your SIN/SSN stolen is far more serious than having your Credit Card stolen. Storing SSNs would substantially increase the risk that a breach would be considered a major privacy breach.


Effects of hidden groups and multisite mailing I'm looking for some clarity on hidden groups. We have 50 states using a multisite instance and the mailer doesn't work well with multisite.

To achieve segmentation, it seems like creating mailings through search is the only way to do it. If we did that, and each state sent 4 mailings per month. We are at 200 hidden groups each mo and 2400 after 1 year.

Is there harm in this or would a process to delete the hidden groups be satisfactory?

Or should an entire new mailer be developed to make multisite mail more intelligently? For instance, it should look at 1 group we have setup (e.g. Volunteers) and then have an AND clause of the users ACL to limit the contacts to their area, be it state or county.

My test so far following artfulrobot's advice was that deleting a hidden group did not effect the normal mailing functionality (unsubscribe/optout/click/open tracking/reports).


Solicitation Frequency More and more donors over the last few months have been asking to have custom Solicitation Frequency - IE: Once a year, once every six months.  I can't seem to find a spot within CIVICRM to indicate this within their record.  Is there a spot I am missing?

There isn't, but you could create one with a custom field - Administer menu >> Customize Data and Screens >> Custom Fields.


I'm having new trouble with CiviCRM in multisites in Wordpress tldr; I'm after a Wordpress multisite setup that uses the same CiviCRM data for all the subsites. Each subsite can then show the relevant data, and users for each subsite can be given the appropriate permissions.

I've had this working previously, but now, using CiviCRM 5.2.2 it's refusing to work.

Previously (around Civi 4.6 ish) I did a multisite install of Civi.

All I did (IIRC) was install to the root site, then set it up.

When I went to the sub-sites, it showed me the CiviCRM information in the same way that it had it on the root site.

Everything was installed and working. I could see people and information about them.

I've just been trying to set up the same thing again, but this time I'm using CiviCRM 5.2.2

Now I successfully install CiviCRM in the main site.

But when I go to the sub sites, it has CiviCRM showing as needing installing. And when I try clicking the button it gives an error of:

Oops! CiviCRM is already installed
CiviCRM has already been installed.
To start over, you must delete or rename the existing CiviCRM settings file - civicrm.settings.php - from /wp-content/plugins/civicrm.

But civicrm.settings.php does not exist there.

It exists in /wp-content/uploads/civicrm

So the error message appears to be wrong as a first problem.

In the previous install that did work, it created a set of directories in:

/wp-content/uploads/sites/3/civicrm

And the civicrm.settings.php file was in there.

It has not done that in this case.

I'm very confused about what's going on.

Is this a major change between 4.x and 5.x that hasn't been documented?

Or something?

Things I've done
I've deleted the civicrm installation canary table from the the database.

I've added the lines to the civicrm settings file as per:
https://docs.civicrm.org/sysadmin/en/latest/install/multi-site/

But it still refuses to let me get into CiviCRM on the subsites.

Thanks for any insight.

Norman

I see you've commented on the recent documentation update to handle this, but in short: Newer versions of CiviCRM under WordPress have moved the default location of civicrm.settings.php.  When installing multi-site, it's looking in the wrong location.  You can either define your CIVICRM_SETTINGS_PATH in wp-config.php or put the civicrm.settings.php in its old location.


Is it OK to switch to PHP 7.2 now that Drupal 7.6.1 supports it? Drual 7.61 was released a few days ago and I notice now "fully supports PHP 7.2".  So, can we move to PHP 7.2 for CiviCRM where it runs with Drupal 7.61?  I've updated a couple of my Civi sites to Drupal 7.6.1. and PHP 7.2 and all seems well, but when I look at stats.civicrm.org there seems very few sites running PHP 7.2 which makes me wonder why. So it is OK to move a Civi site to PHP 7.2?

The latest versions of CiviCRM run fine with PHP 7.2.  However, a) this has only been true a few months, b) Drupal 7 has only very recently become 7.2-compatible, c) most major Linux distributions don't ship with 7.2 by default.  I'd say those three factors account for few sites running it.

Note that as of CiviCRM 5.8.0, known PHP 7.2 import issues have been fixed.  CiviCRM 5.9.0 will handle the other known PHP 7.2 issue, which only occurs on certain types of reports.


Enforce uniqueness of custom field I created a custom field on groups, which contains a string. When this string is not empty, I want it to be unique. What is the preferred way to do this? Should I implement a hook?

I think a hook's the way to go.  For non-custom fields you can specify this a little more easily in the XML definition of the field, but for a custom field, I think the hook is your best best.

I think I'd use hook_validateForm or hook_pre.  The first is more user-friendly, but since it's at the form level you have to identify everywhere the field can be edited.  It's a fairly easy hook to write though - just make an API "get" call to CustomValue with that value and see if you get a count > 0.


Dropdown Custom Field - Is this possible We would like to have the ability to use a dropdown as one of the custom fields linked to an activity. This would enable us to search on this field without mis-spelling causing problems on the future. Is this possible as I can't see an option for a dropdown when setting up a new custom field?

Yes, you can do this by using "select" option

Please try to use text - with select option (Data and Input Field Type) and fill up the details below or you can select an existing set from the drop down

If you are not sure about the option please let me know I can post some Example with screen shots

I guess this helps !!!


CiviCRM upgrade to 4.7.21 (Drupal 7) I am using Drupal 7.56 and have just upgraded from CiviCRM 4.7.20 to 4.7.21 with a number of significant issues that will require that I revert to 4.7.20. When I try to display System Status - Warning nothing is displayed. When I try to continue to use a previous email, nothing displays.
I don't have the luxury of doing anything more to understand the issues since I now need to revert to 4.7.20.

This is my answer pasted from this question

We had one site that had 'lost' all it angular pages, eg CiviMail and System Status.
In our case the angular cache files were returning 404 on the New Mailing page. (and 'inspector' was showing a lot of red angular errors)
It was building the cache files in sites/default/files/civicrm/images, but then searching for them in sites/default/files/civicrm/persist/contribute
The issue here was a mismatch between the resource url setting for Image Upload URL and the directory setting for Image Directory. Strangely (!!) these folders are being used for caching of angular files.


Drupal to Wordpress Migration - Can we keep/recreate our forms? As our tiny organization only has me as our volunteer web developer (and I am far from an expert) we think it may be prudent to migrate over to Wordpress, where things are a little less technically difficult so others will be able to lend a hand. My only hesitation is that we currently make havy use of Drupal's Webform CiviCRM Integration module. We use it for memberships, for event signups, and to collect payment on both of those items. Does Wordpress have comparable capabilities, or would we be leaving that behind?

The answer is no - but having said that we do have one organization that went with a Wordpress main site for content delivery [example.org] and a second Drupal/CiviCRM site [secure.example.org] - to leverage all that Drupal can do. So the Drupal component on the second site is very small - mostly for webform_civicrm; views displays. One added benefit is that donors really like going to the 'secure' site.


How to use Word upload in Print/Merge function? Can anybody kindly help me to understand how to use the Word upload function in the Print/Merge window?

I have tried to insert the CiviCRM tokens into the Word file before uploading the file and doing the Print/merge -> does not associate all tokens to the values from the database.

I have tried create a Message Template with a Word uploaded file, then to go to the Print/Merge function -> does not associate all tokens to the values from the database either.

Therefore my questions: how should the tokens be inserted into the Word file before doing the upload? Is there any special code that needs to be used?
If anybody can provide User-feedback after using this function, I will be very grateful.

Thanks for your help.

(Drupal 7.67 & Civi 5.7.0)

(this is a more precise question, following the question and the answers from last week in Stackexchange : How do use upload function for mail merge with Word)

Which of the various Print/Merge windows are you using - ie what steps do you take to get to that window?  (Similar-looking print/merge windows use different code so the functionality is not consistent.)

It sounds like you are doing the right thing - ie create a Word doc with the tokens and upload it.

Do you mean that some of the tokens work, or none at all? If so, which ones do and don't work? It depends on the context as to which tokens are available so I'd start by creating a simple test using the on-screen composer to check that the tokens are being evaluated correctly in that context.  If they don't work there, they won't work in a document.

Be aware that the functionality with documents can produce poor results if there is complex formatting since the document is converted to html and so depends on the capability of the conversion library.  You might find that converting to ODT produces better - or worse - results compared to DOCX.

In a recent project, we concluded the best option was to do the conversion to html outside of Civi and paste it into the on-screen composer window using the 'Source' button.


How do I clear all the personal / sensitive data from CiviCRM DB via SQL? We have cloned a live DB and run the following SQL to anonymise the contact data:-

delete from civicrm_email;
delete from civicrm_address;
update civicrm_contact set birth_date = NULL;
update civicrm_contact set first_name = 'Staging';
update civicrm_contact set middle_name = '';
update civicrm_contact set last_name = concat('Test',id);
update civicrm_contact set legal_name = '';
update civicrm_contact set display_name = concat('Staging Test',id);
update civicrm_contact set addressee_display = '';

However, when we search for contacts (Search/Find Contacts) it still displays the original contact name under the "Name" column.

How can we improve this SQL script to remove all traces of contact names?

As people have pointed out there is a very comprehensive answer to the question of anonymising data, however this questions was about simply clearing data.

The correct answer from Pete and Demerit was that I had missed the sort_name column from the civicrm_contact table. So the full SQL is now:-

delete from civicrm_email;
delete from civicrm_address;
delete from civicrm_phone;
update civicrm_contact set birth_date = NULL;
update civicrm_contact set first_name = 'Staging';
update civicrm_contact set middle_name = '';
update civicrm_contact set last_name = concat('Test',id);
update civicrm_contact set legal_name = '';
update civicrm_contact set display_name = concat('Staging Test',id);
update civicrm_contact set sort_name = concat('Staging, Test',id);
update civicrm_contact set addressee_display = 'Dear Staging';
update civicrm_contact set email_greeting_display = 'Dear Staging';
update civicrm_contact set postal_greeting_display = 'Dear Staging';

And as pointed out by @Chris you will also need to clear the cache tables, but please use the GUI for this as direct SQL on these tables can cripple the CiviCRM caching logic.

Feel free to edit and expand this answer if you know of any other fields that can be cleared by SQL.


Which contact record should house the membership? My question is related to how drupal users interact with their civicrm membership and contact record.

In 2013 we moved to using CiviCRM. We already had 'Group' and 'Household' membership types, so it was assumed that the Civi membership would be housed on Organisation and Household contact records, and the membership inherited by related Individual records.

However in the following years I've been wondering if we got that wrong, as there are several reasons why this doesn't work:

1) Drupal users can only be associated with an individual contact record, so they would not be able to renew a membership online if it is housed on a Household or Organisation record; they would probably end up creating a brand new membership but on their Individual record.

2) The CiviContribute pages allow for a user to join on behalf of an organisation, but when this takes place the membership is by default added to the individual's record - the relationship of 'employed by' is created by default to link to the Organisation record (which only gives inheritance to that record if the relationship for that membership is set up using that relationship.)

3) If a membership housed on an individual record is renewed online, the membership inheritance does not seem to renew the membership on the Organisation record, but at least the individual still has an active membership and therefore able to use and drupal related benefits associated with current membership.

So I am not sure how CiviCRM is actually meant to be used in this scenario - should we actually house the membership on an individual record by default and allow access via Webform to allow them to create their related Household or Organisation contact records?

Please let me know if you need any more details!

Drupal users can (should) only be associated with an individual contact record but with a correctly set up 'on behalf of' workflow this can allow for an Individual to purchase a membership on behalf of an organisation. (I say 'should' because I know users have overridden this and hence permitted the Drupal user to have a uf_match link to the Org record)

Provided they get a Permissions 'current employer of' relationship, they should then be able to return to a renewal page and have the option of renewing on behalf of the original organisation (or any other organisations they have permissioned current employer relationship with), or join on behalf of a new one.

Inheriting of memberships does not need to be set on the Employer of relationship if you don't want that, eg you could use a Primary Contact for relationship so that only specified individuals 'inherit'. This can help when it comes to sending out reminders.

In terms of Households, we have mostly shied away from using that concept altogether since it does not work with 'on behalf of'. I suspect it is not much work to make this possible, and have flagged it in the past, but no one has funded it, and we have always preferred our work arounds of either having sub-Organisation types, or using Webforms to manage the relationships.

The whole 'on behalf of' can be tricky to get right but there won't be one magic solution that meets all needs.


Is there an accepted standard for storing data as a year? To preface this, I'm using CiviCRM's integration on Drupal 7, with the Webform integration module.

I'm looking to store a number of custom fields as a year. It appears that I am able to use the Date field type to store a date in the format of "YYYY", which sounds like what I want to do. However, the widget that is presented to the user to input the data requires you to choose a specific date from a date picker rather than a year, even if it only stores the year.

On top of that, when I use the Webform module integration with CiviCRM, the widget that I am presented with has 3 dropdowns, one for month, one for day, and one for year.

Ideally both the backend widget and the Webform widget would simply be a select box that allows you to pick only the year starting about 60 years back and ends 20 years in the future. I'm sure I could just make a select box to do just that, but I don't want to manually edit the values in a select box just to get a simple date field.

Does anyone know if there is a way to handle this the way I'm describing or am I stuck using a full date field to simply store a year?

You can achieve this in Webform by hiding the day and month fields as well as deselecting the enable pop-up calendar option on the webform component.  There you can also set how far back you'd like the years to go.

However, Civi still stores the entire date.  I believe the date will be stored as Today's date, 2015 12:00 am if you select 2015 for example.


How to get relationship changes logged? On the 4.7 Drupal 7 Demo site I changed the middle letter of contact Kathleen Adams and it gets logged and becomes visible in the log tab. Then I make a change in the relationship tab, adding a Case Coordinator relationship to Megan Roberts and removing that relationship again. Both these changes to the contact are not logged.

Is there a setting that it will also log these changes? When there isn't such setting available, could this be considered a bug and reported as such?

The same questions for version 4.6.x because that is the LTS version I am using at the moment.

If you have enabled the detailed logging it is currently displayed under the target contact of that relationship.

Arguably it would be better if it is shown on both contacts.

You can view all changes in the Contact Logging Report (Summary).


Make the Contact create API behave like UI in the way in checks for duplicates I am creating a contact using CiviCRM API, what I have noticed that the duplicate checking looks inaccurate compared to the check done when entering new contacts via the User Interface.

Under the CiviCRM API, it's only a match if the given parameters are exactly the same like "John Smith of john@here.com" does not match "Johnathan Smith of john@here.com", for example, but in the UI, simply entering a matching e-mail address throws a warning.

Is there a way to make the CiviCRM API dupe check behave more like the UI  ?

I am passing the parameter dupe_check = true. The complete call is:

$result = civicrm_api3('Contact', 'create',
          array( 'sequential' => 1,
                 'contact_type' => "Individual",
                 'first_name' => "raj",
                 'last_name' => "l",
                 'dupe_check' => 1,
                 'api.Email.create' => array('email' => "raj@abc.com"), )
           );

I did some research in the code. When you use the contact API, the default Unsupervised rule for the Contact Type. This rule is configurable in the Contacts -> Find and Merge Duplicate Contacts screen.

Update: The contact has another option. You can use the duplicatecheck method. But it cannot be tested in the API explorer. The following code returns the contact_ids found deduplication rule 4 (Checking on email for Individuals).

$result = civicrm_api3('Contact', 'duplicatecheck', array(
     'return' => array("display_name"),
     'dedupe_rule_id' => 4,
     'check_permission' => FALSE,
     'match' => array(
        'contact_type' => 'Individual',
        'email'        => 'blue@example.com'
  )
));


Does anyone have recent experience with CiviCRM for RSForm? This Joomla plugin is supposed to provide the ability to update a civiCRM contact record based on a matching email address submitted in an RSForm submission.

Does anyone have recent experience with this plugin? Will it work with latest RSForms and civiCRM 5.21.x?

I purchased the extension, and can confirm that it work with latest release of civiCRM.


Is there a report to export the transfers from CiviCRM to my bank account? I can see all of the payments that people make, but I would also like a CSV export that includes the transfers from civiCRM to my bank account.  Is there a report for that?

Amy, Welcome to SE world.

You can use contribution report or contribution search to list all the contribution recorded in CiviCRM based on Payment method used in one of your payment processor. For example if you are using PayPal and have payment method set to Credit card for the paypal payment processor then you can search on payment method in 'Credit card' and then export the results in a csv.

To get the list of payments associated with the contribution(s) you can use Find Payments extension to find the payments for payment method in 'Credit Card' and  then export the result into CSV.

HTH

Pradeep


New error when editing membership: Argument 1 passed to CRM_Financial_BAO_Order::setOverrideTotalAmount() must be of the type float, string given This error seems to be connected with the update to version 5.36 as it just appeared after that.
When editing an existing membership or adding a new membership the following error appears in the logs:
TypeError: Argument 1 passed to CRM_Financial_BAO_Order::setOverrideTotalAmount() must be of the type float, string given, called in C:\wamp64\www\civicrmd8\httpdocs\sites\all\modules\civicrm\CRM\Member\Form.php on line 486 in CRM_Financial_BAO_Order->setOverrideTotalAmount() (line 152 of C:\wamp64\www\civicrmd8\httpdocs\sites\all\modules\civicrm\CRM\Financial\BAO\Order.php).
I feel it could be connected to https://github.com/civicrm/civicrm-core/pull/19476/files
A quick fix I found was to change line 486 of civicrm/CRM/Member/Form.php from
$this->order->setOverrideTotalAmount($formValues['total_amount']);
to
$this->order->setOverrideTotalAmount((int) $formValues['total_amount']);
But I am not quite sure if this really solves the issue or what sideeffects I do not see. Maybe this type casting should be done earlier in the process? or maybe the problem lies somewhere else? In my case the value of $formValues['total_amount'] is an empty string but I do not know where this value comes from.

Just for the record - the issue is solved in CiviCRM version 5.36.1


CiviCRM API explorer menu is not visibile on Wordpress I installed CiviCRM  5.23.4 on Wordpress 5.4 and the Support menu is not visible. How do I enable and use the API explorer?
If I go to /wp-admin/admin.php?page=CiviCRM&q=civicrm/ajax/doc/api#explorer I have an empty page (only the title is visible).
Thanks

Try clearing your CiviCRM cache CiviCRM >> Administer >> System Settings >> Cleanup Caches and Update Paths.

Check if the Support menu is enabled in CiviCRM >> Administer >> Customize Data and Screens >> Navigation Menu

The api3 explorer link is

/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fapi3#explorer


Created and Last Change Data Created and where is the Last Change data held?

Can I get information about the table location in SQL.

System:

Joomla! 3.9.10
CiviCRM 5.18.2


Responsive Email Layouts - Why move away from Smarty? I'm looking at this GSoC project that I'm willing to take on.

https://wiki.civicrm.org/confluence/display/CRM/Google+Summer+of+Code+-+2016#GoogleSummerofCode-2016-responsivelayoutforemails

Which has "move away from smarty" on it's project description. Smarty, in the context of email messages, is used to replace the contact greeting names in email templates. So, I don't understand why we want to move away from smarty. Is it because we can accomplish the same task by using a simple PHP variable without having to use an extra library? What type of better solution are we looking for?

You are right, we do need some templating system and we don't need to replace smarty. It's just that it's not the framework that seems to have a lot of traction these days and as generally, we are thinking of moving away from it, we might as well start with the mail feature

Moreover, I do recall performances issues being mentioned for big mailings (smarty was generating tons of temp files), so that might be another incentive.

This being said, I the focus should be on improving the layout of transactional emails and make it easier to brand them consistently for an organisation, so replacing smarty might not be super useful in that context.


Price set expire on/active on dates relative to event We'd like to start incorporating expire on/active on dates for some of our price sets to enable early bird pricing, as the docs indicate. Is there a way to set the expire on/active on date for a price relative to an event start date, for every event it's used for? We're on CiviCRM 4.7.27.
Thanks,
Neal

Unless something recently changed, the answer is no. We've had to do a separate price set with specific dates for every one of our events. I'd much rather have one price set for each event type, as opposed to dozens of price sets each year.


Create new report from template is not working (CiviCRM 4.6.5) When you go to /civicrm/report/template/list?reset=1
and for example choose this contact report template
/civicrm/report/contact/summary?reset=1
..and click on the button 'Create report'
Then a popup window appears with
Report Title
Report Description
..and when you click the button 'Continue', the popup window disappears and nothing happens. No report is created.

I tried different browsers, but the problem stays the same.

It appeared that this was caused by a theme that I applied to civicrm.
I reverted to the original bartik theme and the report creation worked.


Add Custom Fields to Contact Details data I'm trying to add Custom Fields for the Contact area. I know I can create custom data for a set of custom fields I create myself, but I can't seem to add custom fields to pre-existing sets created by CiviCRM itself. How can I handle this? Or must I only add to Custom Sets I create?

You create custom fields in custom field sets.  You have the choice of them being displayed inline or tabs, and as initially collapsed or open, but beyond that, you have little control over where they are displayed on the contact summary.

However, with a bit of jQuery they can be moved around.  For an example (although not custom fields) see https://civicrm.org/extensions/group2summary


Is it possible to change the Mailing label format? I would like to change the way the mailing label prints. i.e.. remove the country, bring postcode down to next line etc. Is it possible to do?

Go to Administer - Localization - Address Settings, and the mailing label format is there for you to edit.  You can move, add, and remove tokes as needed.

(For reference, Administer - Communications - Label Formats handles the formatting of label size and arrangement on the sheet.)


Custom form input field missing from &$values when hooking into tokenValues I am hooking into _buildForm for CRM_Contact_Form_Task_Email to add a hidden input called "order_id" that I will need for some token logic. This part is working great. But when I click Send Email, my _tokenValues hook fires and the &$values array is missing order_id.

Does Civi remove things from the $_POST array before building $values? Is this a bug or by design? I'm currently working around it by setting and getting my own session variables, but that means I have to create a session object in buildForm and again in tokenValues ($this->set() doesn't seem to work within an extension).

This code creates my extra input. I have verified that the input is written in the form when I view source in the browser. But doesn't make it to tokenValues:

function invoicetoken_civicrm_buildForm($formName, &$form) {
  if($formName == 'CRM_Contact_Form_Task_Email') {
        if (CRM_Utils_Request::retrieve('order_id', 'String')) {
           $order_id = CRM_Utils_Request::retrieve('order_id', 'String');
           $form->addElement('hidden','order_id', $order_id);
        }
  }
}

Edit: Based on Lobo's answer, I tried using $form->get(), but something still isn't working:

function invoicetoken_civicrm_buildForm($formName, &$form) {
  //add order_id to our form
  if($formName == 'CRM_Contact_Form_Task_Email') {
    //buildForm runs on get and post. this line re-adds the input during post
    if ($form->get('order_id')) {
        $order_id = $form->get('order_id');
        $form->addElement('hidden','order_id', $order_id);
    }
    //this line adds the input on initial load of the form
    elseif (CRM_Utils_Request::retrieve('order_id', 'String')) {
      $order_id = CRM_Utils_Request::retrieve('order_id', 'String');
        $form->addElement('hidden','order_id', $order_id);
    }
  }
}

No matter what I do, the input doesn't make it over to tokenValues; when I log the $form object, 'order_id' field appears in ['_submitValues']. I have tried $form->set(), $form->setVar, and any other combination I could think of. In the end, the only thing that works is to use a session var.

Most likely you are not adding order_id when the form is being posted back to the server

the quickform package basically filters out all variables that have not been added to the form. The buildForm hook is called even when the form is posted, so you might want to ensure that order_id is also added there. In most cases this happens automatically, however if we are using ajax for build parts of the form, it gets a bit trickier

$_GET['pid'] is available only during the first GET request. The POST request sends a very minimal set of GET variables. Try using this variation:`

function invoicetoken_civicrm_buildForm($formName, &$form) {
  //add order_id to our form
  if($formName == 'CRM_Contact_Form_Task_Email') {
    $order_id = CRM_Utils_Request::retrieve('order_id', 'String', $form);
    $form->addElement('hidden','order_id', $order_id);
  }
}`


What is Cron? It keeps on telling me that it's not running What is cron and why does it keep stopping?  What is the effect when it does?

See here: https://en.wikipedia.org/wiki/Cron

It's probably not that it's stopping - but that it was never set up.  CiviCRM won't do any tasks that need to happen automatically - including sending mails, updating membership statuses, etc. - until you set up cron.  I don't think any of the CMSes that support CiviCRM work reliably without setting up cron, either.

I can't explain how to set up cron for CiviCRM without knowing a lot more about your environment - your CMS version and your hosting environment.  If you're using CPanel or a similar control panel for your hosting, there will be a way to set up cron from within the control panel.  There's some instructions on this page that are specific to CiviCRM.


Adding contacts to group after receiving mail from them Say, for example that I want to divide my contacts into two groups, an active group (contacts from whom I've received a mail in last few months) and an inactive group (countacts from whom I haven't received an email in the last few months). Is there a way to do this in CiviCRM? I was looking at CiviRules, but couldn't really find what I was looking for.

You could use inbound email processing to activities and then a smart group based on that activity in the last 3 months.


How can i redirect a user to the PCP link once they login I have added a note to the top of create a PCP page on the thank you event page.  I have added this note in the custom template file ThankYou.tpl. For "here" i have added a href= /user, however if they login it just shows only the account information. How can i redirect user to access the PCP pages once they login. Please help, I am a newbie and do not know much about smarty template customization and CiviCRM. BTW site is Drupal 7.

You wont be able to redirect back to the thank you page, as the thank you page URL is dynamic (with _qfkey, etc.)

Alternative solution:

You can use the URL of the create personal campaign page as the destination after login.

In the href for the login page, you can use the below

please go <a href="/user?destination=%2Fcivicrm%2Fcontribute%2Fcampaign%3Faction%3Dadd%26reset%3D1%26pageId%3D1%26component%3Dcontribute">here<a> to login

Note: The value for 'destination' query paramater should be encoded for the redirect to work correctly for any CiviCRM URLs.

So after login, the user will be redirected to the create personal campaign page directly. This will also avoid an extra button click in the user journey you are expecting (i.e after login redirect back to thankyou page and then the user click 'Create personal campaign page' button which then takes the user to create personal campaign page.

Hope this helps.


Bug in the data import wizard We need to daily export all donation data from CommitChange and import the data to civicrm using the data import wizard. So the process is:

Map the appropriate donation fields to civicrm fields and then import donation information from the CSV file. In each case the name of the donation field is "Total Amount."

According to CiviCRM the donation data is successfully imported. However, in every record, the amount of the donation is stored in CiviCRM as "$0". I do not have the coding skills needed to fix the bug or to write a custom script to import the data, so any help is appreciated.

Drupal 7.53 with CiviCRM 4.7.14
also tested on CiviCRM 4.7.13 on a different Drupal site

Try doing an export of the data from civi of the fields you want to import just to verify you have the data in the expected data formats

EDIT (from Andrew's comment above)

The problem is that CiviCRM exports (and imports) data in a CSV file in which every cell is formatted "general," while CommitChange exports donation amount as formatted "currency." Problem solved.


Webform CiviCRM, add contact to a group programatically I want to add a contact to a group created from a Webform CiviCRM, depending on the fields' values.

I don't find where I should place this logic:

In hook hook_civicrm_post, I don't have the origin (webform) of the contact created.
The place should be in Drupal / Webform hooks, but I don't know how to "inject" the group to be assigned to the contact, to be processed by webform_civicrm.

Any ideas?

Working with CiviCRM 4.6.30, webform 7.x-4.15, webform_civicrm 7.x-4.18

After digging deeply into webform_civicrm, I've found that the hook to use is hook_webform_submission_insert

It's important to check that this hook is executed after webform_civicrm's one, so the contact is created first and then we can perform our own actions. We can alter execution order with hook_module_implements_alter

I couldn't access contact_id created in any webform_civicrm entities, so I had to get it from the table webform_civicrm_submissions where is saved

The source code:

// Be sure our module's hook is the last to be executed
function mymodule_module_implements_alter(&$implementations, $hook) {
  if ($hook == 'webform_submission_insert') {
    $group = $implementations['mymodule'];
    unset($implementations['mymodule']);
    $implementations['mymodule'] = $group;
  }
}

function mymodule_webform_submission_insert($node, $submission){
  if (!empty($node->webform_civicrm)){
    if(... my condition based on $submission values ...){
      $sid = $submission->sid;
      $result = db_select('webform_civicrm_submissions', 'w')
        ->fields('w', array('contact_id'))
        ->condition('sid', $sid)
        ->execute()
        ->fetchAssoc();

      // contact_id is saved between '-'
      if($result['contact_id'])
        $contact_id = str_replace('-', '', $result['contact_id']);

      civicrm_api3('GroupContact', 'create', array('group_id' => $mygroup_id, 'contact_id' => $contact_id));
    }
  }
}

PS: org.civicoop.civiruleswebform looks like a nice alternative, but it has many dependencies (2 extensions and 4 modules need to be installed in Drupal to use it)


Can't see Note type custom field in reports After setting up a custom data set "Member Details", I later added a new text area field called "Notes" to the set. My problem is that I find no way to get any membership report to show the Notes field. It isn't in the checkbox list of columns. I know the Notes field could potentially be a lot of text, but I don't care too much what it does to the report table. We have very short notes.

To see the Notes fields I must generate a report, click a contact, then click the Memberships tab, then click the View link on the right. So it's sort of cumbersome. I would like to be able to view a lot of notes at once in a report table format.

Have you confirmed that your notes field is searchable?  If it is, then the next step would be to check whether there are any ACLs working on that particular custom data set that might be restricting access.

Hope this helps,
Lesley


Has the Dashboard Cache Timeout setting been moved? I can't seem to find the Dashboard Cache Timeout setting, which according to my experience and documentation can be adjusted

  by visiting Administer > System Settings > Misc and editing Dashboard cache timeout.

But this setting is not to be found at that location, neither on my (slightly dated) out-of-the box 4.7.15 install, nor on the Drupal demo site.

Has this setting been moved or removed as of some version of CiviCRM? If so, how would one go about changing the Dashboard Cache Timeout?

This setting has been moved to each Reports(Access Tab). Major improvements related to dashlet has been done in 4.7.11 version. Hence, if you wish to change the cache timeout.

Navigate to any Reports.
Click on Access Tab.
Enable Available for Dashboard? checkbox which displays the setting you need.


Can a contribution page that has a membership section be forced to create a new membership? For our use-case, individuals never directly hold memberships, only organizations do, so we force the On Behalf Of Organization part of the contribution page. There's a different contribution page for New Membership than for Membership Renewal, but they both behave identically more or less for users that already have memberships.

We need the New Membership profile to ALWAYS create a new Organization and a new membership for the created org; currently when a logged-in user with existing current or expired memberships goes to the New Membership page, the membership section shows the renewal options instead of the New Membership options. When a user selects "Create A New Organization" and fills in the details, the membership part of the page just picks the existing membership that is uppermost in the Organization Name dropdown and renews it for another year instead of creating a new membership.

Is this the expected behaviour, and can it be suppressed? Is there a URL parameter I can pass in that will force a new membership?

Edit:

I should say, this is with version 4.4.10 for Drupal.

It looks like it makes the decision in civicrm/CRM/Member/Form/Membership.php, line 205:

if ($this->_contactID) {
        //check whether contact has a current membership so we can alert user that they may want to do a renewal instead

Any thoughts about how to programmatically suppress this without hacking core? My unhealthy temptation would be to do something along these lines:

if ($this->_contactID AND !($_REQUEST["forceNew"]=1)) {
        //check whether contact has a current membership so we can alert user that they may want to do a renewal instead, check for "forceNew" flag in request params

which of course would be a maintenance nightmare. Is there a hook I can use instead that will allow me to change the form's behaviour? Unsetting $this->_contactID with a hook sounds unwise, but that's how it makes the call.

Thanks!

I think you can add cid=0 to your url.

For example, https://example.com/civicrm/contribute/transact?reset=1&id=1&cid=0 will force the creation of a new contact and new membership even you are logged in and already have a membership.


Can a CiviRule trigger off a Contribution Custom Field entry? We have a custom profile "Other Details" that is for Contributions. When someone inputs information into the custom fields, I would like to trigger a Civi Action to do something with that information.
Is there any way to trigger off of that custom table? If I trigger off Contribution is Added, it is too early and has not yet written to the custom table. So I need the trigger to happen off the custom table.

Right now there is no trigger on custom data for a contribution. You could try though with the "contribution is changed" trigger and see if you can pinpoint your custom field/data with the "field value comparison" conditions?
Obviously you are quite welcome to either add the trigger yourself, or fund CiviCooP (or any other partner that is familiar with CiviRules) adding the trigger :-)


Mass hosting best practices for source code management of CiviCRM platforms? I manage CiviCRM installations on various servers (typically 1 client = 1 VPS). This usually includes roughly the same Drupal core and contrib modules, CiviCRM core and extensions, and translation files. While each client has their own specifics, I try to standardize as much as possible.

I was wondering what tools are recommended to 'build' the platform for production environments? Is buildkit recommended? If yes, any examples on how to use it with custom platforms? (my set of drupal modules + civicrm extensions)

I have been using "drush make" until now, but I find myself fighting with it more often that I should. For example, it cannot download "civicrm.mo" files (because it does not recognize the mime type). It also does not run composer automatically on projects, and I find it useful to use composer in extensions, to avoid bundling third-party libraries in my git repo. Custom build scripts become clunky shell scripts that re-invent the wheel.

Ideally, I would also like to manage the source code of CiviCRM itself in git, which means running composer/npm install on the code base. This makes it easier to backport patches when necessary, track local changes, and have the same tool chain in dev and prod.

Would composer be a good option for that? For example, I stumbled upon Using Composer to build your Drupal 7 projects, which uses PHP packagist.

I like that drush make or composer reduce the amount of code in your repository, and encourage IMO better development workflows (eg submitting and documenting patches rather than forked codebases).

However I am also running into challenges using Drush, which is quite Drupal-centric and requires some working around rather than with if you don't do what it expects (profile modules to profiles/ folder etc).

Best of both worlds if you build a deployment branch which is the complete codebase, but it does require that the whole team is OK with patchwork and building - this may be a factor.

Two nights ago I noticed that deploying CiviCRM codebase via Git had a cost of an extra 100MB per site (plus some). Not the biggest cost, but may be a factor if hosting many CiviCRM on a server.


Why does CiviCRM render a validation failure without the Wordpress theme? I have a wordpress site http://logisticsworkersnetwork.org/

There is a 'profile' sign-up form on the front page. The sign-up form works fine but there is no CSS or theme html when someone makes a mistake on the form. It goes to this page: http://logisticsworkersnetwork.org/?page=CiviCRM&q=civicrm/profile/create&page_id=2 and just shows the error and the form in pure html. That is, it shows the PRINTER-FRIENDLY version of the page. The console error says:

Uncaught ReferenceError: CRM is not defined  (anonymous function)   @   ?page=CiviCRM&q=civicrm/profile/create&page_id=2:100

NB: I have removed the civiCRM CSS file with Jquery. I also have a few hidden fields which are shown when a validation error occurs. This problem only arose after I switched from my localhost environment to my server (bluehost). I upgraded to civiCRM 4.6.2 (from 4.5.8) when I uploaded the site too.

UPDATE (12/May/2015):
I have tried deleting the 'templates_c' folder but it doesn't work. I have tried clearing the cache.

I can't add a comment (doh, stupid reputation requirement) so I'm answering when Thomas Jaunism wrote: "Why would CiviCRM be trying to load the page.php and not the front-page.php that the form is on?"

The Civi plugin loads the WordPress theme's page.php template because many (if not most) themes define a homepage template which does not contain the_content() but rather collections of widgets and archive views. Loading page.php has proved to be the most reliable way to show Civi content on the front end.

If you want Civi to load a different template, there is a filter for this called civicrm_basepage_template. You can therefore load a different template with code such as the following in your functions.php file:

add_filter( 'civicrm_basepage_template', 'use_my_own_template_for_civi' );
function use_my_own_template_for_civi( $template ) {
    if ( some condition is met ) {
        return 'your-template-name.php';
    }
    return $template;
}


Database table name for events I want to access the details of registered members for an event through database.So I want the table name in which the details of the registered participants will store.

The table is called civicrm_participant which holds all the event participant record

If an single user is registering for multiple user then you can find the registered user using column name registered_by_id

I guess this help


How to fix a login issue on the new CiviCRM gitlab server? Here's the thing. I've had a user account at civicrm.org for years. Now that the old issues.civicrm.org is shutting down I wanted to check out the new gitlab server at https://lab.civicrm.org

That site tells me that I should login using my credentials from civicrm.org, only that doesn't work.

I'm keen to avoid creating a second user account on civicrm.org unless absolutely necessary as that will most likely just confuse things further. I'm assuming something is broken somewhere.

Can anyone offer a solution?

On https://chat.civicrm.org, mention this on the ~infrastructure channel and a Gitlab administrator will give a hand.


Email sent via CiviRules removes unsubscribe token from email template I tested an email template via CiviMail and the unsubscribe link works and the HTML shows it. In the source it comes up as

Unsubscribe here.

But if the same email template is triggered & sent via CiviRules (you can choose the template along with rules and conditions on how to trigger it), the tag shown above gets stripped out leaving just the text "Unsubscribe here" which has no link - just text! So no one can actually unsub.

Does anyone know how to deal with this? Is there a way to just use the link without using the token? I went through the CiviCRM documentation and didn't find what I was looking for :(

I tried the different versions of the tokens related to unsubscribe/opt out but no joy.

Cheers

The problem with the {action.optOutUrl} token is that generates a url which is linked to a send mass mailing.

When CiviRules sends an e-mail it is not a mass mailing but an inidvidual one. Send to one specific contact at the time.

I could understand that you want some sort of link to a profile/optout page. One way to do that is probably create a profile page and link to that page from within the e-mail you send from CiviRules.

Did you solve the issue yourself? If so how?


CiviRules triggers, but fails to send email I'm using CiviCRM 5.18.4 on WordPress 5.4.1.  I have been successfully using CiviRules to send a welcome email when a contact adds a (pending) membership.

Now, I have created a rule that is supposed to send a different ("Membership Confirmation") email when we confirm the person's eligibility and donation:

Linked Trigger:  Membership is changed

Linked Condition(s):  Membership Status is one of   "New"

Linked Action(s):
Send e-mail from [our email address] using primary e-mailaddress with Template "Membership Confirmation" to the contact and bcc to [internal staff] Delay by 5 minutes

Have tried it with or without delay, and with various (simplified) email templates.  Result is consistent:  When we approve the donation, it successfully changes the membership status to NEW, and the Event IS TRIGGERED for that contact.  However, the emails do not get sent, and the emails do not appear in the "activities" list for that contact (although the donation and membership activities do).   No error is reported, and nothing at all appears in the CiviRules Log.

[Note:  I just installed the CiviRules Logger extension, I haven't seen any logs appearing even on events that trigger and work properly, so I don't really know if the logger is working.]

Any ideas?  Could something be wrong with the email format?  Is it the way I have written the rule?  Is something going wrong on the back end?

Thanks for any thoughts!

UPDATE:  I did finally get an error in the Civirules log:

2020-05-12 18:00    error   Rule: 'Membership Confirmation Email' with id 6 failed for contact 595 because of Failed to execute delayed action
Array

(
    [rule_title] => Membership Confirmation Email
    [original_error] => Civirules api action exception: id is not a valid integer. API call: Email.send with params: from_name="[org name]", from_email="[our email]", template_id="74", location_type_id="", alternative_receiver_address="", cc="", bcc="[internal staff email]", file_on_case="", contact_id="595", extra_data="Array"

[reason] => Failed to execute delayed action

)

Can anyone interpret that for me?  Which id is not a valid integer?

When you have a delayed email, it generates a record in the civicrm_queue_item table.  Since you're experiencing the same problem without a delay, this is unlikely to solve the problem on its own, but is a good way to troubleshoot whether an email was generated while isolating confounding factors like cron not running, a bad outgoing email setting, etc.


Send an email to activity targets when activity is created via the API This feels like a simple one but I am not sure if there is a way to do this.

Does anyone know if you can automate an email to a activity assignee when the activity is created and include activity tokens like {activity.subject}, {activity.activity_date_time} etc.

I want to send emails along the lines of:

  Your meeting is scheduled with Michael McAndrew at 'Wednesday 4th March, 2pm'. The subject is 'How can I get more involved with your organisation'.

I haven't tried the CiviRules route yet (not sure if it supports tokens for activity emails) I'm going to try it now.

This will work in 5.24! As the new "tokenprocessor" functionality in core now has support for activity tokens. You'll also need a modified version of the emailapi extension https://lab.civicrm.org/extensions/emailapi/-/merge_requests/3 and you can then use civirules to trigger.


Error when displaying the CiviCRM Menu As an admin, when I want to display the CiviCRM Menu instead of the drupal menu (via .../civicrm/dashboard), I often get the following Error Message :

Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or service provider with more details about what action you were performing when this occurred.
No API key provided. (HINT: set your API key using "Stripe::setApiKey()". You can generate API keys from the Stripe web interface. See https://stripe.com/api for details, or email support@stripe.com if you have any questions.

Then, if I insist, just once, I get to the Civi dashboard page with the civicrm Menu and there is no more message, and every-thing works correctly.

Apart from this, I have no problem with payments via Stripe.

CiviCRM 5.13.2 / Drupal 7.67

This was due to an unused Payment Processor which had no API key.
Deleting this Payment Processor fixed the issue.


Getting a two-column dashboard in CiviCRM 5.33+ After the recent rewrite of the CiviCRM dashboard, many of the sites I work with have only a single column where previously they had two columns.  How does one restore the two-column behavior?

It autoadjusts to screensize. I suppose you could overwrite the specified widths for css:
https://github.com/civicrm/civicrm-core/pull/19235/files


Is there functionality in CiviCRM for tracking the results of a fundraiser? In a recent fundraiser we got a group of people to sell food for a place and wrote down the orders, for who ordered them and who sold them.

Is there any sort of functionality in CiviCRM for tracking these metrics?

Check out the soft credits functionality!

https://book.civicrm.org/user/current/contributions/soft-credits/


How to modify the country list and their id? I would like to edit the country list to add some countries, for example British West Indies. How do I do that? directly into the table civicrm_country?

I also want to know if I can add my own dropdown custom field with my own key-value country list. It seems I can only add 10 choices, and then one by one. Isn´t there a way to paste my key-value country list into a field?

Many thanks!

You can obviously edit the data directly in the table. Extension https://github.com/CiviCooP/org.civicoop.general.api.country provides an API for Country, you could use that as well


Certain data is not displaying on records I just created a custom field for a multi-select list using tab with table. When I add data, the tab correctly shows that there are four items saved to this field, but the actual items are not displaying. See image attached.

Having another similar problem, not sure if they are related.  We have employer-employee relationships.  The employer properly displays on the employee summary.  Both employer and employee show a relationship, but when you go to the Relationship tab, nothing is displayed.

I did work in a staging environment, and this worked.  What could be causing this problem on this instance?

FYI, I found a work-around by changing from "tab with table" to "tab". Also when I checked the staging environment that I used for testing, there were two fields in the custom field group, the multi-select field and a text field, that I no longer needed.  Although it worked fine with "tab with table", once I deleted the text field that I no longer needed, it no longer worked.  Seems like a bug to me.


can't access to joomla administrator panel after reinstalling civicrm on joomla, I can't access the administrator panel because "Fatal DB error, exiting, seems like your schema does not have civicrm_setting table" - any idea? solutions? thank you...

SOLVED - I think this is not exactly the right way but I've deleted the civicrm folders in administrator -> components, in components and in plugins -> user (on the server) and the tables in the database... now I can access the administrator panel


API Contributions and Payments I'm using the API to create Contacts start Memberships through a signup form. We are offering 1-year memberships at various price points, and I have those set up in CiviMember. My code successfully creates Memberships.

What I'm trying to figure out are the API options for payments. There are API options for creating both a Contribution or a Payment.

Do I need to create both in my API call?

What I found was that a Payment requires a contribution_id, so it seems like they're connected. In another question I saw it's possible to associate multiple Payments with one Contribution. It just seems these two concepts duplicate a lot. Is it correct then that a Contribution just records that a Membership price was agreed to, so it's like an itemized bill at a restaurant? And then that a Payment can be $20 in cash and the rest on a card (one or multiple Payments)?

Also, we accept checks, so I noticed that a Contribution can be marked with is_pay_later to capture that. Would that flow for a person registering with a check be that I create a Contribution with the API at first-signup to record their agreed-upon "bill," and upon receiving the check later a person manually enters the Payment in the backend?

Each contribution should have one or more payments.

When you are creating contribution using contribution api with completed status a payment is recorded automatically.

If you creating contribution with pending status eg incase of check payments then when you receive payment from bank you use payment api to record payment for the pending contribution

In your case if you recording membership via code then i would suggest you to use Order api where you can pass membership and contribution params in the api params and it will create all required records in one call. You can refer here on how you can use order api to create membership or participant records with its payment in one call.
Cheers
Pradeep


URL issue with AWS load balancer and SSL certificate I recently installed Civicrm on AWS. App works great! However, when I creat a load balancer with a SSL certificate and point the Domain towards the LB, I get a 503 page. If I don't use SSL, everything works fine.

What am I missing?

You should look at log the load balancer. the 503 might be generated there (ie. the LB can't reach the backend) or it might be that the LB can reach the real servers hosting civi, but they can't process the request

Assuming you trust amazon (a big assumption), you might want to say that the https LB can talk to an unsecure civi server (via http).

Otherwise if you want to be more secure and don't trust amazon, you might need to configure your civicrm server so they handle https too.


What is the best approach for displaying / modifying behavior of Activity Subject & Custom Field? I have several custom fields in for a CiviCRM Activity ("Client Need"). Which of the following scenarios would be the best approach for me to sort and view Activity Summaries? And how would I go about doing that?

When data is collected into the "Client Need" custom field, dump that data into the CiviCRM "subject" field as well. In other words, these two fields essentially would need to mirror each other at all times.
Edit the default "Activity Subject" field so that it is a drop-down with a list of options when someone is entering a new Activity into the database. If that's possible, then I can just completely remove the secondary "Client Need" field.
Collect the data in the Client Need field, don't collect data in the Activity Subject field, and modify CiviCRM's default behavior for displaying the Activities, so that it displays the custom field instead of the activity subject field (so in the below screenshot, display Client Need field, and don't display Subject field):

If you need to adjust Subject to be a select field for use directly in Civicrm then would need to change the field type in the db and customise so it uses a set of Option Values

If the data is mostly being added via a Webform then you can adjust the widget on the Component and set it up as a Select field without needing to mess with the machinery


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?

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.


Search results - detail pane I realise this probably requires custom development, but curious if anyone has considered a two pane search results, where the left pane is the listing and the right pane a detailed contact record.  The aim is to improve/speed up navigation for user looking at records.

If you mouse over the icon on the left of each result row a popup comes up with more details on the contact. This does help isolating the correct record when reviewing results.


Wordpress Civicrm doesn't seem to generate invoice from other user roles except administrator CMS: Wordpress 4.9.6

CiviCRM: 5.2.1

I'm trying to generate Invoice with the below url, Which is working fine when I login as administrator. but when I login as actual member to download Invoice from WordPress front end with the same url giving me this error

  Sorry, you are not allowed to access this page.

( I gave this civi permission

CiviCRM: view my invoices
Allow users to view/ download their own invoices

to all user roles).

http://devsri.mywebsite.com/wp-admin/admin.php?page=CiviCRM&q=civicrm/contribute/invoice&reset=1&id=48657&cid=35509

Its working when I give below(CiviCRM: access CiviCRM backend and API)permission

"CiviCRM: access CiviCRM backend and API" Master control for access to the main CiviCRM backend and API. Give to trusted roles only.

But I cant give this permission to a member just to download Invoice. In drupal its working with "CiviCRM: view my invoices" permission. I wonder if its a bug in Civi Wordpress??

Did anyone experience this? or Am I missing anything here?

TIA

I found the problem here. actually there is some issue with CiviCRM Wordpress codebase because its always failing to get wordpress user id.

Below checkDownloadInvoice function using drupal global $user; to get logged in user id for wordpress as well.

CRM_Core_Permission::checkDownloadInvoice

public static function checkDownloadInvoice() {
    global $user;
    $cid = CRM_Core_BAO_UFMatch::getContactId($user->uid);
    if (CRM_Core_Permission::check('access CiviContribute') ||
      (CRM_Core_Permission::check('view my invoices') && $_GET['cid'] == $cid)
    ) {
      return TRUE;
    }
    return FALSE;
  }

for WordPress It should be changed to

public static function checkDownloadInvoice() {
    $uid = get_current_user_id();//changed for WordPress
    $cid = CRM_Core_BAO_UFMatch::getContactId($uid);//changed for WordPress
    if (CRM_Core_Permission::check('access CiviContribute') ||
      (CRM_Core_Permission::check('view my invoices') && $_GET['cid'] == $cid)
    ) {
      return TRUE;
    }
    return FALSE;
  }

Hope it helps someone in future. :)


Searching for incomplete fields Is it possible to search for a list of records for which a specific field has not been completed?  For example, if the options in the custom field are 'yes' or 'no', is it possible to find which records have not had either of these selected?

Yes, you need to use the Search builder : Menu search -> Search builder.

Then you can choose the record type, the field and most important the operator : you have empty or is null (not defined) which should work for your need.


Medical Certificates expiration To contact athletes need to register medical certificates. I added a custom field multiple date expired. How do I retrieve all the contacts that do not have a date or that date has expired? How do I get a monthly list of certificates that expire?
Thank you.

Marco

You can use the search builder to search any fields that are empty or null:

civicrm/contact/search/builder?reset=1 (should be in your Search menu item)

We also use a report for tracking a very similar thing. We use the Contact Report (Summary) Template (it might say Constituent instead of Contact)

As long as you've built the field to be searchable, it will be included in your report (this is a check box at the bottom of the field)

You can then select the fields your interested in seeing and filter the report to show those where the field "Expiry Date" = This Month

We trigger this report to be emailed on the first of the month so you can immediately see who requires renewing.

As you're using a relative date, it will always be current for the month you're in.

You can also build a smart group this way, and always have a current list of those who will expire this month which you can use in searches / mailings as you need.

Hope that helps.


Custom fields for invoice / PDF I know that sticking in a contact-related custom field to the invoice template is just "contact.custom_xx" (where xx = custom field id).

We're trying to do the same for a Contribution-related custom field, but the syntax:

contribute.custom_xx or contribution.custom_xx is not working.

Any suggestions?

Tokens are available only for contact related columns -
if you want to use contribution related columns as tokens then you need to create an extension and add token hooks for making the values available in tokens list

Please refer to the following link for creating token hooks

http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_tokens

http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_tokenValues


Does the system status check and upgrade version check only list available updates for in-app extensions? It seems like extensions which are listed in the extension directory but not available for in-app distribution are not included in update checks. They also don't appear in the sites/default/files/civicrm/upload/cache/extensions.json file which seems to be the list of available updates it retrieves. I've run the version update job and "refresh" button on the extensions page manually and can see it downloads a new one.
So for example on the status page it says all extensions are up to date but I know they are not.
Is this a local config issue or is this just how it works?

So I discovered what you can do is put this in civicrm.settings.php:
$civicrm_setting['domain']['ext_repo_url'] = 'https://civicrm.org/extdir/ver={ver}|cms={uf}|ready=';
Note the ready= at the end (the default is without it).
This then properly shows you pending upgrades for your installed extensions that are in the extension directory but not approved for automatic distribution. The downside is it now lists all the available extensions for your civi version on the Add New tab on the Extensions page as if they were approved for automatic distribution.
An alternative is I've made an extension that adds a status check to show you available updates for your extensions that are not automatically distributed: https://civicrm.org/extensions/notify-about-upgrades-unapproved-extensions