How can I use the API to set a field to NULL on an existing record? Let's say I have a contact which exists and has id = 12345. I can use the API like this...

CRM.api3('Contact', 'create', {"id": 12345, "nick_name": "Bob"});

to change the contact's nick name. Cool.

But when I try this...

CRM.api3('Contact', 'create', {"id": 12345, "nick_name": null});

the call completes with success but does not set the nick_name field to NULL as I'd expect. Why? Is there some other way I can do it?

It doesn't quite feel right to me on the empty vs null front - playing around with the API explorer in 4.7.15, but what I can say is if I do an api call for a contact ID (say, 3) with nickname IS NULL as follows:

CRM.api3('Contact', 'get', {
  "sequential": 1,
  "id": 3,
  "nick_name": {"IS NULL":1}
})

I come up with the result for cid 3 including "nick_name": "", (which would say to me that it's empty instead of IS NULL... but comes up with the previous api call anyways.

Then I run the following test by adding a nickname:

CRM.api3('Contact', 'create', {
  "sequential": 1,
  "contact_type": "Individual",
  "id": 3,
  "nick_name": "nickname"
})

and run the same GET query as above, and get no results as follows:

{
    "is_error": 0,
    "version": 3,
    "count": 0,
    "values": []
}

If I then run:

CRM.api3('Contact', 'create', {
  "sequential": 1,
  "contact_type": "Individual",
  "id": 3,
  "nick_name": ""
})

and run the first GET query... I come up with the same result as the beginning again... which appears to be a contact with nickname empty ("") rather than null.

TLDR; It looks like you can use

CRM.api3('Contact', 'create', {
  "sequential": 1,
  "contact_type": "Individual",
  "id": 3,
  "nick_name": ""
})

even though it doesn't feel quite right... if you're trying to pull that contact up with "nickname IS NULL" searches using the api.


Donor wall in CiviCRM Does CiviCRM ship with or have an extension for a donor wall? If so, how well does it work? If not, what is a good solution for creating and managing a donor wall that will work with CiviCRM installed under WordPress?

For wordpress I think you will have to write some custom development.  I tried to use a search profile for this but found it was lacking.  Perhaps you can figure it out but with drupal there are many possibilities.  The code reference is very old but may get you part way there.  I think this would be a great extension if you have funding.


Cannot bootstrap Civi from standalone script in WP We have an old script in the bin folder that bootstraps Civi like so:

require_once '[whatever]/wp-content/plugins/civicrm/civicrm/civicrm.config.php';
require_once 'CRM/Core/Config.php';

But as of 4.7 this no longer works. We get:

PHP Fatal error:  Uncaught exception 'Exception' with message 'Failed to locate civicrm.settings.php. Please boot with settingsFile, search, or CIVICRM_SETTINGS; or normalize your directory structure.' in /var/www/vhosts/humanism.org.uk/wp-content/plugins/civicrm/civicrm/civicrm.config.php:125

I've tried hardcoding the link as recommended here. This gets me a step further, but it then can't find the CMS root folder. And I'm not sure where to set that. I've also tried creating a settings_location.php file to no avail.

I've tried to modernise it by using cv as per the wiki, but I get the same problem:

Failed to locate civicrm.settings.php. By default, this tool searches the parent directories for a standard CMS (Drupal, WordPress, etal) and standard civicrm.settings.php. Symlinks and multisite configurations may interfere. To customize, set variable CIVICRM_SETTINGS to point to the preferred civicrm.settings.php

Civi runs fine otherwise - it's just external scripts that aren't happy.

Any ideas? We're on WordPress, with a standard folder structure: Civi sits in /wp-content/plugins/civicrm.

Sorted. The problem was that the script was being run by the web server cron, rather than civi cron. As such the working directory was my home directory. Hacky fix is:

chdir(__DIR__);
eval(`cv php:boot`);

Better fix is to make it run via Civi cron.


How can I get $params into my own scheduled job? Looking for some help on getting $params to be passed on from the scheduled job -> GUI page -> into my scheduled job; so:

function civicrm_api3_job_ecocalculate($params) {

I'd like to be able to pass in e.g.

But when I try this I just get $params = null in my function;

What am I missing?

This is what I have:

(I know you can read it :-)

And in my code:

function civicrm_api3_note_Migrate($params) {
  // param migrate_type determines what will be selected, defaulted to contact
  $validTypes = array('contact', 'contribution', 'participant', 'relationship');
  if (!isset($params['migrate_type'])) {
    $entityTable = 'civicrm_contact';
  } else {
    if (in_array($params['migrate_type'], $validTypes)) {
      $entityTable = 'civicrm_'.$params['migrate_type'];
    } else {
      $entityTable = 'civicrm_contact';
    }
  }
}

But I am not sure if that is what you mean?


How can I show multiple repeating custom field values in a single cell on a report? We woud like a simple contact report which, rather than showing a single row for each custom field (with repeating contact name on each row), shows a single row for the contact and shows all the repeating custom data in a single cell.

Could anyone share a simple reporting template example that does this?

I've investigated this myself, but haven't had to do it yet.  Broadly, you would use the GROUP_CONCAT MySQL function.  You can see examples of this being used on core contribution reports for displaying multiple credit card types for contributions paid in multiple installments with different cards.

I also have a fork of the salutations extension that provides a UI for exporting multiple-record custom groups as part of an export.  Instead of putting all the data in a single cell, I break the data out into multiple columns, but all on the same row.

You could also use the SQL Tasks extension to generate the report using pure SQL, if you need a quicker solution and can trade off some configurability.


What's the best way to record payments in installments? In the setup I currently have, parents can choose to pay tuition in one annual, two bi-annual, or 10 monthly installments. I attempted to set it up as pledges, but payments do not get counted towards the pledges, nor do I seem to be able to go in afterwards and connect the payments to the pledge. (Is there any way to do this?) So as it stands, it's all manually checking whether an individual has paid for the month, there is no easy report to call up. This works at our current scale, but won't for much longer.

How would you set this up if you were to start from scratch?

I would consider using Membership Types rather than Pledges. You could set up each payment term as its own Membership Type, with different terms (ie 1-month membership that lasts for 10 months; 6-month membership; etc). Then create Membership Contribution pages for each term. You could turn on the auto-renew feature, or make that optional and setup payment reminder emails.

You could also create a new Financial Type called Registration Fee (or something similar) so that it's clearer what the payment is for. Even if you already have memberships set up for something else, you can set the system to allow multiple memberships, and just change the wording on the public-facing pages so it doesn't confuse the parents.

Caveat - I haven't set up CiviCRM this way before, but am currently considering it for one of my clients that is a preschool. I played around in the demo a bit to see if this would work as I'd like it to, and so far haven't run into anything that would make it seem otherwise.


Civi posting additional records for recurring PayPal transactions I'm having problems with recurring transactions with Paypal Pro.  It's posting additional financial_trxn and financial_item records.

I have exported an example including the following tables:

civicrm_contribution
civicrm_contribution_recur
civicrm_entity_financial_trxn
civicrm_financial_item
civicrm_financial_trxn
civicrm_line_item

Looking at the entity_financial_trxn table, instead of one entry for the contribution and one for the fee, two are generated for each. (Contributions: 283111, 283114; fees: 283112, 283116) Also, the second contribution record (283114) does not have an associated financial_item record created.

In the financial_trxn table, the contribution transaction is entered twice (ids: 141185, 141187).  The first entry does not have a valid payment processor code.  The second does not have the net value calculated or a valid status code.  ALso, the fees are also entered twice (ids: 141186, 141188).  The first entry is missing the payment processor code.

Since there are two entries for fees in the financial_trxn table, there are also two entries in the financial_item table (ids: 142094, 142096).

So the contribution information is not fully correct in either financial_trxn record.  The second fee record in the financial_trxn table is correct.  All of these additional records are making the bookkeeping reports inaccurate.

It's not feasible to replicate on the demo site in this case, which suggests posting an issue in JIRA is okay without that step -thanks for asking.

However, as this is widely-used functionality it's possible you have something misconfigured or misinterpreted rather than there being an error in the code suitable for a JIRA issue bug report.

Could you edit your question here to include the relevant original and subsequent records from civicrm_contribution, civicrm_entity_financial_trxn, civicrm_financial_trxn and civicrm_financial_item as well as the civicrm_contribution_recur record? Please refer to the spec for the entries expected in each table for each contribution at
https://wiki.civicrm.org/confluence/display/CRM/CiviAccounts+Data+Flow and explain how there are too many entries.

(Sorry there's no spec for the contribution_recur table but it wasn't affected by CiviAccounts work.)


What's the logic behind Contribution's Payment Method for offline Contributions? I don't really understand Contribution / Payment Method (Instrument) workflow.
This is a typical scenario when creating Contributions (In many organizations that collect manually the money offline):

Create a Contribution, Status: Pending, Payment Instrument: EFT/Bank (or any custom)

Then when go back to Contribution to Edit it, Payment Method drop-down is not displayed anymore (the only place to see the selected method is in Contribution / View)

Change Contribution Status to Completed
It creates a new payment, but its Payment Method is empty

So this behavior is kind of confusing, and I've got some questions to understand the logic behind it:

Why Payment Method is available to be selected when you create a Contribution, but then when go back to Edit it, it disappears ? (just the drop-down, the payment_instrument_id value still stored in civicrm_contribution table)
Why when Completing the contribution, the payment created doesn't share the Payment Method of its parent contribution?
Is there any internal difference between Completing a Contribution or Recording a Payment?. Recording a Payment allows to select a Payment Method, but what's the point to select one for the Contribution then?

I think it's kind of confusing the way this was implemented in 4.7/5.x, but maybe I'm missing another point of view to understand it.

PS: this is based on CiviCRM 5.4.0

The reason is probably that no financial transaction (which is different from contributions) is recorded for pending contributions.

Once you have a financial transaction e.g. if you change the status to completetes you will be able to edit it in the edit contribution screen (click on the little pen - see screenshot).

I think this behaviour was introduced only recently and I am not sure if it is a bug or a feature that you cannot change the payment instrument before you have a financial transaction.


Column deductible_amount not getting filled in on table civicrm_line_item We use price fields/line items for all of our contributions.  I noticed that on the line_item table the column deductible_amount is not filling in.  I checked and Price Fields do not seem to have an option for "Is Tax-deductible".  Financial Types do have the check box.

My set up is
Financial Types:

Donation (tax-deductible is checked)
Tuition
Reimbursement

Line Items under Donation:

General Fund
Capital Improvement
Staff Salaries
Other __________________

What do I do to have it fill in the tax-deductible amount in the line item table?

As you know, financial types can either be deductible or non-deductible. Before the advent of price sets, to record a partially deductible contribution you would use a deductible financial type and then enter in the non-deductible amount. After the advent of price sets, if the overall financial type of a price set is non-deductible, the system will automatically populate the non-deductible amount field for the full amount of the contribution, regardless of whether the individual price field options are configured with deductible financial types.

What this means is that currently, the system only tracks a non-deductible amount on the contribution level, not on the line item level. The field in the line item table is either a legacy field or a place holder for future use, but it is not something that is currently being populated by the system.

The demo site is down so I am unable to verify what built in tax tokens are available, but for our clients we instruct them to use a deductible financial type for the price set - in this way, our line-item based tokens will allocate each line item's deductible amount according to the financial type of the price field option.

Hope this helps,
Tamar


Civicontribute: Missing payemnt options when required field missing or back button I've hit some strange behavior on a contribution page.  I consider payment usability a big issue.

Using a price set, have radio select for different donation amounts (need price set as different financial types).  Also have an "Other" numeric field.  Payment options has 2 choices: "pay by cc" or "pay by check".

This is a common use case.  Unless you add an explicit "other" in the select list with a 0 value, the option list will show "none" as an option.

Setting a radio select field with numeric value >0 works correctly.
Setting a text / numeric input value >0 works correctly.

Setting a radio with a select numeric = 0 AND a text numeric value > 0 will not present the payment options but will increment the total.

Further problems when field does not validate on page or hitting back button - payment processor selection does not appear.

I see lot's of cc related issues but not this one please let me know if this is a known bug or a new one...

I didn't see a specific issue but this looks fixed in latest template file: http://bit.ly/1NecugN


Why are message templates not appearing when I email a contact? I upgraded a client system from 4.4.12 to 4.5.8 at the weekend and now message templates are not appearing when a user creates an email (regular or bulk).  You can pick a template but nothing appears.  In Administer/CiviMail/Message Templates all the templates are there, and can be edited & saved. My other upgrades to 4.5.8 have not shown this problem so I am puzzled - I've cleared the Drupal caches and CiviCRM caches.

This sounds like a javascript problem. You could either troubleshoot it yourself or just upgrade to the latest version of CiviCRM which has a rewritten CiviMail interface anyway and so the problem is unlikely to be in the new version.


Update to 4.7.12 failed I updated from 4.6.10 to 4.7.12 and it failed at updating 4.7 beta 3 DB, now I cannot load the admin screen at all.  This is the wordpress version. All I get now is:  Sorry but we are not able to provide this at the moment.
DB Constraint Violation - possibly dashboard_id should possibly be marked as mandatory for this API. If so, please raise a bug report.
Return to home page.

Any ideas on how to resolve this?

I had the same issue when doing an upgrade to 4.7.12. I believe The problem was with the civicrm_dashboard table. I copied the structure from a clean install of 4.7.12 and was able to get rid of the error.

This is assuming you are starting from a point where you have reverted to a version of the site prior to attempting the update.

CIVICRM_DASHBOARD TABLE
Make a backup of the civicrm_dashboard table data. Then run the following on your DB to create the dashboard again.

Here is the SQL for my civicrm_dashboard table schema:

DROP TABLE civicrm_dashboard;

CREATE TABLE civicrm_dashboard (
  id int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  domain_id int(10) UNSIGNED NOT NULL COMMENT 'Domain for dashboard',
  name varchar(64) DEFAULT NULL COMMENT 'Internal name of dashlet.',
  label varchar(255) DEFAULT NULL COMMENT 'dashlet title',
  url varchar(255) DEFAULT NULL COMMENT 'url in case of external dashlet',
  permission varchar(255) DEFAULT NULL COMMENT 'Permission for the dashlet',
  permission_operator varchar(3) DEFAULT NULL COMMENT 'Permission Operator',
  fullscreen_url varchar(255) DEFAULT NULL COMMENT 'fullscreen url for dashlet',
  is_active tinyint(4) DEFAULT 0 COMMENT 'Is this dashlet active?',
  is_reserved tinyint(4) DEFAULT 0 COMMENT 'Is this dashlet reserved?',
  cache_minutes int(10) UNSIGNED NOT NULL DEFAULT 60,
  PRIMARY KEY (id),
  CONSTRAINT FK_civicrm_dashboard_domain_id FOREIGN KEY (domain_id)
  REFERENCES civicrm_domain (id) ON DELETE RESTRICT ON UPDATE RESTRICT
)
ENGINE = INNODB
AUTO_INCREMENT = 18
AVG_ROW_LENGTH = 1365
CHARACTER SET utf8
COLLATE utf8_unicode_ci
ROW_FORMAT = DYNAMIC;

CIVICRM_DASHBOARD_CONTACT TABLE
Make a backup of the civicrm_dashboard_contact table data and run the following on it. You will likely need to re-import your data to the new table.

Here is the SQL for my civicrm_dashboard_contact table schema:

DROP TABLE civicrm_dashboard_contact;

CREATE TABLE civicrm_dashboard_contact (
  id int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  dashboard_id int(10) UNSIGNED NOT NULL COMMENT 'Dashboard ID',
  contact_id int(10) UNSIGNED NOT NULL COMMENT 'Contact ID',
  column_no tinyint(4) DEFAULT 0 COMMENT 'column no for this widget',
  is_active tinyint(4) DEFAULT 0 COMMENT 'Is this widget active?',
  weight int(11) DEFAULT 0 COMMENT 'Ordering of the widgets.',
  PRIMARY KEY (id),
  UNIQUE INDEX index_dashboard_id_contact_id (dashboard_id, contact_id),
  CONSTRAINT FK_civicrm_dashboard_contact_contact_id FOREIGN KEY (contact_id)
  REFERENCES civicrm_contact (id) ON DELETE CASCADE ON UPDATE RESTRICT,
  CONSTRAINT FK_civicrm_dashboard_contact_dashboard_id FOREIGN KEY (dashboard_id)
  REFERENCES civicrm_dashboard (id) ON DELETE CASCADE ON UPDATE RESTRICT
)
ENGINE = INNODB
AUTO_INCREMENT = 413
AVG_ROW_LENGTH = 199
CHARACTER SET utf8
COLLATE utf8_unicode_ci
ROW_FORMAT = DYNAMIC;

At that point I would try to run the update again. Let me know if it works...

If it fails again, check your apache logs (here for linux: /var/log/apache2/error.log) and see if it gives you any more detail on what is happening.


Difficulties generating an entity's DAO and SQL for a new extension I have been trying to generate DAO and SQL files for an entity I created with civix generate:entity ... according to the documentation ("Add a new entity" - 4.d.).

Using the latest civicrm-core clone (latest commit e637260) I:

ran composer install on the root (civiroot);
verified that the vendor folder has the same packages that come along with, for example, CiviCRM 4.7.20 for Drupal 7.x (sites/all/modules/civicrm/vendor);
copied the new entity's schema to the xml/schema folder;
altered the Schema.xml itself to include this entity.

However, after running bash bin/setup.sh -g or php xml/GenCode.php this comes up:

  Fatal error: require_once(): Failed opening required 'Log.php'

I.e. <root>/CRM/Core/Config.php is expecting:

require_once 'Log.php';
require_once 'Mail.php';

I searched for a while and I could not find these files, so I just thought of trying it out without these lines from Config.php, but once I rerun I got:

  Notice: Use of undefined constant PEAR_ERROR_CALLBACK - assumed 'PEAR_ERROR_CALLBACK' in <root>/CRM/Core/TemporaryErrorScope.php on line 49

  Notice:  Undefined index: _PEAR_default_error_mode
  in <root>/CRM/Core/TemporaryErrorScope.php on line 74

  Notice:  Undefined index: _PEAR_default_error_options
  in <root>/CRM/Core/TemporaryErrorScope.php on line 75

  Warning:  require_once(PEAR/ErrorStack.php): failed to open
  stream: No such file or directory in <root>/CRM/Core/Error.php on line 36

  Fatal error:  require_once(): Failed opening required
  'PEAR/ErrorStack.php' (include_path='.:<root>:<root>/packages:<root>/vendor/tecnickcom:<root>/vendor/phpseclib/phpseclib/phpseclib:<root>/vendor/pear/pear_exception:<root>/vendor/pear/auth_sasl:<root>/vendor/pear/validate_finance_creditcard:.:../packages:..')
  in /CRM/Core/Error.php on line 36

I did find a PEAR folder but it is in <root>/vendor/pear/pear_exception/PEAR, without any ErrorStack.php file.

I also found a couple of related questions in here:

How to automatically generate DAO classes for my DB tables
How do I add a new table to my extension?

In the last one, I understand that people seem to run the code generator without such problems.

I apologize the long question, TLDR;

what am I missing? What does GenCode.php need in order to run properly?
is there another way to generate DAO and SQL files for new entities?

civix generate:entity is experimental and, last I checked, broken.

When I need to do this, my approach is as follows:

create my XML file for the new entity
run a helper script to generate the SQL and DAO

Have a look at the helper files in CiviVolunteer for guidance; they should work for any project with minimal modification.


How do I create CiviEvents that occur in different timezones? Our site will be host to many different events. Some will happen in meatspace and others online. However, they will all have participants from different timezones or be based in different timezones.

For example, a regular Social Lunch in Adelaide, Australia, a regular Public Lecture in Melbourne Australia and a regular online committee meeting with participants from (at times) more than 5 different timezones.

The current situation with CiviCRM and events are that they are displayed as the raw date and time they were scheduled at and a lay person would assume it's their local time. When in actual fact, it's been scheduled at the timezone of the Drupal7 site (Australia/Adelaide).

This means though, that I cannot set an event for Melbourne Australia, set it to display the correct time the event is occurring in Melbourne and have the ical feed give the correct time. I either have to schedule it at the equivalent Adelaide time (so that the ical feed is correct) or schedule it as if it were Melbourne local time but have the ical feed giving the wrong time.

Is there already a fix for this? If not, my organisation would be willing to commit funding to this issue.

No existing fix I know of. It's maddening, and the prime example of this is civicrm.org! The site runs in US Pacific time, so when we have Washington, DC, meetups scheduled, the iCal has the wrong time.


Menus disappear on update to 5.20.2 (Wordpress) Wordpress 5.3.1 (on Siteground)
[upgrading from CiviCRM 5.19.2 to] CiviCRM 5.20.1/2

Apart from a (quite lengthy) list of templates that might be affected by the db upgrade, this process goes as expected. But upon reloading, I lose the CiviCRM menus and get, instead, the weird mile-long mess at the bottom of the page.

I can confirm a 404 error on the crm-menubar css, and I can also see that the path to that file has changed from the previous installation. The previous path had been:

  www.mysite.org/public_html/wp-content/uploads/civicrm/persist/contribute/dyn/crm-menubar.blahblah.css

in version 5.20.2, it is:

  www.mysite.org/home/user_directory/www/mysite.org/public_html/wp-content/uploads/civicrm/persist/contribute/dyn/crm-menubar.blahblah.css

So I've changed the $civicrm_root (in the settings file) to:

  /home/user_directory/www/mysite.org/public_html/wp-content/plugins/civicrm/civicrm/

But I'm still getting the 404.

I have:

double checked the directory permissions (though it isn't clear why these might have changed)
cleaned up the caches and updated the paths
read about a whole lot of similar cases, here

This isn't (yet) a crisis or anything, but I do keep reverting back to the previous version, as it's a lot pleasanter to deal with (though the security warnings are working as they should, and I'd really like to get this patch).

I suspect that this is related to resource URLs, but I'm not sure what additional steps to take.

The definition of $civicrm_root was indeed the problem; in my settings.php (which had been working for a while) the path used Siteground username (as does DocumentRoot), whereas this should be replaced by the generic 'customer.'

How I got there:

It was obvious that something was wrong with the Resource URL, but I couldn't figure it out (as the comments should make clear). So I reverted to 5.19.2, made a full-site backup, and then uninstalled CiviCRM completely: plugins/civicrm, uploads/civicrm, and the db. Then ran a fresh install to autogenerate a new settings.php file, which I downloaded.

Then I restored the full-site backup & ran the CiviCRM update as normal, except that I put the newly-generated settings.php file in place before upgrading the db. This worked, fortunately, and the only difference between the settings files was the one described above.


Best way to setup lists I am familiar with Drupal and just evaluating Civicrm and having looked around not sure of the best way to do something basic so before going too far though I would check.

I need to manage a membership and the out of the box functionality is fine and getting to grips with that. However when a membership is defined for a user I they can choose to be members of one or more clubs. The list of clubs has associated data (such as location, committee members, url etc) which is managed by the club. Each club is also a member of a region.

I know how I would create this data in Drupal but just wondering the best way with Civicrm.

So what I am after is;

Region (each region can modify the basic data for the region)
  Region A
  Region B
  Region C

Club (each club can modify the basic data for the region. The club needs to select one or more regions to be members of)
  Club 1
  Club 2
  Club 3

Membership need the member to be able to select one of more clubs to be a member of.

Creating the Region and Club in Drupal is straight forward but if I want the club to be listed for the member data what is the best way to do all of this?

Sorry if this is a basic question but just haven't been able to work out the best way so far.

Cheers

I would make region and club to be Organization sub-type and make a relationship between club and region.
So you can use the contact fields for the address info and url and if you need you can add custom fields to each subtype.

Then there are 2 options imo:

Create a membershiptype per club, where each club is the Membership Organization.
Create a custom field of type Contact Reference and add it to the Memberships, where you can select a Club for each membership

Both have advantages and disadvantages. I suggest you try them and see for yourself.


Is there an easy way to increase the width of the list of options for a custom field in the pull down? We have a custom field that has a number of options.  The descriptions of a few of them are long and wrap funny in the pull down, which, sigh, apparently is confusing to some people.  Is there an easy change the width of this pull down?

Well, I ended up needing to figure this out. So in a file mysite.css I put this:

#select2-drop {width: 350px !important;}

Then in Administer => System Settings => Resource URL, I put the path and file name the file in the Custom css URL.  (All the other places to put URLs on the page want just a directory.  Custom css URL also needs the file name.)


Extend quick search box We would like to extend the quick searchbox to include the fields  standard civi field 'source' as well as potentially add some of our custom fields.

Any pointers to where in the base code and examples would be hugely appreciated!

The base code for it is located at navigation.js.tpl where all the menus have been listed with their search inputs.

Adding source as a search field seems to just add another line with a value as source.

Note: Changing core file may not be recommended as you may lose them after upgradation.


Extension page no more reachable I'm developing my first extension (through civix) which contains a custom form and a specific menu item linking to the form.
All was working until today, but suddenly, the page URL is no more reachable, the URL is sometime redirected to the home page, sometime a path warning error is displayed.
I tried to uninstall and reinstall the extension, but unsuccessfully.
What can i do?

Thanks
Marcello

Try updating the file perms of the new extension and then clearing cache :)


One Time Login URL not Received : Looking for a Spare Solution Drupal 7.56 / CiviCRM 4.7.20

Some (only a few) of my users do not receive the "one time login url" mail when they want to reset their (forgotten) password (also checked in spam and trash).

The odd thing is that if I personnaly send them a mail from postmaster@... (using thunderbird for instance), they receive it.
They also receive it if I send it from CiviCRM (from any Organization or Individual).
I find no explanation to that.

So, I envisage to personnaly send them their [user:one-time-login-url]. Can I do that ? How ?

(I know that this is rather a Drupal specific question, and I submitted it to Drupal Stackexchange, but I also submit it here just in case someone has a solution : I thought I could include this [user:one-time-login-url] in a mail sent via CiviCRM, but this token is not available in Civi mailing feature).

If you have shell access and drush - then you can generate a one time user login link using

drush uli USERNAME
Check the Site Name - make sure there are no non alphanumeric characters in it (they end up in the From and we’ve seen Postfix having issues parsing it). Update: specifically : in Site Name (as in admin/config/system/site-information - caused major issues;
Reputation: if email from your server arrives for some but not for others then that suggests a reputation issue - a server along the way has marked it as spam; use mxtoolbox.com to check if your domain is blacklisted somewhere.


How can I revert a set of bulk changes to the database? I made a bulk update of addresses that turned out to be incorrect.  I have advanced logging enabled.  I can go into each contact's change log and revert the mistake one by one; how can I do this for all the addresses I altered?

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();


How to create script to delete smart groups I have 300-400 CiviCRM smart groups I want to delete. I will know the id for the group but need to know what other tables I need to delete that may be related.

Also, is there any way to identify which groups are smart groups?

Here is some code I have tried.

<?php
require_once 'api/class.api.php';
$api = new civicrm_api3();
$result = $api->group->delete ( $id=1544 );
?>

Here is the result:

PHP Fatal error:  Class 'CRM_Core_Config' not found in /home/daweb_dev/democratsabroad/drupal/sites/all/modules/civicrm/api/class.api.php on line 92
PHP Stack trace:
PHP   1. {main}() /home/daweb_dev/democratsabroad/drupal/sites/all/modules/civicrm/delgroup.php:0
PHP   2. civicrm_api3->__construct() /home/daweb_dev/democratsabroad/drupal/sites/all/modules/civicrm/delgroup.php:3

This worked using rest.php

wget -a delgroup.log -O delgroup.out 'https://www.example.com/sites/all/modules/civicrm/extern/rest.php?entity=group&action=delete&key=site-key&api_key=api-key&version=3&json=1&id=923'

I suggest you use the api.

Visiting yoursite.org/civicrm/api will let you try it out.


Looking for hosting company I am looking for hosting providers and would like recommendations as well as any horror stories about you to avoid.

The top two complaints we hear the most from organizations about their previous providers are:

lack of responsiveness/customer service to inquiries.
consistency in maintenance and updates.

When we take over hosting and maintenance services, we try to identify any technical debt that exists so it can be addressed as early as possible in the engagement.

I recommend paying attention to what sort of site/code audits the provider does upfront. It will likely save you in the long-term and start everyone off in the relationship with better and more information.


How to use Views to send a Mailing to a Selection of Recipients? Drupal 7.60, Civicrm 5.6.0

I want to give to my users the ability to send a mail or mailing to a selection of recipients, based upon some cross selection of fields values.

Views is a good tool for this cross selection and to get a recipients list.

But then, how can I pass this list to the Mailing Form ?

I'm assuming what you have is a bunch of Drupal users that you are segmenting using Drupal field values.

Step 1 Go here civicrm/admin/synchUser?reset=1 and make sure all your Drupal users are in CiviCRM.

Step 2. Create a custom field for an individual. Make it Yes/No. Call it My Group or whatever. Make it searchable.

Step 3. Make sure that you have the custom field group added to the database config in settings.php /civicrm/admin/setting/uf?reset=1 so you can use it in Drupal Views.

Step 4. Create a view of CiviCRM contacts. Use a Drupal UID relationship so you can filter them into the group you want. Add the custom field you created in Step 2 to the view. Add a VBO filed. Modify the Entity value of the custom field. Bulk edit the custom field and set it to 1.

Step 5. Go to CiviCRM and search for contacts with the custom field set to yes. Add them to a new Mailing Group.

So you could have this as a smart group. You users just have to use VBO to add in the custom field value to update the smart group.


How to use CIVIHR for wordpress I am working on CIVI CRM on wordpress. I need to make HR module in CIVI CRM. Can anyone tell me how to integrate CIVIHR extension in CIVI CRM.?

There are installation instructions on the CiviHR github page.


Is there the ability to globally update relationship end dates or add them to a profile for bulk updates? Suppose I am using relationships for specific classes where the student in a class (organization) may not have a start and end date. Is there a way for me to look up a particular class and globally update all the students/relationships by adding an end date when that class ends?

I am talking about the relationship between a company (class) and an individual (student) in the join table, not the current "employer" field on the individual record.

Ideally, i would like to globally import end dates but can't do that without the relationship key. Is there a way to create a profile listing all current relationships of an organization where I can manually set end dates for students in a editable spreadsheet/profile format? I have many students assigned to classes that have ended and want to globally end those relationships without having to go to mySQL.

In other words, I need to create a listing of all the "active" relationships of an organization so I can easily edit start and end dates without a pop-up form.

I'm guessing you already looked at Batch Update Relationships although it seems like maybe the extension technique isn't working anymore.

The below is maybe only a step above running some SQL directly and I don't recommend it for the average office staffer but it seems to work and is mostly straightforward. The danger is if you get the criteria wrong you might update way more relationship records than you thought.

Visit [your_site_url]/civicrm/api4
Make it look like this screenshot, where you pick the appropriate org contact and set the end date at the bottom to the appropriate date.

Optionally add a "where" criteria for a specific relationship type or types.
Click Execute.
At the bottom right you should see a list of the updated ones.


Regenerating UF Match I started with a fresh install of Drupal 8 and did a migration of about 5K users.  I am trying to force a recreation of the UF Matches. I cannot find a way to get CiviCRM to do this so I wrote the following code but this is not working either. Currently it delete the UFMatch from the table but it does not finish the final API call that creates the new match.
\Drupal::service('civicrm')->initialize();
$q = \Drupal::entityQuery('user');
$q->accessCheck(FALSE); //This is ran under cron
$q->sort('created', 'DESC');
$q->range(0,1);//Testing
$users = $q->execute();
foreach ($users as $uid) {
    $drupal_user = \Drupal\user\Entity\User::load($uid);
    $user_email = $drupal_user->getEmail();
    $result = civicrm_api3('UFMatch', 'get', [
        'sequential' => 1,
        'return' => ["contact_id", "uf_id"],
        'uf_name' => $user_email,
    ]);
    print $user_email;
    if ($result['is_error'] == 0) {
        foreach ($result['values'] as $value) {
            $uf_id = $value['uf_id'];
            $contact_id = $value['contact_id'];
            $uf_match_table_id_result_array = civicrm_api3('UFMatch', 'get', [
                'sequential' => 1,
                'return' => ["id"],
                'contact_id' => $contact_id,
            ]);
            $uf_match_table_id = $uf_match_table_id_result['id'];
            if ($uf_match_table_id_result_array['is_error'] == 0) {
                foreach ($uf_match_table_id_result_array['values'] as $uf_match_table_id_result) {
                    $delete = civicrm_api3('UFMatch', 'delete', [
                        'id' => $uf_match_table_id,
                    ]);

                    if ($result['is_error'] == 0) {
                        $create_match = civicrm_api3('UFMatch', 'create', [
                            'uf_id' => $uf_id,
                            'uf_name' => $user_email,
                            'contact_id' => $contact_id,
                        ]);
                    }
                }
            }
        }
    }
}

I think the issue might be the $uf_id variable that I am getting from the contact and using in the UFMatch create API call.
Any ideas how to do this better or help with the code is greatly appreciated.
Thanks,
Steve

Did you try 'Synchronize Users-to-Contacts' from UI? You need to make sure you have unsupervised dedupe rule for individual set to email only before running 'Synchronize Users-to-Contacts'


Editing a label in "new individual" form I want to edit a field called "source" in the new Individual form. I want to change the name of the field. where can I change it?

You can use the word replacements feature, if you want to replace the word everywhere.

Or if you're just using that field for a different purpose, create a new custom field instead.


Problem with PayPal IPNs not going through End of year and we are getting membership renewals. We've used PayPal for years no problem, but since Dec 1, the IPNs (instant purchase notifications) are not working correctly. The transactions are left in the 'Pending' state. I've gone into PayPal's IPN history page and manually resent a few IPNs and they they go through and are then marked as 'Completed' in CiviCRM. But due to bugs in the PayPal history page I can only resend for payments for the last few days. Why are they not going through the first time? This just started happening this month.
I found the patch line:

$paypalParams['notify_url'] = rawurldecode($paypalParams['notify_url']);

and added it to the CRM/Core/Payment/PayPalImpl.php file (I have a different file version from the github entry but found the spot anyway.) Then I made a contribution and the IPN worked, transaction marked as Completed in CiviCRM. Unfortunately there was an error someplace when returning to our site from PayPal's 'return to merchant' link.
Error:

We can't load the requested web page. This page requires cookies to be
enabled in your browser settings. Please check this setting and enable
cookies (if they are not enabled). Then try again. If this error
persists, contact the site administrator for assistance.<br
/>Site Administrators: This error may indicate that users are
accessing this page using a domain or URL other than the configured
Base URL. EXAMPLE: Base URL is http://example.org, but some users are
accessing the page via http://www.example.org or a domain alias like
http://myotherexample.org.Error type: Could not find a
valid session key.

This is as far as I have gotten with this.
CiviCRM: 5.29.1
Wordpress: 5.5.3

Purportedly resolved in an update pushed by CiviCRM Admin Utilities 0.8 released on 20 November 2020 (https://lab.civicrm.org/dev/core/-/issues/1931). Payments have been closing for us fine since applying the patch - until today :-. We've had two transactions that wrote the incorrect IPN return URL and two right next to them that wrote the correct IPN return. Going to hit up the lab thread and see if others have run into this problem.


Images in templates on civicrm spark I am on civicrm spark running 5.32.beta1 and I cannot get images to work on templates with PDF document merge.
Since it's spark I have little control over the backend installation. As far as I can tell I can't use local image hosting located at "https://mysite.civicrm.org/sites/mysite.civicrm.org/files/civicrm/persist/contribute"  so I have tried hosting the images on our main organization webhost and using the url in an image tag. This appears to work fine for emails but will not generate in the pdf output.
I found this help relevant:
https://forum.civicrm.org/index.php%3Ftopic=22663.0.html
but since I'm on spark I don't believe I have any control over the civicrm version or the "allow_url_fopen" field. Can I only use any images already hosted on civicrm.org then? Is there something I'm missing?

I was able to add a custom field to contacts and upload a signature file to relevant users and then use that generated url. This work around isn't ideal as it means tying the image to a custom field that may not be relevant and a relative location hex link that looks roughly like this:
mysite.civicrm.org/civicrm/file?reset=1&id=2&eid=28&fcs=54ef7e8c1d8fc5b70133338bb1872353e
but we do what works. I would appreciate a better solution if anyone has one.


Custom Field doesn't appear in Drupal views using civicrm entity module I'm trying to use the Drupal module civicrm entity in views to render a custom field (Image) I created in contacts in civicrm 4.7.13, I did the views integration through settings.php and in views when I add the field provided by CIVICRM Entity I get the error:

  Column not found: 1054 Unknown column 'civicrm_contact.custom_4' in 'field list'

The field provided as "Custom Data Field" in views works but it only displays a link to the uploaded image and I need it as an entity to apply image styles on it, etc..

If you have the link to the image file in the view then I would try rewriting the results of that field. Set it up as an
<img src=[token that has path to image] />.

Then you can add a class to it and style it as you wish.


When editing a membership Civi sends receipt and confirmation even with box unchecked Using WP4.3.1 and CIviCRM 4.6.9
I also had this happen on the current CiviCRM.org demo site for WP.

When editing a membership Civi sends receipt and confirmation even when the box for "Send Confirmation and Receipt?" is Unchecked.

Is this a bug or am I missing something?
Of course we do NOT want to send receipts for most edits we make!

Have you checked that the mails are actually being sent out?

In civiCRM 4.6.4 I have found that I receive the following pop-up when editing a membership record with an attached contribution record (this does not seem to occur when there is no contribution recorded with the membership), but if the "Send Confirmation and Receipt" box is unchecked, no mails are actually sent out even though I got the message below.


Recommended upgrade for my civiCRM with Drupal 6 I'm currently using civiCRM 4.4.2 with Drupal 6.

I would like to know if I should upgrade it first to another version, or upgrade it directly to 4.7.5.

What do you recommend?

Thank you!

You don't mention any extensions on your site so if that is not an issue then I think you are as well going to 4.7.x

If you do have extensions then you might want to check things out before going past 4.6.x which is a LTS (long term support) version and has probably had more extensions verified for it than for 4.7.x

Of course if you do have extensions, it helps the community to know if you find any issues on 4.7.x and reporting them back to the maintainers or contributing patches or funds to help ensure they do work on that release.


Ajax Error when trying to view relationships tab Civicrm 4.7.1
Joomla 3.4.8

I'm unable to view data in the relationships tab. I get the following errors:

"DataTables warning: table id=DataTables_Table_0 - Ajax error."

And

"DataTables warning: table id=DataTables_Table_1 - Ajax error."

This issue has been ongoing since updating to 4.7.0

Any help would be appreciated. Please let me know if you need additional information.

Thanks.

I had the same issue.  CiviCRM 4.7/Drupal 7/IIS8 configuration.  The Ajax call was generating a query longer than what the web server was configured to handle and behind the scenes the web server was throwing an error, but it is not logged to the Civicrm log nor the Drupal log.

I was able to solve this by increasing the query string length in IIS.

In IIS Manager select the site
Choose the Request filtering icon
Navigate to the query string tab
Click the edit feature settings
Change the Maximum query string (Bytes) from 2048 to 4096 or something larger

Contact Relationships now show properly.


Cron Job User Permissions Is it possible to run a cli.php without user and password if cron owner has sufficient privileges? Having added it my Joomla dashboard is over run with entries for the cron user logging in. The user I created I didn't give any special acl but it seems to work. I'm assuming due to my cron rights. Suggestions?
Thanks
Wallace

I'm not clear exactly what issue you're wanting to address here, but you might want to look at running 'cv' from cron instead of cli.php/cron.php.  That does not require a password and will not record as a login.

See https://docs.civicrm.org/sysadmin/en/latest/setup/jobs/#cv


REST API without JSON just key=value Is it possible to structure

/sites/all/modules/civicrm/extern/rest.php?entity=Activity&action=create&json={"sequential":1,"activity_date_time":"2015-09-01","id":2,"subject":"test","target_id":"1529697","status_id":2}&api_key=X&key=Y

without the JSON section? I'm integrating with Survey Gizmo and it assumes all REST calls will be in format ?variable=value&variable=value etc..

Yes, you do not need the params to be formatted as json, since they are all simple strings/numbers you can just place them in the url like subject=test&target_id=1529697 etc.

If you want your results back in json format, add &json=1 otherwise leave it off to get xml back.


Notification upon email change This is a question that came up during yesterday's training:
"Does CiviCRM offer the feature of sending email change notices?
If I go online and change my email address at my bank or broker, notice is sent both to my old and new emails. This gives not only a notice of change but also the chance for me to discover if I've entered the new email address incorrectly."

Any thoughts? If it's not possible now, would this be a good feature request?

Not out of the box, no.  As far as a feature request - I think that this would be a good extension, but might not make sense in core CiviCRM - most CiviCRM installations don't even have uses where their contacts log in, let alone change their e-mail addresses.

To implement as an extension, a developer should use the hook_civicrm_pre hook on the Email entity - it's important to use "pre" and not "post" because otherwise the old e-mail address is already overwritten!  Confirm that the change is driven by that person, not a back-end staff person (my comparing the logged-in user ID to the contact ID that owns the email), and if so, send a custom message to both addresses.  I have an extension somewhere that lets you specify a CiviCRM template to send - the advantage being that a staff person can change the e-mail.  Let me know if you need that posted on Github and I'll track it down.


Wordpress left column - sidebar I've never run civi under Wordpress - (many times under Drupal and Joomla) and know NOTHING about Wordpress themes.
How do I get it to look like the demo site ie no wp-admin menu and the Civicrm left column with recent contacts , new contact Etc.

Unfortunately, this is simply a missing feature in CiviCRM for WordPress.  The left-hand menu is collapsible, but it's necessary for navigating the backend.

It would be nice to have the recent contacts and quick-add button somewhere, but it'll have to be within the main real estate of CiviCRM on the backend in WordPress.


Mailing issue. Could not identify any recipients. Perhaps the group is empty? I am experiencing a weird issue on my CiviCRM 4.7.3 on Joomla 3.5.0 (also happening on some 4.7.8 on Drupal 7)

When I try to send or schedule a mailing and I hit "Send test" I receive an error saying Could not identify any recipients. Perhaps the group is empty?. However I have selected a group with valid recipients inside (I can see the yellow text near the recipients field saying "~81 recipients").

If I ignore the test and try to send the mailing, it does not give me any errors, but no emails are sent and if I check the report it says:

Intended Recipients     1
Successful Deliveries   0 (0.00%)

The Mail module works - I can send mail through CiviCRM to a contact directly, only through CiviMail there is a problem.

Further debugging information

After a lot of debugging I can narrow the problem down to an ACL issue:

In CRM/Mailing/BAO/MailingJob.php the deliver() function is reached but the query ($eq->query, $eq->fetch) doesn't return any results.

This is due to the condition from $aclWhere, for me it is:

( ( `civicrm_group_contact_cache-ACL`.group_id IN (8) ) )

which is joined in the full query by

LEFT JOIN civicrm_group_contact_cache `civicrm_group_contact_cache-ACL` ON contact_a.id = `civicrm_group_contact_cache-ACL`.contact_id

while I do get a contact joined in the query, an entry in civicrm_group_contact_cache seems to be missing. What is that table for, anyway?

The solution for me was to set up a Bounce Processing email account in Administer menu > CiviMail > Mail Accounts.


How to grant SELECT access for Drupal user to all CiviCRM Tables I have 2 databases for Drupal and CiviCRM. How can I grant SELECT access for Drupal user to all CiviCRM tables? I am using AWS RDS Databases. Thanks so much!

You will need to perform two operations for this

Give Drupal mysql user to access CiviCRM database.
Add CiviCRM tables in Drupal's settings.php i.e Navigate to CiviCRM >> Administer >> System Settings >> CMS Database Integration. Copy the content from  'Views integration settings' section to settings.php. Clear Drupal cache.

Pradeep


Why can't I delete a Membership Status that has no memberships of that status Site has a custom Membership status that is no longer required. They try to delete that Status but it says 'no way jose: This membership status cannot be deleted as memberships exist with this status'. They go do a Membership Search - find none with that status. I check in DB as well in case some membership belong to contacts in Trash - still no results.

I suggest they set it to 'disabled' as a temporary solution.

Why won't it allow them to delete via UI. I tried replicating with a brand new custom Status on demo but that could be deleted.

Ok, found it. If you have logging 'on' - and you have a membership which was at some point in history 'that' status - then when you search you find 'no results' - but there is a record in log_civicrm_membership

and presumably it is not be able to be deleted in case the record needs to be reverted.

If that is the issue, then perhaps the error message needs to incorporate that fact.

or should the membership status be ok to delete even with data in the logs?


Can I subtract guest fees collected from a membership fee when a user registers Our club allows people to come out as guests, for which we collects guest fee. If that person later chooses to become a member, we deduct that guest fee from their membership fee.

I know I can create different fee structures, but that assumes the person entering the information, whether that's a club executive or the member selects the correct thing. I haven't found a mechanism for membership upgrades, or a means of replacing one membership with another but applying a credit against the new one.

Is there a way with CiviCRM to automate this process?

One possibility is when they come out as a guest and pay the fee, you provide them with an automatic discount from the CiviDiscount extension, which is applicable to the full "Member" membership type and is automatically given to folks with a current "Guest" membership.

You may need to play with settings to see for sure if it will work in your case.

Extension page: CiviDiscount
Github: org.civicrm.module.cividiscount

  CiviDiscount: This extension allows the admin to create and manage
  discount codes that can be used on membership and event pages.

  Features:

  Support for price sets and individual items in a price set
  Use of monetary or percentage based discounts
  Automatic discount based on membership
  Generate random discount codes
  Usage and assigned code tabs on a contact record
  Code summary screen displays usage for a given discount code
  Option to apply discounts to additional participants


I want to customise my contact form - New Donor I am looking to add a field initial next to Mr so that we can create a postale letter with Mr C XX

The language of the question is a bit unclear, but I think what you want is a token that takes just the first letter of the first name.  You don't need to collect it separately to do so.

If this is what you're looking for, please leave a comment to this answer saying so.  I have an extension that adds a "middle initial" token, I could quickly adapt it for your situation.


SOLVED - Cron autorun config help please I had tried the starter pack and ran into a bunch of problems with it.  It was already set up to make cron run automatically.  After scrapping the starter pack and just installing Drupal 7 and then CiviCRM, cron doesn't run automatically and I can't find any documentation that makes any sense to a non-unix admin like me for creating some type of configuration or modifying a config file to make this happen.  Can someone please point me to instructions that are fairly easy to understand?  Gracias.

I'm afraid setting up cron is a bit technical.  Perhaps your hosting company could help you get started?

You can find full instructions here: Managing Scheduled Jobs


How to fetch CiViCRM events externally [ Drupal 7] I'm new to CiViCRM. I want to fetch events which are created in CiViCRM which is hosted on another server. So basically I want to fetch CiViCRM data from one individual site to my site. I don't know that which are the ways to do it and which is the best one. But I think Rest option would be good if I'm not wrong. I'm not able to find any similar example which is near to my task. All I don't understand that how should I use my rest url with code:

Option 1:

$api = new civicrm_api3(array ('server' => 'http://localhost/abc',
    'api_key'=>'123456789',
    'key'=>'123xyzABC'));

Option 2:

 $contactxml =       simplexml_load_file("http://localhost/abc/sites/all/modules/civicrm/extern /rest.php?entity=contact&action=get&key=<site    key>&api_key=$apikey&last_name=Koot");
 foreach ($contactxml->children() as $contact) {
   $display = $contact->display_name;
 }

Is there any other options. I want to go for option 1 if that is possible. And I want response in JSON if possible.

The wiki page http://wiki.civicrm.org/confluence/display/CRMDOC/REST+interface pretty much describe what you could do with rest.

From the wiki page :

  Before the REST interface can be used, two things have to be set up:

  You need to know your site key which can be found in the    civicrm.settings.php file labelled CIVICRM_SITE_KEY.
  You will need to enter an API key for every user that will be allowed to use the REST interface. (See below)

Then you will have to call an url like :

https://www.example.org/path/to/civi/codebase/civicrm/extern/rest.php?entity=event&action=get&key=your_site_key&api_key=the_user_api_key&json=1

Option json=1 will give you result in json format instead of xml
You may need to use &options[limit]=xxx if you want more than 25 results

Every options available in the api should be available in REST but need to be converted in the proper URL syntax. The wiki page give you some good examples of standard api call vs REST api call.


Get civi mailing with status = 'Complete' using API explorer What should be the way to get/find mailing with the status ='complete' using API explorer?

or is it the value which stores in civicrm_mailing.is_completed for each mailing?

or there is any other way to get such mailings?

Yes, this is doable via API Explorer.

Entity is Mailing,
The Action is Get, and
The Parameter is Mailing Completed = Yes


Date picker separator characters munged I've a got a local sandbox running CiviCRM 4.7.18 on Drupal.

For any datepicker field (e.g., Contacts > New Activity), the selection is displayed with munged URLs separating the date components. For example, were I to select today's date, I'd expect to see this value in the text input:

  06/30/2017

Instead, I get this

  06https:http://6pk.l181calh181st/http://6pk.l181calh181st/6pk.l181calh181sthttp://6pk.l181calh181st/30https:http://6pk.l181calh181st/http://6pk.l181calh181st/6pk.l181calh181sthttp://6pk.l181calh181st/2017

Note: the URL of this site is mpk.localhost. In addition to jamming in the site URL instead of separators, some character replacement is happening which might provide a clue as to what's going on:

"m" is replaced by "6"
"o" is replaced by 181

I've tried looking for weird stuff in the date/localization settings, and I've tried switching the Drupal theme. There are no messages in the JavaScript console.

Any ideas?

I found (on the same instance) that the cause was a munged value for the Localization > Date Formats > Date Input Format.
This string is used to search and replace in the Date Picker from jQuery UI.

Not at all clear how the bad value was saved, but saving an alternate selection and then changing it back cleared up the phenomenon.


How do i access the list of email addresses that bounced I am using SparkPost for mail delivery of CiviCRM mass mailing.  I can see the types of bounces that we had but i haven't found a list of email addresses that bounced.  How do i find the email addresses that bounced?

Go to CiviMail -> Scheduled and Sent Mailings -> under Action, in the far right column of the Mailing Name line, select Report -> Select Report to the right of Bounces


"On Behalf of" /Sender header for Emails our setup does not allow us to change SPF records. Which is fine - but we would like to utilize the "On Behalf of" or "Via" by using a "Sender" mail header. This forum post from 2015 explains that CiviCRM does not have the "Sender" mail header - but is there any work on this?  Both MailChimp and SalsaLabs have this feature.

I'm 99% sure there hasn't been any work on this.


How to add a new "From" email address in civi mailing - cannot find function following the update I used to be able to add new "from" email addresses for civi mailing, but I cannot find the location anymore.

Welcome to CiviCRM SE. I don't think it has moved. It is under Administer >> CiviMail >> From Email Addresses.


Is there a limit to the number of fields that can be included in a profile? The organisation I work with is successfully using CiviCRM (with Joomla) for online event registration. However it seems as if there is a limit of 20 fields in the regaistration profile we use.

Twenty fields are easily used with name, address sex, dietary needs and other questions. Has anyone else hit a field limit and how did you overcome it?

thank you.

While I have not run into a limit of 20 that I can remember you can add additional profiles to a registration page. This could be a workaround for you. I generally will use additional profiles to group fields under profile titles (i.e. special requests & Special needs).

Hope this helps.


How do you approach "things that you would use Drupal views for" in WordPress? Coming from a Drupal 7 background but wanting to do more work with WordPress, I am looking for ideas on how people approach "the things that you would normally use Drupal views for".

For any WordPressers that are unfamiliar with views, I'll try and explain it in once sentence:  it is a UI that allows you to run queries on your DB and format these nicely on the screen.

Tools with a GUI are nice, though not necessary - I'd be happy coding stuff. Just thinking that it would be great if there was a framework / set of libraries that I could use, to avoid too much wheel reinvention.

To give a bit of context: I'm creating the data entry part of a monitoring and evaluation system. We'll most likely use Caldera forms for the actual data entry but I want to create a customized dashboard that front end users of the site (without any other access to CiviCRM) that will give an overview to users of what they need to do and point them towards the forms that they need to fill in, etc. Happy to provide more details if that would be helpful.

Tips and tricks and examples are very welcome.

Interesting, we (as in CiviCooP) are on the same quest. We will do a work-together on 9 November and I expect one of the projects coming out of that to develop a View-type of Wordpress plugin. Want to join us if we are going to do this in a sprint?


Can all contacts that share an email be unsubscribed at once? Often we have multiple contacts with a shared email address, as when a parent provides their own email when they register one or more children.  We use the option in civimail to only send one email to each unique address to avoid duplicates.  If they unsubscribe, only one of the family contacts is actually unsubscribed, so the other contacts with the same address continue to receive email. To the parent it looks like we are ignoring their unsubscribe request.  Is there a way to have an unsubscribe request apply to all contacts with the same email address?

Short answer: no.

An unsubscribe request is handled here:

https://github.com/civicrm/civicrm-core/blob/master/CRM/Mailing/Form/Unsubscribe.php

The parameters to an unsubscribe request are translated into the corresponding contact, not the email address.

So what you're asking would require the code to scan the database for contacts with the same email address to unsubscribe, which in some circumstances wouldn't be the desired result.

Conceptually, unsubscribes/subscribes are stored/handled by contact id, not email address.

Your options would be to write your own unsubscribe handler, or (perhaps) to use civirules.


How to build a profile using Activity data I need a logged in user to be able to add an activity but Civi keeps telling me "Profile search, view and edit are not supported for Profiles which include fields for more than one record type."
Here's what I did:
1.  Created a new activity type called "CEU"(Continuing Education Unit)
2.  Created a new Custom Data set called "CEU data" used for "Activities" and Type "CEU"
3.  Created a new Profile with Activity Date and the 6 CEU custom fields and it is used for "Standalone Form"

Civi does not give me the "Use Profile-Create Mode" like normal.
I also tried to add First Name, Last Name, and Email to the Profile but still got the same results.

Not out of the box, you could use CiviCRM hooks (hook_civicrm_postProcess) to create an activity on form submission.

You could also check CiviVIP they developed a WordPress plugin which does that (you will also need Gravity Forms), for the moment the plugin its only able to create contacts and activities, but they have plans for Event registration and Contributions.


What is the recommended way to upload teenage volunteer and their parents data from csv file What is the recommended way to upload teenage volunteer and their parents data from csv file
This is the info looking to upload
First   Last    Email   Cell    Address City    State   Zip Home Phone  Email 2 Birthday    School  Gender
Moms Prefix Moms First Name Moms Last Name  Moms Cell   Moms Email  Moms Gender Moms Birthday
Father Prefix   Fathers Name    Fathers Last Name   Fathers Email   Fathers Gender  Fathers Birthday
Also...how do i group only the volunteer as group Volunteer & not the parents? Would you recommend to have the parents as a smart group such as parents of teenage volunteers for mailing purposes for example or to make a group called parents of teenage volunteers? How would i load that as part of this upload.
Thank you!

You can use relationships to tie the parent(s) to the teen.

https://docs.civicrm.org/user/en/latest/organising-your-data/relationships/

Here is some information on importing relational data on this page. Just scroll down about 3/4 of the way down:

https://docs.civicrm.org/user/en/latest/common-workflows/importing-data-into-civicrm/


Message is localized but message template is not I received an summary of an activity that looked like this (in Swedish):

Åtgärdssammanställning - Telefonsamtal

Med kontakt(er)
name_10564

Typ av åtgärd
Telefonsamtal

Ämne
Introduktion

Obviously this is translated, which is kind of good, but the name_10564 should definitely be a real name.
Problem is that I can't find this template in the System Workflow template list. The only one I find is "Cases - Send Copy of an Activity" and that is using the default template.
How can this be and where should I look for the template for "Activity Summary"?
We're running on Joomla if that (file locations?) are relevant.
(It seems that some of these strings exist in the translation on Transifex, to which I'm partly responsible ;-)

For the name_xxx check your settings at Administer - CiviCase - CiviCase settings. There's a setting called "Redact Activity Email" that changes real names for privacy.
And yes the email template used to send to activity assignees is called "Cases - Send Copy of an Activity" even for regular emails.


WordPress - user record URL doesn't show for one user. Can't see why? In the user detail view for a member with a WordPress account there's usually a link to the WordPress user record like so:

Contact ID / User ID   :   1354  / 1561

For one member the user ID doesn't appear and I'm stumped.

I've deleted and recreated both the Civi and WP records several times.
dumping the WP user record and toggling membership off/on does recreate the WP record (but doesn't show the link to it)
We use the profile sync plugin and this is working fine (i.e. name changes sync to wordpress profile and vice versa)

Digging through the template code shows the {$userRecordUrl} variable as the trigger for showing it or not, so I assume this isn't set somehow.

Has anyone seen this behaviour?

The user for whom it does work was created some time ago -- perhaps its functionality that is no longer present in 4.7? I can't find any documentation to support that though.

thanks!
- Chris

I've seen this happen when there are multiple WordPress accounts using the same email address.

These values are stored in the civicrm_uf_match table of the database.  If my first suggestion doesn't pan out, you may want to browse that table and look for duplicate values for contact_id and uf_id (the "WordPress user id") corresponding to this user.  Delete the offending record(s) in this table and let CiviCRM recreate them.


'A potentially unsafe operation has been detected in your request to this site' error I want to get a membership list contaitning their name and address through the 'Report' function. But when I do this, a message 'A potentially unsafe operation has been detected in your request to this site' appears and cannot get the list' appears. What should I do? Thanks.

This error doesn't come from CiviCRM, but comes from either the Wordfence plugin for WordPress, or your hosting provider has mod_security configured in such a way that it breaks normal operation of CiviCRM.  I generally warn people away from shared hosting providers for this reason and toward a VPS unless they specifically know that CiviCRM is supported.  In theory, a good webhosting company will fix their settings - but bad shared webhosting companies are far more common than good ones!

If you have Wordfence, see if disabling it fixes your problem.  If so, it may be worth exploring a bit further which Wordfence setting is causing the problem.  If you aren't running Wordfence, open a support ticket with your webhosting company.


Exclude members in a smart group I want to create a group of members that have paid their contribution last year, but not yet this year, and do not have an email address.

With an email address, the solution is simple: create two groups "paid last year" and "paid this year". Send an email via CiviMail to "last year" by excluding "this year". CiviMail only takes into account the contacts with email.

But how to do so with the ones without email? I do not see a way to "subtract" (= excluding members who paid this year) two groups outside CiviMail.

Or do I need to activate CiviMember for this purpose? Now, I enter the value of the year of payment into the field "Source of contribution" and, for the moment, we do not see the added value of another component CiviMember.

There's two answers, although you probably just need the first:

Instead of Advanced Search, use Search Builder (also in the Search menu).  Use "paid this year" and "email address is empty".
Alternatively, there's a custom search (Search menu > Custom Searches) called Include/Exclude by Group/Tag.  So alternatively you can create a smart group in Search Builder "No email" and combine it with existing searches using the include/exclude search.


What can I do about this error after attempting to install CiviCRM on a Wordpress site: Table 'myprefix_civicrm.civicrm_setting' doesn't exist My attempt to install CiviCRM on a WordPress site (in a separate database) failed after creating only one table in the database. I didn't record the error, thinking I could just delete the database and the files from the Plugins folder, then run things again. After recreating an empty INNODB database and re-extracting the files into the plugins directory, when I go to Plugins.php and click Activate, I get the following error:
Initialization Error
Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => simpleHandler
        )

    [code] => -18
    [message] => DB Error: no such table
    [mode] => 16
    [debug_info] => SELECT id, name, value, domain_id, contact_id, is_domain, component_id, created_date, created_id
FROM civicrm_setting
WHERE (domain_id = 1) AND (is_domain = 1)
 [nativecode=1146 ** Table 'myprefix_civicrm.civicrm_setting' doesn't exist]
    [type] => DB_Error
    [user_info] => SELECT id, name, value, domain_id, contact_id, is_domain, component_id, created_date, created_id
FROM civicrm_setting
WHERE (domain_id = 1) AND (is_domain = 1)
     [nativecode=1146 ** Table 'myprefix_civicrm.civicrm_setting' doesn't exist]
    [to_string] => [db_error: message="DB Error: no such table" code=-18 mode=callback callback=CRM_Core_Error::simpleHandler prefix="" info="SELECT id, name, value, domain_id, contact_id, is_domain, component_id, created_date, created_id
FROM civicrm_setting
WHERE (domain_id = 1) AND (is_domain = 1)
 [nativecode=1146 ** Table 'myprefix_civicrm.civicrm_setting' doesn't exist]"]
)

The only way to get rid of it is to rename the Plugins folder Plugins.Hold, then revisit the plugins page. However, as soon as I rename the folder back and click Activate again, I get the same error.
I don't have any caching plugins on the site.

It turns out that the civicrm folder in the wp-content/uploads folder was preventing a clean reinstall. Deleting that folder allowed me to start the install over.


is it possible to merge duplicate event locations? Multiple events have taken place at the same location, but there are multiple listings of the same location. Is it possible to merge these locations without losing any of the data from the events?

On CiviCRM 5.3.1.

Location details for events are stored in a sql table called civicrm_loc_block which brings together an address an email and a phone number for each event.

At a push you could identify the affected events and update them so they all share the same loc_block id. But that would need to be done by querying/updating the SQL tables.

Basically, there isn't a function to address this in the user interface.


Where in the database is the Date Added for Group records? I'm trying to help a friend. A slew of his contact records got added to groups that they don't belong in. It happened on July 19th. I thought the civicrm_group_contact table would have a timestamp column, but I don't see one. Where is this Date Added stored (see below)? Is there a way to select these group records and delete them? Thanks...

That information is contained in the table civicrm_subscription_history

To remove them from those regular groups you would need to remove them from both the civicrm_subscription_history table and the civicrm_group_contact table

Seamus


How do I get correct currency data to stripe.com from my CiviCRM transactions Background: Wordpress site, CiviCRM 4.6.x, Stripe extension version 1.9.1 is reported, and the directory in my extensions folder is called com.drastikbydesign.stripe-4.6-dev (installed in June/July).

Civi is configured with GBP as the default currency, and GBP, USD and EUR are all set as available currencies. We have - at present - three contribution pages, one for each of the three currencies, and the currency is set in the configuration for each page.

CiviCRM is recording the transaction in the correct currency (USD). Stripe is recording the transaction, but is recording it in GBP. This is causing a major issue as you might expect. For example, we have a user who has donated USD20. CiviCRM tells us they have donated USD20, but Stripe has read this as GBP20, and taken USD31.64 from the user's credit card. Not good.

Looking at the events and logs data in the Stripe dashboard I can see that 'gbp' is being given everywhere as the currency.

I don't know if this is a bug in this extension or more generally in CiviCRM, but my guess - and it is a guess - is that the currency data is being taken from the default currency rather than from the currency that is set for the specific contribution page.

Here's a link to the issue in the extension repo: https://github.com/drastik/com.drastikbydesign.stripe/issues/91

It transpired that the error was due to the fact that the affected transactions were recurring payments, and the stripe extension did not pass currency data to stripe.com. So, in my use case, a user has submitted a recurring payment in GBP, and a subsequent user has attempted to submit the same payment in terms of amount and frequency, but in USD. As the currency was not being included in the payment plan data being submitted, stripe.com assumes that the plan is in GBP, because that is how the plan was originally defined, and so takes the payment in GBP.

Having liaised with the extension developer, this issue has since been addressed and I'm aiming to test the changes as soon as possible to see if it has resolved the issue.


CiviEvent price set custom validation rules I want to create an event that uses a complex price set, and I want custom validation rules that express relationships among the fields in the price set. For example, if I have a checkbox "Entire Retreat" for participants to say they're registering for the whole event, it should be an error for them also to check the boxes for any individual part of the event. Is there a general-purpose way to configure rules about the entire price set?

You can limit the price options the user sees with some JavaScript in a custom template. This can allow you to control the user options based on the selections. For example:

If the user clicks 'Full Registration' it triggers JavaScript to only show the relevant options. So if meals are included in the user doesn't see the individual meal prices.

You need to do some planning particularly with required fields. If there is a field that you need to be required that relates to individual items you need to have an option for when it is included in the full registration. This will avoid errors.

More information on custom templates can be found here: https://docs.civicrm.org/sysadmin/en/latest/setup/directories/#custom-templates

Hope this helps.


Getting Error Message from payment gateway A payment processor configured for this page might be disabled (contact the site administrator for assistance)
I keep getting the above error when I visit the live page of my contribution.
what can i do about

I did a workaround when i got this error:

Edit the Contribution page
Go to "Amounts"
click "Test Processor"
Save

I assume a prior processor wasn't showing up or configured after i reinstalled my server and re-enabled Drupal and CiviCRM.

By selecting a different processor, it fixes the problem. If you really need the original, i'm sure you can recreate the payment processor and set it.


For gift memberships, send email receipt to the giver When Alice is creating and paying for a gift membership for Bob, she enters Bob's contact info and email address on the Membership Contribution form, so the emailed receipt goes to Bob (with a copy also going to the back office via the cc settings on the form) and Bob's email address becomes part of the contact record.

We have an optional custom field on the form where Alice can enter her own (different) email address and, ideally, receive a copy of the receipt as well.

in CiviCRM 4.6 we could make this happen by patching into postProcessMembership(), pulling the email address out of the form parameters, and tacking it onto the cc_receipt field that was passed to the sendMail function. However, in 4.7, the form handling is different enough that this method no longer works.

Is there a clean way to add a recipient to the emailed contribution receipt based on a value entered on the contribution form in CiviCRM 4.7?

thanks,

After some digging with debug_backtrace() to unravel the program flow within CiviCRM, I found this solution, which works:

(1) Implement hook_civicrm_postProcess(), and use it to get the giver email from $form->_submitValues. Stash it into a global variable.

(2) In CRM/Contribute/BAO/Contribution.php, patch function composeMessageArray() to append the giver email to $values['cc_receipt'] prior to the sendMail calls at the end of the function, then clear the global.

Obvious, this will need to be tested and reapplied with each upgrade of CiviCRM, but we already have a handful of such patches so one more is not too bad.


How do I simplify multiple contributions? Our client is association which only has organizational members. There are no individual memberships. However, member organizations have related contacts who require annual recertification. I want a contribution page, which works like an event registration, allowing one individual to register multiple contacts at the same time, but for an annual recertification fee. It's not an event and each contact should receive their annual reminder that certification will expire in a year.

I don't see this option for recurring contributions or memberships. Did I miss something or does someone have a clever solution for our unusual situation?

This can be done with Webform-CiviCRM integration, and probably with Caldera Form as well.  You can create multiple contats on a single form, specify a single fee, create relationships between the organization and individual.  The annual reminder can be sent out in a number of ways; if you're using Drupal, I'd just use the Webform email functionality to send the email to all the individuals.


Cannot set sort order of custom fields in profile I created a custom group and populated with custom fields. When I preview all fields in group, it is in the correct order.

When I use the custom group in a profile, the profile reverses the order.

I've tried changing weights to order, but I can't seem to make it work.
Any thoughts?

The weight of the custom fields only controls the order in which they appear on the back end.  The profile sets its own order.  You can set the order from Administer menu » Customize Data and Screens » Profiles, then clicking the Fields link next to the profile you want to edit and using the "Order" buttons (see screenshot).


What will be the way to give user public access to check their contribution? What will be the best way to give event registrant to check their payment and contribution status through an public front end form?

Is an email address with CAPTCHA authentication field appropriate to grantee the give access to real user preventing others/spammers?

The reason to do this through an extension is to give partial payment feature and refund request feature.

The Contact Dashboard is a good way to show people their information.

Usually people need to login, you may be able to use a token to allow people to see it without logging in (not sure) but if payments are involved I would recommend people should have to login.


How can I use Xdebug with CiviCRM unit tests? Ideally in conjunction with an IDE (I use Netbeans, but will fire up pretty much anything that gets this to work).

Xdebug configuration is a somewhat temperamental issue -- the details depend on the IDE, the PHP build, host OS, target application, test suite, etc. Providing a good answer to this is tricky -- e.g. I could describe my configuration (Mac OS X, PHPStorm 2016.2, MAMP 3.4, PHP 5.4, buildkit/dmaster), but the odds are that most people reading it will need something slightly different -- and in six months one of those pieces will have changed in a way which breaks it.

Rather than a comprehensive step-by-step guide, we might look at a few distinct problems. After you've looked at these separately, it's easier to tackle them together.

Problem 1: Running PHPUnit generally (most PHP projects)

The idealized workflow for PHPUnit can be imagined as something like this:

1: wget https://phar.phpunit.de/phpunit-old.phar -O /usr/local/bin/phpunit4
2: chmod +x /usr/local/bin/phpunit4
3: git clone https://example.com/my-php-project.git
4: cd my-php-project
5: phpunit4

Step #1-2 can be accomplished in a few ways -- e.g. download from phpunit.de or download civicrm-buildkit or run apt-get install phpunit or somesuch. Whatever the approach, take care to note the precise name of the executable (e.g. phpunit or phpunit4 or phpunit.phar).

In step #5, you call this executable, and it reads a configuration file from your project (phpunit.xml.dist). By default, it runs all tests in your project. However, you can run a specific test-file or test-folder, e.g.

5b: phpunit4 tests/foo/MyFullTest.php
5c: phpunit4 tests/foo/

Problem 2: Running PHPUnit with the CiviCRM test cases

To run the CiviCRM tests (v4.7+), there are a few additional requirements. These requirements are generally met automatically if you use buildkit and civibuild, but it may help to describe them anyway:

You must have the command cv installed.
You must have a working CiviCRM installation.
You must have an extra, headless database defined in TEST_DB_DSN. (To view/edit this option, use cv vars:show and cv vars:fill.)
You cannot run all tests by default. Always specify a particular test-file or test-folder (e.g. phpunit4 tests/phpunit/api).
You may need to set the environment variable CIVICRM_UF. For some tests (eg E2E and WebTest), this can be blank. For other tests (e.g. api or CRM or Civi), set CIVICRM_UF=UnitTests.

Assuming these requirements are met, you can invoke the "E2E" tests using a conventional PHPUnit command:

phpunit4 tests/phpunit/E2E/AllTests.php

To run all the "CRM" tests, you would execute:

export CIVICRM_UF=UnitTests
phpunit4 tests/phpunit/CRM/AllTests.php

I suggest that you get this working before trying anything inside an IDE.

This page may also be useful: https://github.com/civicrm/civicrm-core/blob/master/tests/README.md

Problem 3: Running PHPUnit with an IDE+XDebug

This part varies widely, and I can't do it justice. I'd usually do a Google search like "phpstorm mamp xdebug phpunit" or "netbeans ubuntu xdebug phpunit" or "eclipse vagrant xdebug phpunit". For most permutations of IDE and PHP runtime, you should be able to find some guidance like this for Netbeans, or this and this for PHPStorm.

Bring it together

Whatever instructions are provided for the IDE, keep an eye out for how to set these additional configuration options for Civi:

Specify where phpunit lives (e.g. /usr/local/bin/phpunit.phar or /home/myuser/buildkit/bin/phpunit4)
Specify the working-directory as the CiviCRM folder (e.g. /var/www/drupal/sites/all/modules/civicrm).
Specify the PHPUnit configuration file as CiviCRM's phpunit.xml.dist (e.g. /var/www/drupal/sites/all/modules/civicrm/phpunit.xml.dist)
Specify the environment variable CIVICRM_UF=UnitTests.

As a demonstration, the following includes screenshots about setting those options within a specific version of PHPStorm. However, the precise windows+fields may be different in your IDE.

https://wiki.civicrm.org/confluence/display/CRMDOC/Tests+in+phpstorm
How do I run PHP Unit Tests w/ XDEBUG from within PHPStorm [on Mac]?

Variation: Extension Test Suites

Beginning in 2016, the recommended practice for testing extensions is to create your own test-suite inside each extension -- e.g. each extension should have its own phpunit.xml.dist and its own bootstrap.php file. Configure your IDE to use those resources, e.g.

Specify where phpunit lives (e.g. /usr/local/bin/phpunit.phar or /home/myuser/buildkit/bin/phpunit4)
Specify the working-directory as the extension's folder (e.g. /var/www/drupal/sites/default/civicrm/ext/org.example.mymod).
Specify the PHPUnit configuration file as the extension's phpunit.xml.dist (e.g. /var/www/drupal/sites/default/civicrm/ext/org.example.mymod/phpunit.xml.dist)
Specify the environment variable CIVICRM_UF=UnitTests.

Legacy: tools/scripts/phpunit

CiviCRM v4.7 works with a standard executable of phpunit 4.x. However, in older versions, you had to use an alternative executable, tools/scripts/phpunit. Unfortunately, this executable required a different syntax which made it incompatible with IDE's and other tools. You can still use the tools/scripts/phpunit syntax in v4.7, but I consider it a distraction.


Security Vulnerability in Dashboard CiviCRM 4.6 for Drupal 7 I am currently testing the dashboard feature before enabling it on a production site.
There seems to be a vulnerability in the Dashboard where a contact who only has "View my contact" permission and not "Edit my contact" is able to Edit a relative's contact (for which he has Dashboard access) even though he can only View his own contact.

Can someone confirm that this isn't only on my installation? I cannot test this on the Demo site as there is no access to Drupal.

Permissions User's Dashboard User's CiviCRM ProfileThe Spouse's ProfileSpouse's Profile Edit Screen

You should look at the comment by cividesk, and make sure that if you uncheck the setting on Evan's relationship record to be able to edit the spouse contact, that Evan can't edit the spouse record.  If that works as expected then:

Discussed this issue with CiviCRM Security Team.  The consensus is that this is not a bug, more like a feature, or one way to look at it is that CiviCRM is just flexible/configurable in this manner. If you don't want to have the contact be able to their spouse from that form you either need to not enable the setting on the contact's relationship record to allow editing, or possibly use ACLs(Access Control Lists) or some custom code in an extension to modify this behavior.

Also as a side note, the permissions "edit my contact" and "view my contact" when enabled for a Drupal user role can cause performance issues in installations with large numbers of contacts.


Advanced Search: Proximity search fails; returns "We could not geocode the destination address." Side Note: This worked before upgrading from 4.7.8 to 4.7.10.

When we go to Advanced Search (ourdomain/civicrm/contact/search/advanced): Address Fields, enter a Postal Code and a range (ex: Find contacts within 25 miles), and click "Search," CiviCRM returns an error like:

No matches found for:
Proximity search to a distance of 20 miles from 78660, UNITED STATES: We could not geocode the destination address.

I went to the sandbox (http://dmaster.demo.civicrm.org/civicrm/contact/search/advanced ) to check/test this, but the sandbox does not offer the option to search by proximity to a Postal Code. The sandbox is running 4.7.11

Thoughts? Thanks!

Proximity search worked fine for me in 4.7.11 and 4.7.10.  Proximity search is available on the demo if you select a geocoding provider (Administer menu » System Settings » Mapping and Geocoding).

I'd advise checking/changing your system's geocoding settings.  If that doesn't work, please update the question with the settings that aren't working, this is likely specific to your settings.


Set value of one field based on another field I've seen a couple of answers to similar questions (e.g. How do I set the value of external_id to be the same as a custom field? and Membership fee based on custom field).

What I want to do is change the content of a field from www.fubar.com/id= to www.fubar.com/id=[CONTENT OF FIELD]
I thought this was doable with CiviRules, but it appears there is no option to change the contents of a field based on the value of another field change (I can do other things based on a field value change).

Is this an area where I need to look into custom development? Or am I missing the bleeding obvious?

You could create your own action for CiviRules to update the field you want. You can find guidelines on creating CiviRules actions here


Paypal Recurring Transactions Are Broken in 4.7 When posting a recurring transaction with PayPal (offline and online), we're getting a 'Transaction ID not set' Payment Processor error.  The payment is created in Paypal.

Checking Civi log file, on offline transactions, getting:

[info] Could not find payment processor for contribution record: #######

For the online transaction, the log file has:

[info] contributionRecur could not be loaded
[info] Contribution record updated successfully
[info] Receipt sent
[info] Success: Database updated

This problem seems to have started with the 4.7 upgrade.

Even recurring transactions coming from Paypal are giving the same '[info] Could not find payment processor for contribution record:' error.

Site profile settings

You don't say which version of CiviCRM you're using. There were some fixes related to PayPal in 4.7.13, in particular look at CRM-18483 If you're not up on at least 4.7.13, it would be worth upgrading.

(Edited to correct a typo)


CiviCRM Contribution Page Theme I was wondering if anyone had suggests on great themes that I could purchase or are free for the public facing CiviCRM contribution pages? We would like to to be very responsive (Mobile friendly) and maybe incorporate Bootstrap.

Any ideas or suggestions are helpful. Thanks

There is a drupal theme Civi Bartik Public: https://github.com/CiviCooP/civi_bartik_public

You can configure the colors in the drupal admin. Unfortunately I dont have screenshot.


How to add memo type comment field for memberships? We have a set of custom fields for memberships, including one that is "Comments". I set the alphanumeric size to 1028. Problem is that the text box really should be a memo area.. the text box is just too small. I don't see Memo as one of the options for creating a custom field. Ideally it would be best to convert the existing field over to a memo control without changing the database too much. Could this be accomplished within the system or would you have to edit a template or something?

You can set the data type to "Note" and the input type to either "TextArea" or, if you prefer a wysiwyg editor, "RichTextArea".


Missing Log Tables Error It seems that daily, my System Status page is giving me the following error:

Missing Log Tables
You don't have logging enabled on some tables. This may cause errors on performing insert/update operation on them.

I then create the log tables, error goes away - next day - repeat.

Two activities I did in past couple weeks might have triggered this

Upgraded PHP version from 7 to 7.1 - while I believe I selected all the proper modules/extensions - there may have been something I missed.
Updated from 5.3.1 to 5.6

Wordpress

Most people who have this issue are on CiviCRM 5.3-5.6, and is caused by the "missing logging tables" check assuming that temp tables should have a logging table.  There is a fix available on Github, and it's part of CiviCRM 5.7+.


Outbound Domain Enforcement extension error I'm getting the following error and don't understand what it means.  Can anyone explain what this means?

The Outbound Domain Enforcement extension has prevented the following From Email Address option(s) from being used as it uses a different domain than the System-generated Mail Settings From Email Address configured at Administer > Communications > Organization Address and Contact Info: contact@k9direction.org, jefftawater@k9direction.org You can add another one here.

What are you doing when you get that error? It sounds like you have something configured to have two email addresses separated by a comma. Pick one and use that as the setting.


Can I format a smarty token number to have thousands comma? Based upon smarty documentation I should be able to do something like this

{contribution.total_amount|number_format:2:".":","}

and get something like 1,234.56, but it shows blank.  In the logs I see:

[plugin] (secure mode) modifier 'number_format' is not allowed
(core.load_plugins.php, line 118) in Smarty->trigger_error() (line 1094
of  .../sites/all/modules/civicrm/packages/Smarty/Smarty.class.php).

In searching our code tree a bit, I find a plugin modifier.crmNumberFormat.php, which looks like it should be the one. So why isn't it using it?

I do see that there are two Smarty plugin directories.  Not sure which one it's using.  There is one in sites/all/modules/civicrm/packages/Smarty and another in sites/all/modules/civicrm/CRM/Core/Smarty

We're running 4.5.8 and have 4.6.7 in a dev environment.

The civi provided modifier has a different name: crmNumberFormat

moreover as per Paul-Tahoe analysis, smarty seems to be confused, so the trick is to assign the formatted value to a temporary variable:

{assign var="ttl" value=$contact.total_amount|crmNumberFormat:2:'.':','}

and then display it:{$ttl}


Is there a way to search for organizations that have no active relationships? We're working on cleaning up database records, and while it's easy to pull individual records with no activity, I'm not sure how to find organizational records that are not tied to any current individuals. Is there a way to do this through Advanced Search?

Search for organisation contact using advance search who have relationship. Add those contact into a smart group.
Now find contact using Include/Exclude custom search or search builder, with contacts not in above created smart group.


Importing Notes with Privacy / Privacy level for Notes We have a client that wants to import private notes.

(1) Is it possible to import note with privacy? There is not an option, when importing, to specify a particular row as "Author of"; any imported note will be attributed to the importer. Nor do I see an option to specify a particular row as "Privacy"; all notes I've imported thus far enter as privacy none.

(2) Under Option groups, there is a Privacy level for Notes. Within this section, you can add a privacy level beyond Author only or None. But I do not see what this group corresponds to.

You might want to check out the API Import extension which adds a lot more options than the Civi Import Wizard


How do I import contact records with phone numbers without overwriting existing phone numbers? If I import a spread sheet with contacts and phone numbers and:

I choose to update duplicate contacts
I choose the same phone location and phone type of an existing, matching contact

Then, the existing phone number will be replaced with the one I'm importing.
That is reasonable for many workflows - but what if I want to add the number to the record and not overwrite anything? I know I can create more and more phone types but maybe there is a better way?

Use the API CSV Importer and import to the Phone entity which will always add new entries.