Twilio Extension: "The selected contacts have no valid phone, or prefer not to receive SMS, or are deceased."

Just the start of debugging, but maybe it evolves to a complete answer. I focus on the fact that the Send SMS menu does not show on a contact with a valid mobile phone. Can you execute the following script with your test contact_id (my test contact id = 204)?

<pre>
<?php
  $testContactId = 204;
  civicrm_initialize();
  if(CRM_SMS_BAO_Provider::activeProviderCount()){
     echo "SMS provider configured\n";
     $mobileTypeID = CRM_Core_OptionGroup::getValue('phone_type', 'Mobile', 'name');
     echo "Mobile type id =  $mobileTypeID \n";
       print_r(CRM_Contact_BAO_Contact_Location::getPhoneDetails($testContactId, $mobileTypeID));
  } else {
     echo "NO Sms provider configured\n";
 };
?>
</pre>

To execute the script save it to a file (for example test.php) and run it with

drush scr test.php

Hopefully, we get a hint if the configuration of the provider is the problem or the details of the test contact.

Update
When you have only web access the code can be executed on a Drupal instance as follows:

Enable the Drupal PHP Filter module.
Create a new Article
Past the script as contents of the article
Set the filter to PHP Code
Use the preview button for the result.

A word of warning, enabling the PHP Filter is a security risk because it allows the execution of arbitrary PHP code in every Drupal page.


Is there a way to disconnect CiviCRM contacts and Drupal Users via the UI?

This is just a top-of-the-head thought and I am not sure I've thought through all the ramifications, but could you:

Create a new contact (blank, essentially, or with the same name)
Run a search that pulls both of these, and select to merge them
Flip the contacts so the old contact is considered the duplicate contact
Check the boxes to transfer all the info except the Drupal user to the new contact in the process of merging?

Test first, obviously!


This is a frustration and I wish there was a better answer. I've asked a similar question myself.
One solution is to use tokens in links sent out in mailings as much as possible, so this checkbox is already selected, but you won't be able to cover all uses with this.
You can use two groups, the first of which is the one on your forms. Then set up a CiviRule that contacts are added to a second group, the real mailing list, when they are added to the first group. But then people who are logged in or using a tokenized link won't be able to remove themselves from the group, so I wouldn't recommend this unless you aren't using tokenized links or allowing logged in users.
I'd like to fix this, at some point.


Solved :)

I activated CiviCase in the paste and deactivated it. Some sample relationship remained in the database. So deleting them is the answer...


Can webform-civicrm cause an Activity of type Email to actually send the email from CiviCRM

It's not really the opposite of the answer I gave in the other question. The webform-civicrm module does not treat the "send email" activity type as special. Just like the "print pdf" activity type, it dutifully creates the activity, but does not do any extra civi-workflow stuff with it. To actually send an email, I suggest doing this via the webform.


How can I create a list of the contacts in a household?

I assume you are using Relationships to connect individuals to their Household. So if you start from the H/h or from the Individual you should be able to go to the Relationship Tab and click Add Relationship.

On the Rel. Tab of the H/h you should also see any Individuals already related to it.


"Cron not running" (but it is), trying to use wp-cli in crontab, with WordPress

whereis wp showed wp: /usr/bin/wp, so I tried that in crontab and the problem appears to be solved!

System Status no longer says cron is not running and the "Last Run" column on Scheduled Jobs listing shows that the jobs have run.

successful crontab entry:

*/15 * * * * /usr/bin/wp --user=cronuser --url=http://mydomain.org --path=/myserver/homepages/34/d1111111/htdocs/mysite/ civicrm api job.execute auth=0


Install error when generating a new extension module

Check the Extensions Directory specified at Administer > System Settings > Directories.  Your extension needs to be in that directory.  If not, either move your code or change the setting.


An error was trace it back to a PHP issues with certain Drupal themes, specifically the one used with the drupal commerce module.  Although we are not using that module, We did have the admin theme for the module installed for the admin theme.  We changed that back to the standard admin theme and it appears to be working now.


getting error message "too many connections"

Two thoughts:

1) any chance you have a very low limit by default in your hosting setup/config?
Can you get into MySQL and figure out the value of this variable:

show variables like 'max_connections';

2) could you be under brute force attack - e.g. against the login form? Can you see any extra/unusual load on your server. If you can get to a shell you can type the following command:

top


clickatell sms "Recipient phone number is invalid or recipient does not want to receive SMS"

Looks like sites/all/modules/civicrm/CRM/Activity/BAO/Activity.php is failing in function function sendSMSMessage( because $doNotSms = TRUE; on line 3154. Set it to false and you should be Ok. However, the check will not happen, so all numbers (even Do Not SMS #s) will get the SMS.

The other option is to comment out the following block and add an if block:
/*
    if ($smsProviderParams['To']) {
      // If phone number is specified use it
      $toPhoneNumber = trim($smsProviderParams['To']);
      Civi::log()->debug(print_r($smsProviderParams, true)."\ntoID: $toID\n");
      //echo "<pre>".print_r($smsProviderParams, true)."</pre>";
      $doNotSms = FALSE;
    }
    elseif ($toID) {
*/
    if ($toID) {
      // No phone number specified, so find a suitable one for the contact


How can I specify quantity of tickets on event participant import?

There isn't a way to record multiple tickets directly - CiviCRM expects every event participant to have a contact record.

The simplest solution is to create a custom field associated with Event participants (or even with the participant role) that indicates the number of tickets booked. The only issue there is whether you can import the custom field - it should be possible, but I admit that I haven't tried this.

One way to get round the issue would be to import a duplicate event participant for the person who booked - but that could be confusing, as there's no way to tell when a duplicate is intentional. (The import process should allow you to skip duplicate checking).

A more complicated solution would be to create a new contact record for the guest (and create a relationship between that record and the person who booked), then import the event participant for that guest record. You can then go back in after the event and add in their real details (assuming you find out who the guest is).

This is assuming you're not also importing event fee information - it's not something we currently track, so I can't really help there - it's possible there are solutions available involving event fees/contributions.


Can't seem to find the correct CSS selectors for public buttons - contributions pages (Save, Cancel and Review Your Contribution)

It should be something like
div.crm-submit-buttons i { display: none; }
div.crm-submit-buttons span { /* your styling */ }
div.crm-submit-buttons input { /* your styling */ }

If you want it specific to the page you'd add something like div.crm-contribution-page-id-1 or div.crm-profile-name-volunteer_interest in front.


Is civi automatically adding recurrence to contributions?

There was an issue that sounds very much like what you are describing (https://issues.civicrm.org/jira/browse/CRM-18277 that is marked as having been fixed as of 4.7.8), but I think you are saying that beyond the source of the first installment, there were actual recurring contribution records created and listed at the bottom of the contributions tab of a given contact that you then are not able to cancel? If that is the case, I would suggest opening a ticket on JIRA - I haven't seen any tickets in this regards.


How can I use Drupal Rules to remove a contact from a group

Graham, you can do this with CiviRules? Trigger should be when contact is added to group, condition specifies what group and the related action is to remove contact from group.


Hide contacts from search results ,added to specific group

This is directly not available through UI, but you can do this by creating your own extension and using hooks like post and queryobject.

HTH

Pradeep


Where do I find and change user interface displays?

Any fields that are showing on a front-facing contribution or event page would be managed through the configuration of each contribution or event page (or the price sets or profiles associated with them) - to find the configuration area of a given contribution or event page:

Contributions > Manage Contribution Pages > Scroll to find the contribution page of interest, then click on the "Configure" hyperlink and select the area you wish to configure
Events > Manage Events > Scroll to find the event page of interest, then click on the "Configure" hyperlink and select the area you wish to configure

If you are referring to a back office registration (e.g. Event > Register Event Participant), then custom code would be required to change the data entry form.

Hope this helps,
Tamar


Auto-filled Drupal Webform That Creates New Contact

Check out I3Val Input Validation (https://github.com/systopia/be.aivl.i3val/blob/master/docs/index.md) as this allows backend validation before changes go into Civi. It may save people having to complete information again that hasn't changed and from an admin perspective unlikely more work than having to check and then dedupe.


How do you make certain category options non-selectable (but still there/reportable)?

I'm afraid this isn't a scenario covered by core or an extension. Only custom fields can be set readonly. For a fast but hacky solution you could try a javascript approach.


Custom field set - how to move Delete button (or prevent deletes)?

You can use a bit of CSS (either in your CMS theme or in a custom CSS file you define in Administer menu » System Settings » Resource URLs to move the buttons further apart.


Is there a hook for when a CiviMail is created/scheduled/sent/completed?

to be checked, but creating a mailing should go through the normal hooks like the other entities in civi

so if you go with the pre or post hooks
http://wiki.civicrm.org/confluence/display/CRMDOC/Database+hooks

hook_civicrm_post( $op, $objectName, $objectId, &$objectRef )

you should have one with the objectname mailing you want to handle and do the needed


Providing Smart-Group Specific Price Sets

You could try CiviDiscount which offers options for eg auto-discounts for people logged in or using a checksum who are Members


Class naming and namespaces: best practice as an extension author?

The conventional approach

Generally, the safe play is to make a file like <myextension>/CRM/MyExtension/MyClass.php:

<?php
class CRM_MyExtension_MyClass { ...}

(Be sure to match the capitalization of files and classes.)

Most documentation and tooling is based on CRM_* conventions, and a handful of things in core (such as civicrm_payment_processor_type.class_name) make quirky assumptions which only work with CRM_* classes.

How it works: In civix-based extensions, the default hook_civicrm_config adds your extension to the include_path. The classloader CRM_Core_ClassLoader searches the include_path automatically for CRM_* classes.

Critique: In older PHP projects, it was common to automatically link the class-loading with the include_path, but in large codebases this can lead to a large number of file-system checks. Now-a-days many frameworks will reduce lookups by pre-generating some kind of map (namespaces<=>directories or classes<=>files).

The PSR-4 approach (Civi v4.7+)

PSR-4 is a more contemporary technique in which you explicitly map a directory to a namespace. Many PHP developers have been exposed to PSR-4 through composer.json. Civi v4.7 adds CRM_Extension_ClassLoader; with this, you can use info.xml to declare similar mappings:

<extension key="..." type="module">
  ...
  <classloader>
    <psr4 prefix="My\Namespace\" path="src" />
  </classloader>
  ...
</extension>

In this case, the file <myextension>/src/Foo.php would look like:

<?php
namespace My\Namespace;
class Foo { ... }

In terms of lookup performance and caching, this should be better than CRM_Core_ClassLoader. However, it doesn't have full parity with CRM_* in terms of documentation / tooling / testing.

Custom class loader

You should be able to register your own class-loaders -- e.g. just call spl_autoload_register(...) in your module's main PHP file (perhaps in hook_civicrm_config). If you do this, I suggest following a convention like PSR-0 or PSR-4.

Compared to the PSR-4/Civi v4.7 approach above:

Pro: Should be compatible with any version of Civi
Con: Requires more lines of code
Con: Has the same issue of negligible documentation / tooling / testing

PHPUnit Base Classes

There is an issue if you want to write a custom base-class for PHPUnit tests within an extension -- which is the topic of Does class autoloading not work in standalone phpunit testing?


Can no longer modifiying priceset amounts in hooks in 5.1.2

You can use Build Amount hook to alter the price. If you want to trigger the change on form submit than you can use $form->_flagSubmitted. This is set to true when form is submitted. You can also use buildform or post process hook. But validateForm is a bad option.

function xxx_civicrm_buildAmount($pageType, &$form, &$amount) {
  if (get_class($form) == 'CRM_Event_Form_Registration_Register' && $form->_flagSubmitted) {
    foreach ($amount as $key =$value) {
      foreach ($value['options'] as $pid =$value) {
        $amount[$key]['options'][$pid]['amount'] = $value['amount'] - ($value['amount'] * 0.1);
      }
    }
  }
}

HTH

Pradeep


How can you edit the end date for an auto-renew membership?

I've raised this as issue #1126 in GitLab. From the discussion, it appears that this was implemented as a 'feature' in the past but it is unclear why this was necessary. Hopefully this issue will be resolved at some point in the future but this may take some time as we need to ensure that it won't cause a regression for existing users.

As a workaround in the meantime, this issue can be resolved by either by making some minor changes to a core file or creating an extension that undoes the core behaviour and makes the fields editable.

The relevant core file is CRM/Member/Form/Membership.php. The class in this file checks to see if the membership is related to a recurring contribution. If so, it prevents users from editing certain fields by freezing them. To prevent this behaviour you can simply search for and comment out the lines with 'freeze' in them.

These are the relevant lines:

line 217: $this->entityFields['end_date']['is_freeze'] = TRUE;
line 584: $sel->freeze();
line 611: $statusOverride->freeze();

Obviously, do some testing on a copy of your site before implementing this to make sure it doesn't cause any issues!

Update 19 October 2019

A fix has been merged into CiviCRM core (PR #15540) that fixes this issue for the end date field. This fix should be included in CiviCRM 5.20.

A separate issue (#1331) has been raised in Git Lab for the other fields that are also frozen (Membership Organisation, Membership Type, Membership Status).

Update 23 March 2020

A fix for the Membership Organisation, Membership Type and Membership Status has been merged into core (PR #16609). This fix should be included in CiviCRM 5.25


You might try the display_name short code (assuming it exists as I do not use WP mysqlf)? You can control the way the display name is built in Administer>Customize Data and Screens>Display Preferences.

Alternatively you can set customized addressees for your contacts? That is a lot of work if you have to do it manually but you could also create a scheduleld job to do this with the API if you have any development skills available?

If you want to make sure the prefix is not in the display name you change the settings for display name. Standard they will probably be:

{contact.individual_prefix}{ }{contact.first_name}{ }{contact.last_name}{ }{contact.individual_suffix}

Change into

{contact.first_name}{ }{contact.last_name}{ }{contact.individual_suffix}


Contribution forms with numerical quantities is not taxed properly

This patch has solved my problem:

https://github.com/civicrm/civicrm-core/pull/6520/files

PriceField tax_amount should not be rounded


Need to make changes to Paypal website pro templete, Where is it located?

templates/CRM/Core/BillingBlock.tpl

Note that the template is quite programmatic and gets in pretty much all of its info via template variables. I suspect you will benefit from reading the developer documentation which will help you with the Civi learning curve.


How to change Paypal IPN URL when migrating Civicrm onto a new domain?

I ran into this problem today, and found my solution.

Folks who are saying that you can change the IPN URL on an existing Paypal recurring payment are incorrect; you can't, you can only change the IPN URL for future notifications.

I was able to use a rewrite to redirect from Drupal to Wordpress, as follows:

RewriteRule ^sites/all/modules/civicrm/extern/ipn.php$ https://mysite.org/wp-content/plugins/civicrm/civicrm/extern/ipn.php [R=307,L]

The magic is the R=307.  A 307 redirect indicates that a POST request must be resent as a POST.  Otherwise you lose the IPN data.


What can be done to improve loading of Activity searches and tabs on databases with gazillion civicrm_activity_contact rows

I do not know why this is so slow but we developed an extension together with Matthew Wire that improves some of those problems. Information can be found here.


Chamber of Commerce with multiple levels and sublevels of membership

Yes - this is fairly straightforward.  In fact, unless there are different benefits to membership, I'd only create a single membership type with different price set levels.  If there are different membership benefits, I'd consider multiple membership types.


Turning off Asset Caching fixed this issue for us.


How can I generate a custom PDF using CiviCRM?

You might want to make the invoiceName end with a .pdf

so:

$invoiceName = "{$participantName}-{$eventName}.pdf";

The third parameter return the pdf if set to true, else initiates a file download via the browser

the 4th parameter is optional and is used to send additional (or override the default) parameters to the pdf code


How many levels of security can I set for a data base of 12000 people with their confidential data?

Levels of access is tricky. Generally it is best to think of it in a id, ego, superego type of access. I would recommend at least 3 from most restrictive to least. See/edit own data, See other's data, See/Edit other's data.

If, for example you were to create a fieldset called 'super_secret_stuff' I would recommend the following approach. By default remove the privilege  'CiviCRM: access custom data' from all non-admin users. Then, only give the requisite groups access to 'super_secret_stuff' using the ACL Dashboard(q=civicrm/admin/access) within CiviCRM. This is where it gets tricky.

Generally speaking, if users have access to a specific set of custom data, and can see (and edit of course) other user's profiles then they will be able to see the 'super secret stuff' for those users. To restrict this, you can uncheck the privilege 'CiviCRM: view all contacts' and 'CiviCRM: edit all contacts' in the ACL Dashboard.

Of course, disallowing all users from seeing each other's basic information can be onerous if that is supposed to be an aspect of your system. In order to do this you need to start going behind the scenes. Probably the easiest way to do this is to use the hook_civicrm_aclGroup. Using this hook you can specifically grant access to tables that you want your users to be able to see across the database (i.e. basic contact info but not 'super_secret_stuff'). Look at the examples there.

Another hook you could use is the hook_civicrm_buildForm
where you check to see if the form being looked at is 'super_secret_stuff' and if so if the userID of the profile == current user id.

In the buildform example use

function dbhooks_civicrm_buildForm($formName, &$form) {
    if ($formName == 'your custom form_name' ) {
        if ($session->get('userID') !== $form->_contactId){
            CRM_Core_Error::fatal(ts('You do not have permission to access this page, user:' . $session->get('userID')));
        }
}


How to use the API to query custom fields on activities?

The answer at the time of writing is that this is not implemented, so you can't use the API for this.

However, work has begun and you need to wait for issue CRM-16036 to be resolved and released.


How to show by default Contributions Tab in Contact Summary Page?

I don't think CiviCRM allows this out of the box, but you can achieve this by following the below steps using JavaScript:

Using JavaScript check to see if the page url have '/civicrm/contact/view?reset=1&cid='
Then set below two attributes in  to true:

aria-selected="true"
 aria-expanded="true"

Where id = tab_contribute

Example:

<li id="tab_contribute" class="crm-tab-button ui-corner-all livePage ui-tabs-tab ui-corner-top ui-state-default ui-tab ui-tabs-active ui-state-active crm-count-1" role="tab" tabindex="0" aria-controls="ui-id-23" aria-labelledby="ui-id-22" aria-selected="true" aria-expanded="true">

If your CMS is drupal, you can use JS Injector module to include javascript which provides functionality to run JS on specific pages.

Let me know if you need more help.


Members still have "new" status, after over a year and a half

In CiviCRM Scheduled Jobs, the job to check and update membership status was not enabled.


cf-civicrm State/Province field dropdown not populating after country is chosen

This type of problem commonly occurs when any of these is true:

No default country is set
No default state is set
Available countries is not set - list on right-hand side is empty
Available states is not set - list on right-hand side is empty

Check your CiviCRM Localisation Settings. Below is a screenshot of a working configuration for a site in Australia that allows both Australia and USA country/state options to be selected.


Is it possible to make Case Resources a smart group?

It uses whatever group is defined in
    <custom_templates>/CRM/Case/xml/configuration/Settings.xml

Just note that it needs to match the "name" field in the database in civicrm_group, which is usually different from the label that appears on screen. So if you create a group in the admin pages called "Ant Exterminators", the name might actually be "Ant_Exterminators_37". This would be true even if you deleted the current Case Resources group and recreated it - it might be "Case_Resources_43".

I tried it and it works with a smart group (at least on a slightly older CiviCRM version).


Why would two distinctly separate custom fields share the same options?

Civi allows you to set the same Options to be available on multiple fields. You do this by selecting an existing set of Options when creating the field, rather than creating a new set.

If you require different options for the second field then yes set that field to "Create a new set of options"

However that will mess with any existing data you may have. I would suggest you create a new Field with the new set of options, then, if required, you may be able to figure out how to review the existing data and use Batch Update via Profile to add the relevant data to the new field.


How do I import both student and parent information together?

No need to do this manually! Providing that you have a spreadsheet/data source that has all students and a parent/guardian column - so that you can create relationship during import. I'll try dig up a field mapping for you - and post it here shortly.

EDIT: found a wiki page for you: https://wiki.civicrm.org/confluence/display/CRMDOC/Importing+Student,+Staff+and+Parents

PS - though tailored for CiviSchool - which is no longer supported - the import/mapping screens will show you how what import/mapping to use.

EDIT: highlighting the key screens from this Wiki - it's a two pass import:

First: import the student:

Next: import the parent: key is Child of relationship to the Student:


Can we integrate forms on wordpress using CiviCRM?

I'd recommend using Caldera Forms CiviCRM which has great integration with WordPress via the superb Caldera Forms plugin. Check out the tutorial by Tadpole Collective to get yourself going with Caldera Forms CiviCRM.


Show default country and state for public proximity search

The profile search fields respect the system-wide default country.  To set the default country:

Administer menu » Localization » Languages, Currency, Location.
Default Country is located about halfway down the page.

Screenshot:


Unable to change contribution status using API

For the why on restrictions - see: Reasons for restricting changing contribution statusses?

I'm co-maintaining the iATS extension and we're doing Uk direct debit - so I hear you. And I also have a status = Returned that I need to be able to get in for North American ACHEFT processing. ACHEFT here can go from Pending -> Completed -> to Returned. And Returned is not a refund. It's also not quite a Canceled either.


How do I get more than 25 records from the API?

To return more than 25 results you need to add options.limit to your api call:

$params = array(
  'version' => 3,
  'sequential' => 1,
  'membership_type' => 1,
    'options' => array(
    'limit' => 100,
   ),
);
$result = civicrm_api('Membership', 'get', $params);

For the second part, we want to be able to retrieve say 5,000 records. We can't really set rowCount to 5,000 because depending on the size of data, we run the risk of timing out.

The solution here is to page the results using a parameter 'options.offset':

$params = array(
  'version' => 3,
  'sequential' => 1,
  'membership_type' => 1,
  'options' => array(
    'limit' => 100,
    'offset' => 100 // offset value is equal to the number of results to skip
  ),
);

For this to work, we decide on what our ideal page size is let's say 100. We set options.limit to 100, and then we increment offset by our page size (100) on each call, until we no longer get results.

How do we know when we're done? Check the value of count in the returned result. When the returned count is less than the page size, stop.

  $memberships = array();
  // Initialise our pagesize and offset
  $page_size = 100;
  $offset = 0;
  // Start out loop
  do {
    // Call the api
    $results = civicrm_api(
      'Membership',
      'get',
      array(
        'version'         => 3,
        'sequential'      => 1,
        'membership_type' => $membership_type,
        'options'         => array(
          'limit'  => $page_size,
          'offset' => $offset
        )
      )
    );

    // do something with the results if we didn't error
    if ($results['is_error'] == 0) {
      foreach ($results['values'] as $value) {
        $memberships[] = $value;
      }
    }

    // Increment the offset by the page size
    $offset = $offset + $page_size;

  } while ($results['count'] >= $page_size); // Check if we still need to fetch results


What payment processors will be supported in core for 4.7?

Omnipay should work with the latest version - but is only relevant if a processor you wish to use is currently offered through it.

If you want recurring in the US you should probably consider
IATS
Paypal
Authorize.net

in that order.

IATS is most actively developed & IATS has been investing in Civi development itself & the other 2 have the most traction - although Authorize.net has some real technical gaps - ie. they don't retry IPNS.

If you do go with IATS you should use their customer referral programme as your customer will save $100 that way. IATS will also either give you $100 or donate it to CiviCRM if you (like us) prefer not that in order to maintain neutrality http://home.iatspayments.com/civicrm-referral


Upgrade error: Rebuild Multilingal Schema

I noticed the 5.28.2 update that was just released includes release notes that specify the 5.28.2 update includes a fix for issues that may occur during the upgrade process:
https://github.com/civicrm/civicrm-core/blob/5.28.2/release-notes/5.28.2.md#bugs
Per the release notes, this patch was originally published in 5.27.1. However, it was not initially ported to the concurrent 5.28.beta1.
The 5.28.2 release is now available for download, so it may fix the upgrade issue:
https://civicrm.org/download
Please Note: If CiviCRM was originally installed on your website with version <=4.6, PRIOR TO THE UPGRADE PROCESS for CiviCRM 5.29.0 (next release) you may need to change/update the civicrm.settings.php, Directories, and Resource URLs configuration settings:
https://docs.civicrm.org/sysadmin/en/latest/upgrade/version-specific/#civicrm-5.29


How to load custom css into admin popup boxes?

The custom css file do load on every page of civicrm, even the pop ups. Note that the elements in the ajax contains different ids and classes(mostly starts from ui-**) compare to page view.

So you need to redefine the css for them on your custom file.


How can I revert a set of bulk changes to the database?

I was able to create a script to revert in bulk.  I needed to look up the log_conn_id value associated with the bulk change I made.  I made the change using the API import, but any change that happens in a single connection can be reverted.  Simply change the value of $log_conn_id in the script below, and change $tablesToRevert to include the table(s) that need reversion.

#!/usr/bin/php
<?php
eval(`cv php:boot`);

$log_conn_id = '5dcf086e9a837';
$log_date = NULL;
$tablesToRevert = ['civicrm_address'];

$reverter = new CRM_Logging_Reverter($log_conn_id, $log_date);
$differ = new CRM_Logging_Differ($log_conn_id, $log_date);
$diffs = $differ->diffsInTables($tablesToRevert);
$reverter->setDiffs($diffs);
$reverter->revert();


Upgraded to 4.6.2 - 'New Mailing' brings up 'Unknown Extension' error

You'll get a more complete error message if you turn on debug + backtrace in CiviCRM. Also, since the message is coming from the extensions system, can you try disabling your CiviCRM extensions?


Welcome to SE!  There are many reasons why one might refund an event participant payment which would affect how the event registration is recorded.  For example, if you refund because someone cancels you also want to cancel the event registration.  If they have paid but they are a speaker you might refund the payment and want to change their role from 'attendee' to 'speaker'.
Conversely, just because someone cancels does not necessarily mean you want to refund the payment.
What is the reason for the refund?  How do you want their registrations to show now? If they are not attending you could select those registrations and set the status to 'Cancelled'


Discrepancy between # of contacts in smart group vs # of contacts in smart group mailing

I think we've worked it out! A while ago some contacts had been manually added to the Smart Group (their status on the contact list for screenshot 2 showed them as 'Added' rather than 'Smart'). Smart groups don't automatically remove these people, so I've manually removed them which should solve the problem.

Going to avoid manually adding people to Smart Groups now and let them do their thing!


Get a 403 error when adding an image to the online registration page in event management

Turns out it's ModSecurity on the server interfering with things.


Installing Direct Debit UK and Smart Debit extensions for civi 4.6

we are the extension maintainers so hopefully can help with any questions. Yes, they're actively used and installed however they're not explicitly designed to work with webform.

We've just released a 4.6 ready version of the extensions that needed it, the rest are 4.6 compatible already and should indicate so.

Let us know if you need anything else.


Does Contact Editor Extension work with Version 5.2.1?

I just identified the issue & fixed it & tagged another release of Contact Editor


Setting USPS and recaptcha overrides breaks site

My syntax was wrong I needed to use tick marks around the values.


Not all URLs get magically converted to being click-through tracking ones. Most internal ones, for example, do not (e.g. a link to a donation page with the cid and hash).

If you look at the email being generated (look at the actual html of the email, using something like 'show original'), you should be able to see which ones should be click-through ones because their path looks like this:

/modules/civicrm/extern/url.php

Here's a related inverse question:
avoiding tracking of some links

If your links really are click-through tracking ones and people are clicking on them, they'll get counted (unless the click-through links are badly formed due to an incorrect configuration, but that seems unlikely if you're not noticing a lot of other errors).

Update

If you go into your email client and copy a message you recieved from CiviCRM and then paste that as a new message into CiviMail, you will be copying the magically-generated click-through tracking urls from that past mailout (and ones that are specific to you). The new mailout will generate click-through tracking for the previous mailout, all as if it was you that clicked on the links. This is a super bad idea, don't do it.

In a better future world, CiviCRM should give you a big red warning if you try to directly include urls of the form /modules/civicrm/extern/url.php in your message source.


Register Multiple People for Multiple Paid Events With Webform

Yes you can do this with webform civicrm; check out the screenshots I posted in response to a similar question by Naomi - not too long ago.


Manually adjusting a contribution in the database

In Civi 4.6, when a contribution is made, an entry is recorded in the following three database tables: civicrm_contribution, civicrm_financial_item, and civicrm_line_item.  If a contribution is marked as Failed, other entries in other tables do not get made (these other entries are needed for CiviAccounting features like Exporting Accounting Batches).  To change the Failed contribution to Completed after the fact, follow the below steps:

In the civicrm_contribution table, the contribution_status_id for the contribution in question needs to be changed from 4 to 1.
In the civicrm_financial_item table, the status_id for the contribution needs to be changed from 3 to 1.  (You can identify the exact contribution in this table using the entity_id field.  The entity_id here comes from the id field in the civicrm_line_item table.)
In the civicrm_financial_trxn table, create an entry.  (This entry must be created before Step 4, so the entries in Step 4 have a financial_trxn record to reference).
In the civicrm_entity_financial_trxn table, create two entries.

4a) The first entry will have 'civicrm_contribution' in the entity_table
field and the contribution ID of the contribution itself in the
entity_id field.  The financial_trxn_id field will use the the
id from the entry you created in Step 3.

4b) The second entry will have 'civicrm_financial_item' in the entity_table field and the id from the civicrm_financial_item table in the entity_id field.  Again, the financial_trxn_id field will use the id from the entry you created in Step 3.


Fonts for TCPDF are generated, and are located in civicrm/vendor/tecnickcom/tcpdf/fonts/ in a format like this:

-rw-r--r-- 1 www-data www-data 1,9K Aug  9 14:44 robotoi.ctg.z
-rw-r--r-- 1 www-data www-data 8,6K Aug  9 14:44 robotoi.php
-rw-r--r-- 1 www-data www-data  78K Aug  9 14:44 robotoi.z

To generate the fonts, a static method from the library addTTFfont is called, and saved to the previously mentioned folder.

$roboto_italic             = TCPDF_FONTS::addTTFfont('/var/www/boell_testing/public/sites/default/files/civicrm/persist/fonts/roboto/roboto/Roboto-Italic.ttf', 'TrueTypeUnicode', '', 32);

After this call, the fonts should be available. The civicrm has to be told that there are additional fonts, which is done via a global settings array:

global $civicrm_setting;
$civicrm_setting['CiviCRM Preferences']['additional_fonts'][$roboto_italic] = "Roboto Italique";

In civicrm/CRM/Utils/PDF/Label.php --> public function getFontNames() the fonts are added to the menu and are available in the drop down menus for, in this case name Badges. But every other PDF generator using TCPDF should have the fonts as well.


CLI Contact Import is not importing address details

The CLI Contact import is meant to work on a per-entity basis, since it uses the API.  So Contact is a separate entity from Address.  The Contact entity API has a couple of hacks to accept certain parameters from other APIs - e.g. primary email address - but generally speaking, what you're doing is unsupported.

If you'd like to do what you're doing via command-line, you have a couple of options:

Pull the contact ID into your CSV, and do a second import using the Address entity.
Write a small PHP script that handles this using the API Chaining rules.
If you're super-ambitious, you could write support for API Chaining into the existing CLI import, or submit a paid issue queue item to the core team to do so.

If this is a one-time import and you're not a coder, the first choice is the easiest.  Do your initial contact import first.  I use a tool called Pentaho Kettle to automate the process of substituting contact IDs into my address etc. imports - but it's got a steep learning curve if this is a one-off job.  Instead, export contact ID and external identifier from Civi, open it in a spreadsheet program, and use a VLOOKUP formula to generate your address import.


Why does the mailer processQueue method 'shuffle' the array of possible locks?

I don't know the original authors' intent but can find some background and share a theory:

Background: To figure out the origin of some code, it sometimes helps to spot-check the branches in the old Subversion repository. This can require a bit of digging (to trace through incidental merges and cleanups in the history), but ultimately the shuffle() originated in r35243 and CRM-8460. Alas, there's no commentary in there about this detail. You could ping the original author.
Theory: Statistically, shuffling reduces the number of lock-acquisition attempts in one typical scenario. Suppose you're starting up a bunch of workers at the same time. (Maybe you're starting 5 workers, but you've set a limit of 10 workers.) Compare what happens with and without random polling order:

(Without shuffle()) When worker #2 starts and tries its first attempt at lock-acquisition, there's a 100% chance of failure, so it will have to do a second lock-acquisition attempt. Similarly, when worker #3 starts and tries its first lock-acquisition, there's a 100% chance of failure.
(With shuffle()) When worker #2 starts and tries its first lock-acquisition, there's 10% (1/10) chance of failure. Similarly, when worker #3 starts, there's a 20% chance.

Now, even if we accept this theory, it might not amount to much. In a typical Civi deployment, you have a single server with maybe 1-10 workers, and locks are acquired infrequently. The total overhead isn't very high (esp. in comparison to the work being done). However, if one had thousands of workers, or if the communications channels were slow, or if you had to acquire the locks frequently (every second), then it would add up... so it wouldn't be surprising if some folks viewed it as a generally good practice to shuffle when polling.


I use alter template file in 4.7.2. It has been working great for me.

I needed to switch out the contact editor form based on contact subtype. One important thing I found if doing this programically was the clear the template cache.

function customcomponent_civicrm_alterTemplateFile($formName, &$form, $context, &$tplName) {

    // swith contact template based on contact type
    switch ($formName) {
        case 'CRM_Contact_Form_Contact':

            $clear = true;

            if ($form->_contactType!='Individual'||empty($form->_contactSubType)) break;

            // there are some weird non printable chars on contact sub type
            $contactSubType = preg_replace('/\W/i','',$form->_contactSubType);

            // switch out the form based on contact type
            $newTpl = 'CRM/Contact_'.$form->_contactSubType.'/Form/Contact.tpl';
            $newDir = __DIR__ .'/templatesconditional/ContactSubType_'.$contactSubType;

            break;
    }

    // clear out old templates -- found CRM_Admin_Form_Setting_UpdateConfigBackend::postProcess -> CRM_Core_Config::cleanup
    if (!empty($clear)) {
        $config = CRM_Core_Config::singleton();
        CRM_Utils_File::cleanDir($config->templateCompileDir, false);
        CRM_Utils_File::createDir($config->templateCompileDir);
    }

    // switch out the templates
    $template = CRM_Core_Smarty::singleton();
    if (!empty($newTpl)&&$template->template_exists($newTpl)) $tplName = $newTpl;
    if (!empty($newDir)&&is_dir($newDir)) $template->addTemplateDir($newDir);
}


Missing Contacts from Mailing Labels in Civi 4.4

How are you trying to reproduce the problem? Are you just running a search and comparing the number of labels to the number of results?  If so, you should expect to have fewer labels because CiviCRM will automatically exclude contacts with "do not mail".

If that's not the issue, try looking at what shared attributes the excluded contacts have. If it is a bug, an important step to replicate and fix the issue is to know what kinds of contacts go missing (or alternatively if it's a new random group dropped on each search run).


How to control which activity types options appear in dropdown when creating new activity in WP version

Certain activity types are reserved by the system for certain purposes. You cannot directly create an "Inbound Email" activity, for example, because those are created by the email processor in CiviCRM.

You can add new activity types by going to Administer -> Customize Data & Screens -> Activity Types in the menu.


Using checksums to access the civicrm/user dashboard

Checksums can only be used for visitor facing forms like event registration, membership sign up or profile forms. If you have drupal as frontend you can also use it in the webform module. It is not usable for backend screens.

Also see http://wiki.civicrm.org/confluence/display/CRMDOC/Tokens


joomla privileges: can't grant allow to add contacts

Update to the latest Joomla version, which is now 3.7.4. There were problems with the ACL settings for CiviCrm in earlier versions that are solved in the latetst versions of Joomla.


How to handle donors that pay by wire transfer

I copy and paste your questions in slightly different order and intersperse them with my responses in an attempt to provide a clear answer:

Should I complete reconsider the usage of memberships for this type of setup entirely and do something different?

      Since, as you state, the entire family gets benefits as a result of a single donor making a donation, using memberships makes sense to me.

How can I automatically renew these memberships so they are extended but waiting for payment?

      if you were to use a payment processor like iATS who offers ACH capabilities and who works specifically with non-profit organizations and has developers who are dedicated to the development and maintenance of their CiviCRM extension, you might actually end up saving money since you would be able to set up recurring membership payments directly through Civi on whatever schedule your donors prefer (or your donors would be able to do so themselves online), and you would free up staff time to do other things than to re-enter financial information for payments handled outside of Civi.

How can I enter multiple payments for donors who split up their payments (as rediculous as it sounds, I have one who pays €2,17 every quarter), or for those who pay more but in multiple instances?

      Ah, if you want to speak of the ridiculous, how about a donor that asks to split a $18 contribution to 6 different funds? Joking aside, if you still choose not to use a payment processor, then as Eli suggests, using pledges to be paid in installments is the method that I am most familiar with, but this means maintaining memberships separate of financials which may not be the best process for you.

How can I tell which households still need to pay (part) of their fee?

      Again, the use of pledges is a process that I am more familiar with than the use of membership contributions, but if you continue to manually record these contributions in the back-office, you can enter a membership contribution with a status of "partially paid" or "pending" (in the case that no payment was received upon initial creation of the membership).

      To search for pledges with balances still due, Contributions > Pledges > Find Pledges and select the pledge status of Pending, In Progress, Overdue, and Partially paid

      To search for memberships contributions that are either pending or partially paid, you can use Contributions > Find Contributions, select the relevant pending statuses, and select the financial types you use for those membership contributions.

How can I send an e-mail to donors when the e-mail address is on (one of the) household members and not on the household itself?

      For this, you would either need to have the email address of the primary member on the household record, or you would need to maintain the memberships on the individual record (and related contacts would be provided membership according to the membership type configuration). The latter method is the one we recommend to clients given that when members login, they typically do so with an an individual login, not a household login - if you eventually open up the option for online membership signup, you will then have a mix of household vs. individual memberships that may become difficult to manage and report on consistently. Detailed instruction on how you would set up memberships to manage this process can be found at the following link: https://docs.civicrm.org/user/en/stable/membership/defining-memberships/#membership-types

      If the purpose of your email is to remind members of renewal, you can use scheduled reminders - documentation for setting these up on memberships can be found at the following link:
      https://docs.civicrm.org/user/en/stable/email/scheduled-reminders/#chasing-members-who-have-not-sent-membership-payments

So, as you can see, there is quite a bit of research to be done, but the best way to figure out the best way to track this information is to learn through testing to see if the end result provides you with easily obtained information through reports that already exist within CiviCRM.

Good luck,
Tamar


Out of curiosity: why would you want to do that?
You can remove it in the css, by adding a little jQuery to a template and then add the template to the Contact Summary, or by changing your specific copy of the Summary template. You can get more information on how to do this on
http://wiki.civicrm.org/confluence/display/CRMDOC/Customize+Built-in+Screens


This sounds like a duplicate, or at least new variation in 4.7.1 of, Formatting of formatted text in print case and activiy audit


Can I use {contact.checksum} in membership confirmation receipt

You can include token in any message template. The system workflow message template doesn't show editor hence you will need to add content in html format. But the normal message template does show ckeditor, if you want to provide a link to a text you can click on button  on ck editor option bar and add url with contact check sum.

Regarding Thankyou footer, its not possible to add tokens as CiviCRM doesn't support it at the moment, however you can certainly achieve this by implementing preProcess() or buildform() hook via extension/plugin/module.


Problem solved - after updated mariaDB
following
Uncaught CRM Core_Exception Transaction/Manager.php

and
re-installed stripe.


I just created a custom extension that uploads a  CSV file and reads it into a table.

I added the file element in buildQuickForm as follows

  $this->add('File', 'uploadFile', ts('Import Data File'), 'size=30 maxlength=255', TRUE);

And the processing of the file was is done  with

public function preProcess()
{
    if (isset($this->_submitFiles['uploadFile'])) {
        $uploadFile = $this->_submitFiles['uploadFile'];
        $importer = new CRM_Importer();
        $importer ->truncate();
        $importer -> importCVStoTable($uploadFile['tmp_name']);
    }
}

I think the key element is $this->_submitFiles and you already found about the tmp_name


There is an extension which will record exports using civicrm export from contact search. Unless you have this extension installed there really isn't a way to see if there were specific exports of information.

More information on the extension can be found here


PHP Fatal error Class 'CRM_Extension_ClassLoader' not found in civicrm/civicrm/CRM/Extension/System.php:196

Sorry, I finally found the solution.  It was incredibly simple but hard to find.  When I uploaded the new version of civicrm using FileZilla, it said all transfers were successful and 0 failed.  However, there were a few files, one being ClassLoader.php, that were 0 in File Size.  It marked it as successfully uploaded, but didn't upload any content.  I just used FileZilla to upload all files again with the option to only Overwrite if the size was different, and it fixed these errors.


membership source field not displaying in reports or exports sometimes

The fact that the record displays correctly on save suggests that there's a difference between how correct and incorrect values are recorded in the MySQL database.  I've seen this happen on multi-select custom fields when you import values with a comma rather than a value separator.  The field LOOKS ok, but it's not stored correctly - but on save, the form corrects the data.

If you view the underlying MySQL table in a tool that supports showing hidden characters, I'm guessing you'll find one missing (or present) in the incorrect records.

UPDATE: To see if you can view hidden characters, try inserting one into the database.  E.g.:
INSERT INTO civicrm_worldregion (name) SELECT CONCAT('a', UNHEX(01), 'b');

If I view that in the MySQL CLI client, I can't see it:

mysql> SELECT name FROM civicrm_worldregion ORDER BY id DESC LIMIT 1;
+------+
| name |
+------+
| ab  |
+------+
1 row in set (0.00 sec)

I also can't see it from my command line:

~/ » mysql temp -e 'SELECT name FROM civicrm_worldregion ORDER BY id DESC LIMIT 1'
+------+
| name |
+------+
| ab  |
+------+

However, if I pipe to vim then it appears as:

name
c^Ab

That ^A is in blue, which indicates it's not actually "caret then A" but rather "control character 0x01".


How do I delete registrations and automatically recalculate the invoice total?

I believe this is possible with the Line Item Editor extension.


I didn't mean to answer my own question but I kept poking around - I'm also not sure that this is the whole picture:

I found that the main "edit message templates" permission shows the "Message Templates" option in the Mailings menu. But with either of the other two permissions turned on, you can still access the page at yoursite.org/civicrm/admin/messageTemplates.

I also found that the ability to Enable/Disable a template is tied to the new permissions. The option is displayed but it throws an error if you try without the additional permission(s)

  API permission check failed for MessageTemplate/create call; insufficient permission: require edit message templates and edit user-driven message templates and edit system workflow message templates

Meaning you'll want to add these additional permission(s) to anyone who already had the previous "edit message templates" permission - so that they are still able to enable / disable templates.

If anyone has additional info please feel free to add!


CiviEvent URL Aliases being munged in Drupal 7

This is still working for me using redirects

admin/config/search/redirect

sends

/join

to

/civicrm/contribute/transact?reset=1&id=3


will a scheduled reminder be sent after the specified date, if it hasn't been sent before?

From memory scheduled reminders will only look into things within a 24hr window. So if you said 1 day after then the max it will go back is 2 days (1day + 24hrs). This was a while ago though, although I don't think things have changed.


Payment gateway for WordPress and Drupal

CiviMember also intersects with the payment plugin, potentially.

But the basic functionality can be built without reference to how it's used.

You'll want to start with this:

https://docs.civicrm.org/dev/en/latest/extensions/payment-processors/


The instructions you found I have used several times and I think they are still valid. So, in your case first upgrade CiviCRM to a version with both a drupal 6 and drupal 7 version, then upgrade drupal and use the same version of CiviCRM. Then I'd advise to further upgrade CiviCRM to the Long Term Support version 4.6.


Can't install extensions on CiviCRM 4.6.36 with Drupal 7.59

The syntax looks fine for me. You will need to check php version you are using. It should be 5.5 or more i believe.


Install Development Environment CiviCrm for Drupal 8

UPDATE: You can use this method but instead of a version 5.x in the composer command specify dev-master.

You can also use buildkit with e.g. target d8rec-clean. See https://github.com/civicrm/civicrm-drupal-8/pull/37

OLDER:

Here's what I've been doing. I don't think it's the ideal solution and am curious if anyone else has a better way.

Use the roundearth installer as normal to install the latest "numbered" version. (https://gitlab.com/roundearth/drupal-civicrm-project)
Hack the vendor/roundearth/civicrm-composer-plugin/src/Handler.php file so that:

(a) getCivicrmCoreVersion() returns 'NIGHTLY'

(b) addMissingCivicrmFiles() uses https://download.civicrm.org/latest/civicrm-NIGHTLY-drupal.tar.gz as the civicrm_archive_url.
Delete vendor/civicrm/civicrm-core
Run composer require civicrm/civicrm-core:dev-master civicrm/civicrm-drupal-8:dev-master


Dropdowns in the admin area appear underneath the modal window

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


If there is no state/Province API you would have to create one? Assuming you put your import script into an extension, this is not very hard to do. Using civix you can do generate:api StateProvince Get and the codes files (which you then have to adjust) will be generated for you. If you want to know more check out http://wiki.civicrm.org/confluence/display/CRMDOC/Create+a+Module+Extension#CreateaModuleExtension-AddanAPIfunction


Searches generate error 'CiviCRM_API3_Exception: "Constructor failed"'

On the surface this was a memory issue - increasing PHP memory limit from 512mb to 900mb fixed the error and let search work as before.

The most likely cause was the ICU update for PHP 7.2.16 - http://site.icu-project.org/download/64 - which came out & was merged into FreeBSD the night before the problems emerged. I can't really take it any further than that. The ICU update referenced "Various Out-Of-Memory (OOM) issues have been fixed" so maybe that's a clue if someone else had the same problem and can't increase PHP memory limit further.


Can I configure CiviDiscount for additional participants?

I don't think that you can use CiviDiscount for the work-flow you are describing.

CiviCRM does have another way of registering multiple participants, and that is with the use of price sets.  You could use this to offer a discount.  However, this method would only be useful fo you if you don't need to collect any information about the additional registrants.

If you went down the price set road, you would turn off register multiple participants on the event config, create a price set and and set your event fees to use this price set.

An example price set would look something like this:

First price field: a required check-box set at $100 dollars (this handles the first registration)
Second price field: a text/numeric quantity field set at $80 that increments the registration count by 1 (for all subsequent registrations)

Note: We are not using CiviDiscount at all in the price set example above.

Aside: "Option to apply discounts to additional participants" would probably be better worded as "Discounts can be applied to additional participants" in the documentation.


Error: Sorry an error occurred Supervised rule for Individual does not exist

It sounds like you don't have a rule for Individuals that is set to be the supervised rule.

Here's the description of this rule type: "The 'Supervised' rule for each contact type is automatically used to check for possible duplicates when contacts are added or edited via the user interface. Supervised Rules should be configured with a broader definition of what constitutes a duplicate."

In my CMS (Drupal), I find the page to set these here: http://www.mydomain.com/civicrm/contact/deduperules?reset=1

You'll want to choose how a record is determined to be a duplicate when you're adding/editing someone. And then set that rule to be your supervised one.


How to set up 'renewal reminders' 5 days after renewal, and filter by a group

I spent some time looking through the source code and the history of this feature.  After review, I think you're best off trying to implement this via CiviRules instead.

Your CiviRules trigger should be "Activity added", not membership-related.  Otherwise you run into similar limitations as the Scheduled Reminders approach.
Your conditions can be "Activity is of type: Membership Renewal" and "Contact is in Group: X".
You'll also need to install the Email API extension so you can add an action of "Send Email".


Can I change a contribution's values for Financial Type and Campaign directly in SQL without danger?

If you're not using the in core CiviAccounts bits - then changing the financial_type_id is ok. We do lots of retyping (update more specific financial_type_ids ad-hoc) - on projects where we do our own Accounting integration i.e. bypassing the core CiviAccounts.

PS - forgot to note that updating campaign_id should be safe


Wordpress subscribe.url not using base page

SOLVED at https://lab.civicrm.org/dev/wordpress/issues/27/

Old workarounds:

I tracked down the problem somewhat and opened an issue at the bug tracker.  I describe a code change which makes this work...but I don't know whether it's the best solution.

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

UPDATE: I couldn't get that old fix to work any more after upgrading to CiviCRM 4.7.21.  So I put in an Apache rule in my .htaccess file to redirect:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI}  ^/wp-admin/admin\.php$
RewriteCond %{QUERY_STRING} q=civicrm/mailing/confirm
RewriteRule ^(.*)$ /civicrm [L,R=302]
</IfModule>


why are contacts images stored as absolute URLs?

The schema for contact records specifies that the image be stored as URL (civicrm_contact.image_URL).

As an historical matter, I don't know why this was chosen, but it does come with some trade-offs:

If you write a UI in a different PHP stack, it's easier to share image uploads if they're URLs. For example, webform_civicrm accepts uploads using Drupal/webform techniques and then simply sets the URL.
If you have a complex site that spans multiple domains, the contact images can be shared. Similarly, if you're migrating into Civi, you can import the URLs without rearranging the image files.
It's trivial to include the image URL as a mail-merge token.
If you migrate the Civi site to a different URL, the contact images break.
If you access via APIv3, it's can be awkward to manage image data.

To fix contact images after migrating to a different URL, use SQL to perform a search/replace on field image_URL of table civicrm_contact. For tips on composing a search/replace, see, e.g., https://stackoverflow.com/questions/1876762/mysql-way-to-update-portion-of-a-string


It sounds like you would want to create a custom token. See https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_tokens/
So for the value of the token you would need to do the Swish api call and then use the result.


Can a message template replace tokens with appropriate translations?

This is not really an answer but a work around.

You can use smarty's to look for the English and replace it with the French (which I'm guessing at).

{if "{contact.gender}" eq "Female"}
    Femme
{elseif "{contact.gender}" eq 'Male'}
    Masculin
{/if}


Why would my CiviCRM CSS file not load correctly?

I would guess it is likely an issue with domain name and/or HTTPS conflicts. In your civicrm.settings.php file you define a CIVICRM_UF_BASEURL which may or may not include the www or https:// on the domain name. For example, it could be:

http://yourdomain.org/
https://yourdomain.org/
http://www.yourdomain.org/
https://www.yourdomain.org/

So my recommendation is to make sure that you forward the other 3 versions to the version you would like to use throughout the site. Then you may want to double check that the URLs set up in the CiviCRM Resource URLs page match (Administer > System Settings > Resource URLs).


Embed video in Profile field for directory

I followed the same steps on wpmaster and i was able to add embeded video. Here is what i did:

Added 2 custom field of type Link and Note(RichTextEditor).
Added above 2 fields in a Profile search.
Updated custom field for individual

Added video link to link type custom field.
Added embed video code to Note type custom field.

On Profile search mode i did a search on contact #3

Can you check CiviCRM Log to see any error being recorded?


Unknown DB Error When Trying to Disable the Automatic Wildcard Option

I started experiencing this also, although I was trying to enable the auto wildcard option, which I had previously turned off.

I think it's a bug, but did have success updating it directly in the database as a workaround. In the civicrm_setting table there's a value called includeWildCardinVlaue. s:1:"1" means "yes" it's on, s:1:"0" means "no" it's off.

I'm running Civi 4.7.3 in Wordpress 4.4.2 on civihosting.com.

Looks like it might be happening to Drupal users, too. Why can't I save search preferences? Specifically 'Autocomplete Results'


Allow list subscribers to update their email addresses?

Creating such a profile is fairly straightforward.  The (potentially) hard part is for CiviCRM to know who the person is.  You have three options:

If your users can log into your site, then the site will know who they are.
If you can trust your users to enter their data correctly, you can give them a blank form to fill out and configure your Unsupervised Dedupe Rule to identify the record that needs updating.
You can create an email linking users to the profile using a URL with a checksum token.  These can be a bit confusing to add to your emails for non-technical folk, in which case you may want to install the Fancy Tokens extension, which gives a nicer user experience.

As for the form itself, you can use a profile, or if you need something fancier you can use Webform with CiviCRM integration (if you use Drupal or Backdrop) or Caldera Forms CiviCRM (if WordPress).

If you haven't created a form like this before, and you aren't a documentation learner, you can find videos on YouTube covering CiviCRM profiles.

It often helps to include first and last name as read-only fields, it helps folks understand that the system knows who they are.


Webform: recommended permissions handling when using existing contact feature

Not that I'm aware of. Permissions in CiviCRM typically follow the logic "you either have permission to access this contact, or you don't." There isn't really a concept of having permission to access a contact on one form but not in other contexts.

A different approach would be to disable permission checks for the org field on that form, but only allow trusted users to access the form (who are not likely to abuse it by hacking other cids into the url).


How can I make a civi event registration form that collects the individual's information as well as the organization to which they are affiliated?

I have a number of webforms where the user is logged in and we have set the auto-complete to be based on the relationship between the user and their organisation.

Contact 1 is the individual and Contact 2 is the organisation.

I would imagine that using non-logged in users is similar, depending on how exposed the organisation list is? Would it make two contacts if there were none matching then create a relationship?


If statement not working if the smarty variable is not set

Try this:

{if "{note.note}" eq ""}None{/if}


Mass mailings and German law conformity – provide do-not-track for civimail (opt-out from track open)

I don't think there is a way to achieve "pseudonymization" without having to touch code (except for turning off tracking altogether). However, implementing what you suggested, i.e. assigning the tracking events to a predefined contact ("Anonymous") one way or another, should be reasonably easy for a developer.

Adding on do-not-track flag is a different story though, that entails a lot of little changes throughout the system. It also raises questions like "if I set this flag for a contact, do we want to keep the previously gathered data?" or "should that flag also affect bounce processing?".

You might also consider doing this as an extension at first, because it will take a while to be released in an official CiviCRM version. Plus, you could make sure it's working and well thought-out.


I believe the issue to be as a result of CiviCRM seeing the payment as being a test.

Essentially, I used the PayPal sandbox configuration for the "production" processor. Looking back at the contributions for the membership, it stated the type was 'Member Dues (test)'.

After setting up and using the dummy processor, the contribution stated was just 'Member Dues', and it then recorded the contribution and membership renewal activities.


Create buttons on action from ResultTasks

By "buttons", I assume you mean the buttons referenced in the screenshot below.

It's not recommended to edit the .tpl files directly - it's hard to maintain, and will be overwritten any time you upgrade.  Instead, it's preferable to use an extension with hook_civicrm_links, which allows you to inject your own links.

My Fast Action Links extension also provides a framework for adding links; you can either use it directly if it makes sense, or use it as an example of how to inject links to search results.


Help: Fatal error doing an export (Civi 4.7.4)

Line 435 in CRM/Export/BAO/Export.php that your error message is referring to says:

if (!empty(self::defaultReturnProperty($exportMode))) {

This will give an error in all PHP versions below 5.5. From the PHP manual (http://php.net/manual/en/function.empty.php):

  Prior to PHP 5.5, empty() only supports variables; anything else will
  result in a parse error

You should be able to fix this by replacing lines 435-437 in Export.php with something like

  $key = self::defaultReturnProperty($exportMode);
  if ($key) {
    $returnProperties[$key] = 1;
  }


This is my answer pasted from this question

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


Mailing labels - print: "TCPDF ERROR: Some data has already been output, can't send PDF file"

I imagine the ideal solution would be to sniff out the reason there's content in the output buffer when there shouldn't be. That's not what I did. Knowing very little about PHP, I looked up functions pertaining to the output buffer, then added

ob_clean();

right after the author/version comments in tcpdf.php ... that's the only change I had to make. Successfully downloaded my address label pdf in Civi and patted myself on the back.


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

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

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

HTH

Pradeep


Is CiviEngage available with Backdrop CMS?

It seems that the long-term plan is to turn CiviEngage into an extension for CiviCRM (see here and here) and deprecate the module. I don't see much recent action on that front, so you might be right that a simple port to BackdropCMS from the Drupal7 module would be the quickest way to start using it in the meantime. In short:

If you are able to help convert to a native CiviCRM extension (by coding or sponsoring), that
would be a great place to start.
If you can't do that but can do the module port to Backdrop CMS, that should be quite painless (he says without having looked at the code directly).
Beyond those, you could also submit a module port request for Backdrop CMS here. (I'm guessing it won't get into CiviCRM's core Backdrop implementation since the plan is to phase that into an extension, but it could be ported and hosted on BackdropCMS's contrib section in the meantime until such an extension exists).

UPDATE: It seems that CiviEngage may be ported to Backdrop and included in the Backdrop version of CiviCRM, unbeknownst to me. I have not tested it but give it a shot.
https://github.com/civicrm/civicrm-backdrop/tree/1.x-master/modules/civicrm_engage


Can you create a mailing list based on a relationship setting?

It depends what you mean by relationship status, but go to Search - Advanced search and choose "Display results as" - "Related Contacts" and then in the relationships section lower down make your choices. In the search results list there's an Actions dropdown at the top and one of the choices is Group - Add contacts. You can also choose Group - Create smart group if you want the group to keep updated by itself.
And then use that Group as your Mailing List.


CiviCRM Initalization Error: DB Error: extension not found

This turned out to be the issue with PEAR trying to load DB (mysql) extension. PHP mysql extension is removed from PHP7.

For those who landed here with same errors, when trying to execute commands with civix or drush which uses command-line php (php-cli), if your OS has installed both PHP5 and PHP7, the default php command available in /usr/bin/php refers to PHP7 while PHP5 executable will be available as /usr/bin/php5

One needs to update /usr/bin/php to /usr/bin/php7 and direct /usr/bin/php5 towards /usr/bin/php. Maybe using update-alternatives would be best suited.


How can I send a different Scheduled Reminder to recurring memberships?

If your membership type allows recurring contributions (auto renewal), when creating the scheduled reminder you will see additional options to specify whether this reminder is for non-recurring, recurring, or both:


Dealing with CiviCRM contact records of Drupal blocked accounts

We didn't find a great way of dealing with this. I think we found the best approach was to use Drupal Views and VBO and probably civicrm entities so that we could grab the civi records of the users who we wanted to cull, and then delete the civi record and then delete the user record. If I can dig out the View I will share


CiviCRM 4.7.8 error after upgrade on eWay Recurring

It looks like you had at some point set up the eWay Recurring extension.  Looked at the list of paths, it doesn't seem to be installed currently.

I looked at line 59 in Civi/Payment/System.php, which your error references.  It seems like that function is running based on the payment processors you have configured.

The solution is to either:
a) Install the eWay Recurring extension it's 4.7-compatible); or
b) Go to Administer menu » System Settings » Payment Processors and delete your payment processor that uses eWay Recurring.


CiviVolunteer 2.2 - problem with missing profile

Profiles are in the table civicrm_uf_group, and the table civicrm_uf_field contains the relevant fields for the profile. This does not answer your main question, but may help you workaround.


Is there a "best" forum for suggesting improvements to CiviCRM?

I think it would be useful to ask a self-serving question in SE and then answer it yourself. I think SE has a more public audience and hence improvements get noticed.

In addition, I would suggest starting off on one of the new chat.civicrm.org channels depending on whether it is 'hey i have this new idea' (maybe town square) or 'i need to insert x in to y while not breaking z' perhaps in the developer chat.

hth


Is there a way to make a contact page immediately visually arresting?

CiviCRM 4.7.16+ has the ability to color-code tags.  Color-coding a "VIP" tag should give a quick visual indicator that someone is a VIP.


Contact Summary Layout Extension - Screen display problem

I was setting this up in a staging environment which is not up to date with the latest versions of CiviCRM. If you go are running a version of CiviCRM earlier than 5.24 then you need to apply this patch which solves the problem. The issue is not seen in versions of CiviCRM 5.25 and later.
(https://patch-diff.githubusercontent.com/raw/civicrm/org.civicrm.contactlayout/pull/79.diff)


1/ you might need to add a screenshot to your Question so folk can see what you are seeing

2/ you could visit https://dmaster.demo.civicrm.org/civicrm/dashboard and compare what you are seeing with what the Demo site shows

3/ you could visit https://dmaster.demo.civicrm.org/civicrm/admin/menu?reset=1 and compare what the Navigation Menu looks like there compared to yours


Clean install on WordPress and blank dashboard

I experienced something similar (not sure if the same situation), but I solved it checking database credentials and domain  in civicrm_settings.php on wp-content/uploads/civicrm, may you could check if so.


Strange 'Permission Denied' message when browsing to CiviCRM home page

The errors in your log that you note are not a problem, they are CiviCRM doing a little security check for you (and succeeding).

I've seen this occasionally on my servers, and especially on my staging server. I believe that the cause is indirectly related to the errors you are seeing, in that:

If you're logged in, CiviCRM does a fair amount of these checks before rendering the page.
If you have production-type settings on a not-super-fast server, then you can get timeouts of various flavours that aren't necessarily going to show up in your apache/webserver logs.

As you probably also experience, just reloading the page will solve the issue, presumably because CiviCRM and or the webserver is using some kind of caching so it doesn't take so long.

In my case, extending the default backend timeout in my varnish configuration eliminated the problem.


Menu does not appear unless in debugging mode in wordpress

JavaScript for the menu bar is served up from two different places, depending on your debug setting. So good job tracking down that difference.

in debug mode it is served from a dynamic script which is slower, but doesn't rely on the file system.
in regular mode, the script is cached in a file. If you're CiviCRM files directory is incorrectly configured, or inaccessible due to permission problems on your server, then it will not load. FYI all Angular-based pages (e.g. CiviMail) rely on this file caching as well, so they too will be broken.

I recommend you double-check your system settings for file directories and resource URLs, and also ensure those directories are publicly readable on your server.


How can I get the WYSIWYG editor to appear when using CiviCRM with Wordpress on Cloudron?

This is because your cms.root doesn't match properly with civicrm.root variable and you might be using variables in Resource url for 'CiviCRM Resource URL'.

For such cases you add below two line at the end of the file you will need to change

$civicrm_root = '/app/data/wp-content/plugins/civicrm/civicrm/'; to $civicrm_root = '/app/code/wp-content/plugins/civicrm/civicrm/';

$civicrm_setting['URL Preferences']['userFrameworkResourceURL'] = CIVICRM_UF_BASEURL . 'wp-content/plugins/civicrm/civicrm';civicrm/';
$civicrm_paths['civicrm.root']['url'] = CIVICRM_UF_BASEURL . 'wp-content/plugins/civicrm/civicrm';civicrm/';

Thanks

Pradeep


Autocomplete Contact Search - Add Contact ID possible?

I needed to do something similar. There were two things to work on: getting the Contact ID in the search suggestion in the quick search and getting CiviCRM to search the Contact Id by default when placing a number in the quick/regular search and hitting enter.

Note: I just adapted my code to work with contact ID, didn't test it.

I used a CiviCRM extension with the queryObjects hook:

[myext]/myext.php

// Get the Contact ID to display in the suggestions
function extname_civicrm_apiWrappers(&$wrappers, $apiRequest) {
   if ($apiRequest['entity'] == 'Contact') {
      if ($apiRequest['action'] == 'getquick') {
          $wrappers[] = new CRM_Extname_APIWrapper_GetQuick();
      }
  }
}

function emulate_civicrm_api3_contact_getList($params) {

    $res = civicrm_api3('Contact','get', $params);

    // reformat the output to look like getquick
    foreach ($res['values'] as $idx => &$value) {
        $value['data'] = $value['id'].' :: '.$value['sort_name'] . ( empty($value['nick_name']) ? '' : ' ('.$value['nick_name'].')' );
        foreach (['street_address','city','state_province_name','postal_code','phone','email'] as $col) {
            if (!empty($value[$col])) $value['data'] .= ' :: '.$value[$col];
        }
    }

    return $res;
}

// Get the id to be part of the default search
function extname_civicrm_queryObjects (&$queryObjects, $type = 'Contact') {
    if ($type == 'Contact') {
        $queryObjects[] = new CRM_Extname_BAO_Query();
    }
}

[myext]/CRM/Extname/APIWrapper/GetQuick.php
clas

s CRM_Extname_APIWrapper_GetQuick implements API_Wrapper {

  public function fromApiInput($apiRequest) {

        if (!empty($apiRequest['params']['field_name'])) return $apiRequest;

        $apiRequest['entity'] = 'Contact';
        $apiRequest['action'] = 'getlist';
        $apiRequest['function'] = 'emulate_civicrm_api3_contact_getList';

        $apiRequest['params']['sequential'] = '1';
        $apiRequest['params']['nick_name'] = $apiRequest['params']['id'] = $apiRequest['params']['name'];

        unset($apiRequest['params']['name']);
        unset($apiRequest['params']['option']);
        unset($apiRequest['params']['task']);
        unset($apiRequest['params']['field_name']);
        unset($apiRequest['params']['table_name']);

        return $apiRequest;
  }

  // this never seems called
  public function toApiOutput($apiRequest, $result) {

      return $result;
  }

}

[myext]/CRM/Extname/BAO/Query.php

class CRM_Extname_BAO_Query extends CRM_Contact_BAO_Query_Interface {

    function &getFields() {
        return ['id'];
    }

    function from($name, $mode, $side) {
        return '';
    }

    function where(&$query) {

        $grouping = NULL;
        foreach (array_keys($query->_params) as $id) {
            if (empty($query->_params[$id][0])) {
                continue;
            }

            $this->whereClauseSingle($query->_params[$id], $query);
        }

    }

    function whereClauseSingle(&$values, &$query) {
        list($name, $op, $value, $grouping, $wildcard) = $values;

        $fields = $this->getFields();
        if (!empty($value) && !is_array($value)) {
          $quoteValue = "\"$value\"";
        }

        // Look in CRM_Contact_BAO_Query:2025 for how this is all gatherered into or's and ands

        switch ($name) {
          case 'sort_name':
            // the default search is grouping=0; this is pretty hard coded into CRM_Contact_BAO_Query
            if ($grouping==0) {
                foreach ($query->_where[$grouping] as $key => $val) {
                    if (strpos($query->_where[$grouping][$key],'sort_name')===false) continue;
                    // search id if numeric
                    if (is_numeric($value)) {
                        $query->_qill[$grouping][$key] .= ' Or '.($value ? ts('Contact ID is '.$quoteValue) : ts('Contact ID is not '.$quoteValue));
                        $query->_where[$grouping][$key] .= ' OR '.CRM_Contact_BAO_Query::buildClause("contact_a.id", "=", (int)$value, "Int");
                    }
                    break;
                }
            }
            return;
        }

    }

    public function getPanesMapper(&$panes) {

        return $panes;
    }

}


Why is my membership contribution page not generating a contribution or transaction?

The symptom was caused by a misconfigured membership priceset. Specifically, it had a price field with an assigned membership type that had been disabled.

If you want to check your database for a similar issue, you can use this sql:

select pf.label,fv.id,fv.price_field_id,fv.is_active,fv.label,mtype.name,mtype.is_active from civicrm_price_field_value fv left join civicrm_membership_type mtype on fv.membership_type_id = mtype.id left join civicrm_price_field pf on pf.id = fv.price_field_id where fv.membership_type_id > 0 and fv.is_active = 1 and mtype.is_active != 1;

If that sql returns any rows, you probably want to disable the corresponding price field values in the price field labelled by the first column of the results.


How can I get custom file fields in an activity to display correctly?

It sounds like you're encountering CRM-17791.  This bug was discovered and fixed in CiviCRM 4.7.  I would recommend upgrading a test copy of your site to 4.7 to see if that resolves the issue.  If so, consider upgrading or funding the long-term support team to backport a fix to version 4.6.


Can CiviCrm be used for membership and financial management?

You may need to use an accounting system such as Xero which has integration with CiviCRM to fully achieve the goals.

You can find some documentation about the integration here and here


Not inserting a ACL Role using ACL Role API

Make sure the value 14 for acl_role_id is correct.

ACL role is an option value pair and should to be set as one of the existing value available from civicrm/admin/options/acl_role?reset=1.

UPDATE - just tried on my local and looks like a bug to me. Can you raise this as a new ticket at https://lab.civicrm.org/dev/core/issues/new?


How can I search for upcoming birthdays?

There is an extension called "Birthdays By Month" which may prove helpful:

  BIRTHDAYS BY MONTH

  This extension lets you look up contacts that have a birthday on a
  given month. Once installed access it at ~/civicrm/birthdays-by-month.
  Author:  S. Lee Gooding


Copying the CiviCRM installation in a different machine

See documentation on moving an existing installation to a new server or location on this link: https://wiki.civicrm.org/confluence/display/CRMDOC/Moving+an+Existing+Installation+to+a+New+Server+or+Location


Event confirmation e-mail is showing empty values for the mandatory profile fields

Mandatory was not the trigger of this.
Fields of type: "Money" don't get printed in the e-mails.

Another nice one!


How do I debug CiviCRM when I hit a blank page / white screen / fatal error?

A white screen (WSoD or "white screen of death") indicates that PHP is configured not to display errors, and has hit an error which it can't recover from. The result is an empty page.

Your next step is not to fix the error, but to first give yourself enough information to identify the source of the error. (Diagnose, then treat.)

Viewing errors in logfiles

The webserver can be configured to display errors to screen, but it also logs errors to files on disk. These files vary depending on your hosting environment, so you might consult your webhost's documentation to locate them. You might look for errors in some of these locations depending on webserver/php config -

/var/log/nginx/*err*log       # NginX webserver error logs
/var/log/apache2/*err*log     # Apache webserver & mod_php error logs
/var/log/*php*log             # PHP-FPM & PHP-CGI error logs
/var/log/php5/*log            # PHP-FPM & PHP-CGI error logs
/path/to/site/err*log         # Some hosting environments

And a CiviCRM specific debug log file - location varies depending on hosting environment and CMS, refer to this wiki page for location -

path/to/site/path/to/civicrm/files/ConfigAndLog/CiviCRM*log

(The *s above represent a wildcard, not an actual filename. Eg the last entry might be public_html/error_log on Bluehost.)

Once you've located these files, you can download them to view, or you can use tools like tail or less +F to follow the files. I prefer to follow logfiles because you can watch the error appear each time.

Displaying errors to screen

You may prefer to display errors to screen. This is probably disabled on your site because it's a security risk to some degree - an attacker can see more information when errors are visible, so the default configuration is often to restrict visibility to people with server access (via the logfiles above).

To enable error display, either:

Configure your PHP to display errors for your site via php.ini / .htaccess (see How can I get PHP errors to display), OR

Add PHP code to enable error display (you can add it in civicrm.settings.php or the top of the index.php of your host CMS).

<?php
  error_reporting(E_ALL);
  ini_set('display_errors', TRUE);
  ini_set('display_startup_errors', TRUE);

Making sense of what you see

Once you've taken one of the above approaches, try reproducing the actions which led to a white screen. If all's gone well, you should see an error now (on screen, or in your terminal / SSH session).

This is where you can start debugging meaningfully. There's a good chance you're exhausting server resources (timeouts, memory exhaustion) or hitting some coding error, but once you have the relevant error message at hand you'll be much better equipped to track down the source of the problem affecting your site.

Further reading

Debugging on docs.civicrm.org/dev is probably a better source than this answer now
Stack Overflow: How do I get PHP errors to display?
Where should one look for logs when debugging a new problem?
Drupal.org: Blank pages or White Screen of Death
Joomla SE: What is an efficient way to troubleshoot a White Screen of Death
CiviCRM wiki: Debugging for developers

Notes

If this is the first time you've looked, there may be other errors visible which don't relate to the problem at hand. You may still need to discern what the actual problem is ...

If you're not familiar with UNIX, this may seem like a lot of effort. It's a lot less effort than guessing your way through a problem though!


Priceset fields do not appear on CiviEvent form (field notes do) | Backdrop

As had no data to speak of in db, dropped tables in Civi db and reinstalled CiviCRM. Replicated form and works as expected.


Early Bird Registration by Membership Type

There are two approaches you can take.

One is to use the Group-Based Pricing extension with price sets to enable members-only price sets.

You could also use a custom extension - about 10 lines of code should get you there. See Are private contribution pages a thing?


See Problem with CiviCase, which is scheduled to be fixed in version 5.6 as per the comments there.


CiviCRM will not try and send to an email address that is marked on hold (regardless of any other characteristics of that email (primary, bulk mailings).

If a contact has multiple email addresses and one or more of them is on hold, then CiviMail chooses the 'next' available email address and tries to sent to that.

More background here: https://docs.civicrm.org/user/en/stable/email/maintaining-healthy-email-lists/#what-do-i-do-if-an-address-is-put-on-hold


Unable to load registration pages or save registrations

It sounds like you may be having a problem with SSL pages.  I suggest checking that you're not switching between HTTP and HTTPS.  If you are, try going to Administer menu > System Settings > Resource URLs and changing "Force Secure URLs" to "No" until you have your SSL certificate straightened out.


Can't Remove CiviCrm Membership Type From Being Visible Publicly

I just saved the changes in the contribution page and that somehow fixed it. Not clear how the price changes updated (without saving) but not the actual membership type, but that's okay.


Becca, the Vanco processor has been upgraded to 4.4 and is being utilized by several organizations.  It is publicly available in git hub.

Hope this helps!


Mosaico - ImagickDraw unable to load any image on templates

After looking for a while, I found this was due to the whitespace before <?php i.e

<space><?php (starting of the file)

in civicrm_settings.php file which was messing the png file generation. On removing this space, the image was loaded correctly without errors. So if anyone encounters this error, make sure all your included files are white-space free before <?php.

Update: This normally occurs due to an invalid image that is formed by the headers. Flushing the headers with ob_clean() just before specifying the same have also worked for some users. There is a great answer https://stackoverflow.com/a/2591854/4243217 which explains about the space issue while creating image using ImagickDraw(used by Mosaico).


I think it's fair to say the new Civi\Token\TokenProcessor model is still evolving, but the older method still works and is the easier option for now unless it is not sufficient for your needs.

You can find a range of extensions doing things with tokens here


Is it possible to Pre-Fill Form Fields Using URL Parameters?

Most pages don't support this out of the box because securing inputs is tricky.  CiviReports supports this, and search pages are starting to support this (it works for a handful of fields and more are coming) but for now, if you want to do this, you should probably write a bit of jQuery to parse the url argument and fill the field in.

EDIT: See this Github issue which tracks the status of documenting the fields that are supported by passing parameters in the URL.


Thank You page on contribution form. Print option for the PDF that is emailed as "receipt.pdf"

Not tested yet, but can you try calling /civicrm/contribute/invoice?reset=1&id=<contribution_id>&cid=<contact_id> in the href instead of javascript:window.print()?
Note that the token <contribution_id> is the payment id that was created after you submitted the contribution form. <contact_id> is the id of the contact to which contribution belongs. Check if you can already get this in the thankyou template variables. More info - https://docs.civicrm.org/dev/en/latest/tools/debugging/#in-smarty-template-files
Also, make sure you've permission to download the invoice. I think civi requires either access CiviContribute or view my invoices.
UPDATE - For Joomla - The url is - /index.php?option=com_civicrm&task=civicrm/contribute/invoice&reset=1&id=< contribution_id>&cid=<contact_id>


how do I make the FROM box on a bulk email show the same list as a single email?

I guess the "Allow mail from logged in contact" option is for sending Email Activity or Contribution receipt but not bulk emails. Might be because if the bulk emails are not send using site domain address than it end ups in users spam box.

Its a good idea to raise for a feature request on https://lab.civicrm.org/ or you can implement an extension to include logged in users id.