Is there a token for contribution type? There seems to be tokens for all sorts of contribution things but not for the financial type.   Maybe I'm missing it somewhere.

We're doing tax letters and the type ends up being the fund the people donated to, which we'd like to include in the letter.

I thought I had tried the obvious but must have had a typo.  It is there but it isn't listed in the list of tokens. It's {contribution.financial_type}.  Should it be listed?  If so, it looks like a bug.

It didn't take much make it show.  In my test version I hacked SelectValues.php and added financial type to the contribution token array.  If I looked at the latest versions of that file it doesn't seem to be there either.


Coding of civimail header body and footer - best practice I've seen several questions about how to use civimail header/footer but can't find a best practice for coding.

I know email coding can be hairy especially since clients handle things differently and there is no "standard."  I've done some basic homework. CSS styles are typically inline.  There is usually the standard HTML document structure with DOCTYPE, head, and title tags.  The styles are placed in the /head section.  The "problem" is that (as I understand it) HTML requires only one /head /body tag.  So if we want HTML in the Header / Body / Footer how should it be coded?  Is there a post-process to strip or merge tags?  Sorry if this is naive, this my first foray into email coding.

Note: I tried to put all the styles in the template header but they were ignored in the body (probably a scope issue.)

I see a related question: How can I use <html>, <head>, <body> tags in a mailing? however, I'm not using CKeditor and still have issues.

Do we need some sort of Wrapper Template defined?

I've been using something like this by adding HTML to the CiviMail Header and Footer options.

https://gist.github.com/danaskallman/57616e7d17cc4c4f5050
https://gist.github.com/danaskallman/1a40f03900a631c6389b

It works nicely, wraps around the content area so that no HTML has to go in that area if not wanted to do so. Works best with Single column newsletters, which I believe work best on mobile anyway.


CiviCase + CiviRules + Tokens I would like to trigger an email to a particular Role on a Case (not the Client) when a Case Status is changed. Is this possible? I've added the CiviCase Tokens Extension, and I can create a message template to be triggered (containing CiviCase tokens, such as the name of the client), but CiviRules doesn't appear to have the option to specify a different email on the Case.

I tried to use the token {case_roles.role_email} in the 'Use alternative email' option in CiviRules, but it doesn't see that as a valid email address.

Any other ideas I can try?

You can do this with CiviRules. The trigger is then Case is changed. At the condition you can select Field Value Comparison to check for the right case status.

At the action you select: Send E-mail to contacts on a case'

It might be that you need two condition with the field value comparison, one of the old case status and one for the new case status.

You need for this the CiviRules extension and the Email api extension.


class Civi not found I'm trying to use the Civi class to debug an extension with build kit,
but after I add this line:

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

to my class I get:

ampuser@58e3a823b9ee:/opt/buildkit/build/dmaster/sites/default/files/civicrm/ext/api4$ phpunit4
PHP Fatal error:  Class 'Civi\API\V4\Civi' not found in /opt/buildkit/build/dmaster/sites/default/files/civicrm/ext/api4/Civi/API/V4/Action.php on line 117

I feel like this ought to work out of the box... am I doing something wrong?

This feels like a variant of this and this question ... but different in that I'm looking for the pattern to call a core class

Ok, so it turns out I was kinda doing something wrong...

What I needed was a simple \ prefix:

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


Civcrm Refund - why are amount and fin. type are based on (priceset) rather than line_item? For non-'test'/Dummy refund (e.g. Authorize), the refund 'contribution' details for a 'contribution' consisting of 2 line_items (a price and a service fee) are getting assigned the same financial type and total amount (with sign reversed) instead of retaining the line_item values. For example, a refund for an event where the price-set includes an event_fee of $20 and service_fee of $2 should have -$20 for the event_fee and -$2 for the service_fee, and the financial-types not changed. In CRM/Contribute/BAO/Contribution.php, both the event_fee and service_fee amount is set to -$22 and service_fee financial type is changed to 'event_fee' type.
   I modified the code in (Civicrm 4.7.23) CRM/Contribute/BAO/Contribution.php.  Is there a reason NOT to do this?

Your modification is almost certainly correct.

Line items are an area of the code that was traditionally weak, but have come a long way in the last year.  My recommendation is to submit a bug report on issues.civicrm.org, and your patch on Github.  The review process means that this question will be answered by the financial experts. Financial improvements are generally reviewed pretty quickly.


Effect of address change on current employer I need your opinion on a standard CiviCRM behavior:

When you add or change the address of an individual AND you check "Use another contact's address", AND that target contact is an organization, then the current employer is changed + the "employee of" relationship.
Regardless of the location type.

This makes sense for location type "work". But why does this happen for all location types?

Wouldn't it better to limit this functionality to location type "work"? Or add a checkbox on location types, so users can specify on which location types they expect that behavior?

@AlainB I totally agree that this should not happen for all location types. Do I understand correctly that:

I change the address of John Doe
I tick the 'use another contact's address'
I then select organization CompanyB

and then companyB automatically becomes the employer of John Doe?

That sounds like unwanted behaviour to me, I would not expect the employer to change automatically even if I changed the work address.


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

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

I received a similar message when trying to create a 'Provides Membership to' relationship. If you go in the civicrm_membership table for that contact ID, you will see that the join_date, start_date and end_date fields are all NULL. Set them to the correct values and it should work.

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


dedupe rule using birth date is not working using drupal A dedupe rule using birth date is not working with drupal CMS. I receive the message "unknown error, please contact your administrator". The rule is working well in WordPress

This sounds odd since it should not be CMS related. I tested on dmaster - set up a DoB based rule, it worked

Link is below but will be removed when site next rebuilds in a few hours

https://dmaster.demo.civicrm.org/civicrm/contact/dedupefind?reset=1&action=update&rgid=8

Is it possible you made an error setting up your Rule?


How can I identify the hard contributions/contributors that lead to a soft credit? I have just upgraded from 4.4 to 4.7.19 and can't seem to identify a certain group of contacts now that the "In honour of" functionality has been subsumed into Soft credits.

When admin processes a membership, if the box "Record Payment from a Different Contact?" is ticked you can record that the payment for the membership was made by someone other than the member and send the receipt to the "other" rather than the member.

This results in the actual contribution being recorded against the "other" contact and a soft credit being recorded for the member.

I need to create a smart group of all the "paid for someone else" contacts for a certain soft credit type.

In Advanced Search with results displayed as contacts, when defining contribution search criteria the options for the Contributions OR Soft Credits? field are:

Contributions only
Soft credits only
Soft credits with related Hard credit
Both

(With the last three options a box that lets you specify soft credit type appears.)

Based on the names of the options, my plan was to create groups of contacts from  "Soft credits only" and "Soft credits with related Hard credit** searches and use the include/exclude custom search to create the "related hard credit contacts" group.  But it doesn't work.

I would have thought Soft credits with related Hard credit should have given me a list of both the contacts getting a soft credit and the contacts who made the contributions that lead to the soft credits. However the results for Soft credits with related Hard credit are the same as the results for Soft credits only AND the results for Both are also the same.

This is true whether I am displaying results as contacts or as contributions.

So, I am not sure how the last three options differ from each other and I am no closer to being able to identify those people/organisations who paid for someone else's membership.

I did look at Search Builder also, but it does not seem to recognize any of the soft credit fields.

Does anyone have any suggestions?

I just published an extension called Soft Credit Custom Fields.  As a side effect of what it does, it also allows you to search for soft credit type even when returning hard contributions, which should solve this issue.


Unsubscribe link shows all groups in Civicrm When an email recipients clicks on the unsubscribe link in a Mosaico email, every group in Civi is revealed. EG Are you sure you want to be removed from the mailing list(s) shown below: 100 plus groups appear This happens whether the person is subscribed to all of the groups or not. Is there a way to ensure that they just see the group that they are subscribed to? Some of the information revealed is potentially sensitive.

I would suggest using the GDPR extension to manage group subscriptions. The extension will provide finer grained control of which groups are displayed and how they are shown to subscribers etc.


Why are emails not being sent when a contribution is made? We are using CiviCRM 5.35.0, but I have tracked this issue down to the installation of 5.34.0 (updated from 5.33.2). Our CMS is Drupal 7.78. Our PHP is 7.3.27. Our outbound mail setting in CiviCRM is "mail()" and this continues to work for most mailings.
However, starting right after I installed 5.34, when a contribution is made, CiviCRM does not seem to actually send the expected emails (receipt AND profile submission notifications). In the contact's contribution record, it says that the email receipt was sent, but neither the contact nor myself (I am cc'd on those receipts - setting on the contribution page) gets an email.
Our Payment processor is Stripe and we are using the Stripe Payment Processor extension version 6.5.7. All extensions are up to date. Stripe continues to send its receipts directly, so at least our users are getting those.
As far as I know, this issue is only occurring when emails are triggered by a contribution. Otherwise, the system's emails seem to be going out as expected.
Anybody have any ideas what might be causing this?
Thanks.

I narrowed this down to one particular contribution page. Others were working as expected. I don't know what the problem was, but I worked around it by simply creating a replacement for that contribution page. Thanks to everyone who gave this some thought.


Clickatell SMS Troublshooting I'm runnning the bitnami image on Google cloud (5.0.1), trying to get sms reminders working.

Provider Account is set up and tested, extension installed and configured, but when I send a test sms it is reported as delivered by Civi, but it's not, and nothing appears in the providers reporting either, so I assume there has been no actual communication with the gateway.

How can I troubleshoot this? Does the extension work with 5.1?

Aha, nothing wrong with either extension, after some time I finally noticed the timezone mismatch with the server


How can I hide non-mailing list groups in receipts? At the moment, when someone signs up for a membership or makes a contribution, the receipt returns a list of their newsletter subscription groups AND non-mailing lists group assignments.

How can I hide the non-mailing lists group assignments from the receipt?

In CiviCRM 4.6+, this only happens if the user receiving the receipt has a user account, and that account has the "View All Contacts" permission.  See CRM-16433 for details.


“MySQL support not included in PHP” I have drupal running perfectly; with mysql support. But CiviCRM still giving me this error - “MySQL support not included in PHP.”

My PHP version is 5.6.31, as indicated in the screenshot below.

Your drupal may be using a different mysql driver. CiviCRM recently migrated to requiring mysqli. See https://civicrm.org/blog/totten/psa-please-verify-php-extension-mysqli for more details.


What is the best way for an end user to get all the contact and activity data from the database? Our group is using CiviCRM to house membership data for a small food cooperative.  We've lost our web developer and we're trying to get all of our data out of CiviCRM with only the user interface tools.  I've tried the various search tools, but the results are perplexing.  When I go to Search >> Find  Activities and search without any filtering, I get 124 activities.  When I do Custom Searches >> Activity Search without any filtering, I get 898 activities.  The discrepancy between the two is confusing, but if I assume the custom searches gives me the complete list, then my problem is that custom search doesn't allow me to specify which fields to download.  The regular activity search provides over 80 data points whereas custom search only gives 13 data points.  Feel free to point me to documentation if it's covered out there.  Thank you.

The difference in counts might be explained by the fact that at one time Find Activities only returned results where the With Contact field wasn't empty, and a quick check on the public demo suggests that's still true.

That also seems true for Advanced Search.

You can also try Search Builder, but the list of fields is minimal.

If you're using Drupal, you could try creating a View on the Drupal side that lists the activities.


How to show "Formal Title" on the view Contact screen? A previous developer repurposed the "formal title" field to be used as "badge name" for events.

The problem is that when viewing a contact, it doesn't show there unless you go to edit the name.

I found a "recipe" for displaying formal title as part of the general display of names, but that is not what we want.

How can we 1. display the "formal title" field when viewing a contact, but 2. not display it as part of a name everywhere that a name is displayed?

As @coleman says and as I also mentioned in my comment above, you can create an extension as explained here or you can use an existing one and implement  hook_civicrm_contact_get_displayname, somthing like this:

function myextension_civicrm_contact_get_displayname(&$display_name, $contactId, $objContact) {
    $formal_title = civicrm_api3('Contact', 'getsingle', array(
        'sequential' => 1,
        'contact_id' => $contactId,
        'return' => 'formal_title',
    ));
    if(!$formal_title['is_error'] && !empty($formal_title['formal_title'])){
        $display_name = $display_name . ' - Formal Title: ' . $formal_title['formal_title'];
    } else {
        $display_name = $display_name;
    }
}


Dequeue Backbone from theme load and load CiviCRM Backbone I've got a WordPress theme that's giving me issues with the Backbone JS module.  According to https://issues.civicrm.org/jira/browse/CRM-17352, it's because CiviCRM isn't running Backbone in no_conflict mode.  Unfortunately, I'm not familiar enough with all of this to figure out where the no_conflict() call would be placed in the code.

According to Backbone isn't loading on Civi 4.6.11/WP 4.4.1, Andrew West suggests dequeue-ing the theme's loading of Backbone, and enqueue-ing the CiviCRM backbone.  I get the concept, understand how to limit the if statement to the civicrm base page, and already have the child theme, but I'm unclear of how I tell it to enqueue the specific version of Backbone for CiviCRM?

EDIT:  Adding var Backbone = Backbone.noConflict() to wp-content/plugins/civicrm/civicrm/packages/backbone/backbone.js blows up in an impressive array of 15 errors on the Manage Online Event page, with Backbone Undefined.  Scary thing is that it seemed to render more of the page, but still not correct.

Assuming the file you want to load is the one located in the CiviCRM plugin folder at 'civicrm/packages/backbone/backbone-min.js', then you'd use:

wp_enqueue_script( 'your_backbone_handle', CIVICRM_PLUGIN_URL . 'civicrm/packages/backbone/backbone-min.js', array(), CIVICRM_PLUGIN_VERSION );

See https://developer.wordpress.org/reference/functions/wp_enqueue_script/

The only slight issue with this is that the constant CIVICRM_PLUGIN_VERSION is not updated with each minor dot release (it should be) which means that you may need to manually bump this each time you upgrade CiviCRM in case it ships with a new version. Replace it with your own version numbering in that case.

Disclaimer: I'm not sure if this is the only Backbone-related file you need to enqueue. Also, this may not solve the issue with your theme but it is the method by which you should target CiviCRM's copy of Backbone :-)


How do I print the "received date" on an invoice? I have an urgent problem with invoices. For our finance department, I have to print out all invoices we generated this year.
On the invoice, it HAS to display the date the invoice was issued, but instead it displays the date that I print the invoice.

In the template, the line

  {ts}Invoice Date:{/ts} {$invoice_date}

gives me the CURRENT date, not the date the invoice was issued.

I have looked for other variables I could use, but I had no luck finding anything.

Does anyone have a solution for this?

I came accross the same issue. The invoice date gives the current date and that is in most cases not correct.

We have used the receive date of the contribution in the invoice template as follows.

...
{crmAPI var='contribution' entity='Contribution' action='getsingle' id=$id}
...
{ts}Invoice Date:{/ts} {$contribution.receive_date|crmDate:$config->dateformatFull}
...

The top line with {crmApi...} could be present already in the template. So check whether you can find that line. The {crmApi...} line is not defined before the {$contribution....}


How to display an Event's custom field on its registration form I have a custom field set with fields used for managing extra data on the event.
I want one of the custom fields' value to be shown in its registration form.
What is the Smarty expression to put in the 'Register.tpl' file so that I could show this custom field in the registration form.
Clarification - this custom field is not on a Participant, but on the whole event.

I guess the custom fields for Event are not available in smarty on Event registration form but are available on Event information page. But you can retrieve the custom fields for an Event using api. You can use below snippet in tpl file to get custom field data

{crmAPI var='result' entity='Event' action='getsingle' return="custom_81,custom_82" id=$event.id}

The return value specifies list of custom fields that i would like to retrieve. You can remove return option if you would like to get all the Event data including custom fields.

  To print you can use {$result} variable eg. in above case i would use
  {$result.custom_81} and {$result.custom_8}

HTH

Pradeep


adding colour/color button to Ckeditor I'm trying to add colour/color buttons to Ckeditor on a new site. I've done it on a previous site using configuration option for the editor in Administer >> Display preferences, but either I have forgotten something or something has changed with an upgrade.

As described in How to restore the colour button in Ckeditor I add the Colorbutton plugin, but no buttons appear. The color group was already there but it remains empty. I can't see any options for adding or moving individual buttons (just hiding buttons or adding separators).

I've tried clearing caches, but as it doesn't show in the config screen I don't think that is relevant.

CiviCRM 5.15.1 and WordPress 5.3.1

If clearing your browser cache and templates_c doesn't work. Try adding in both the Civimail and CiviEvents tabs - not just the default tab.


Donor access to edit recurring donations WP 4.8
Civi 4.7.21
iATS Payments 1.6.0

Our donors have very limited ability to edit recurring donations. Ie. if their card expires they cannot update the expiry date. Or if the card number is changed, they cannot update to a new card number.

As admin, I can see an update card info but the donor cannot.

I have looked at ACL but have not seen anything there that looks like would give/restrict that ability.

Is there something I am missing in the ACL or is this an iATS Payments setting?

A friend asked for the links that are used in case they can be put in to receipt template. this is what i dug out of contact dashboard

civicrm/contribute/updatebilling?reset=1&crid=XXXX&cid=YYYY

civicrm/contribute/updaterecur?reset=1&action=update&crid=XXXX&cid=YYYY

civicrm/contribute/unsubscribe?reset=1&crid=XXXX&cid=YYYY

not sure how useful this is but wanted to paste it somewhere other than skype ;-)

--

Evan's findings.

WordPress 4.7.3 | CiviCRM 4.7.22 | iATS Payments 1.6.0

Providing a link to update / cancel a recurring donation should be included in the receipt, and it is. Sort of. From the iATS Payments 1.6.0 release notes:

  "Cancel/modify URL receipt links are wrong. This affects recurring contributions. You can manually edit the message template to fix this."

https://github.com/iATSPayments/com.iatspayments.civicrm/blob/master/release-notes/1.6.0.md
https://issues.civicrm.org/jira/browse/CRM-20401

While debugging using the Send Receipts workflow from a contribution search, it was discovered the URLs in these links are built correctly. When sent automatically from the creation of a contribution, the links point to iATS website, when sent from a contribution search they're. As such, I was able to get the URL scheme of how it should be built, see below.

civicrm/contribute/unsubscribe&reset=1&coid={contribution.contribution_id}&cs={contact.checksum}

civicrm/contribute/updatebilling&reset=1&coid={contribution.contribution_id}&cs={contact.checksum}

civicrm/contribute/updaterecur&reset=1&coid={contribution.contribution_id}&cs={contact.checksum}


Crash in upgrade to 5.35.1 on task core-issue#365 - Add created_date to civicrm_action_schedule While upgrading several of my sites to 5.35.1 (from 5.28 or later) I experienced a nasty database crash in the step called core-issue#365 - Add created_date to civicrm_action_schedule
$Fatal Error Details = Array (
 [callback] => Array ( [0] => CRM_Core_Error [1] => exceptionHandler )
 [code] => -1
 [message] => DB Error: unknown error
 [mode] => 16
 [debug_info] =>
   ALTER TABLE `civicrm_action_schedule`
   ADD COLUMN `created_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP
               COMMENT 'When was the schedule reminder created.'
   [nativecode=1118 ** Row size too large. The maximum row size for the used
   table type, not counting BLOBs, is 8126. This includes storage overhead,
   check the manual. You have to change some columns to TEXT or BLOBs]

What can I do?
(Note in my case this is not related to Upgrade fails with Row size too large error)

Of course

you ran this on a development copy of the site first, so you're not panicking, right?
you took a backup before your production upgrade, and can roll back to that?
you wished you had?

If you can, revert your database to a pre-upgrade backup
Then run this SQL on the CiviCRM database: OPTIMIZE TABLE civicrm_action_schedule;
Then repeat the upgrade.
If you didn't have a backup
Then run this SQL on the CiviCRM database: OPTIMIZE TABLE civicrm_action_schedule;
Then try to resume the upgrade procedure. If you're  on the command line you can use cv upgrade:db which will probably suggest you run cv upgrade:db --retry.
Hopefully it runs through clean for you now.


Payment Gateway return URL I'm trying to integrate CiviCRM with a payment gateway. I'm using the method notify where user will have to key in credit card detail in payment gateway website.

I have followed CiviCRM guide at

CiviCRM Wiki: Example of creating a payment processor extension
CiviCRM Wiki: Create a payment processor extension

However i'm not clear on the return URL. In the payment gateway configuration I can enter the URL so that after the payment is made, it will redirect the user back to my CiviCRM website. However i'm clueless on the value that I should enter.

Update

The payment gateway is senangPay.my (specific to Malaysia, accept visa/mastercard and bank account transfer). The guide for integration is available at http://guide.senangpay.my/manual-integration-api/

The still in progress plugin is available at:

https://github.com/zulazri/senangPay_CiviCRM

Update 2 (implemented answer from Chris Burgess)
Added handlePaymentNotification() but it does not seems to work. It does not execute the function. Refer to GitHub I just added redirect URL to thank you page. However when I tried it just return to main page. FYI when payment gateway redirect the user back to CiviCrm page it will redirect to http://civicrm.secretgroup.my/civicrm/payment/ipn?processor_name=senangpay&status_id=0&order_id=144283261515&transaction_id=14428326334290&msg=Your_payment_was_declined._Please_check_with_your_bank._Thank_you.&hash=07a5b4aa22b086bfe583f97474ca3401&component=event&contactID=39&contributionID=31&contributionTypeID=4&eventID=1&invoiceID=f237d39119b5c7f358127bbf8287e49f&membershipID=&participantID=13&qfKey=2f9e11313ad9d55bec78f759dfdad420_9895

Thanks!

Where you return the user depends on your gateway's payment workflow. There are a couple of options.

If the user is returned without additional information (the gateway handles payment confirmation via direct comms between your server and theirs), then you can simply return the donor/registrant to the final "thanks" page.

If the user is returned with additional information (the gateway notifies of payment via some additional tokens / parameters in the browser redirect) then you might want to return the user to civicrm/payment/ipn, in which case you'll be implementing handlePaymentNotification() in your payment method.

If users are redirected back to the IPN you need to consider handling duplicate IPN attempts (browser reload, or IPN from both browser and gateway) by making sure you don't close off the transaction twice. You will probably also want to send an appropriate redirect for browser IPN so that the donor / registrant ends up on the right page eventually.


How to show a CSS class of a contribution form based on Stripe iFrame element via jquery? I would like to add a jquery in my extension,  as I enter the card details on the stripe, the submit button should show, otherwise hide. Since the new stripe element is served on an iFrame, I am struggling to figure it out, although I have targeted the parent class, still no avail... Can anyone help please? Here's my code..

CRM_Core_Resources::singleton()->addScript("
  CRM.$(function($) {
    showSubmit();
    $('div#billing-payment-block div#card-element .__PrivateStripeElement input.__PrivateStripeElement-input').bind('change keyup click blur', showSubmit);
    function showSubmit() {
        let cardValue = $('div#billing-payment-block div#card-element .__PrivateStripeElement input.__PrivateStripeElement-input').val();
    if (cardValue.length> 0) {
        $('span.crm-button.crm-button-type-upload.crm-button_qf_Main_upload.crm-i-button').show('slow');
      }
      else {
        $('span.crm-button.crm-button-type-upload.crm-button_qf_Main_upload.crm-i-button').slideUp('slow');
      }
    }
  });
");

You can use the Stripe element events to trigger something - see https://stripe.com/docs/js/element/events

We do that in the Stripe extension here: https://lab.civicrm.org/extensions/stripe/-/blob/master/js/civicrm_stripe.js#L281

There are some useful CiviCRM/Stripe extension events which help with frontend integrations and we are open to adding more: https://docs.civicrm.org/stripe/en/latest/events/


Multiple insances of a custum field for one entity How do I implement a custom field where I can input multiple instances of that thing.

For example I want to add Hobby custom field to Contacts. But a person can have more than one hobby. Is there  a way I click add another hobby, and then another etc.

Is there a way to add an arbitrary number instances of the same filed?

It is not so much the field you set to multiple, it is the custom group! So for example, many contracts.

You can add multiple custom fields for contacts ONLY (including individuals, orgnaizations and households). You need to check the box Does this Custom Field Set allow multiple records? (see attached screen print) and then you can add multiple hobbies.


Custom Case Fields do not work in Drupal Views I have correctly setup views to work for civicrm fields and am also using the civicrm entity module for Drupal to expose fields. In my testing it seems like the custom fields work for certain types of civicrm components. For example, if i use a custom field for All Contact Types then it works correctly and even the dropdown shows CiviCRM:Custom - Field name. However, for a custom field for Cases it does not work and has the same issue i.e. refers to SQLSTATE[42S22]: Column not found: 1054 Unknown column 'civicrm_case.custom_3' in 'field list'. Has anyone had any success in using custom civicrm case fields in Drupal views?

I spent some time on the setup of the Views and it does actually work. However, what is missing is the relationship in the View. It is subject to the type of view you try to create and the relationships. Also remember to choose the CiviCRM Custom: [Field_name] instead of the one provided by CiviCRM Entities.


Should one choose contact types or groups when organizing data and how can one customize built-in details I'm setting up civi on a Wordpress site and after reading all that I could find I still have tons of questions with no-one to ask.
My NGO that has members, volunteers, people interested in NGO's activities but who don't fall into the first two categories.
My problem is that I'm unsure in how to properly setup the data, ie. should I just enter individual contacts and then segment them by adding them into member, volunteer or similar groups or stick with Member or Volunteer contact type?
The problem in the second option is that when a volunteer decides to become a member, change from one contact type to another deletes the data from the first and the only way to go about it is to merge the data but it seems like a clumsy way to work with it. Similarly, if a person decides to stop his membership he's still a member contact type but with that added info.
Also, if I want to use civiVolunteer for working with volunteers does the choice from the second paragraph affect it in any way?
Same thing with wanting to add contact data of other NGO's, public administration bodies and similar - are groups or contact types the way to go?
Also, is there a way of expanding the demographics field that doesn't rely on adding new custom data segments because the custom data I would add would fit nicely into demographics? And, can one remove the employer, job title, nickname and so on fields from contact details because, for the life of me, I haven't been able to find it?
Thanks a bunch.

Many of these questions are going to be specific to your organization's needs, and there are multiple legitimate ways to organize your data, depending on the mental model the users will have.
With that said, here's some info:

Using groups is more lightweight than contact subtypes.
It sounds like you're using custom field groups specific to certain contact subtypes, which is a good reason to consider contact subtypes.  However, it sounds like maybe you're using the custom fields to capture data specific to membership, which likely belongs on the membership, not the contact itself.
A contact can have multiple contact subtypes.
If you could edit your question to say more about data that's "merged" when moving from volunteer to member you could get more specific help.  If there's data that applies to both members and volunteers they shouldn't get separate sets of custom fields.
Since it sounds like memberships aren't permanent, it may be worth making a smart group of members based on a membership record in CiviMember.
It sounds like you want the Contact Layout Editor extension to customize your summary screen.


Paid Event - free for members Is there a way to setup a paid event which is free for members?  Is CiviDiscount necessary for this?

CiviDiscount can calculate an automatic discount based on criteria such as current membership for individuals.


Stopping robot registrations Some months ago we started getting a bunch of robot spam users registering on the website. Both a CMS (Joomla 3.9.24) and Civi (5.33.2) user/contact are created with only firstname, lastname, and email. Here's what I've investigated:

I checked to make sure the reCaptchas were functioning and increased those settings.
I've looked at the Civi logs and tried logging page activity in the CMS (with extensions), but I'm not finding any clues as to what page these robots are registering on. It's clearly a Civi-related page, because a Civi contact is created.
I disabled the public mailing list sign-up profile temporarily and still got robot registrations.
I've changed the settings on public "stand alone" profiles to send me a notification email when someone uses them. Still getting registrations without any Civi notification.

What are some next steps to help me figure out where these are coming from and how to stop them? I know there is a Civi extension to up the game with reCaptcha, but if I'm not sure what page/profile to deploy it on, I'm not sure how that would help.

One of the steps we did in Civi was to set our Available Countries. This does not allow user registrations unless they are from within one of the countries on the list. Most of the spammers are operating in specific countries, so if you are not needing the whole world to have access to your forms, then you can do this to block out a large % of these guys.
Admin>Localization>Languages,currency,locations then scroll down to Available Countries and add the one(s) that matter to the approved list
Joomla might have something similar as well that you can add there.


One Password for All? When someone signs up or registers, we need to generate a username and password. But for the password, we would like one (1), the same password for everyone.

Is this possible? And if so, how do I set it up?

Also for importing people in, and for new sign ups.

Thank you so much.

There is no setting to have the same password for all people signing in. If you have a CiviCRM installation that is accessible from outside your domain in any way I would strongly advocate you do NOT allow the same password for everyone. All security and integrity recommendations would mention that you do NOT allow all your users to have the same password?


The requested Profile is disabled Using 5.17.5 on Wordpress, I've got the dreaded error on a member search form: "The requested Profile (gid=10) is disabled OR it is not configured to be used for 'Profile' listings in its Settings OR there is no Profile with that ID OR you do not have permission to access this profile"

The search form works for admins, but not other users or members.

I'm using [civicrm component="profile" gid="10" mode="search" hijack="0"] on the search page.

In Admin>Customize Data/Screens>Profiles, the profile exists:

The profile is active:

These are the fields:

Is this a problem with an ACL? Search settings? How do I fix this?

Based on comments, it sounds like you have a permission issue.  It's possible you have an ACL issue, but it's pretty unlikely; you would know if you set up ACLs.

Go to Administer menu » Users and Permissions » Permissions (Access Control).
Click the WordPress Access Control link.
Check the permissions: CiviCRM: profile create and CiviCRM: profile view and ensure they can be used by the role in question.


How do I upgrade flexmailer? I have flexmailer 0.2-alpha2 installed. Extension directory says 1.0-beta1 is available, but CiviCRM extension manager does not offer that as an update.

How to proceed?

Can you try by downloading the extension from here and replacing it with older one in extension directory and then visit the extension page on click on refresh.


Import donations from an external source using Form processor We have a customised platform where we have been receiving donations before moving to CiviCRM. This platform will continue to be in use.

We would like to import all the donations and the contract data automatically on civicrm whenever it’s submitted. We would also like to send a receipt from civicrm whenever a donation submitted.

I have had a look at “Form Processor” extension and seems to be a viable option for our need. Is it possible to use for importing contribution? What is the risk of importing data this way? Any security concerns? Has anyone used Form processor for this kind of use case? Any tips would be much appreciated. Thanks

We use the Form Processor at a few of our clients for scenario' s like yours. In most cases we use this in a configuration with CiviCRM on another server and outside traffic (including the Form Processor API request) coming in through CiviProxy (https://docs.civicrm.org/civiproxy/en/latest/).

For this we use the CiviMRF framework (https://github.com/CiviMRF/cmrf_core).


User Permissions Not Updating Let me start with I have read numerous posts regarding this issue and have tried the max_input_vars = 2500 and I only have 10 groups (nine standard and one added).

I am trying to add the View My Invoices for all Registered users. So selecting that option and changing the permissions to Allow for Registered shows the new setting to be correct but when you hit save/save and close it doesn't actually update. I do get the updates saved message, but again no update.

I have gone into the database and manually added this code {"2":1},"civicrm.view_my_invoices": in the Asset table. That will display the Print Invoice button in the users Dashboard, however, when you click it you get a Joomla error page that indicates that you don't have permissions to access this page.

I am hoping someone has suggestions or possibly post their Asset table civicrm Rules entry that is working on their site. Thanks for any suggestions or advice.

Working. New install. Using J!v 3.5.1/CiviCRM 4.7.7. db-prefix_assets/row name = com_civicrm; rules={"1":1,"2":1},"civicrm.view_event_info":{"1":1,"2":1},"civicrm.view_event_participants":{"1":1,"2":1}}


manage new scheduled job What should I put on this screen to make the cron work for mailing?
I use wordpress 4.9.6  Thanks

I assume you mean the job that is used to send Scheduled Mailings . You do not have to create it. It is part of the standard configuration. So the only thing to do is to enable it. But to be complete here is the configuration:


Batch Data Entry payment_instrument is now required? we've been using CiviCRM for several years and we've just recently version 4.7 to 5.8.2, but now we can't use the Batch Data Entry any more. We can create new batches, add entries and save them, but when I press Validate and Process the batch it just displays the batch again.

I guessed that it might be a validation problem and eventually put a log statement to get any errors on form validation. In my test batch there are two entries and this is the error I get:

Form Errors: Array
(
  [field[1][payment_instrument]] => Payment Method is a required field.
  [field[2][payment_instrument]] => Payment Method is a required field.
)

Nothing is displayed on the screen because there isn't a Payment Method--or Payment Instrument--field in the form, so that explains what is going wrong, but not why.

Looking at the DB for past batches, we've never had to specify the Payment Method before, I notice that there is a payment_instrument_id field on civicrm_batch, but it's optional and null for all our past batches.

How can I make it optional so I don't need to add a field to the form?

Thanks!

We had one client inform us that they could not save Batch Data - everything we tried to replicate the issue failed. In the end we concluded that it was due to browser caching which the client was able to confirm by testing with a different browser.

Refreshing the chrome caching (https://support.google.com/accounts/answer/32050?co=GENIE.Platform%3DDesktop&hl=en) sorted it for them.

May not relate to your situation at all.


Installation Issue - Database Triggers not allowed by hosting provider After spending 3 months configuring and testing CiviCRM on a locally hosted/internal server (and being suitably impressed), I attempted to install onto our website which is hosted with GoDaddy.

I kept running into an error that prevented CiviCRM from installing being that I am unable to install triggers on the DB due to permissions in a shared server environment.

I appear to have 2 options:
1 - fork out more $$$ to get a dedicated server or VPS.  Not possible.

2 - Move from GoDaddy to HostGator who claim to allow triggers. "We can enable trigger privileges for your database, simply contact us via phone or Live Chat with the database, database user, and the tables that you require the permissions on."

Can anyone provide a list of tables that require the trigger permissions added please?

Or provide an alternate hosting solution/suggestion, noting that the organisation is a Not For Profit based in Nepal and not able to spend much money on a solution.

Thanks, Joe.

The tables that use triggers are: civicrm_contact, civicrm_address, civicrm_phone, civicrm_email, civicrm_im, and civicrm_phone.  Additionally, if you turn on advanced logging, all tables have triggers.  The Summary Fields extension also creates triggers.

The "core" triggers are mainly used for updating the modified_date, though they also generate a value for a hidden numeric-only phone field (used for SMS etc.).

In all though - I would NOT use GoDaddy for hosting.  CiviCRM uses far more resources than a brochureware WordPress site.  While I hear your concerns about cost, there's plenty of VPS services that cost the same as GoDaddy hosting - assuming you or someone else is willing to manage the server.  I use Linode, whose $10/month plan will give you far better performance than any shared hosting out there.  There's equivalent plans from smaller VPS providers too.


How do I change the Fee Amount display in CiviEvent registration? The fee amount is displaying too many zeros. Every time I set the fee amount for an event, for example $55.00, a bunch of zeros gets added to the end ... $55.000000. I've reviewed all of the localization settings and everything appears to be set us as described for USD display. I've attached a screenshot of the issue.

I was having a similar problem with php 7.2, Wordpress 5.0.3 and Civicrm 5.9.1.
I ended up adding a javascript function to my website's javascript file. The meat of the function is number.toFixed(2) This forces the number to have only two decimal places.

function formatPrices() {
        const price_spans = document.querySelectorAll('.crm-price-amount-amount');
        if (!price_spans) {
            return;
        }

        price_spans.forEach(function(node) {
            const price = node.innerText;
            const data = price.split(' ');
            const symbol = data[0];
            const num = +data[1];
            const new_price = symbol + num.toFixed(2);
            node.innerText = new_price;
        });
    }


Membership fixed period, not working as expected I want to to create a monthly membership that recurs automatically, but doesn't start until the first of the following month. So if someone signs up January 2nd, they won't be billed until February 1st. Is this possible?

I've setup a membership type with auto-renew required, 1 month duration, fixed period, with fixed period rollover day of 01.

It seems like this should do what I want, and yet when people register, their payment comes through immediately, regardless of what day it is.

For fixed membership type plans, the Fixed Period Start Day and Fixed Period Rollover Day apply solely to the membership start and end dates, not to the payment date. Copying from the explanation provided when clicking on the Membership Type Plan help bubble:

  If membership duration is specified in years, you will be able to specify the exact month and day for memberships to start. If membership duration is specified in months, memberships will start on the 1st of the current month and run for the number of specified months.

So long as your membership start and end dates follow the examples below, then the feature is functioning as programmed.

If you have a fixed membership type configured for a Duration of 1 month and Fixed Period Rollover Day of 2, someone signing up on on May 22 will have the following membership dates:

Member Since: May 22
Membership Start: May 1
Membership End: June 30

If you have a fixed membership type configured for a Duration of 1 year with a Fixed Period Start Day of Jan. 1 and Fixed Period Rollover Day of Nov. 30, someone signing up on on Dec. 1, 2019 will have the following membership dates:

Member Since: Dec. 1, 2019
Membership Start: Jan. 1, 2020
Membership End: Dec. 31, 2020

Note that the Member Since date is always the date that the membership is submitted - this is because the system is not programmed to handle future memberships. The workaround is to create a membership status rule (e.g. called "Future Membership") with a Start Event = Member Since Date and End Event = Membership Start Date and that should not be considered a current membership .

Regardless of your membership type configuration, payment will be processed on the day that the membership is submitted. If your payment processor allows for the selection of a payment start date for recurring contributions, you should be able to solicit a customization from an expert that will allow you to set the desired membership start date for monthly memberships, and then pass the membership start date as the payment start date of the recurring contribution.

Hope this clarifies things!


Shared hosting vs VPS with CiviCRM & Wordpress I would like to start a new civi installation on WP to keep around 1000 contact records. What is the best option, Shared hosting vs VPS?
Pros & cons?
Any recommended hosting provider?
Thanks

Shared hosting can work well, but use one that specifically supports CiviCRM.
Typically VPS offers more resources (RAM, CPU etc) but at a higher price.  VPS's are not all the same: on unmanaged ones you need to do more sysadmin work but have more flexibility; on managed ones there are more restrictions but more of the work is done for you.
Good shared hosting gives you flexibility while taking care of all the basics.
Have you considered CiviCRM's own Spark offering?
I've had good experiences with shared hosting on CiviHosting


Unable to add file to event with Attachment api I am new to CiviCRM and did not find any answer to this.

I have a form on a Drupal page, and want to give ability to upload an image file in both Drupal and CiviCRM from within this form.

I use the "Attachment" api function. When saving the Drupal node, I call civicrm_api3('Attachment', 'create', params) and pass file params as well as entity_id and custom field_name as explained in the api explorer. The CiviCRM field is a file custom field and the entity is an event.

Here is the code I use :

$result = civicrm_api3('Attachment', 'create', array(
    'debug' => 1,
    'sequential' => 1,
    'name' => $file->filename,
    'mime_type' => $file->filemime,
    'entity_id' => $event_id,
    'field_name' => $field_name,//custom_14
    'url' => file_create_url($file->uri),
    'path' => drupal_realpath($file->uri),
));

I finally catch this error (look at {main} at the end):

20 {main}
            [is_error] => 1
            [error_message] => Failed to run permission check: Unrecognized target entity table (civicrm_event)
        )

Guess I missed something, but what ? Any suggestion ?

Thanks for your help

Philippe

Do you have created the custom field on event?

I would suggest you to add manually (via the UI) an attachement and check how it looks like (using the api explorer and get the file(s)), it will be easier to understand what civi expects by looking at what it does


User is logged into different account on CiviCRM than Drupal This is happening inconsistently, but often enough to be a problem.

So far, we have come across two issues with it:

#1 -  A new user registers for the site.  That user is then taken to a CiviCRM form for them to choose their payment level.  Sometimes, the user is logged out between the drupal registration form and the CiviCRM form, leading to them being prompted to log in again when they reach the Civi payment form.

#2 - Background: We are currently testing some changes to our site, and so the admins all have multiple accounts, most of which have admin permissions.

An admin logs into the drupal site, and then goes to CiviCRM.  For some reason, though, they are logged into one of their other admin accounts on CiviCRM.  They go to "Find a member", and then click the link to the member's drupal profile.  When Civi takes them back to drupal, it throws an error because they are logged into a different account on Drupal than on Civi.

We are using Drupal 7 and CiviCRM 4.6.28

Are your users perhaps logging into an https page and then following a link to a http page (or vice-versa) ? I have seen such issues in that case. You need to be consistent, and set the Drupal $base_url, Civi CIVICRM_UF_BASEURL, and $civicrm_setting['URL Preferences'][] values all to either http or to https, and change any links in your content to use that same scheme also.

If you are not defining all four $civicrm_setting['URL Preferences'][] values in civicrm.settings.php, then those values are instead defined at Administer | System Settings | Resource URLs. While there, verify that the value of "Force Secure URLs (SSL)" is consistent with your intended scheme.


Create fakefile warning I have seen this warning on a couple of sites.

Warning: file_put_contents(.../sites/default/civicrm/ext/delete-this-DEbcrmuyt7): failed to open stream: Permission denied in CRM_Utils_File::createFakeFile() (line 306 of /.../sites/all/modules/civicrm/CRM/Utils/File.php).

On one site this warning then came up when we tried to delete a Price Set but were unable to do so.

We have provided a fix for this at https://github.com/civicrm/civicrm-core/pull/10677


Fix for "Incorrect Resource URL" message In my Wordpress installation of CiviCRM I have had a persisting System Status:Error message since version 4.7.28 which was still present despite upgrade to 4.7.31.  This appeared to be a false-positive as CiviCRM was working well.
The Resource URL was correct and I could not get rid of the error until I upgraded PHP from version 5.6 to version 7.0, and the error message disappeared!!

The error disappeared after upgrading php to version 7.0


Where do I change the wording "membership fee total?" I'm already in the automated workflow templates, but I don't know which variable I need to tinker about with so that I change the wording. I have a recurring recertification, that I'm processing as a membership fee, but the client doesn't want the receipt to read "membership fee." So, what am I looking for? I'd like to simply call it Fee Total instead of Membership Fee Total.

It should work with Word Replacements, even for receipts. Under Administer - customize - Word Replacements.

UPDATE: Under Administer - CiviMail - Message Templates, then on the System Workflow tab, there's two receipts for memberships. You can edit it in there. If it's hard to find the wording use CTRL-F and search for Membership Fee.
Once in a while an upgrade will warn you that the template has changed and you'll need to merge the changes, but doesn't happen too often.


CiviEvent custom data missing on confirmation page I am testing out some custom data on CiviEvent under wordpress; on both the civicrm demo site and a live production site.  In both cases if you add a custom field with a checkbox to the profile for online registrations, for participant, the confirmation page confuses the data coming back.  I created a check box with 3 options (good, bad, ugly).  If I choose 2 of them (bad, ugly) then on the confirmation page I see the data as ", good,good".  If I choose the checkbox as (good) then I get "good, ,".  And if I select the checkboxes as (good, bad) then I get "good, good, ".  I each case I get the wrong set.

It seems to always use the first option no matter what I choose but it does return it in the correct index. Anyone have any suggestions to make this work?  Or has anyone looked into the issue already and solved it?

Yep, that is a proper bug.
CiviCRM has a public issue tracking system, it's on https://issues.civicrm.org.

This bug was already found, see https://issues.civicrm.org/jira/browse/CRM-17129
It's solved in 4.7

If you really need it on 4.6 you can also find the patch there and try it on a test version of your site. No guarantees, so make sure you are not doing it on your production site.

If you would find another bug in the future and it can not be found via a search on issues.civicrm.org, you can help the whole community by creating an issue over there.


CiviCRM 4.7.4 (Joomla version) contains Drupal version of civicrm.config.php I just downloaded and extracted https://download.civicrm.org/civicrm-4.7.4-joomla.zip. Within /admin I found civicrm.zip. When I extract that and go into the civicrm folder, it contains civicrm.config.php. This file's code looks like Drupaly code, not Joomla-specific code. For example, line 36 is "function civicrm_conf_init() {". That's a Drupal function call ... the Joomla version of this file should look very different.

So my question is: is it correct that this file contains what look like Drupal functions? This appears to be preventing my CiviCRM cron jobs from running. The cron job errors out with:

"Could not load the settings file at: /var/www/public_html/administrator/components/com_civicrm/civicrm/../..//default/civicrm.settings.php"

I am pretty sure it is due to this civicrm.config.php being a Drupal version rather than a Joomla version. Seems the zip file needs to get updated to include the correct Joomla file.

EDIT: Just wanted to clarify that I was attempting to upgrade CiviCRM from 4.6.8 to 4.7.4, after which I encountered the above issues.

It does look like Joomla should be excluded from having civicrm.config.php generated for it. So you might try moving that file away from the directory it's in - keep a backup in case! - and see if Joomla "comes right".

If this fixes the problem for you, the issue should be reported to the CiviCRM bugtracker @ https://issues.civicrm.org/

You might also look back at older CiviCRM downloads (eg Joomla for 4.6.10) and see if the civicrm.config.php was recently added to the Joomla zip.


Can I pass a GROUP BY to an API call? I'm trying to write an API call returning all contacts that are at one end of one or more active relationships of a certain type, and their names. I note that you can specify limit, offset (LIMIT) and sort (ORDER BY) options. Something similar for GROUP BY, so I don't need to do this in PHP separately after the API call, would be useful. Does it exist?

Like this, for example:

$ao_result = civicrm_api('Relationship', 'get', array(
  'version'    => 3,
  'sequential' => 1,
  'relationship_type_id' => 19,
  'is_active'  => TRUE,
  'options'    => array(
    'group_by' => 'contact_id_b',
  ),
  'api.Contact.getvalue' => array(
    'id'     => '$value.contact_id_b',
    'return' => 'display_name',
  ),
));

I think this makes sense as an addition - but note that there are 3 types of get api

1) api layer api - e.g anything that uses basic_get
2) query object api (contact, contribute etc)
3) random assorted api

1 is easy & in one place - 2 & 3 are ... not

BUT #1 changes substantially in 4.7 compared to 4.6 so you would need to fix at minimum in 4.7 & add unit tests and ALSO in 4.6 if you want it to work there too.

(We are open to backporting the 4.7 internals en masse to 4.6 with an self-deprecating opt-in -eg. $params['options']['4.7plusmode'] = TRUE;
- the 4.7 code also supports custom field filters (e.g on address) and lays the groundwork for more nuanced acls since it permits joins in simple api which is a blocker in 4.6)


Unable to cancel a PayPal_Standard recurring transaction I created a contribution page using the PayPal_Standard payment processor.  When I used it to set up a recurring contribution, it seemed to be set up ok, but I was unable to cancel it, either using the link in the email or from with CiviCRM. I am using CiviCRM 4.7.30 and Drupal. Is there any other config for recurring payments in CiviCRM?

As far as i know, Paypal Standard doesn't support cancellation of recurring payment from within CiviCRM. You need to cancel it from your Paypal account.

If you want to have this ability, you need to either upgrade to Paypal Pro or find a payment processor that support it.

Although I can't find a documentation that clearly state if the payment processor support the cancellation or not, the ones that are listed as SSL (Users submit their credit card directly on your site) in https://docs.civicrm.org/sysadmin/en/latest/setup/payment-processors/ should be able to do it.


can't log into a site build using civibuild This is how I created my site

civibuild create demo8 \
 --type drupal-clean \
 --web-root /sites/demo8 \
 --title demo8 \
 --url http://demo8.roiaws.com \
 --admin-user admin --admin-pass 12345

and this is what I get after I try to log on using admin/12345 or demo/demo (in short - it doesn't login):

Additional info: when looking for problems in the civibuild output, this is the only interesting thing I saw:

+ pushd /sites/demo8/sites/all/modules/civicrm/./bin/..
/sites/demo8/sites/all/modules/civicrm /sites/demo8/sites/all/modules/civicrm
+ php bin/cli.php -e System -a flush --triggers 1 --session 1
Failed to bootstrap CMS
Died during initialization+ mysql -udemo8civi_k31lr -poNammLP06izIxkcx -h 127.0.0.1 -P 3306 demo8civi_k31lr -e 'UPDATE civicrm_domain SET config_backend = NULL; UPDATE civicrm_setting SET value = NULL WHERE name = '\''userFrameworkResourceURL'\'';'
+ popd

When setting up a new environment, sometimes Apache's mod_rewrite is disabled. This breaks in Drupal -- creating a symptom where the home page opens, but logins do nothing. Try enabling mod_rewrite.

I've filed an issue about this: https://github.com/totten/amp/issues/23


Back end credit card not sending info to PayPal We're running Civi 4.7.4 on Wordpress 4.4.2. We recently switched to PayPal Pro (from Standard) in order to use back end credit cards and keep everything on one site. So far, PayPal Pro has been handling transactions properly from the front end. When I tried to submit something via the back end yesterday (member renewing over the phone) the renew-credit card screen appeared, I filled out the data, and submitted it. The screen refreshed and a new renew-credit card screen appeared and no transaction went through.

Today I decided to do some testing in the back end. None went through. It appears Civi overwrote the test api credentials. I then tried to save the test api credentials again. The credentials were saved, but the "sandbox" portion of the URL was removed. As a result I can't test - everything comes back "internal error internal error." This is occurring when I use an anonymous window as well. What does "internal error internal error" mean? Does Civi show the paypal error code somewhere? Edit: I think I solved this part - it needed a valid mailing address.

I am using credit card = 4111111111111111, CVV 123, expiry Apr 2017, which seems to be what paypal suggests.

Finally, how do I test a contribution page without overwriting my contact profile? When I click to test as a different person from the logged-in account it appears to send me to a regular version of the contribution page. Edit: using anonymous window here. This part is solved.

I'm at a total loss - I want to be able to test that my payments are going to work when our members try to join or renew, and I would really like to be able to call members as part of our fundraising drive.

Any pointers that can help me get to the bottom of this are appreciated.

Lots of questions wrapped together ;)

As for how to test without overriding your account: either use an anonymous windows so you aren't logged in anymore or add manually cid=0 as an extra param should do it

And to avoid any mistake, you might want to install the no-overrite extension that locks the first and last name :
https://civicrm.org/extensions/no-overwrite


Impossible to get the source field with the Contribution API On CiviCRM 4.6.11.
I need to get the source field of a contribution, but the api seems to fail.
Testing the API on http://xxx//civicrm/api#explorer with entries giving the following PHP code :

$result = civicrm_api3('Contribution', 'get', array(
  'sequential' => 1,
  'return' => "source",
  'contact_id' => 4889,
));

gives as results :

{
    "is_error": 0,
    "version": 3,
    "count": 1,
    "id": 4676,
    "values": [
        {
            "contact_id": "4889",
            "contribution_id": "4676",
            "id": "4676"
        }
    ]
}

Although the contribution DO HAVE a source value, no source entry in the result.
Is-it a knonw bug, or what wrong in the trequest ?

Thanks for help.

Jean-Pierre

There is an issue with the contribution 'source' field being accessed through the API, due to there being a conflict between the 'source' field of a contribution and the 'source' field of a contact.

To get around this conflict, add the prefix 'contribution_'. So in the API call, change 'source' to 'contribution_source':

$result = civicrm_api3('Contribution', 'get', array(
  'sequential' => 1,
  'return' => "source",
  'id' => 1,
));

...becomes...

$result = civicrm_api3('Contribution', 'get', array(
  'sequential' => 1,
  'return' => "contribution_source",
  'id' => 1,
));

This worked for me.


Can I mock the CiviCRM API for unit tests? Suppose I want to mock the API in unit tests for my extension, can I do that? Or should I implement an interface myself that is just a wrapper around civicrm_api3, and create mocks of that interface?

Thank you!

johan

update: I think a part of the answer is here in the source: https://github.com/civicrm/civicrm-core/tree/master/Civi/API/Provider

Generally, you need to get a reference to the API kernel. (For testing, I usually build up a custom instance, but you can use Civi::service("civi_api_kernel")). Then  call registerApiProvider(...) and pass along a new provider. I usually define mock APIs using new AdhocProvider(...).

There are examples of mocking an API in api_v3_UtilsTest and CRM_Core_ManagedEntitiesTest.

(Update) I originally thought api_v3_UtilsTest was easier to read, but maybe CRM_Core_ManagedEntitiesTest is easier to generalize/imitate. Note how the setup() registers the API provider:

$this->apiKernel = \Civi::service('civi_api_kernel');
$this->adhocProvider = new \Civi\API\Provider\AdhocProvider(3, 'CustomSearch');
$this->apiKernel->registerApiProvider($this->adhocProvider);

and how testRemoveDeclaration_CleanupUnused() manipulates the CustomSearch.getrefcount API to return different values at different times, e.g.:

// Override 'getrefcount' ==> The refcount is 1
$this->adhocProvider->addAction('getrefcount', 'access CiviCRM', function ($apiRequest) {
  return civicrm_api3_create_success(array(
    array(
      'name' => 'mock',
      'type' => 'mock',
      'count' => 1,
    ),
  ));
});


How do I find civicrm field names for import? I want to import memberships, but civi isn't finding the membership type. How do I find out the field names (such as membership_type) for each membership?  This problem has cropped up for other imports.  For example, I'd like to be able to import relationships.

Is there a tool that I need outside of civi?  Is there someplace in civi where I can find this type of information?

Thanks.

When importing memberships the type needs to match name of the type from the first column on the membership page (Administer => CiviMember => Membership Types).  So if you've defined a membership type of "Gold Member" then when importing, you need to put Gold Member in the column for membership type in the CVS.

Importing relationships is a bit trickier.  You can only import one type of relationship with each cvs file.

Have you looked at the on line book on importing.  It gives some good examples and tips on importing.

http://gitbook.civicrm.org/common-workflows/importing-data-into-civicrm.html


Following a CiviCRM checksum link doesn't populate civicrm tokens but logging in populates the tokens. Example use case:

You want to link a user to a page and populate some information about them (e.g. display an online membership card):

[current-user:civicrm-contact:display-name]
[current-user:civicrm-contact:custom-122]

These tokens do not populate following a checksum link but do populate when the user logs in.  Is there an easy way to make the checksum link behave in the same way as logging in for the purpose of these tokens?

I assume the "page" you're referring to is using a Webform, If that's the case, then you should mention that in the title.
The link to the form should be of the format http://example.com/your_form?cid={contact.contact_id}&{contact.checksum}.
On the CiviCRM tab, in the Contact Field section, select Existing Contact, as well as all the fields you want to appear on your Webform.


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

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

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

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

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

I deploy with "Drush make":

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

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


How to test for CiviCRM status messages in selenium? CiviCRM presents status messages in a slick overlay, which looks neat for human users but has been hard for me to test for in Selenium. It appears the messages first appear within the main page content, but are then moved into the overlay div, where they appear on-screen only for several seconds before fading.

I'm guessing CiviCRM's own Selenium tests have standardized a variation on  assertText() that works with this overlay, but I've not dug around enough to find it.

How would one detect the presence of a given status message, in Selenium IDE and in phpunit?

So one possibility is to use Selenium2TestCase as your base class for you test...

I've been using Selenium Standalone Server 3.3 (looks like 3.4 just released)
http://www.seleniumhq.org/download/

So its a little different that SeleniumTestCase, because Selenium 2 uses the WebDriver, and support for firefox may require you install the third party gecko drivers, there's a chrome driver there too that works really well.

So I have a test class that extends Selenium2TestCase , and added this helper function:

/**
   * Utility function to wait for an element to be displayed
   *
   * @param $elementCssPath
   * @param $timeout
   * @return \PHPUnit_Extensions_Selenium2TestCase_Element
   * @throws Exception
   */
  public function findElementWaitUntilDisplay($elementCssPath, $timeout){
    $this->waitUntil(function() use($elementCssPath){
      if ($element = $this->byCssSelector($elementCssPath)) {
        if($element->displayed()) {
          return true;
        }
        else {
          return null;
        }
      }
      return null;
    }, $timeout);
    try{
      $element = $this->byCssSelector($elementCssPath);
      return $element;
    }
    catch(Exception $e){
      throw $e;
    }
  }

So then you may have a test use it like so:

testStatusMessageDisplayed() {
  $status_message_element = $this->findElementWaitUntilDisplay('whatever-your-css-selector-is', 5000); //wait 5s for status message to appear
  $this->assertEquals('expected text', $status_message_element->text());
}

This helper function has been coming in handy, whether I am waiting for a page to load, or an ajax request, or some javascript rewrite the dom.


Drupal views: Civicrm drupal_id entity missing after update? Inside Drupal views, I use some contextual filters and relationships which, I think, are provided by CiviCRM Entities.

Before Civi 5.15, some seemed to be provided by CiviCRM itself (?). Under 'relationships, for example, there was 'CiviCRM Contacts: Drupal ID' which did not say 'provided by CiviCRM Entities'.

After an update to 5.15, that relationship, and a whole bunch of others, are gone. Under relationships, the only one left is 'CiviCRM Contact: Entity translation: translations Translation information.'

Also under 'contextual filters', a lot of civicrm filters, but not all, are gone.

What am I missing ? Have they moved somewhere else ?

The problem has disappeared.

Ehm, I cleared caches. Fairly sure I cleared caches the first time, but I did it again, now using the UI, and all looks normal now.


How to use G Suite / GMail as your CiviMail Provider After receiving some clarity on CiviMail settings and using a ton of guides - we were able to setup GSuite / GMail as our email provider. The answer to how we implemented it is below. If others have feedback - please chime in.

Setting up GSuite/Gmail as your CiviMail Provider.

Decide if Gmail/G Suite is right for you.  The limits for GSuite users is 2000 sent messages sent per rolling 24 hour period. Regular @gmail.com users are limited to 500 sent messages per rolling 24 hour period. If you are an organization with less than 1000 email list contacts and you have Gsuite - this may be a good option for you - assuming you only send 1 email blast every 24 hours - to not exceed limits. If you are a regular Gmail user - this would only be a good option if you have less than 400 contacts that receive emails - and I would stagger your email blasts to maybe 100/hour. This would still leave you with 100 emails for regular communication and activity emails. Using the SMTP relay service - limits expand significantly - however - I have not tested the reported 10,000 emails per rolling 24 hours limit for SMTP-Relay.

Create two accounts in Gsuite/GMail, one that will be used as a bounce account and another that will be an email to activity account.

Follow these instructions on how to setup gmail as your email provider in CiviCRM. Same instructions apply for the bounce account except you will use the bounce email and select Used For Bounce Processing. You will need to allow access to less secure apps - if you use 2FA - you will need to setup an app password.

Setup your from email. If you are not using SMTP Relay - it must match the same email address you have in Gmail - or the Gmail server may reject your email. If you are using SMTP Relay - you should be able to add multiple from addresses as long as they are real email addresses that share your same domain. Meaning if your smtp relay is selma@wonky.org, the only other emails you can use as from are @wonky.org. You would not be able to use a @gmail.com address.

Follow these instructions on how to configure your outbound email service. While the doc recommends using mail() - I found the best experience to be using the IMAP settings in your GSuite/GMail account - however - if you are a GSuite user - I highly recommend you use the SMTP-Relay service. Follow these instructions to setup your GSuite account for SMTP Relay - Comprehensive email storage is recommended for best deliverability - but we have not noticed much of a difference.  Then use the following settings for your outbound mail settings.

Server: ssl://smtp-relay.gmail.com
Port: 465
Authentication: Yes
SMTP Username: complete email
SMTP Password: password

Setup Cron & Mailer Settings

We setup our mail cron to send batches every 15 minutes - we also limited batches to 250 contacts (Mailer Batch Limit). (Administer - CiviMail - Mailer Settings)  We have also sent email without the mailer batch limit with success. We will be testing limits further and will update this answer.

I hope you found this guide useful - let me know if I should clear anything up or add anything else.

Do you use Gsuite as your outbound email in CiviCRM?  If so - chime in with your thoughts!


Civi 5.9 not serving extension javascript in WP 5 TLDR EDIT:
  Civi getURL generated <site>/civicrm/<resourcepath>?r=<key> doesn't serve <site>/<resourcepath> Should the file be coming from civi with a key or not go through civi?

I have a fairly new LAMP machine with CiviCRM 5.9.1 installed in Wordpress 5.0.3 with the plugin installer.
I am getting a 404 when a contribution page is trying to pull in civicrm_stripe.js for the stripe payment processor.

I can load the file at <site>/wp-content/uploads/civicrm/ext/com.drastikbydesign.stripe/js/civicrm_stripe.js (where I probably should get a 404) but get a 404 on <site>/civicrm/wp-content/uploads/civicrm/ext/com.drastikbydesign.stripe/js/civicrm_stripe.js?r=<key>

Is there any way to see why the resource isn't being served?

WordPress/CiviCRM can have trouble resolving tokens like [civicrm.files] if you have a symlink in your path.

If you're having resource URL issues, I recommend replacing the tokens with absolute paths (with no symlinks) in Administer » System Settings » Directories as well as checking Administer » System Settings » Resource URLs as Aidan suggests.  It sounds like your CIVICRM_UF_BASEURL is set correctly in civicrm.settings.php but it never hurts to check.

A permanent solution for this is underway: See https://lab.civicrm.org/dev/core/issues/1497.


How to add a 'Confirm Email Address' to an event registration form I want to add a 'Confirm Email' field in an event's registration form, that is not saved as an extra field, but just acts as a validation function to the event's form submission.

Aside from writing custom JavaScript to do this as a hook, is there an easy way in CiviEvent?

If you’re on Drupal create your event registration with webform_civicrm module and you can do just that

Here’s an example:


Questions for using civi as part of a election campaign So we are looking at CiviCRM to help run my campaign. We have been using votebuilder which is very good but it has some drawbacks as well. one of the big drawbacks is that you can not see people outside of your district.

So i have downloaded the files for all of the voters in PA. I have some questions

Have other people loaded these types of files into Civi before and if so
a. How do you keep track of things like if the person is a dem or rep or other
b. How do you keep track of the times in which they have voted
c. How do you keep track of the multiple districts that they live in
d. How can you search on all of the above so that you can find all of one party who has voted in the primary and general of x year and is in District Y
I saw a note back in 2014 that they were working on the ability to "cut turf" does anyone know if that was completed, and if so do I need to download anything else
If you can cut turf is it done visually? So on a map and i can draw on the map to cut the turf? if so is there a demo somewhere
Is there a way to print by street (or turf) odd and even street numbers?
If you can not cut turf, is there a way to create a list of people then go out and meet with those people, then somehow pull the same list up and quickly enter data?
If you do go out and lets assume you are giving out pampletts, where would you store the information like ... not home..took pamplet...agreed to have lawn sign..agreed to volunteer..so that we keep track of that as part of a date related item..so when we run for office again we can look back see who did it last time and then capture if they will do it again this time
Becuase the campaign has a limited life, can this be hosted on a shared server at godaddy or hostgator or something that is inexpensive. I need to keep the costs down but I never want to lose the data

thanks for your help.
Mark

So i have downloaded the files for all of the voters in PA. I have
  some questions

  Have other people loaded these types of files into Civi before and if so a. How do you keep track of things like if the person is a dem
  or rep or other b. How do you keep track of the times in which they
  have voted c. How do you keep track of the multiple districts that
  they live in d. How can you search on all of the above so that you can
  find all of one party who has voted in the primary and general of x
  year and is in District Y

Yes, political parties import voter data into CiviCRM.  There's a CiviCRM partner whose main clients are Libertarian parties, and Rick Santorum ran his 2012 presidential campaign on CiviCRM.  One of my clients is a political party.

You'd use custom fields to store that data; you can use multi-value custom fields to store multiple districts.  The Electoral API extension will create some of those fields - and automatically look up which district they live in (Federal and State only, but it wouldn't cost much to have someone add municipal-level).  Searches work like any other search.  You might need to get a little clever with smart groups to get "voted in primary" and "voted in general election", but it's certainly doable.

  I saw a note back in 2014 that they were working on the ability to "cut turf" does anyone know if that was completed, and if so do I need
  to download anything else

  If you can cut turf is it done visually? So on a map and i can draw on the map to cut the turf? if so is there a demo somewhere

Nope, sorry.

  Is there a way to print by street (or turf) odd and even street numbers?

Yes, the Walk List Report.

  If you can not cut turf, is there a way to create a list of people then go out and meet with those people, then somehow pull the same
  list up and quickly enter data?

Yes, there are several ways to do this, depending on your needs.

  If you do go out and lets assume you are giving out pampletts, where would you store the information like ... not home..took
  pamplet...agreed to have lawn sign..agreed to volunteer..so that we
  keep track of that as part of a date related item..so when we run for
  office again we can look back see who did it last time and then
  capture if they will do it again this time

You'd capture that as an activity type, and add custom fields as necessary to that activity type.

  Becuase the campaign has a limited life, can this be hosted on a shared server at godaddy or hostgator or something that is
  inexpensive. I need to keep the costs down but I never want to lose
  the data

I would NOT use shared hosting for a database that holds the entire voting population of PA.  Get a Linode or similar for $10/month.

All this said - I'll answer a meta-question.  ANY campaign organizing tool is going to cost you time and money.  CiviCRM is "free" - but if you want to run an effective campaign, you'll need to be willing to spend money.


How can I customize the user dashboard? I'm talking about the user dashboard displayed for each contact who is logged in.  In wordpress this is displayed on a page using this shortcode: [civicrm component="user-dashboard" hijack="0"]

By default it displays (for the logged in user) Groups, Contributions, Events, Memberships,Related Contacts and Organizations.

I would like to display only the Groups and the Membership information, for example. Is there a way to customize this user dashboard?
(I'm using wordpress and civicrm 4.6.23)

Under Administer - Custom Data and Screens - Display Preferences menu item there is a section for "Contact Dashboard"

You can turn on or off the display of Groups, Contributions, Memberships, Events, My Contacts/Organizations, Pledges, Personal Campaign Pages, Assigned Activities, Invoices / Credit Notes


How to prevent CiviCRM contact from receiving emails for Scheduled Reminders When a contact (dashboard) is edited, I see Communication Preferences as the option where I can tick NO BULK EMAILS or under Privacy "Do not mail"
Will that stop the emails from being sent during scheduled reminders(ran through CRON)
Where is the code for the same located in the CiviCRM core? Can I add event subscriber to it ?
I am using sendgrid as Mailer

From UI you can set the contact email to 'On-hold' this will prevent contact from getting any automated email from CiviCRM. The other option is use to mailing hooks to abort emails being sent based on some flag set for the client.

HTH

Pradeep


Where I have to write my hook I am new to civicrm.

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

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

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

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

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


Track URL containing tokens in CiviMail Is it possible for CiviMail to track embedded URLs? For eg, I've a URL which contains contact id and checksum tokens in it. I need to check how many users have clicked the URL from the email.

URL to track - https://site-name/info?cid1=<contact_id_token>&cs=<contact_checksum>

Currently, the code in CiviMail don't consider such tokenized URL from tracking and don't insert it in civicrm_mailing_trackable_url table.

There is a similar question on SE - Tracking links that have been added via tokens but it seems to provide different track links for each tokenised URL which is a pain when number of recipients is large in number. Eg 10k contacts would have 10k trackable links and will considerably increase the size of the database.

Our thought now is to cut the URL till a token is reached and consider this for tracking. For eg, if the original URL is https://site-name/info?cid1=<contact_id_token>&cs=<contact_checksum>, we need to modify the functionality to track only https://site-name/info and if such url is hit by the user, the click counter should be incremented.

To proceed with the above, we can store the partial link in civicrm_mailing_trackable_url table and replace the main html URL with the trackable link. Now, when the user hits this url in the mail, the main problem arises as we don't have any data of what should be appended to the partial URL to navigate user the original page.

Is there any another solution possible?

We've accomplished this by modifying the core function getTokenData() to track non-tokenised part of the URL string. For eg. with the url posted in the question -

https://site-name/info?cid1=<contact_id_token>&cs=<contact_checksum>

Grab the main URL before the ? (https://site-name/info) and get the trackable url of this string from CRM_Mailing_BAO_TrackableURL::getTrackerURL() function.
This enters the URL in civicrm_mailing_trackable_url table.
Replace the HTML with this trackable URL so that main URL that is sent is in the form -
http://site-name/sites/all/modules/civicrm/extern/url.php?u=13&qid=17&cid1=<contact_id_token>&cs=<contact_checksum>, i.e, trackable url + query string from the original URL string.
When the user clicks the link in the mail, user gets navigated to trackable URL and is redirected to the original URL from civicrm_mailing_trackable_url table.
The extra query string automatically gets appended to the main URL.

The above is working correctly for us and tracks each click when the URL https://site-name/info is loaded.

Overriden the file in an extension. Sample Code diff looks like -

$ git diff CRM/Mailing/BAO/Mailing.php
diff --git a/CRM/Mailing/BAO/Mailing.php b/CRM/Mailing/BAO/Mailing.php
index 3a0f08048c..f2501a0b91 100644
--- a/CRM/Mailing/BAO/Mailing.php
+++ b/CRM/Mailing/BAO/Mailing.php
@@ -1348,6 +1348,21 @@ ORDER BY   civicrm_email.is_bulkmail DESC
       elseif (preg_match('/^href[ ]*=[ ]*\"/', $url)) {
         $url .= '"';
       }
+      if (!empty($token_a['embed_parts'][0])) {
+        $string = ' ' . $token_a['embed_parts'][0];
+        $start = 'http';
+        $end = '?';
+
+        $ini = strpos($string, $start);
+        if ($ini != 0) {
+          $ini += strlen($start);
+          $len = strpos($string, $end, $ini) - $ini;
+
+          $partialLink = "http" . substr($string, $ini, $len);
+          $trackableLink = CRM_Mailing_BAO_TrackableURL::getTrackerURL($partialLink, $this->id, $event_queue_id);
+          $url = str_replace("{$partialLink}?", "{$trackableLink}&", $url);
+        }
+      }
       $data = $url;
       // CRM-20206 Fix ampersand encoding in plain text emails
       if (empty($html)) {


Completed emails showing on draft list We've got 27 emails that show as completed, have a report, etc; however, they are showing on the list of Draft/Unscheduled emails. What could be causing this to happen? I'm trying to clean up the back-end for the new volunteers who will be working with the site this year, but I don't want to delete emails that have actually been sent.

We're on Drupal 7 and CiviCRM 5.5.3

I just verified that a completed mailing (in my test installation of 5.5.3) will show up  in the draft/unscheduled list IF the original creator of the email is a deleted (permanently) user. Doesn't solve the problem but at least gives us a cause.


How to create a Wordpress User Profile when creating a Membership with Civi? I am using WP 4.8.1 and CiviCRM 4.7.22

I would like to know what steps I need to take to ensure that when someone contributes through a civiCRM contribution page a Wordpress user profile with access to restricted pages is created?

Does this require an extension?

Thank you

You can require users (or give the option) to create a WordPress user account in the advanced settings in the settings of the profile used on the membership contribution page.

You will have to check the box 'Anyone can register' in the WordPress general settings. I would also recommend installing a recaptcha plugin for user signups to prevent a large number on user accounts being created by bots.


GetCount not implemented on 4.4? It appears that the Contact GetCount API is not working properly in 4.4 to retrieve group counts.  I can code around it by switching to Get which works fine, but wanted to see if there was something I was missing. (I'm upgrading from a 4.2.6 site which works fine.)  My specific example is a smart group, but I've tried non-smart groups as well with the same result.

Using the api/explorer ....

On my 4.4.19 test site

The GetCount is wrong

/civicrm/ajax/rest?json=1&sequential=1&debug=1&&entity=Contact&action=getcount&group=82  returns { "is_error":0, "result":1 }

But the get is right
/civicrm/ajax/rest?/civicrm/ajax/rest?entity=Contact&action=get&debug=1&sequential=1&json=17&group=82  returns ... "count":9,  ....

But on my 4.2.6 live site

The GetCount and Get are both correct

/civicrm/ajax/rest?json=1&sequential=1&debug=1&&entity=Contact&action=getcount&group=82  returns { "is_error":0, "result":8 }

/civicrm/ajax/rest?/civicrm/ajax/rest?entity=Contact&action=get&debug=1&sequential=1&json=17&group=82  returns .... "count":8,

I have just checked the API call in Civi 4.4 installation and the getcount with the group parameter on Contact does not work.

Also the API call on GroupContact does not work either. What you could do is probably write a small extension which includes a getcount api for Group memberships.


How to force a field to be mandatory? I want to make it so that all new contacts must have a contact type. I have found where the contact type is in the templates, and have managed to add the wee * besides it, but I am struggling to find what tag or code I need to add to make it be an actual mandatory field. Is there some way of doing this?

Welcome to SE, You can set contact type mandatory by using hook_civicrm_buildForm something like below

function extension_civicrm_buildForm($formName, &$form) {
  if ('CRM_Contact_Form_Contact' == $formName
    && !($form->getVar('_action') & CRM_Core_Action::DELETE)
  ) {
    $form->addRule('contact_sub_type',  ts('This field is required.'), 'required');
  }
}

HTH

Pradeep


Consider Relationships in Contact Reports Dear CiviCRM community!

I have a question. Our NGO need a report / list of all contacts for sending post letters. We now have some contacts that are married and they only want to get the letter once to one address. Since they contribute separately, we can not define them as a household and we created a relationship between them with the relationship function inside the contacts.

What would be the best practice to get these two people now in one list row, with a specific postal greeting  and address between normal contacts who also need to be on this list?

Do I need to extend the relationship tab and write a custom report or is there an easier way with existing resources?

Thanks in advance for your suggestions!

Cheers
Goran

When you do a contact Export or print Mailing Labels there should be options like "Merge labels for contacts with the same address". Does that take care of your need?


com_civicrm/civicrm/CRM/Core/BAO/SchemaHandler.php on line 730 Do you have any information about the solution of the error found in the image?

Joomla Version: 3.7.4
CiviCRM Version: 4.7.22

Have you tried clearing cache? And clearing Expired Cache? I had the same error, cleared cache/expired cache and the message went away.
Also have you done the indices fix?

I found this to be useful
https://issues.civicrm.org/jira/browse/CRM-21203


Civicrm fails to launch - Wordpress gives "The plugin does not have a valid header." We have been running CiviCRM 4.6.8 for a while now on our site. Last evening, while trying to access our site, Wordpress gives us this error: The plugin civicrm/civicrm.php has been deactivated due to an error: The plugin does not have a valid header.

we had plans to update to 4.7.9, so we backed up our SQL database and entire CiviCRM installation and proceeded with updating to 4.7.9 as per https://wiki.civicrm.org/confluence/display/CRMDOC/Upgrading+CiviCRM+for+WordPress. However, when point our browser to the upgrade url: http:///wp-admin/admin.php?page=CiviCRM&q=civicrm/upgrade&reset=1, we get this error: You do not have sufficient permissions to access this page.

I would have thought that upgrading would have resolved any issues with invalid headers, but now it seems we have even further issues. Any ideas on how to go about resolving these problems?

As regarrds the error message "You do not have sufficient permissions to access this page", please have a look at the Civicrm wiki page at the following link.  https://wiki.civicrm.org/confluence/display/CRMDOC/Upgrading+CiviCRM+for+Wordpress

If you get this error when trying to run the upgrade script, you most likely deactivated CiviCRM plugin during the upgrade process. You just have to visit /wp-admin/plugins.php and activate the plugin.

I  regret I can't help with the "valid header" problem.

Hope this helps.


Struggling: Search report for donations by creation date not receive date I want to send thank you letters and gift aid forms to everyone who 'created' a contribution donation (not membership contribution) within a period of a few months, a one off or recurring donation with us. I can only seem to get results with received date, which might be fine for the one-off donations, but not for recurring ones, as we receive them every month. It seems that neither the Search builder nor Find Contributions can create a report with the 'created date'. Any thoughts? Am I missing something, or is this not available?

Yes, there is no such field in contribution table that holds when a contribution record was actually created. However an activity is created when a contribution is recorded with status completed. If contribution is created with pending status and updated later after day or 2 then it is very difficult to track via Activity.

I have an extension that uses activity to get created date and display on a Civi Contribution Detail report.

The alternate way of doing this would be create a date custom field for contribution, auto populate the field with now() using buildform or post hook.

HTH

Pradeep


Setting up CiviCRM in WordPress - warning message and failure to connect to WP DB So I'm trying to set up CiviCRM on my wordpress site hosted by GoDaddy.  I called them to help get the plugin installed, which was fine.  Once I go to our WP dashboard and begin the setup process for CiviCRM, at the top it shows the error message:

Warning: mysqli_real_escape_string() expects parameter 1 to be mysqli, boolean given in /home/content/p3pnexwpnas12_data02/23/3646623/html/wp-content/plugins/civicrm/civicrm/install/index.php on line 1256

Ignoring that, I went ahead to set everything else up.  It should be connecting to the existing WP database, however, it doesn't.  I get the following still:

Your database settings don't appear to be correct. Please check the Database Details below for specific errors.

I called GoDaddy to verify and they said the settings were correct.

Any suggestions?

I had a GoDaddy Managed WordPress account and the same is happening to me. I've checked all information (db server, username, password, database) and all seem correct. But still the got message
"Your database settings don't appear to be correct. Please check the Database Details below for specific errors."

After many calls to GoDaddy support, I gave up and changed to a regular shared hosting account with cPanel. This time the CiviCRM setup worked as expected and everything is working perfectly.

GoDaddy didn't provide a good answer, so my guess is that Managed WordPress hosting doesn't provide the access required by CiviCRM.

Hope this helps in any way.


Custom Report By Relationship Can you point me to resources that can cover this requirements, I'm sure it would be needed often, and whilst I can dive into working it out from first principals, as a newbie, it would be nice to get thr benefit of some starting points.

Scenario is multiple households are 'managed' by an individual rep.

I would like to produce a reported, grouped / broken by rep of all their households.

Effectively a 'responsibility list' they can use to 'tick off' their annual visit to households.

So I have set up reps as type of 'individual'

and set up an A-B relationship between rep and household.

The standard 'contact relationship' goes part way there, but for instance doesn't have address.

I can see a 'developer tab' so I am assuming I can tweak the SQL -  but before I start hacking around I though I'd ask the best way to approach this.

Thanks

p.s.

I found this https://wiki.civicrm.org/confluence/display/CRMDOC/CiviReport+Reference
the implication to me is to write a custom php report?  Is that the right approach?

Seems pretty heavy weight  to get the desired results - but blogs lik ethis seem to indicate it is the way to go

https://alastaira.wordpress.com/2011/03/17/civicrm-creating-a-custom-report/

This could be a place where it's just easier for the users to use an advanced search to bring up a list of households related to their own contact record. It's definitely possible that this puts too much onus on the user for your use-case, but it really only adds a couple of clicks over pulling up a report:

Advanced Search>Relationships tab
Relationship Type = your relationship from org to individual
Target Contact = the reps name

This would bring up the list of households the rep has a relationship for them. There are many ways to proceed in how they may 'tick off' these households for the year depending on the org process.

If that's too much for this set of users than your "p.s." is probably on the right track and writing a custom report is the way to go here. I would not create an entire extension for this.

If you're just adding results columns, it's usually pretty painless - the documentation is just kind of all over the place. The new .tpl file is a one-liner explained in Alastair's blog post. You can copy the base report (contact relationships in this case) .php file that is closest to what you want and then copy/paste the address block columns from a different report base that has them included.

I would like to add two resources to your links above that I found helpful to put it all together when learning custom report writing for myself:

https://artfulrobot.uk/civicrm-custom-birthdays-report

https://sf2012.civicrm.org/sites/default/files/slides/CiviCRM%20Reports-Customize%20and%20Extend.pdf