How to determine Payment Processor for "pending" transactions (via SQL or otherwise)? Is there a way to determine the Payment Processor for "pending" transactions? Our site has both Authorize.Net and PayPal Standard configured as payment methods, and I'm seeing and trying to debug lots of "pending" transactions (running on WordPress v.5.4.2, Civi v.5.25.0 -- just upgraded to 5.28.0, but the pending transactions have been happening since before then).
Or: should all of the "pending" transactions always only be from PayPal, since Auth.Net should complete immediately without IPN callback? And even for Auth.Net recurring transactions? (Since in principle one can configure and use multiple PayPal Payment Processors, it would still be helpful to be able to disambiguate pending transactions for those.)
I've explored the database, and I see that once a transaction has completed, I can get the Payment Processor via the civicrm_financial_trxn table (SQL below). But for 'pending', I haven't been able to track anything down.
select y.name `Payment Processor`
    , p.title
    , c.receive_date
    , c.id `contrib_id`
    , c.contribution_recur_id
    , c.invoice_id
    , c.trxn_id
    , case when c.contribution_status_id = 1 then 'Completed'
        when c.contribution_status_id = 2 then 'Pending'
        when c.contribution_status_id = 4 then 'Failed'
        else c.contribution_status_id end `Contrib Status`
    , t.payment_processor_id
    , y.url_site `Processor URL`
    , c.contact_id
    , c.total_amount
    , c.fee_amount
    , c.net_amount
    from civicrm_contribution c
    inner join civicrm_contribution_page p on p.id = c.contribution_page_id
    left join civicrm_financial_trxn t on t.trxn_id = c.trxn_id
    left join civicrm_payment_processor y on t.payment_processor_id = y.id
    where c.receive_date >= '2020-06-01'
    and c.is_test = 0 and c.is_pay_later = 0
    and t.from_financial_account_id is null
    order by c.contribution_status_id, c.receive_date, y.name, c.id desc;

(The t.from_financial_account_id is null clause prevents multiple matches with civicrm_financial_trxn table, since has multiple records for a single transaction when there are transaction fees.)

Below query should give you all pending contributions from payment processor
SELECT cc.id, cc.contact_id, cc.total_amount, cpp.title,
  cc.receive_date, cft.trxn_date, cc.invoice_id, cc.invoice_number, cc.trxn_id
FROM civicrm_contribution cc
  INNER JOIN civicrm_entity_financial_trxn ceft
    ON ceft.entity_id = cc.id AND ceft.entity_table = 'civicrm_contribution'
  INNER JOIN civicrm_financial_trxn cft
    ON cft.id = ceft.financial_trxn_id
  INNER JOIN civicrm_payment_processor cpp
    ON cpp.id = cft.payment_processor_id
WHERE cc.contribution_status_id = 2 AND cc.is_pay_later = 0;


Advanced Search: Exporting Groups/tags fields from event participant search When using advanced search to find event participants, the option to export Group(s) and Tags is not listed under "individual record type". Is there a way to pull this data together with event participant fields?

Thanks,
Jon

A possible work around is to do the search twice, first search will be to add the contacts to a temporal group and export contacts with the right tags and groups, the second search, export the events related data and use excel function example Vlookup to add tags/groups to your last export. You may want to export the contact ID, which will be your unique column for Vlookup.

Hope this helps.


Site broken. How do I fix Couldn't repair table: civicrm.log_civicrm_status_pref? On Drupal 7.52 and CiviCRM 4.7.13

Recently I discovered Civicrm couldn't connect to MySQL. This wonderful error popped up when registering someone for an event:

DB Error: no database selected

Checking the SQL log I see the following over and over

Couldn't repair table: civicrm.log_civicrm_status_pref

How do I get rid of the problem? MySQL seems unhappy at start up when it says

1:55:43 UTC - mysqld got signal 11 ;

Followed by a bunch of mundane stuff, none appearing error related then

Some pointers may be invalid and cause the dump to abort.
Query (7fc4005eff10): is an invalid pointer
Connection ID (thread ID): 9
Status: NOT_KILLED

I've heard that if I drop the table civicrm.log_civicrm_status_pref this will fix the problem. Really? Is there anything else I should know? Is it really as simple as

SELECT civicrm
DROP TABLE civicrm.log_civicrm_status_pref

Then the world returns to normal?

What if I think MySQL is pooched and I want to re-install it. Will I then find a database server with no databases? Thanks for any help the community can provide. Until now CiviCRM has been running great. This is the only serious problem I've had with it but it seems to be quite a problem. I've tried recovering from backup. No go. Same error.

Found the problem. Corrupt log tables. Causes MEGA-chaos for poor mysql. It's crash-a-roo anytime a CiviCRM table is used.

To resolve,

Find where the civicrm databases are stored. If on a typical *nix distribution and using mysql, likely /var/lib/mysql/civicrm

Shutdown mysql (service mysql stop)

Create a new directory (mkdir logtables), now move all the log tables into that directory (mv civicrm.log_* logtables)

Clear out the error.log files so you can see what is happening each time you start mysql. To do that cat /dev/null >/var/log/mysql/error.log (this assumes the mysql server log file is located at /var/log/mysql, which you'd check before issuing that command)

Start mysql (service mysql start)

If you do not have root privileges the OS will freak out when you attempt to move the log tables. Suggest elevating your privileges to root either using sudo (e.g. sudo mv civicrm.log_*) or su root, then go crazy but not too crazy. Remember, there's no undo in Unix/Linux. After starting mysql, check the mysql server's log file to see if it's happy again.


Kcfinder: Will not browse In CiviMail 4.6.10 on Joomla 3.4.5, clicking on Browse Server button opens Kcfinder popup window. Kcfinder is contained in CKeditor insert image toolbar function. No images populate and internal links result in error:

  Firefox doesn't know how to open this address, because one of the
  following protocols (kcact) isn't associated with any program or is
  not allowed in this context.

All major browsers same result. Cleared all browsers and CiviCRM cache to no avail. (The CiviCRM demo is still at 4.6.0 which doesn't have this feature.) See image below:

KCfinder is very sensible with the path to image storage. It configured path to the storage must match the path send by the JS component exactly! It doesn't work well with symbolic links on unix.

On windows servers, there may be problems with capital letters and small letters too.

I'm not shure, if this may be the problem in this case, but just double check all configured pathes.


Modifying Relationship.tpl modal I have custom fields underneath a relationship type that I want to restrict to view only or entirely remove if they are not a specific user. I can make the permissions work so the issue is load order I think. My jQuery code in Relationship.extra.tpl loads before the custom fields appear. I suppose my answer lies somewhere here https://docs.civicrm.org/dev/en/latest/framework/ajax/ but any pointers to get me in the right direction?

You can use preProcess or BuildForm hook on formname CustomDataType and unset the custom group or field based on user role or id

You can use PageRun hook and unset the variable in smarty template based on condition and it will not display on view page

since the custom fields are build using ajax, you can also use ajaxSuccess jq event to remove the custom field using Relationship.extra.tpl


Why are my contacts' name and email empty? I have many contacts with no first name, last name, or email. I don't know what my client has done to this site.

I viewed the records and they contain only id and sub-contact type.

Edit: I also tried the suggestion by Heather O. and looked at the Change Log.

I added one contribution where the external id there is not in my system but no new records have been created.

Do you have any idea?

I'd recommend clicking on one of the records and seeing what information is there. Presumably there is something, custom data or an activity or relationship.

I have seen this happen on imports that haven't been thought through. So for example, if you're using an external id to match contacts records on an activity import and there isn't a matching external id in CiviCRM, a new records will be created with only the external id on and activity.


Views: Filter results by current logged-in user I'm trying to create a view to show a list of past events that were attended by the user that's currently logged in.
Could anyone advise on the filter criteria needed to do this?
Fields

Event Title
Event End date

Filter criteria

Status = attended
???

Found it!
To limit views results to the current user, you want to:

Create a relationship

Go to Advanced > Relationships > Add 'CiviCRM Contacts: Drupal ID'

Add the filter criteria

User: Current (Yes)
On the Relationship dropdown, select Drupal User


What is the installation canary? One of my CiviCRM instances database has the table civicrm_install_canary, another has not. In code it is marked as a mechanism that check whether the install has run before. But how does this mechanism work. Does it mean that the installation has been failed irreparable, and that the backup must be restored. Is er een method to fix it, or can it maybe restored (or ignored)?

The installation canary is part of the current code base (CiviCRM 4.7.12).

What is the installation canary?

The civicrm_install_canary is fundamentally a test to see how well we control/understand the installation process. It's part of a bigger topic, so bear with me in giving the context.

The crux of the CiviCRM installation process has traditionally been two steps:

Copy a config template and edit it (civicrm.settings.php.tpl => civicrm.settings.php).
Load a SQL file into the database (civicrm.mysql and either civicrm_data.mysql or civicrm_generated.mysql).

When you use tools like sites/all/modules/civicrm/install/index.php or the Joomla installer or setup.sh or civibuild or provision_civicrm, these are basically all wrappers which do those two steps (plus random-other-things).

There are several installation-related things which aren't addressed by those two standardized steps, leading to some pain-points, e.g.

System requirements are not enforced or communicated consistently across installers.
If you install from git (instead of .tar.gz or .zip), then you need to run extra commands (GenCode).
You cannot automatically activate CiviCRM extensions during installation.
SQL triggers are generated using PHP logic. (The triggers should be generated during installation... and also when setting up custom-data or extensions...)
If you want to use a different language, then you need to load localized .mysql files. The pre-generation process for this slows down developmental builds and produces slightly stale translations for users.
PHP's MySQL API's have become a bit hostile to pre-generating SQL files.

For a long time, changing this was blocked because we simply didn't have a reliable way to add PHP logic during all installations... until someone proposed that we could do a bit of install logic during the first page-request. Sometime (maybe 4.7.0?) we introduced SystemInstallEvent.

Originally, the only thing SystemInstallEvent did was prove its own validity. The event should fire exactly once. If it fires a second time, then that's an error. Specifically, the SystemInstallEvent triggers the InstallationCanary which creates the table civicrm_install_canary (and failing if it already exists).

Eventually, we added DatabaseInitializer which also listens for SystemInstallEvent. During the first page-request, it runs the System.flush to ensure that triggers, caches, etal are current.

  Does it mean that the installation has been failed irreparable, and that the backup must be restored.

The system is probably OK. If you're getting an error, here are a few things to know:

On a new system (before the first page-view), the expected pre-condition is that the setting installed is untrue/undefined. The table civicrm_install_canary does not exist.
On an active system (after the first page-view), the expected post-condition is that the setting installed is true. The table civicrm_install_canary does exist.
If your system satisfies either pre-condition or post-condition, then it should be fine. You only get an error from a mix.
You might want to do a system flush and enable triggers, e.g.

Using Drupal website: http://mysite.example.com/civicrm/clearcache?triggerRebuild=1
Using drush CLI: drush cvapi system.flush triggers=1
Using cv CLI: cv api system.flush triggers=1


Custom report with custom fields: Group By not correctly naming custom fields Update I think the issue I'm running into is from this bug: https://issues.civicrm.org/jira/browse/CRM-18055

Using Civi 4.6.7 and Drupal 7.

This is my first custom report, and I'm attempting to let users sort by some custom fields. By reading through the docs and with the help of all y'all here on the forums, I got the fields added to the Sort dropdown:

class CRM_Report_Form_Special extends CRM_Report_Form {
  protected $_selectAliasesTotal = array();
  protected $_customGroupGroupBy = true;
  protected $_autoIncludeIndexedFieldsAsOrderBys = array( 'Activity' );
  protected $_customGroupExtends = array(
    'Activity',
  );

That part works great. What I can't get to work is when the user actually tries to sort by one of the custom fields, I always get a database error, as if the relevant columns don't exist:

FROM civireport_activity_temp_target tar
GROUP BY civicrm_activity_id  ORDER BY value_volunteer_activity_11_civireport.volunteer_activity_type_30 DESC  LIMIT 0, 50 [nativecode=1054 ** Unknown column 'value_volunteer_activity_11_civireport.volunteer_activity_type_30' in 'order clause']
    [to_string] => [db_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT SQL_CALC_FOUND_ROWS GROUP_CONCAT(civicrm_contact_contact_target SEPARATOR ';') as civicrm_contact_contact_target, GROUP_CONCAT(civicrm_contact_contact_source_id SEPARATOR ';') as civicrm_contact_contact_source_id, GROUP_CONCAT(civicrm_contact_contact_assignee_id SEPARATOR ';') as civicrm_contact_contact_assignee_id, GROUP_CONCAT(civicrm_contact_contact_target_id SEPARATOR ';') as civicrm_contact_contact_target_id, civicrm_email_contact_target_email, civicrm_activity_id, civicrm_activity_source_record_id, civicrm_activity_status_id, civicrm_activity_details, civicrm_value_volunteer_activity_11_custom_30, civicrm_value_volunteer_activity_11_custom_43, civicrm_value_volunteer_activity_11_custom_31, civicrm_value_volunteer_activity_11_custom_42
FROM civireport_activity_temp_target tar
GROUP BY civicrm_activity_id  ORDER BY value_volunteer_activity_11_civireport.volunteer_activity_type_30 DESC  LIMIT 0, 50 [nativecode=1054 ** Unknown column 'value_volunteer_activity_11_civireport.volunteer_activity_type_30' in 'order clause']"]

[Edit]
 The field I want here is civicrm_value_volunteer_activity_11_civireport.volunteer_activity_type_30, instead of value_volunteer_activity_11_civireport.volunteer_activity_type_30, but I don't understand why the settings at the top of my post don't make that happen already...

I think that the custom fields should work here, right? I don't want to go mucking about with the various SQL statements to fix this, do I?
Thanks in advance for any help, and please let me know if I've left out relevant info!

I think the issue I'm running into is a result of this bug:
https://issues.civicrm.org/jira/browse/CRM-18055


Check number and date fields do not appear when manually entering contributions Since upgrading to version 4.7.27 the boxes for entering check number and date do not appear when you enter a contribution in the back end with a payment type of check.  It used to be that once you selected payment type check, the options to enter this information would appear.  They don't anymore.

Thanks for any help anyone can provide!

Leslie

That would definitively be a bug - but I just had a look and check number is still there:

Perhaps something other than Core (an extension, custom code) is hiding your check number field?


Unable to create label format for membership card I'm trying to configure printing of a membership card directly from Civi using a custom mailing label format. Here's what I've done so far:

Created a custom label format with the parameters for Avery Label 5371 (business card)
Tried to get the data to print as a mailing label on the card stock (which is pre-printed with the org logo) by creating a message template using tokens for member name, membership expiration date, and membership type (Membership Card Data).
From member search results, performed the action "Create Mailing Label" and selected the custom label format I created in step 1.
Result is a nicely printed list with the name and address of each person, not the information specified in Membership Card Data.

I am guessing that the custom label format controls the size and number of each entry on a page, and the Membership Card Data message template is ignored and replaced by the specs in Localization>Address Settings/Mailing Label. I can't find anywhere to add a new mailing label format that contains the tokens I need for membership cards.

I've combed the boards and have seen discussions, but none seem to address my particular problem. Any thoughts?

I ended up creating an extension for a professional organization to handle this - ingredients:

function membershipcards_civicrm_tokenValues [you must create the tokens e.g.  $value['membership.type'] and $value['membership.status'] - I have 'see Example from Lobo' in my NOTES: https://civicrm.org/node/480
Then I have a Task: class CRM_membershipcards_Task_IssueMembershipCards extends CRM_Contact_Form_Task {
So that you can Find -> Advanced Search Contacts -> select them and then in the -actions- you can pick: Print Membership Cards
Then in the postProcess for that -action- I swap out the tokens and I re-use much of core mailing label bits - this is everything I want on the card:

  $formatted = $row['addressee_display'] . "\n" .
  $row['contact.homestreetaddress'] . "\n"  . $row['contact.homecity'] .
  ' ' . $row['contact.homepostalcode'] . "\n" . "\n" . 'License #: ' .
  $row['external_identifier'] . "\n" . $row['membership.type'] . "\n" .
  $row['contact.activityskills'] . "\n" . 'Start Date: ' .
  $row['membership.startdate'];

Eventually that gets passed onto self::createLabel($rows, $fv['label_name']);

Then my own function createlabel has all my custom layout for this organization:
XY positioning of the details, font, logo (watermark) placement, authorized signature.

Hope this helps! You could just create the Tokens and then you might be able to get at them into a template - however if you really want control over layout/looks - you'll need your own createlabel.


Anonymous role cannot make contribution Help wanted –
Suddenly, our donation and membership pages are stop working (the credit card fields are gone). Anonymous role cannot make contribution or sign up for membership. When an anonymous user filled out all the required screens, clicked on “review your contribution” and was given this error: Payment Method is a required field.
I am using WordPress 5.5.1, IATS and CiviCRM 5.29.1. I checked the Access Control (Permissions) in WordPress; it shows anonymous role can” Make payments or donations through your (our) website”.
Please help. Thank you.

I have had a similar problem with a WordPress install. In my case the Anonymous role of WordPress missing.
The Wordpress roles can be checked with
wp role list

I created the new role with
wp role create anonymous_user 'Anonymous User'


System status - disabled/deleted fields on Smart Groups (5.24) After upgrading to 5.24 I get the above message in system status.  I've disabled and re-enabled all smart groups but the message persists and I can't find any redundant custom fields.  The message shows no smart group name or custom field name so there's no clue what's wrong. There are no error messages in the log. This is a very small Drupal based system.  Here's the message:

After upgrading a couple more installs both produced these system status messages linked to phantom smart groups. To clear them click the left of the 2 small icons, then click the smart group criteria to go into advanced search. Then it really doesn't matter what you set this search to, as after clicking search you then go ahead & create the phantom smart group & then delete it. The message will then disappear.  This is the same process you would use to deal with this error message where the smart group exists, but for those you simply update the smart group after the advanced search.


Transitive relationships Does anyone know a way to find transitive relationships in civicrm?

Something like:
 ContactA is related to ContactB
 ContactB is related to ContactC

So ContactA is related to ContactC

Best approach for a Drupal based CiviCRM would be using Views which is a Drupal module, then you can build up search/displays that will daisy-chain the relationships the way you describe.


How can I fix broken clickthrough URLs in Mosaico emails? I've just started in on an issue with a D8 site, currently running Civi 5.25 and Mosaico 2.5.
Emails sent using Mosaico with clickthrough tracking contain a mix of correct and incorrect URLs. If I add a URL to an image that has been placed in Mosaico, then that URLs get correctly converted to something like https://example.org/libraries/civicrm/extern/url.php?u=xxx&qid=yyy
Embedding a URL into text in the body of the email, and/or using a button with a URL, they get converted to an incorrect link, of the form https://example.org/vendor/civicrm/civicrm-core/extern/url.php?u=xxx&qid=yyy - and clearly these links lead only to 404s.
If I construct a comparable email using the 'traditional' mailer then the resulting trackable URLs are all of the correct form.
So it looks like Mosaico is doing something weird in terms of constructing the paths for some, but not all trackable URLs.
I've looked at my settings for Directories and Resource URLs, and also looked at civicrm.settings.php and nothing is jumping out at me as being wrong.
I'm not too familiar with D8/Civi, and neither do I know much of the history of the site, other than that I've just updated Mosaico from 2.3x to 2.5 in an unsuccessful effort to resolve this issue.
Where is Mosaico getting the path data from? Why is it constructing some URLs that are fine, but others that are broken? Any clues gratefully received.

Drupal 8's architecture is different from most, and you probably know that there are two copies of some files - one in libraries and one in vendor.  My guess is that Mosaico is getting the path to url.php through two different functions that give different results.
Open up your civicrm.settings.php and find the line that has CIVICRM_UF_BASEURL in it, and paste these three lines anywhere below that:
$civicrm_setting['URL Preferences']['userFrameworkResourceURL'] = CIVICRM_UF_BASEURL . '/libraries/civicrm/';
$civicrm_paths['civicrm.root']['url'] = CIVICRM_UF_BASEURL . '/libraries/civicrm/';
$civicrm_setting['domain']['userFrameworkResourceURL'] = CIVICRM_UF_BASEURL . '/libraries/civicrm/';

This should hopefully force Civi to always return the libraries folder when constructing URLs to the extern subfolder.
EDIT: Today I was troubleshooting a site that went from using the Roundearth install method to the civicrm-asset-plugin method, and I had to comment out these lines to get the site to work.  I suspect Mosaico will be fine without these lines now that I've completely converted.


How do I tell what security issues require upgrade? Just upgraded a site to 4.6.11 (long story as to why).

CiviCRM is showing the "Security update required", which links to https://civicrm.org/advisory

As I click on advisory after advisory, in reverse chronological order starting from "CIVI-SA-2015-011: REFLECTED XSS IN ERROR MESSAGE", all have been fixed prior to 4.6.11.

So ... what is the vulnerability then, if I don't upgrade to 4.7.1?

I'm guessing the advisory will be posted any moment, but you should be able to go to 4.6.12 instead of jumping to 4.7. I believe the 4.6.x branch is now a LTS branch so you don't need to go to 4.7 immediately.
Update: The advisories have been updated (shortly after I posted) and also an email has been sent to the security list (subscribe here):

This is a notification of a security release for CiviCRM. We recommend
you immediately upgrade to a secure version of CiviCRM.
The most recent releases are CiviCRM 4.7.1 or CiviCRM 4.6.12. 4.4.21
LTS has been released also.
Some fixes affecting security were included in CiviCRM 4.6.10 and
4.6.11, but the email announcements which should accompany such releases was omitted. So, we're releasing 4.6.12 to time with a
security release window and ensure subscribers get notified.
Read the security advisories for details of the various fixes included
in the latest CiviCRM builds:

https://civicrm.org/advisory/civi-sa-2015-010-version-information-disclosure
https://civicrm.org/advisory/civi-sa-2015-011-reflected-xss-in-error-message
https://civicrm.org/advisory/civi-sa-2016-01-path-disclosure
https://civicrm.org/advisory/civi-sa-2016-02-access-bypass
https://civicrm.org/advisory/civi-sa-2016-03-multiple-vulnerabilties-in-dompdf

A number of other non-security issues have also been fixed in the
latest releases. Upgrade now for the most stable CiviCRM experience.
CiviCRM security announcements are available from
https://civicrm.org/advisory and via the CiviCRM Security
Notifications email list.
CiviCRM.org, San Francisco, CA 94117 United States


Profile Picture on CIvicrm Form How can I show the Users Profile Picture on a Civicrm Form please (in joomla)?

Thanks a lot,
Sri

You can use an API to get the image URL for a contact. For eg -

$result = civicrm_api3('Contact', 'getsingle', [
  'return' => ["image_URL"],
  'id' => contact_id,
]);

And then copy the value returned by the above API and fed it to the source of image tag in simple HTML code:-

  ......
  ......


How can I add additional clients to a case? I want to be able to add additional clients to some cases. The ability to do this used to be configurable via the case settings XML file before the configuration got moved into the UI. What's the current approach (version 4.6.x)?

From a comment by Coleman on June 18, 2015 regarding a question at civicrm.stackexchange.com/.../module-or-extension-to-use-for-tracking-agreements

> You can setup CiviCase to enable multiple clients per case, by editing
> your xml/configuration/Settings.xml file. Set
> <AllowMultipleCaseClients>1</AllowMultipleCaseClients>


Which value to use for tag_id to create EntityTag I am struggling with adding tags trough the CiviCRM API to a newly created contact in an extension (trough API Chaining). The installation is running on Wordpress 4.4.1 with CiviCRM 4.7. The following PHP snippet creates the contact with Tag "Non-Profit" which is not the expected behavior.

$contactParams['api.EntityTag.create'] = array(
        'entity_table' => 'Contacts', 'tag_id' => array("Interessent",     "Contributor")
);

$api->Contact->Create($contactParams)

A few advices :

when you chain, you shouldn't have to define the entity_table. If you want to define it anyway, the entity_table should be the database table - i.e. civicrm_contact in your case.
Label and id of the tag can be used in tag_id but i really encourage you to use the id. The label can change or be language dependent while the id could not change.

But to answer your question, in your case, the real problem is the array part. The EntityTag api is to create one tag assignation. I don't think there is a syntax to assign multiple tag.

It could be nice to be able to add several api.EntityTag.create but because the key is the api call definition, it's impossible right now (or i don't know how).

So while this will work fine :

$result = civicrm_api3('Contact', 'create', array(
  'contact_type' => "Individual",
  'first_name' => "xxx",
  'last_name' => "yyy",
  'api.EntityTag.create' => array('tag_id' => 5),
));

If you have multiple tags, i suggest you do :

$result = civicrm_api3('Contact', 'create', array(
  'contact_type' => "Individual",
  'first_name' => "xxx",
  'last_name' => "yyy",
));
$contact_id = $result['id'];
foreach ($tags as $tag_id) {
  civicrm_api3('EntityTag', 'create', array(
    'entity_table' => 'civicrm_contact',
    'entity_id' => $contact_id,
    'tag_id' => $tag_id,
  );
}

EDIT

For multiple tags, you could try (not tested but work for website for example - https://github.com/civicrm/civicrm-core/blob/master/api/v3/examples/Contact/ChainTwoWebsites.php)

$result = civicrm_api3('Contact', 'create', array(
  'contact_type' => "Individual",
  'first_name' => "xxx",
  'last_name' => "yyy",
  'api.EntityTag.create' => array('tag_id' => 5),
  'api.EntityTag.create.2' => array('tag_id' => 8),
));


Using Civicrm_api3 in onAjax[Name] plugin function I created a plugin which provides custom validation for civicrm forms.  Part of the jQuery validation on the plugin makes an AJAX call to the plugin.  The plugin calls its onAjax[Name] method.  In the onAjax[Name] method, I want to use civicrm_api3( ... ).  However, the system returns a fatal error

Call to undefined function civicrm_api3()

How do I use civicrm_api3 in the above context?  Do I need to import some class files?  The same code works if the validation occurs when the form is submitted with the submit button instead of AJAX.

Call civicrm_initialize() before using civicrm_api3() (or other CiviCRM functions).

This function is defined in the various CMS plugins (eg civicrm.module) and will load required files then initialize CiviCRM, after which you can make API calls.

Since booting the CRM adds overhead, it's best to only do when CRM is required - hence the separate function.


Joomla front end map function gives a narrow map You can search for contacts using a profile from the Joomla front end, and permit mapping, but the map is very narrow, and you can't search for counties.

Inspecting the page with a debugger shows that the code is expecting to see files under the civicrm folder which is not in the front end components/com_civicrm folder.

This is caused because the system expects to find css and other files under the civicrm folder.  This folder does not exist in [joomla root]/components/com_civicrm.  You can solve this by creating a symlink as follows:
cd [joomla root]/components/com_civicrm

ln -s [joomla root]/administrator/components/com_civicrm/civicrm civicrm

I suppose it is possible the code will be changed so this is unnecessary or the installation process will create the symlink if it is not needed.


Undefined index: value in _webform_conditional_get_all_components() I'm getting an error on the webform
Here is the error:
Notice: Undefined index: value in _webform_conditional_get_all_components() (line 662 of /home3/site/public_html/sites/all/modules/webform_conditional/webform_conditional.module).
I'm using Drupal 7 and the latest version of Webform.
I also have the error notification off.

It sounds like perhaps you have webform_conditional module installed even though conditionals are part of webform module?
☝This is the answer. If webform_conditional module is uninstalled properly it simply is impossible for that module to still be throwing error messages.


Trying to get New Member, Member Renewal Contribution working CiviCRM 5.33.2, Drupal 7.78.  Using example tokens found in the CiviCRM docs at "Tokens and mail merge/Checksum for Contribution Pages for Membership Renewals" to create an email to go out, I am struggling to claim a victory.  The example I am using looks something like this in my email template...
https://oursite.org/civicrm/contribute/transact?reset=1&id=5&{contact.checksum}&cid={contact.contact_id}&mid={membership.id}
...but the membership.id does not get picked up when the mail goes out.  The contact.contact_id seems to grab the correct information, but the url ends with "&mid=" with no value filled in.
Help please!

My guess is that you're sending emails out using CiviMail or the "send mail to contacts" search action.  This won't pick up the membership ID, because a contact can have multiple memberships and there's no way to know which to use.
I believe at present the only way (in CiviCRM core) to use the membership ID token is when using Scheduled Reminders (**Administer menu >> Communications >> Scheduled Reminders).  There's ongoing work to use the new token processor in other areas of CiviCRM, which would allow using this token elsewhere.
If you only have one active membership per contact, you can install Fuzion Tokens, which has a "latest membership ID" token.  This works for contacts because it eliminates the ambiguity of which membership is meant.


Group - Added (by Email) - how do i prevent this? I have a contact which is a member of 2 groups and the status is "Added (by Email)" - i don't want this to be possible!

on the same day, the account i use for bulk email received a (no subject) email from the relevant contact to civimail+u.1421.81227.ac26f752ec18f10b@

The IDs of the groups in question are 14 and 10.

in civimail accounts i have a default "bounce processing" with localpart "civimail+" account which i understand is for all bulk sending.

I also have one without a localpart used for "email-to-activity" - i don't think i actually want this at all now i look, but it's there currently.

What is triggering the "added (by email)" group join, and how can i block it in the future?
Thanks!

Added (by Email) is normally added when a contact is added to the group using a subscription URL provided in any mail.

It is basically used to know how a contact was added to the group.  This information is stored in civicrm_subscription_history table(method column) in civicrm database.

If you want to simply remove Email method from your DB, you can do it by a simple SQL -

UPDATE civicrm_subscription_history SET method = 'Web' WHERE method = 'Email'

To avoid it in future, you can proceed in writing an extension and a post hook which updates civicrm_subscription_history after a group contact is created.


How to quickly update a Smart Group? On CiviCRM 5.6.0

I have a Smart Group based upon custom_param1=1 (as an example).

I change some values of custom_param1, to update my Smart Group in order to send a mail to its updated members.

But the Smart Group is not updated immediately (I have to wait 5 minutes before it is)

How can I force its update to have it immediately ?

(rebuilding the smart group cache has no effect)

Clearing the Civi cache doesn't work? It should.


Clean reinstall on Wordpress New to CiviCRM.
WordPress Version: 4.4.2
PHP Version: 5.5.32
MySQL Version: 5.1.73-log

I initially installed CiviCRM 4.6.14 LTS by mistake and rather than do an upgrade, I deactivated it, deleted it, and dropped all the tables from the database (It was installed to its own DB).

I neglected to remove the plugins/files directory or its contents, though.

I then installed 4.7.3 and when I activated it, I had green lights all the way on the installation page, so I just proceeded. However, any attempts to open CiviCRM resulted in errors (something about MySQL MyISAM).

So, I deactivated, deleted and then found that the db files were put in my Wordpress database, not the CiviCRM db. I deleted all those, and reinstalled 4.7.3.

Now, when I activate, I get a SQL Error -- table not found. Obviously, CiviCRM is still trying to use the WP database. I wholly expected to get the Install page again, but that never happened.

What setting is lurking around that uninstalling doesn't delete? How can I get a clean install that runs the installation check and lets me enter the alternate DB info. I tried https://MYSITE/wp-admin/options-general.php?page=civicrm-install, but all I get is "You do not have sufficient permissions to access this page.")

Thanks!

EDIT: Here's the error message I get when I try to activate civicrm:
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 'db561663860.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 'db561663860.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 'db561663860.civicrm_setting' doesn't exist]"]
)

Warning: Invalid argument supplied for foreach() in MYSITE/wp-content/plugins/civicrm/civicrm/Civi/Core/SettingsBag.php on line 311content/plugins/civicrm/civicrm/Civi/Core/SettingsBag.php on line 311

Uninstalling CiviCRM doesn't delete its settings which are stored inside wp-content/uploads/civicrm folder. The best option is to delete that folder (it solves this issue in my case).

WARNING! Remember about making backups before deleting anything.


How to retrieve all contacts belonging to a smart group Given the ID of a smart group, what API/BAO/whatever do I need to use to retrieve all contacts belonging to that group? I've been looking through the source code all morning and can't seem to find what I need. Thanks.

As of version 4.6, you can use the API Explorer (top menu: Support > Developer > API Explorer) to get code, examples and docs.  You can use the entities and actions to find the right combination to get the info you're looking for. (You can use any number of actions, but it is a live API tool so if you e.g. update an entity, it will change values in the database).

In this case, go to the Explorer then click the tab for Examples.  Choose the entity: Contact and then example: GroupFilterUsingContactAPI.  That generates this code (taken from the Drupal Demo at dmaster.demo.civicrm.org, but the API explorer is not CMS dependent):

<?php
/**
 * Test Generated example demonstrating the Contact.get API.
 *
 * Get all from group and display contacts.
 *
 * @return array
 *   API result array
 */
function contact_get_example() {
  $params = array(
    'filter.group_id' => array(
      '0' => 1,
      '1' => 26,
    ),
    'contact_type' => 'Individual',
  );

  try{
    $result = civicrm_api3('Contact', 'get', $params);
  }
  catch (CiviCRM_API3_Exception $e) {
    // Handle error here.
    $errorMessage = $e->getMessage();
    $errorCode = $e->getErrorCode();
    $errorData = $e->getExtraParams();
    return array(
      'error' => $errorMessage,
      'error_code' => $errorCode,
      'error_data' => $errorData,
    );
  }

  return $result;
}

/**
 * Function returns array of result expected from previous function.
 *
 * @return array
 *   API result array
 */
function contact_get_expectedresult() {

  $expectedResult = array(
    'is_error' => 0,
    'version' => 3,
    'count' => 1,
    'id' => 1,
    'values' => array(
      '1' => array(
        'contact_id' => '1',
        'contact_type' => 'Individual',
        'contact_sub_type' => '',
        'sort_name' => 'man2@yahoo.com',
        'display_name' => 'man2@yahoo.com',
        'do_not_email' => 0,
        'do_not_phone' => 0,
        'do_not_mail' => 0,
        'do_not_sms' => 0,
        'do_not_trade' => 0,
        'is_opt_out' => 0,
        'legal_identifier' => '',
        'external_identifier' => '',
        'nick_name' => '',
        'legal_name' => '',
        'image_URL' => '',
        'preferred_communication_method' => '',
        'preferred_language' => 'en_US',
        'preferred_mail_format' => 'Both',
        'first_name' => '',
        'middle_name' => '',
        'last_name' => '',
        'prefix_id' => '',
        'suffix_id' => '',
        'formal_title' => '',
        'communication_style_id' => '',
        'job_title' => '',
        'gender_id' => '',
        'birth_date' => '',
        'is_deceased' => 0,
        'deceased_date' => '',
        'household_name' => '',
        'organization_name' => '',
        'sic_code' => '',
        'contact_is_deleted' => 0,
        'current_employer' => '',
        'address_id' => '2',
        'street_address' => '1 my road',
        'supplemental_address_1' => '',
        'supplemental_address_2' => '',
        'city' => '',
        'postal_code_suffix' => '',
        'postal_code' => '',
        'geo_code_1' => '',
        'geo_code_2' => '',
        'state_province_id' => '',
        'country_id' => '',
        'phone_id' => '',
        'phone_type_id' => '',
        'phone' => '',
        'email_id' => '1',
        'email' => 'man2@yahoo.com',
        'on_hold' => 0,
        'im_id' => '',
        'provider_id' => '',
        'im' => '',
        'worldregion_id' => '',
        'world_region' => '',
        'individual_prefix' => '',
        'individual_suffix' => '',
        'communication_style' => '',
        'gender' => '',
        'state_province_name' => '',
        'state_province' => '',
        'country' => '',
        'id' => '1',
      ),
    ),
  );

  return $expectedResult;
}

/*
* This example has been generated from the API test suite.
* The test that created it is called "testGetGroupIDFromContact"
* and can be found at:
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
*
* You can see the outcome of the API tests at
* https://test.civicrm.org/job/CiviCRM-master-git/
*
* To Learn about the API read
* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
*
* Browse the api on your own site with the api explorer
* http://MYSITE.ORG/path/to/civicrm/api
*
* Read more about testing here
* http://wiki.civicrm.org/confluence/display/CRM/Testing
*
* API Standards documentation:
* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
*/


What does the CiviCRM Contact Reference Field Drupal module do? What does the CiviCRM Contact Reference Field Drupal module do? And, if I select On to enable it, the selector changes to orange, rather than green, which I assume means 'proceed with caution if enabling this module'. So I'm not enabling it. Should I?

This module functions as a type of Entity Reference field so that you can link Drupal entities back to Contacts in Civi.

In the display settings for your content type, you can specify whether the Civi Contact appears as:

a plain text name,
their name linking to the Contact's record or
a raw Contact ID (CID).

An example of how we use them:

We have a Drupal content type called Event.  We want staff to know who is leading the event so we include a CiviCRM Contact Reference field.  When the Event node is filled out, we choose the event leader from a Civi-linked autocomplete field.  When the node is saved and displayed, the Civi Contact Reference field displays the event leader's or leaders' name(s) so the staff person can just click on the name to go straight to the individual's contact information.


Civisualize can't find JS and CSS resources I've got Civisualize running very nicely on an installation of CiviCRM 4.5 and Drupal 7 with some custom templates and queries. I then moved a copy of the whole site across to a different server under a different URL. After a bit of fiddling around, everything is now working under the new server/URL, except for Civisualize. I can access the dataviz template pages but no graphs/data are displayed.

The problem stems from the Civisualize extension looking for the d3 javascript and css resources in a place that they're not but I've no idea how to force/trick/coerce Civisualize to look for them elsewhere. Directories and Custom Ext path have been set up correctly and disabling/uninstalling/re-installing the extension hasn't helped.

Any suggestions as to what to try next?

You need to change the url where civi looks for extension so it looks at the new url

http://d46.demo.civicrm.org/civicrm/admin/setting/url?reset=1


Ampersand Changed to "&" in URL I have a site I am working on and sometimes the URLs are being changed &amp;id=X rather than &id=X.  For example, https://secure.domain.org/civicrm/event/register?reset=1&amp;id=15 .

I am not sure how this happening. Any help on how to get CiviCRM to recognize either is appreciated.

I am running CiviCRM - 4.6.24 and Drupal - 7.52.

Thanks,
Steve

Steve, I'm not sure exactly how this is happening, but it sounds like something about your process is getting confused between HTML and plain text.

If I typed &id=X in a Wysiwyg editor, the HTML source for that would be
&id=X (actually, what I wrote over there to the left was "& amp;id=X" but without the space. It was interpreted as HTML and the "& amp;" was rendered as "&" - talk about illustrating the confusion - apparently I needed to use "preformatted" in this wysiwyg editor!)

Is it possible that some of the parameters for your site were cut and pasted from html and it snuck in this way?

Can you elaborate on when this occurs? E.G. is this manifesting in browsers, or in emails sent by CiviMail, or in some other way?

Rick


Two "total number of participants"? I'm defining a two day event. For the first day there will be a 120 max participant limit and for the second day a much lower limit.

I also want to have "Early", "Regular" and "Late" fee levels with appropriate "discounts", which are limited in time as "Early Bird" fees are usually handled.

In addition I want to give some discount if you sign up for both days.

My current configuration is based on the three fee levels as time limited price sets each having three options, first day, second day and both with appropriate fees (where the fee is manually calculated according to the strategy I want).

The problem is that with this approach I cannot limit the second day participants to the level I want.

What are my options? Is there a way to do this completely with CiviCRM:s current feature set?

Since you have a different participant limit, its really a distinct event and you should treat it that way by creating a second event.  Yes your participants have to register twice but then you'll have a much nicer record of which day they attended (and all the benefits of automated reminders as well).

With the two-event configuration you can offer registrants of the first event a special discount for the second - just include the discount code in the confirmation email. You'll need to configure your discount codes carefully to activate and de-activate at the correct time. As a bonus, include a checksum link to the registration page, then the registrant won't have to re-enter all their information.


Webforms with offsite payment processor development Is anyone currently working to resolve the incompatibility between off site payment processors such as paypal standard and webforms?

On the wiki, it states its being developed.

Does any off site payment processor work with webforms yet?

Many thanks all,

Andy

The issues related to paypal standard and webform_civicrm have already been resolved. I've just updated the wiki documentation to reflect this.


CiviRules - to trigger a Mosaico templated email (with CiviMosaico extension)? Is it possible to trigger sending an email based on a Mosaico template (using the CiviCRM - Mosaico extension?). I'm guessing not, but thought maybe someone had done it, or had a workaround.

Thanks!
..clark

My understanding is that it's not possible, because Mosaico doesn't currently support transactional emails, only bulk emails.  I believe Veda is looking for funding from folks willing to sponsor adding Mosaico for transactional emails.


Problems installing CiviCRM under Drupal 7 on Windows? I have just tried installing CiviCRM 5.30.1 using Drupal 7 under WIMP, i.e. Windows, IIS, MySQL and PHP 7.4, and was unable to do so, as I got a message telling me that \sites\default was not writable.  On investigation, it seems that the PHP function is_writable will always return false under Windows. This means that it seems you can't install CiviCRM under Windows any more, as the IsCreatable function in \sites\all\modules\civicrm\setup\src\Setup\FileUtil.php relies on the is_writable function to test if the above folder is writable during the setup process.  I got round it with the following code snippet.
public static function isCreateable($file) {
    if (file_exists($file)) {
      return is_writable($file);
    }

    $next = dirname($file);
    do {
      $current = $next;
        // Under Windows, it seems that folder are never writable      if (file_exists($current)) {
        if( is_writable($current)) {
          return true;
        } else {
          //Try to create a file
            $result = fopen("Test.tmp", "w");
            if ($result) {
            // Close the file.
            fclose($result);
            // Delete it.
            unlink("Test.tmp");
            return true;
            } else {
              return false;
            }
        }
      $next = dirname($current);
    } while ($current && $next && $current != $next);

    return FALSE;
  }

No doubt some of you CiviCRM experts will have a comment.

In windows to change the folder permissions use attrib -r path\to\sites\default (can be a relative or absolute path).


Total Amount not displaying in contribution price set in Joomla 3 I have seen this issue in a couple other posts, but none that had an answer that applied to me.

I have CiviCRM 5.5.2, Joomla 3.8 and the RocketTheme Notio template. I have upgraded from a much older setup. In this updated build, the total amount doesn't display in my online form. In the backend preview, it displays and works just fine. On the website, not so much. I get the "Total Amount" label, but nothing for content.

Ideas of what I could be missing?

There should be JS errors on browser console. Since the total amount is calculated using javascript. If you see JS errors check

Directory path in CiviCRM
Resource URL
3 Cleanup CiviCRM Cache

HTH

Pradeep


Edit the financial type of an online contribution? We have some online contribution transactions that we'd like to assign to a different Financial Type. E.g. they were assigned Donation rather than Member Dues. Is there a way to manually change the Financial Type of a completed transaction?
On a related topic, there are some combined transactions that we'd like to split: $20 -> Member Dues, $10 -> Donation instead of $30 -> Member Dues. Is it possible to edit and split these transactions across the correct Financial Types?
cheers ... :) gn

I could say try price set where you will have two different Financial type - one for donation and one for membership
For the record which you wanted to correct which has been already completed - you need to delete the records and create it against manually using price set that should be the best option
I guess this helps!!!
Thanks


How to hardcode the unsubscribe /optout URL in a transactional email? I would like to send a transactional email with unsubscribe/opt-out url included. It usually gets triggered by civirules when the person gets added to a group. when email is sent the unsubscribe url does not render. civirules have suggested I hardcode the link. I have tried https://example.com/civicrm/mailing/unsubscribe?reset=1&cid={contact.contact_id}&{contact.checksum}
But with this link I get "Missing Parameters" errors. What is missing here? thanks

I think the unsubscribe link either needs mailing id or group id. The other option would be to create a profile with groups and opt-out field. And the include the profile as a unsubscribe link

https://example.com/civicrm/profile/edit?reset=1&gid=2&id={contact.contact_id}&{contact.checksum}

Where gid is a profile id.

Cheers

Pradeep


Find contacts on CiviCRM Good morning,

Every time I search for a contact, which I know is on our database, I get the message 'No contact found'.

Please can you advise?

Many thanks

Kind regards

Myriam Barker

(Adding this answer based on Comment by Myriam)

This could be a Permission issue. If the contact is in the db but you do not have permission to see them then you won't see any results.

Ways to confirm this would be use the QuickSearch and just hit ENTER (or type % and hit Enter if the former has no effect), do you see all the results of contacts, ie your complete list.

If you do and you still do not find them, then you may also need to search in Trash

If you only see a subset of your contacts then there could be some ACL that is restricting which contacts you can see

If you only see your record, then it is likely to be civicrm Permissions which are set by your CMS


How to insert Javascript into an inline form edit via an extension? Normally, if I want to inject a Javascript snippet into a form, I use a hook like in an extension like this:

function alternateduplicatecheck_civicrm_buildForm($formName, &$form) {
  if($formName == 'CRM_Contact_Form_Inline_CustomData'){
    CRM_Core_Resources::singleton()->addScriptFile( 'org.cpehn.alternateduplicatecheck', 'alternate_duplicate_button.js');
    }
  }

This works on most forms; however, this doesn't appear to work for forms used for inline editing loaded via AJAX.  The hook is called, but the Javascript doesn't run.  Maybe I need to modify my Javascript, insert an onLoad in there?  It looks like:

cj(function ($) {
  'use strict';
  console.log('hi');
  cj('.crm-button-type-upload').hide();
});

Here's the AJAX request (it's a custom field set on the summary tab): http://<sitename>/civicrm/ajax/inline?cid=5652&class_name=CRM_Contact_Form_Inline_CustomData&groupID=10&customRecId=339&cgcount=1&snippet=6&reset=1

cj(function ($) {}) has an implicit document.ready. To unpack that dense few characters of code:

cj is the deprecated alias of CiviCRM's copy of jQuery. In 4.5 and above use the new one: CRM.$.
Passing a function straight into jQuery is an alias of calling jQuery(document).ready() (not one that we made up, it's a jQuery thing).
The argument your function receives ($) is yet another alias of jQuery, which you should use inside your code block to make it more readable (so your code inside should be $('.crm-button-type-upload... not cj(...).
So the whole thing, written out in full would be CRM.$(document).ready(function($) {$('.crm-button-type-upload').hide();}); (not that I'm saying you can't use the shorter form CRM.$(function($)... I just wanted to make it clear what's going on)

To answer your question about how to include your js. As of 4.5, CRM_Core_Resources will add javascript files to snippets, and by default it does. I just tested it out and was able to get a script file loaded when I clicked to open an inline edit form on the contact summary page.

The only time this wouldn't work is if you specify the "header" region as the location for your script. This is because ajax snippets do not have a header.

You can find out more about loading javascript files and ajax at: http://wiki.civicrm.org/confluence/display/CRMDOC/Resource+Reference


Installing Civicrm session_start(): error fatal I installed Civicrm on Wordpress on the plugin folder and I can't active it.

I have this error :

  Warning: session_start(): user session functions not defined in
  /srv/bindings/code/wp-content/plugins/civicrm/civicrm.php on line 282
  Fatal error: session_start(): Failed to initialize storage module:
  user (path: ) in /srv/code/wp-content/plugins/civicrm/civicrm.php on
  line 282

Can you help me?
Thanks

It looks like your hosting provider or server config has overridden the PHP ini setting session.save_handler (or related settings like session.save_path).

You could try applying a fix similar to the one over on CRM-17212: IPN and other scripts break on Pantheon due to session handler


Mailing taking weeks to complete We sent out a pre-event bulk email to all event attendees on Nov 3. Today, we were informed by someone who just received their email today (Nov 30 - I can confirm in her message header that it arrived to her mailbox Nov 30, it wasn't that she just didn't see it until today). The Mailing Report lists that the mailing was successfully delivered to all 175 recipients, and that the start date was Nov 3, and the ending date was Nov 30.

Why in the world would it take nearly 4 weeks to complete a mailing to 175 individuals? How can we tell if it was just this one individual who didn't receive it until today? (The Activity includes the start date of the bulk email, but not the date that the activity was completed for her.)

Edited to add:

Now that I can find the reports, I see that the entire list didn't receive the mailing until yesterday.

Looking into the job scheduling and logging, I discovered that the job has been starting as scheduled every 15 minutes. However, the job log does not show that the job has finished executing until the time stamp that the mailing actually went out yesterday. SO... would this have been a problem with the server rather than with civi? Is there a way to get warning notices if a mailing hasn't completed within a certain amount of time so this doesn't surprise me (or less technically minded colleagues) later?

Further edit:

In an exchange with my hosting support (civihosting.com), we've decided that since it is working now, we won't pursue it to determine the reason. Kudos to anyone who can think of more information, though.

How can we tell if it was just this one individual who didn't receive it until today?

The Successful Deliveries Report (Mailings > Scheduled & sent Mailings > Report > Successful Deliveries) should show you the time each person was sent their email. You can also look at the mailings tab on each recipient.

I tested this on a sandbox where the Send Scheduled Mailings  job was not active and set the Mailer Batch Limit = 1, and Mailer Throttle Time = 120000.

I had to execute the job manually multiple times, once for each email to go out. Perhaps your job did not process fully and then finished the next time it was run.


Webform submission redirect to view it come from I have a view of player's grading record using custom fields set in civi. It's a table with current grade, previous grade, dates, etc.

I've created a form that allows adding extra rows into that view.

I'm trying to create a redirection URL on the webform that after submission will go back to that view with contact id in it's argument.

Not sure how to do that :-(((

Any help appreciated.

I've got it finally, I should have copied the token from the actual field, which in my case was "submission:values:civicrm_1_contact_1_fieldset_fieldset:civicrm_1_contact_1_contact_contact_id:nolabel]" and not the example from the token's help window.
Happy days!


How can I have both Participants Custom Data and Contacts Custom Data in a Drupal View I want to create an Event Participants View which displays both Participants Custom Data and Contacts Custom Data.

But when I want to add new fields, the Contact Custom Data are not proposed.

Isn't this feasible ?

I am on Drupal 5.57 / Civi 4.7.27

You need to add the Relationship (click open the Advanced fieldset on the right side in your View) to bring the Contact data to the party.

Here's how:

Create a View: Show CiviCRM Participants
Relationships: add CiviCRM Contributions: Contact Record ID

That will bring the entire CiviCRM Contact with custom fields to the party


Define CIVICRM_LOGGING_DSN in PHP? Is it possible to use PHP to define the CIVICRM_LOGGING_DSN setting located in civicrm.settings.php? We are using Drupal.

I have successfully used the following to change some settings before:

Civi::settings()->set('customPHPPathDir', "$root/CustomPHP/");

Thanks for any help!

It's not a setting you can set with Civi::settings. You can set it with a define() anywhere outside of civicrm.settings.php, but it would need to run that section in your file before running the code where it gets used, so somewhere pretty early in a page run. It always falls back to CIVICRM_DSN if CIVICRM_LOGGING_DSN is not set, if your setting runs too late.


Dependant autocomplete civicrm Working on custom enhancement, two text fields Parent and Child field.

Existing:-

Parent autocomplete - lists all existing contacts
Child autocomplete  - list all existing contacts

Required:-

Parent autocomplete - lists all existing contacts
Child autocomplete  - Parent specific

Using:- addEntityRef

 $form->addEntityRef('parenttwo_id', ts('Parent Contact'), array(
                    'placeholder' => ts('- select or create contact -'),
                    'create' => 'Parent_profile',
                    'api' => array('params' => array('contact_type' => 'Individual')),
                  ), FALSE);

 $form->addEntityRef('parenttwo_id', ts('Child Contact'), array(
                    'placeholder' => ts('- select or create contact -'),
                    'create' => 'Child_profile',
                    'api' => array('params' => array('contact_type' => 'Individual')),
                  ), FALSE);

Can't do below method because contact id must be dynamic one,
Means on searching of child contact field must lookup the relationship and fetch parent1's children.

 'api' => array('params' => array('contact_type' => 'Individual', 'contact_id' => '123123')

Can't do through simple textfield and ajax request because for contact creation profiles are being used.

Any other method available which can be used for this case?

CiviCRM Entity you can reference contacts, like from nodes with the Entity Reference module...To get the UI you describe, should try the Dynamic dependent fields module, with its submodule DDF Entity Reference

https://www.drupal.org/project/ddf


Is there an introduction to CiviCRM Entity anywhere? After a year or two of occasionally trying to utilize CiviCRM Entity, I am no closer to understanding the module.

I've read every bit of documentation that I can find, which mostly pertain to Rules (which I try to use sparingly).

What I'd really love to see is an example of how to use it to create content types if that is possible (I have no idea!).

With as much as I try to integrate Civi and Drupal I am missing this golden goose!

Any suggestions?

I found the best introduction was this workshop: https://denver2015.civicrm.org/sessions/civicrmdrupal-integration-showcase  The PDF on that page is helpful; the video of the workshop is available here: https://www.youtube.com/watch?v=i2GpnrVGdrc.

Note also that there are significant plans underway for CiviCRM Entity announced this week, see here: https://www.drupal.org/node/2676756


Relationship type id stored in the wrong custom group column? I made a custom group in a Relationship type. When I look back in MySQL table civicrm_custom_group I see that civicrm_relationship_type.id is stored in column civicrm_custom_group.extends_entity_column_value .

I am trying to write query that lists all custom groups in order to write an initialisation script. When doing a JOIN ON involving civicrm_custom_group.extends_entity_column_value, I discovered that is of type VARCHAR. I did not know that even with the MySQL CAST function it is impossible to use mixed types in a ON comparison.

Could it be bug that the id is stored in the wrong column? May be it should have been stored in column civicrm_custom_group.extends_entity_column_id ? That column is correctly of type UNSIGNED INT(10)

civicrm_custom_group.extends_entity_column_value stores more than just a number. You can have a custom group that extends a relationship type, but it can also be an activity type or a contact (sub-)type. If you extend a contact subtype, that field will contain the name of the subtype (not quite the same thing as the label btw), which will be in words.

The other thing is, that a custom group can extend more than one activity/relationship/contact subtype. How this is done, is by separating the values in extends_entity_column_value with the contents of CRM_Core_DAO::VALUE_SEPARATOR (ASCII SOH or 0x01), which isn't always visible when the data is shown to humans.

So, I have for extends_entity_column_value in one of my custom groups, <SOH>School<SOH>Further_Education_Institution<SOH>.

To unpack one of these kind of fields into an array, look at CRM_Utils_Array::explodePadded. (implodePadded being the reverse.) You could also match it using a regex- for example, this looks for a contact_sub_type field containing any of the subtypes School, Further Education Institution or Sixth Form College:

AND contact_a.contact_sub_type REGEXP CONCAT('(^|', x'01', ')School|Further_Education_Institution|Sixth_Form_College($|', x'01', ')')

Edit, for further info on where the IDs come from.
extends_entity_column_value will contain SOH-separated:

Numeric activity type IDs, if the custom group extends activities. Maybe null if it extends all activities. See also, civicrm_option_group's value column when option_group_id is 2 (you're looking at options in the activity_type option group).
Numeric relationship type IDs, if the custom group extends relationships. Maybe null if it extends all relationships. See also, civicrm_relationship_type's id column.
Contact subtype names, if the custom group extends a contact type. Maybe null if it extends all subtypes of a contact type. See also, civicrm_contact_type's name column. (If you look in civicrm_contact_type, and any of your contact (sub-)types have spaces/punctuation in their names you'll see the difference between the name and the label. The name is for use by code, the label is for humans to see.)

Custom field groups can also extend things other than contacts, relationships and activities. Events, participants and contributions for example.


Upgrading Mosaico without losing templates I have a client using Mosaico beta 3 (WordPress 5.1, Civi 5.7.5). I want to upgrade them to Mosaico beta 4, but they have a number of templates already built and I don't want to lose them when I upgrade. If I uninstall Mosaico beta 3 and install Mosaico beta 4, I will lose them. Anyone know if I can save the templates during the upgrade, and if so, the best way to do so?

@mattwire helped me out. Disable the Mosaico extension, replace the mosaico directory in the extensions directory with the new version, refresh the extensions page in app, enable Mosaico, and run an extensions database upgrade. In this case there were no db upgrades necessary, but there could be depending on the versions.


Dependency on php5.6-simplexml goes unchecked, is that a bug? I'm trying to install CiviCRM 4.7.10 on Ubuntu 16.04/WordPress 4.6.1/PHP 5.6.

After completing the installation, when I try to open the CiviCRM node in the WordPress admin menu, I get an error 500 Internal Server error.

The error log in /var/log/apache tells me there is a problem: "Call to undefined function simplexml_load_file".

I fixed this by starting from scratch, this time making sure that I install the  php5.6-simplexml package.

Could I have know about this in advance? Should the CiviCRM Installer page (in the WordPress admin) have checked and warn me about this problem?

This is a good question!

Until very recently, this issue hadn't come up, because just about every distro packages the XML extension with PHP.  Since you're using Ubuntu 16.04 with PHP 5.6, my guess is you're using the Ondrej PPA.  For whatever reason, he packages the XML extension separately.  And of course very few people used this PPA with CiviCRM until recently, but now people want Ubuntu LTS with PHP 5.6.

So yes - in theory this check should happen at install.  In practice, it doesn't really come up except for folks using the Ondrej PPA (and, I suppose, people who compile their own binaries).  So I'd guess this would be considered a "patch welcome" situation - now that PHP7 compatibility has landed in CiviCRM, my guess is that this will bite very few people (who will probably find this page).

If you feel strongly about this and are motivated to submit a patch, feel free to hit me up on chat.civicrm.org (@junglebird) if you need help getting a CiviCRM dev environment together.


Quickform Types Definitions or Examples I'm building my first extension with a basic Quickform. I'm trying to figure out the options I have for different field types, but I'm not seeing where the documentation is on definitions of types, especially the extended types.  For example, the Developer Docs talk about deprecated types for dates, and they mention using datepicker, but where would I find all the options I have available to me for the datepicker type? In this case, I'd like to have a datepicker without the time part, or set the minimum date. But same goes for other types as well, I'm not seeing the documentation or examples.  Where can I get more details on each extended type and/or examples of use?

I usually find more detailed examples by looking in the CiviCRM code, which is exactly where I found the answer to the " i do not want time" question a while ago :-)
As I found it I can share it with you:

$this->add('datepicker', 'activity_compare_date', ts('Comparison Date'), array('placeholder' => ts('Compare with')),FALSE, array('time' => FALSE));

And yes,it would be ideal if all these examples would be in the developer guide. So I would like to invite you to the next CiviCRM sprint to make this happen :-)


Copy/Duplicate a Contribution I've been requested to add a feature to our installation that allows an admin to copy or duplicate an existing contribution, including all it's custom fields.

I was wondering if anyone has tackled this before, or if there is an extension out there which may help.

If not, any pointers to doing this the right way?  Should/Can this be written as an extension?

I was thinking to add a button on the contribution view page (not sure which template this may be yet), and then use the API to pull the current contribution (hopefully with custom fields) and create a new one with the same fields (removing/replacing the transaction id so we don't have a duplicate key).

I'd appreciate any tips on this.

To this very old but unanswered question, I'll answer that there's now an extension that does exactly what you're asking: Clone Contribution. Quoting from the description:

  This extension provides:

  UI controls to clone a particular contribution, wherever contributions are listed (e.g., a contact's Contributions tab;
  contributions search results).
  Options to omit certain contribution properties from the cloning process (i.e., properties that will not be copied from the source
  contribution to the new contribution).
  An API Contribution.clone for cloning any number of contributions.

  During the cloning process, the following contribution properties can
  be changed so that they're immediately different in the new
  contribution:

  Contribution Status

I'm the developer on this extension.


Is there a CiviCRM payment processor extension to support Square? Is anyone developing the interface needed for using Square as a payment processor?

It might not be too hard to implement the omnipay version, there's a contributed plugin for that here: https://packagist.org/packages/ryanthompson/omnipay-square

If you want to take this route, here's how it might look [thanks petednz for the prod].

Read my old wiki entry here: https://wiki.civicrm.org/confluence/display/CRMDOC/Omnipay
as a general introduction to what omnipay is.
Get a copy of the omnipay payment processor extension. The extension home is here: https://civicrm.org/extensions/omnipay-multiprocessor-extension
But you'll want to clone it from the repo here:
https://github.com/eileenmcnaughton/nz.co.fuzion.omnipaymultiprocessor
Add the omnipay-square plugin to the omnipay payment processor exentsion. Yes, this is the hard part. There is a simple note here:
https://github.com/eileenmcnaughton/nz.co.fuzion.omnipaymultiprocessor/blob/master/README.md
I found that it was most instructive to look at some examples.

A few things I found helpful were:

a. Learn about composer if you don't already know about it. Don't skip this step or you'll get confused.

b. You have two routes if the omnipay plugin doesn't just work out of the box - either contribute your modifications back to the original project and keep it as the source of the plugin (possibly from your forked repo), or you can fork the original and create it as a separate project. The first one is usually the right answer, particularly if the existing plugin looks like it's going to be maintained. There are some confusing bits in terms of the vendor paths and git sources in the composer file that you'll have to figure out to sort this out.


Civimail 4.6.2 on Drupal 7.36 creating multiple drafts while editing We recently upgraded from CiviCRM 4.5.8 to 4.6.2 and this is our first shot with the new interface.  We're just at the compose stage but what we've run into so far:

Multiple copies of the draft appear to be created as you're editing.  In some of those copies it will say "place holder" in the Mailing Name column while others have the correct Mailing Name.
Once you've backed out of the editor (either from a freeze as we've had with IE or you just intend to come back later to finish it up), the Status column shows "Complete" and the Scheduled/Started/Completed columns now have timestamps.  Nothing has been sent and if you click on the Report link it shows all "0" even though while editing there was a number for the estimated recipients.
Even though the Status shows as Complete versus Not scheduled as it would back in 4.5.8, these draft mailings show up for both Mailing Status of Draft/Unscheduled as well as Complete.

At this point we've seen this from a client using Windows 7 and IE while I'm using Chrome on Linux.  Using the same Chrome/Linux combo I was able to get a mailing composed and sent using CiviCRM 4.6.2 on a WordPress site.

I just put in the define('CIVICRM_CIVIMAIL_UI_LEGACY',1); setting into the civicrm.settings.php file to get this mailing out but can revert back for some testing.

The answer is to update to 4.6.3.

In CiviCRM 4.6.2 on Joomla 3.4.1, I experienced somewhat the same thing. After sending the mailing, the draft remained in Drafts and was marked as Completed with all the appropriate reports. So, there are two identical listings for the same mailing in each Scheduled/Sent and Drafts areas.

Can the duplicate in Drafts be deleted or is it a the same entry as what is in the Scheduled/Sent area?

I updated today with CiviCRM 4.6.3, and performed the same and usual process and this doesn't occur any longer.


mismatch between journal and contribution transaction ID Love iATS and Civi!

That aside, we're experiencing an issue where some transactions have a mismatch as stated in title.

In the SQL Database I'll browse the 'civicrm_iats_journal' table and find the transaction record and I'll see something like 'AC13AA7R'

Then, on the civi contribution record, I'll see this in the transaction ID field: 'A1FA1CC2:1574381880' i.e. a different ID altogether.

Curiously, the invoice ID matches in the contribution 'Invoice Reference' field, in the iATS online journal, and Civi's 'civicrm_iats_journal' table. So I'm 99.9% sure it's the same transaction.

It’s 100% the same transaction. iATS reported they had an issue with Transaction ID numbering sequence for a portion of Nov. I’ll copy paste the Email thst went out to Partners:

Dear Valued Partner,
Please be advised that if your environment takes postbacks and/or runs morning download journals from the iATS system, your clients may have recently been impacted by duplicate transaction records caused by a logic error in creating and assigning iATS transaction ID's.
When did the issue occur?
From November 18th to December 2nd .
Has the issue been resolved?
Yes. Our development team has identified the root cause and made the necessary coding changes to correct any duplicate iATS transactions importing into your environment. We can confirm that this was due to our logic in creating/assigning iATS transaction ID’s and did not impact the number of transactions charged to account holders. This has been corrected and should not occur again, but as always, please keep us informed if you see any instances of this occurring.
What should you do?
There is no update needed on your part to correct the coding in order prevent this in the future. Clients are free to delete the duplicate iATS transaction from the environments without worry of impact. Note, clients should check the iATS portal to confirm which iATS transaction was processed and which one was the duplicate needing to be deleted.
If you have any additional questions, or should you need assistance in identifying these duplicate transactions, we are happy to assist you, or our mutual clients directly. They can reach out to our iATS Customer Care team for assistance with this process at iatscs@iatspayments.com or via phone at 1-888-955-5455 Option 1.
Sincerely,


Extended Report - Line Item report for price sets final line concatenating all records The Extended report  Line Item report for price sets was working perfectly fine till recently.

Now the last line is concatenating all first name and last names.  See Screenshot

This is because of full group by mode. I feel the latest version of CiviCRM group bys with fields that are mentioned in sort by(order by). Try after clearing the sorting fields.


Changed behavior in handoff between CiviContribut and PayPal We're encountering a problematic changed behavior in the CiviContribute module when it hands an online contribution over to PayPal Standard for payment.

The purchase description used to be like this:

Online Contribution: Sponsor a Child

which made it very easy for our treasurer to assign the payment accordingly.

The purchase description now appears like this:

1092-4219-Sponsor a Chil

where the first number is the contact ID and the second is Civi's internal  contribution ID -- neither of which is very useful to the treasurer.  Meanwhile the purchase purpose is truncated making it harder to figure out where to assign the payment in the back end accounting.

We are running Civi 4.7.14 in a Wordpress CMS.  It looks like the changed behavior might have begun when we upgraded from 4.6.X to 4.7.14.

Questions:

a.  Is this a "feature" or a "bug"?

b.  Is there a setting or template that we can adjust to get back to the original behavior or otherwise control the product description that is handed to PayPal?

It's documented and resolved in JIRA

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


Why can't I add more CiviCase fields to my Profile? I have created a new Profile to prompt the user to complete a new Case within CiviCase. However, when adding fields to the Profile, it only offers the 'Case Subject' field from CiviCase. What have I missed about the other fields (which are all unmodified, such as the Case Date) that will allow other fields to be added?
David

(4.7.9 on Wordpress, so I can't use Webforms)

(EDITED) When you set up a civicrm profile using lateset civicrm you can add Case fields and they all seem to be available. The below shows Profile with Case Subject and Case Status added and other fields still to add.


Manage Case ─ display activities in chronological order Joomla 3.9.2
CiviCRM 5.12.0

On the Manage Case page, the activities are now displayed in a clever order (overdue first, then the rest in newest-to-oldest order). I can imagine that this makes sense in some situations, but it doesn't in ours, so I need to tweak the code to have a simple ASCENDING order (oldest last). Previously, I had tweaked civicrm/templates/CRM/Case/Form/ActivityTab.tpl to replace
class="nestedActivitySelector crm-ajax-table" data-page-length="10" with
class="nestedActivitySelector crm-ajax-table" data-page-length="50" data-order='[[0,"asc"]]'> (see also this post), but this tweak no longer has any effect.

Can some kind developer please point to the part of the code which I need to change? Thank you.

As mentioned in the comments, it turns out the problem was one of numptitude, not a problem with CiviCRM. In fact the tweak works fine, as Demerit kindly confirmed.


DB Error: unknown error (Tablespace is missing for table .civicrm_setting) i just restarted my PC which has a locally hosted dev version of CiviCRM in WordPress, and now get the following error on initialization...

Initialization Error

Array (
  [callback] => Array
     (
         [0] => CRM_Core_Error
         [1] => simpleHandler
     )

  [code] => -1
  [message] => DB Error: unknown error
  [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=1812 **
Tablespace is missing for table `ieditims`.`civicrm_setting`.]
  [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=1812 **
Tablespace is missing for table `ieditims`.`civicrm_setting`.]
   [to_string] => [db_error: message="DB Error: unknown error" code=-1 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=1812 ** Tablespace is
missing for table `ieditims`.`civicrm_setting`.]"]

Please help!!!

Joe.

The relevant underlying error is hidden in that long message:

  ** Tablespace is missing for table ieditims.civicrm_setting.

I am no expert in database administration but it seems this might be related to a corrupted or missing file of your database system.

If your dev system doesn't have very specific civicrm settings, I would try to delete the table civicrm_setting in an admin tool like phpmyadmin and recreate it afterwards.
For CiviCRM 4.7.10 the SQL query to create the table would be

  CREATE TABLE IF NOT EXISTS civicrm_setting (
    id int(10) unsigned NOT NULL AUTO_INCREMENT,
    name varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Unique name for setting',
    value text COLLATE utf8_unicode_ci COMMENT 'data associated with this group / name combo',
    domain_id int(10) unsigned NOT NULL COMMENT 'Which Domain is this menu item for',
    contact_id int(10) unsigned DEFAULT NULL COMMENT 'FK to Contact ID if the setting is localized to a contact',
    is_domain tinyint(4) DEFAULT NULL COMMENT 'Is this setting a contact specific or site wide setting?',
    component_id int(10) unsigned DEFAULT NULL COMMENT 'Component that this menu item belongs to',
    created_date datetime DEFAULT NULL COMMENT 'When was the setting created',
    created_id int(10) unsigned DEFAULT NULL COMMENT 'FK to civicrm_contact, who created this setting',
    PRIMARY KEY (id),
    UNIQUE KEY index_domain_contact_name (domain_id,contact_id,name),
    KEY FK_civicrm_setting_domain_id (domain_id),
    KEY FK_civicrm_setting_contact_id (contact_id),
    KEY FK_civicrm_setting_component_id (component_id),
    KEY FK_civicrm_setting_created_id (created_id)
  ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci


On Language change civicrm api for participant status change does not work as expected $result1 = civicrm_api3('Participant', 'create', [
        'id' => $participant_id,
        'contact_id' => $contact_id,
        'event_id'   => $event_id,
        'status_id' => "Registered",//已登記
      ]);

when I have English enabled in the civicrm, the above API works changes status to Registered from Attended
When I have Chinese Language enabled in the civicrm, the above API does not change the status
In the list of Civicrm Participant Status I found that Participant status label is different in Chinese and English(which is obvious)
But how can we determine if the civicrm page is chinese, As I am using drupal, In drupal we have

global $language;
$lang_code = $language->language;

but in civicrm , how can we determine the language selected from the dropdown and based on that change status_id to be in chinese.

Even if the label is different in English and Chinese, the above API with 'status_id' => "Registered", parameter should work fine as it is meant to make the mapping based on name and not label.

Anyway, I think you should be able to use id instead of passing the name of the participant status in the api params. Something like -

$statusOptions = CRM_Event_BAO_Participant::buildOptions('status_id', 'validate');
...
...your api ...
...
  'status_id' => array_search('Registered', $statusOptions),

If the above fails, and you still want to do this by knowing which language is enabled, you can simply use -

$currentLanguageLocale = CRM_Core_I18n::getLocale();

The variable $currentLanguageLocale will hold the locale value of the current language enabled in civi.


Unable to create Joomla user account through CiviCRM profile Running Joomla 3.5.1, CiviCRM 4.7.7 with the user registration profile set to require Joomla account creation, a new civiCRM user profile is created, but a Joomla user account isn't created. The user registration profile worked in the past, but I don't know exactly when it stopped working. Creating a Joomla user account with using the default Joomla registration form directly works. Any suggestions for resolving?

This issue is coming in case of multilingual site.

To resolve this issue , go to Root/components/com_users/models/registration.php,near line no. 307 find below mentioned code

    if (JLanguageMultilang::isEnabled())
    {
        $form->setFieldAttribute('language', 'type', 'frontend_language', 'params');
    }

    if (empty($form))
    {
        return false;
    }

Replace with

if (empty($form))
{
    return false;
}

if (JLanguageMultilang::isEnabled())
{
     $form->setFieldAttribute('language', 'type', 'frontend_language', 'params');
}

Try this solution.


Deduplicating - unexpected over-ride behaviour We're using Civi 4.5.4 and Drupal 7, and finding that the deduping rule is confusing us - or we have a bug.

Unexpected duplication of addresses.
Contact A (the duplicate) has a home phone, email or postal address
Contact B has the same of any of these.
We choose not to include these in the duplication merge - we don't check its merge checkbox.

We expect that Contact A's home detail will not be moved over to Contact B.
Instead, after the merge we find that Contact B now has an additional home address containing the same email, phone and/or postal address as Contact A. In other words, the merge process is duplicating the home address.

If we do check the merge checkbox, then the merge process over-writes or adds as expected.

Any ideas?

(We did explore using the demo site, but it was in Russian, and we weren't sure if it was wise or kind to set it to English for our purposes, nor how to do this.)

This does sound like a bug with 4.5.x. But it's worth noting that a lot of effort has gone in to improving the dedupe process in 4.7.x, and there are now automated tests in the core suite that test this sort of thing.

If you cannot recreate the issue on the demo sites (4.6.x LTS or 4.7.x) then I would say the issue has since been resolved and I would recommend updating to whichever version you feel more comfortable using.


Wrong time in Mailing Report as said in the title, the mailing report seems to have a wrong time...when I send a mailing to my private email adress at 4 pm and open it right away, the mailing report says I opened it 2 hours ago.
Not much of a big problem here but it triggers me anyway!

Would be very thankful for some help!!

Ben

Glad to have been able to help - reposting my comment as a response and kindly requesting that you mark it as accepted given your findings.

  When you've got things running on different servers, there is a chance that dates and times may be mismatched - e.g. your mail server might be configured with a time zone that is different from the server on which your civi instance is installed and hence the time is incorrectly translated. Determining whether this is the case would be the first step.

Glad I could be of help!


Trying to set up read only role in Drupal I'm trying to set up a read-only role in CiviCRM on Drupal.  The environment is Drupal 8.9.12, CiviCRM 5.32.2 on Centos 8 with Apache.  This is a brand new installation I'm setting up for an organization that I volunteer for.  (I'm new to CiviCRM but have a long career with the IT industry and Linux in particular.)  Right now I'm working on a test environment that I've set up for learning my way around.
I've created a role in Drupal and enabled a number of CiviCRM "view" permissions in this role.  I've then created a used and assigned the newly created role to this user.
If I log in as this user I get "Access denied" for everything I've tried.  If I now enable "CiviCRM: access CiviCRM backend and API" for this read only role, I can now see the CiviCRM pages but I also seem to ave the ability to edit, which I'm trying to prohibit.
This is all on a virgin install.  I didn't encounter any problems installing the software, and if I log in as a user with adminitrator permissions everything works as expected, so there doesn't seem to be a problem with the install.
Any ideas?
Thanks,
Martin

So it turned out that the "Contact edit" capability was turned on for the "Authenticated User" role.  One needs to remember that Drupal "ORs" the permissions for logged in users in any custom role with the permissions in the "Authenticated User" role.
Always check the defaults before blaming the software!


Upgraded civicrm but the previous jquery files are still being called Upgrading from 4.0 to 4.1 by working through the fine documentation on wiki.civicrm.org. Cleared all drupal caches, deleted civicrm/templates_c/* and ConfigAndLog/*
ran civicrm/admin/setting/updateConfigBackend&reset=1,
    civicrm/admin/setting/path?reset=1

However menu dropdowns, tab expansion were not working since civicrm is still trying to open files from v4.0.8 namely in ../jquery/jquery-ui-1.8.11, ../plugins/jsTree.v.1.0rc2, jquery/jquery.js etc
whereas V4.1.5 comes with jquery-ui-1.8.16 for example

Got the site operational by copying the old jquery files back into the codebase so most appears to be working.

What resets which jquery files are used?

you need to rebuild all the menu items please use the following
Drupal sites: http:///index.php?q=civicrm/menu/rebuild&reset=1
and clear cache again

for more details please have a look at the below documents
http://wiki.civicrm.org:8090/confluence/display/CRMDOC/Moving+an+Existing+Installation+to+a+New+Server+or+Location


Report on Memorial gifts made in memory of a person I am new to CiviCRM.  How would I run a list of donors and their contact information who have made contributions in memory of someone?
Your help would be appreciated.
Thanks.
Felicia

I've just released an extension that does this called Soft Credit Custom Fields.  It does more than the name suggests - it also allows searching by soft creditee from Find Contributions or Advanced Search.  See screenshot:


How to fetch activity including custom fields using API I hope this is a useful question + answer. I feel it's necessary to document some, um, quirks, of the API v3 around Activities and custom data, because as a developer this took me ages to figure out.

I want to fetch all the details of a single activity, including custom fields.

Currently (4.6.7):

The normal activity get methods omit the custom fields.
You can get the custom fields using some voodo, but then you don't get all the standard fields.

Let's say $params is enough to find the single activity, e.g. $params = ['activity_id' => 123] where 123 is the known Id. But it could be any other API acceptable params.

$result = civicrm_api3('activity', 'getsingle', $params)
        + civicrm_api3('activity', 'getsingle',
                       [return:'custom_%,activity_type_id'] + $params);

The custom_% results in all custom fields being added. But this won't work without activity_type_id also being requested.

(You probably know, but the $array1 + $array2 stuff in PHP means extend array 1 with key/value pairs from array 2 when the key from array 2 does not exist in array 1.)

Alternative method

You can, list every field in the activity table as well as the custom stuff and in the return parameter to one API call.

However, this assumes that you know all the fields and that they won't change over time/upgrades. So the 2-call method above ensures that you're getting all CiviCRM has to offer on your activities. (Although you have to do extra calls to get the related contacts like targets and assignees etc. of course). It could be argued that you should only request what you want anyway.


Webform emails direct I've created a question on my webforms that require an answer of 'yes' or 'no'
 I can see there's an instruction of

'The selected component 'xxxxx' has multiple options. You may enter an e-mail address for each choice. When that choice is selected, an e-mail will be sent to the corresponding address. If a field is left blank, no e-mail will be sent for that option'

Is it possible to have one member of staff receive the result of the form if the answer is no, and another person if the answer is yes?

Starting from the webform configuration page:

Add your Yes/No component
Click the Emails button
In the E-mail To column select Component Value and choose your Yes/No component
Click Add
In the Component E-mail options, enter the email addresses to receive mail for Yes and for No.
Configure the rest of the email settings as you want


Automatic Invoice on CiviCrm My question is, can the Member get an automatic invoice directly from CiviCRM once he renewals his membership even if he didn't pay online, or he chooses to pay via bank transfer?

Abdalla, Welcome to CiviCRM SE. Yes, Member will get the receipt when a payment is processed from payment processor or bank transfer. CiviCRM sends the receipt to the user if the payment is complete. CCiviCRM also lets you generate invoice which includes tax details for the contribution(payment), this is not send automatically to user by CiviCRM.

HTH

Pradeep


How do I see which permissions are necessary to execute a given API call? If I pick a random entity and action, what steps can I take (manually if necessary) to see which specific permissions are necessary for CiviCRM to execute an API call with check_permissions=1?

This doesn't have a completely straightforward answer because sometimes one entity will create another entity with its own set of permissions.  Additionally, permissions also get blended with ACLs and custom permission hooks.  Finally, the permissions typically happen at the BAO and not API layer.

That said - the best single resource is CRM_Core_Permission::getEntityActionPermissions(). See CRM-20581 for a real-life recent example of how creating an event failed because accessing the StateProvince entity went from being a permission-skipping call to a permission-respecting call.


How to limit number of participant less than 10 for a single transaction? Scenario is like this:

Total Participant for the event is 500 (I know how to define that)
2 types of ticket available: Adult & child
On a single transaction only 5 people should be able to register, mix and match of adult & child. (But when I
select "multiple participant is allowed", CiviCRM automatically enables
10 participants).

Is it something possible to do to decrease number of participant value to less than 10?

This function is added to CiviCRM core 4.7. But I have managed to get it done by this extension
https://github.com/veda-consulting/uk.co.vedaconsulting.maxadditionalparticipants


Can't install extensions on CiviCRM 4.6.36 with Drupal 7.59 So I successfully installed CiviCRM and most things are running well but I can't install extensions.

From Gui
I get to the "Download and Install button and the installation fails with:

WARNING: The downloader may be unable to download files which require HTTP redirection. This may be a configuration issue with PHP's open_basedir or safe_mode.
Unable to extract the extension.
Extension Upgrade Failed
Download failed - ZIP file is unavailable or malformed

Manual
I download and expand the zip file in the extensions directory
It shows up as a local install
When I click the "Install" button:

the browser shows an address of (myserver)/drupal/index.php?q=civicrm/admin/extensions
And the message is:
This page isn’t working
(myserver) is currently unable to handle this request.
HTTP ERROR 500

I suspect some sort of PHP error but I don't know what the solution is.

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


Why does the user not get a "transaction complete" or "success" confirmation message after submitting an online transaction? Just updated to CiviCRM 4.6.26 from 4.6.x. Using iATS 1.5.3. Using D7. The user does not experience a completed transaction even though the transaction is complete through iATS and shows complete on user record (and in iATS dashboard in civi). The submit or "make contribution" link appears to hang up. No confirmation is sent to user or administrator. This results in the user attempting to resubmit. Any solutions? Any troubleshooting tips?

BTW: we have changed no configurations on contribution/registration pages. Previously working. But now they all hang up, we get no confirmation or "success" notification on any of our pages.

This has been resolved here: iATS Scheduled job for recurring payments does not "finish" in the logs. How can I fix this or troubleshoot further?

The answer is that I'm not sure why this is no longer working for you.

All our 4.6 sites have been upgraded to 4.6.26 and are using iATS
1.5.3 and I've had no reports of anything breaking.
I've just confirmed myself by making a donation to one of our projects that I
get to the Thank you page.

There is a bit of Javascript on that Make Contribution button. Ask your developer/support to open up a Firebug/Console to start the hunt as to what may be going on with your Contribution page.

From your Comments I see DOMPDF is throwing an error -> it is known to blow up at times - best to disable PDF creation for your receipt. It's one of those obscure settings under Misc -> civicrm/admin/setting/misc?reset=1 -> hit No on Attach PDF copy to receipts.