Outlook "Failed Fraud Detection" notice--only for some addresses from same domain I'm experiencing a curious issue that I've been unable to fully resolve. After Microsoft modified their SPF detection sometime late last year, I discovered that the SPF record for my organization had never been correctly configured on our website and all outgoing messages where failing Fraud Detection for Outlook recipients.

I did some research and configured our SPF Record and this seemed to resolve the issue for the primary general email address for our organization's domain. However, time passed and one of our other users attempted to send an email using their email address (on the same domain) as the From address, and those messages still triggered the Fraud Detection. I've tested with other email addresses on the domain and replicated this issue, while the primary address continues to send without issue.

Any thoughts on how to resolve this situation would be greatly appreciated.

Email delivery can be a tricky business and there can be many reasons why this is happening.

To diagnose, I use https://www.mail-tester.com/

It will give you a score out of 10 and let you know where you can improve, giving you details of SPF and DKIM records which may be causing issues with delivery.

You can just put the testing email provided by Mail Tester in the same place you put any email to send a test message in CiviMail. I'd recommend changing the from address on different tests and see how the score changes. Based on what you described, I would expect some feedback about your mail records.


Fatal Error when accessing Civi in WP Install My Civi seems to be broken, and I'm really unsure why! This is the error I receive when trying to open the base CiviCRM homepage.

Fatal error: Uncaught CRM_Core_Exception: [0: Invalid cache key: Not a string thrown in /home2/snachodo/public_html/boyscoutstech/wp-content/plugins/civicrm/civicrm/CRM/Utils/Cache.php on line 221

Can anyone point to a resource to resolve the error?

A further complication that I didn't realize until this week is that I am unable to create new blog posts or pages in WordPress. I receive the same error as above. However, WordPress works when I deactivate CiviCRM as a plugin.

Log message below:

[22-Dec-2018 00:25:12 UTC] PHP Fatal error:  Interface 'Psr\SimpleCache\CacheInterface' not found in /home2/snachodo/public_html/boyscoutstech/wp-content/plugins/civicrm/civicrm/CRM/Utils/Cache/Interface.php on line 40
[22-Dec-2018 00:47:24 UTC] PHP Fatal error:  Interface 'Psr\SimpleCache\CacheInterface' not found in /home2/snachodo/public_html/boyscoutstech/wp-content/plugins/civicrm/civicrm/CRM/Utils/Cache/Interface.php on line 40
[22-Dec-2018 22:29:32 America/Denver] PHP Warning:  Declaration of CRM_Mailchimp_Permission::check($permissions) should be compatible with CRM_Core_Permission::check($permissions, $contactId = NULL) in /home2/snachodo/public_html/boyscoutstech/wp-content/uploads/civicrm/ext/uk.co.vedaconsulting.mailchimp/CRM/Mailchimp/Permission.php on line 40
[22-Dec-2018 22:29:38 America/Denver] PHP Warning:  Declaration of CRM_Mailchimp_Permission::check($permissions) should be compatible with CRM_Core_Permission::check($permissions, $contactId = NULL) in /home2/snachodo/public_html/boyscoutstech/wp-content/uploads/civicrm/ext/uk.co.vedaconsulting.mailchimp/CRM/Mailchimp/Permission.php on line 40
[22-Dec-2018 23:15:00 America/Denver] PHP Warning:  Declaration of CRM_Mailchimp_Permission::check($permissions) should be compatible with CRM_Core_Permission::check($permissions, $contactId = NULL) in /home2/snachodo/public_html/boyscoutstech/wp-content/uploads/civicrm/ext/uk.co.vedaconsulting.mailchimp/CRM/Mailchimp/Permission.php on line 40
[03-Jan-2019 09:02:18 America/Denver] PHP Warning:  Declaration of CRM_Mailchimp_Permission::check($permissions) should be compatible with CRM_Core_Permission::check($permissions, $contactId = NULL) in /home2/snachodo/public_html/boyscoutstech/wp-content/uploads/civicrm/ext/uk.co.vedaconsulting.mailchimp/CRM/Mailchimp/Permission.php on line 40

Unfortunately, the log message suggests you've hit a limit of your hosting provider.

  User snachodo_657 already has more than 'max_user_connections'

This could have various causes. If your hosting plan only allows a certain number of DB connections simultaneously and your site creates more than that, you'd see this.

I don't think it's a common issue for CiviCRM so it may be that the hosting provider has a low number of permitted DB connections, OR that your site is busier than most sites on your hosting provider.

It's worth noting that CiviCRM's DB connection methodology does not re-use Wordpress's DB connection, so for any visitor on a CiviCRM page, your site will consume two DB connections at once.

In the first case, I'd contact your hosting provider and enquire about the limit. It might be a config tweak they can make, or they may offer you a plan with more DB connections.

If that doesn't work out, you could ask an expert to investigate why your site is making too many connections, or look into hosting providers who provide support for CiviCRM sites.

Hope that's some help!


Get a field label instead of value using the api I would like to retrieve both the value as well as the label from a custom field using the api, but it only seems possible to retrieve the value.
I wonder if this is possible, would surely help me a lot!

I assume you mean a drop-down field? You then need to do another lookup on the OptionValue to get the label, e.g. from the api explorer:

    $result = civicrm_api3('OptionValue', 'get', [
      'return' => ["label"],
      'option_group_id' => "custom_marital_status",
      'value' => "S",
    ]);

gives you

"is_error": 0,
    "version": 3,
    "count": 1,
    "id": 866,
    "values": [
        {
            "id": "866",
            "label": "Single"
        }
    ]


How can I include the number of relationships in a household in exported data for that household I need to mail multiple copies of our Client and Family Newsletter to households shared by individual clients.

How can I access the 'number of relationships' for each household (visible in the top ribbon), so that I could include that number in the info I give to the mail house, so that they can put the right number of copies in the envelope for each household?

Or is there a better way to achieve the same outcome?

Pete's answer is the only solution I can think of that doesn't require coding, but it's only an option for Drupal users.

If you're on Joomla/Wordpress, you'll need to code a solution, or hire someone to do so.  Create a custom field on the contact "number of relationships".  Create an extension with civix and use hook_civicrm_post on any relationship being created/updated/deleted; use an API call to getcount for relationships, and populate the number of relationships to your custom field.

If you know SQL but not PHP, an easier solution is to set up a cron job to fill in the custom field with a SQL statement that runs over the whole database.  I'm not sure if you can use an UPDATE statement with a GROUP BY though - so you might need to use a subselect, which is expensive.

The other SQL-centric option is to create a trigger to handle this.  You can be quick and dirty and drop it right into the database, or you can wrap it in a CiviCRM extension.  If you go the latter route, consider coding it into the "Summary Fields" extension: https://civicrm.org/extensions/summary-fields


Set memberships with no end date? It would be convenient for us to have open-ended memberships. For example, our board members are permanent members of the organization (this is different from lifetime memberships).  I'd like to have their membership record maintain a start date but drop the end date.  Is there an easy way to make that happen?

You can create an additional membership type for Board members that is separate from your "normal" life membership. On the page where you create the membership type, you'll set the duration unit to be 1 lifetime. I'd suggest giving the membership a name such as "Board Member" to help distinguish them from your regular lifetime membership.

That gives you an open-ended membership. Here's a screenshot to show you what I mean:


How can I disable the JQuery date widget and all just text input? CiviCRM 4.7.3 Worpdress 4.4.2

Due to issues with the JQuery date widget (e.g. Month and year, or year only formats are not saved and date list only goes back 10 years), I would like to simply disable it to avoid any confusion.

Is there an easy way to do this?

Adding the following CSS disables the date picker widget and allows users to simply type the date into the field:-

#ui-datepicker-div, .ui-datepicker .ui-widget  { display: none !important; }


Setting up geocoding The log says the scheduled job ran and worked, but I checked some contacts and see nothing happened. I had it set to run daily. It geocodes just fine on import and upon saving a record.

So, I have some questions.

How long does it run each time it is triggered? (max exec time?)
Can I throttle the amount of contacts it attempts to code for each run? I want to avoid it running non-stop and killing the server by overloading it.
I don't like to have more than one street address field (disabling supplemental 1,2,3) as users do not consistently input the their data right if you give them too many options. However, is it okay to include APT numbers etc in the main street address field and it still geocode reliably? I've done a few tests on records but not with a large sample.

I don't see in the docs clear answers: https://docs.civicrm.org/user/en/latest/initial-set-up/mapping/

Perhaps we can update the docs more on this?

Your questions are not provider specific and you didn't specify one, but if you are using Google, it looks like the documentation you reference is a bit out of date with regards to Google's requirement for API keys: the use of API keys was optional until changes recently went into effect in the Google Maps Platform. This month's Cividesk newsletter includes an article that details what needs to be done for Google APIs to continue functioning properly - you'll find that article HERE.

That said, I copy and paste your questions and intersperse them with my responses below and include links to resources where you should find more detailed instruction:

Q1: How long does it run each time it is triggered? (max exec time?)

A1: It depends on  how you run the cron - the answer to THIS question should point you in the right direction.

Q2: Can I throttle the amount of contacts it attempts to code for each run? I want to avoid it running non-stop and killing the server by overloading it.

A2: You will find job parameters detailed HERE (including throttle and limiting to specific contact IDs).

Q3: I don't like to have more than one street address field (disabling supplemental 1,2,3) as users do not consistently input the their data right if you give them too many options. However, is it okay to include APT numbers etc in the main street address field and it still geocode reliably? I've done a few tests on records but not with a large sample.

A3: The basic rule of thumb is to specify addresses in accordance with the format used by the national postal service of the country concerned. Additional tips on address formatting can be found HERE. CiviCRM includes an optional plugin for interfacing the the United States Postal Services (USPS) Address Standardization web service, details of which you will find HERE.


How can I speed up a slow upgrade to 4.7? Upgrades to 4.7 for big CiviCRM databases can take many many hours.

What is the best way to speed them up?

The slowest part of upgrading on a large installation is usually the civicrm_mailing_event_* tables.  That data is also often stale, so consider deleting it if you don't need to keep historical information about past civimailouts.


What does LExIM stand for? I've heard a few developers refer to LExIM. What on earth is it?

(Other than "Reading" in Albanian or an on-line learning company?)

LExIM is the new overall release and extension strategy:

LEAP BY EXTENSION. ITERATE BY MONTH.

  It basically means that:

  CiviCRM development will now happen mostly through extensions, enabling the users to individually turn these new features on or off by enabling these new extensions
  Releases are going to be published on a predictable monthly schedule, facilitating planning and execution of regular updates by CiviCRM service providers (from here)

See also: blog post and wiki article.


Does CiviCRM fulfil our charity's requirements? I work for a very small UK-based homeless charity.  We work alongside a similar organisation, and are looking to share information on a cloud based database. I work from home on a Mac, and the other charity work from an office on PCs.

What we want from a database is -

to be able to each of us access it at any given time from our own machines (mixed OS and location)
to record basic client information such as name, age, gender etc and also reasons for homelessness, case outcomes, blacklisted clients etc
to access simple reports for the purposes of these applications

Currently this information is held on an Microsoft Excel spreadsheet.

I also apply for various grants and funding, hence the requirement for reports.

Do you think that Civicrm would meet our requirements?

Thanks

Yes. Specifically:

CiviCRM is a web-app and therefore works equally well on OS X and Windows.
CiviCRM has a case-management feature which incidentally was originally designed for homelessness services.
There is a grant tracking feature but this is intended for organizations giving grants not receiving them. However CiviCase may be adequate for your grant tracking needs.
Information like "reason for homelessness" can be stored in custom fields - you can create as many of these as you need.
You can import records to CiviCRM from spreadsheets (specifically from the .csv format, which Excel can save as)


CiviReport's and CiviContribute Charts not displaying We are using civi 5.3 on Wordpress 4.9.
Using CiviReports or CiviContribute, I am selecting Charts, and clicking the view button.  The chart is not loading.   I saw the other answers suggesting that I enable flash in chrome for this site, but this is happening on Chrome, Explorer and Safari. Could the paths for these graphs be wrong?  Where would I check that?
The charts have never worked for us, even before upgrading to 5.3.

Some browsers don't show up flash chart by default, you will need allow flash for certain urls or make it allow for all sites. This answer might be useful to fix your problem.
HTH
Pradeep


How to send a confirmation email when adding a contact to group via API? I'm using the REST API to create contacts and add them to an existing mailing group.  I want to add them as pending and trigger the confirmation email but I can't find a way to do it via the API.

The extension org.civicoop.emailapi seems like it does what I need but it only supports up to 4.6 and I'm running 5.0.2.

Are there any other options?

edit - I've installed org.civicoop.emailapi and it's working under 5.0.2, but I can't make it send the group confirmation email as it's not a normal mailing template.

edit - If I create my own mailing template, I can't find a token that generates the confirmation link for a specific user and a specific group.  To be clear, I want to recreate the {subscribe.url} token from the Subscription Confirmation Request automated message.

We’re using civicoop email api extension on 4.7 and that means it should work on 5.x as well.


Database scheme corrupt - foreign key relationships are missing in mysql At a client of us we have a problem with the database scheme. CiviCRM is working normally except that when you want to merge contacts the Activities/Groups/Relationships etc.. are missing in the merge screen.

After some investigation it turns out the merge functionality use the mysql databasescheme for fin ding out which tables are linked to a contact.

It does so with the query below:

SELECT table_name, column_name
FROM information_schema.key_column_usage
WHERE referenced_table_schema = database()
AND referenced_table_name = 'civicrm_contact'
AND referenced_column_name = 'id';

The problem at this specific installation is that the information_scheme.key_column_usage is empty for this specific database.

So I assume that the foreign key relationships are missing in mysql. In the past this civicrm site has moved databases from one to another and there has been an update from 4.5.x to 4.6.x

Does anyone know how to fix the database scheme?

Thanks

Having spoken to our hosting experts we are going to rebuild foreign keys. Will update you shortly.

thanks,
Jon-man


Can I use multiple values in an api Get call? For example, can I use a single api call to get all the contributions from contact a and contact b. My actual need is to get contributions from the contact and any related contacts, but I assume I need to do that as a previous step, which is done.

Yes, I just used the new API explorer in 4.6 and got a sample PHP call:

$result = civicrm_api3('Contribution', 'get', array(
  'sequential' => 1,
  'contact_id' => array('IN' => array(58, 25)),
));


Latest 'Note' field is not being used in the "Profiles - Admin Notification" email template Was wondering if anyone else has seen this problem and found a fix.  I was going to test on the Demo site, http://dmaster.demo.civicrm.org, but I figured I wouldn't be able to receive the email to see if the problem exists there since I'm not an Admin.

The situation is that I'm leveraging the existing Note field for Contacts in a Contact Us profile used on our WordPress Frontend.  Basically option #1 indicated in the first paragraph of the answer for the following question:

Creating a Contact Form in CiviCRM

When the Admin receives the email from the Contact Us profile submission it seems to always parse in the first Note for the contact and not the last Note (which would have been what was submitted at the time).

Rather than using "Notes", consider creating an activity instead - and instead of using Profiles, use Caldera Forms with CiviCRM integration to create the Activity.

There are several advantages, including those I mention here, but also that you won't get the wrong "note", or pollute your notes data with information that's not really a note.


how to add two dropdowns parallel to each other how to add two dropdowns parallel to each other, e.g. one drop down with name of the item and the second dropdown with the quantity of the item. I have tried to add two dropdowns but they appeared one below thee other. Basically what are I'm trying to do is to have an "Item" correspond to the "Quantity" to how many were sold. Please check the image below.

you need to write JavaScript in order to view the drop drown parallel.

If you are trying this in summary screen just use tab.extra.tpl else please let me know the screen so I will help you.


Contributions made via Charitable gift funds My organization sometimes receives gifts from Donor Advised Gift Funds. We need to thank the individuals who are in the contacts table but also need to mention the source of the gift as being the Donor Advised fund. What is the best way to enter a contribution received in this way?

This is specifically why soft credit types were introduced. Record the donation as coming from the fund and add a soft credit for the individual. Donor advised fund is one of the types available by default.


Send test mail works, CiviMail doesn't On a 4.7.11 site, I'm trying to send mails using the smtp relay server of google.

I followed the instructions on the google website for setting up mail relay in G suite (https://support.google.com/a/answer/176600?hl=en and https://support.google.com/a/answer/2956491)

Then in CiviCRM I configured outbound mail settings like this:

Select mailer: SMTP
SMTP Server: smtp-relay.gmail.com
SMTP port: 25
Authentication? No

When I click the "Save & Send Test Email" button, it works. So the setup of google relay for my account is correct.

Also, when I use activities to send an email, it works.

But when I try to send a test email using CiviMail, I get the error:

Error in call to Mailing_send_test : Failed to set sender: b.25.13.aa68527faac1fed1@EXAMPLE.ORG [SMTP: Invalid response code received from SMTP server while sending email. This is often caused by a misconfiguration in Outbound Email settings. Please verify the settings at Administer CiviCRM >> Global Settings >> Outbound Email (SMTP). (code: 550, response: 5.7.0 Mail relay denied [62.19.72.76]. Invalid credentials for relay for one 5.7.0 of the domains in: example.org (as obtained from helo and mail-from). 5.7.0 Email is being sent from a domain or IP address which isn't registered 5.7.0 in Google Apps account. Please login to your Google Apps account and 5.7.0 verify that your sending device IP address has been registered within 5.7.0 Google Apps SMTP Relay Settings. For more information, please visit 5.7.0 support.google.com/a/answer/6140680#maildenied e9sm8480344wjh.2 - gsmtp)]

Which is weird, because the IP address is correct and SMTP authentication is not required in my google settings.

Is CiviMail using other settings than the one defined in the outbound mail settings screen? Or does it use another method to send mails?

Thanks.

Alain

Apparently, CiviCRM adds a lot of things before the @yourdomain.com in the From-address. Things like a job id, event queue id, and a hash. Google didn't like that because that email address didn't match an existing mailbox. Luckily, in the Google SMTP relay settings, you can specify to accept any address from your domain. That did it!


Data too long for column breaks export The error is e.g.

  Data too long for column 'custom_194' at row 1

Our values are 1 character so we set the DB Field Length to 1. However, this makes exports of this same field fail. It is exporting the label, not the value, so DB Field Length needs to accommodate the label.

Since this is unresolved https://lab.civicrm.org/dev/core/issues/181 is setting a longer DB Field Length my only alternative to letting exports work again?

For the interim to let exports work, I have made the DB Field Length match the longest field label.


Create custom entity in CiviCRM with its UI form for data entry? I want to create new custom entity in the Drupal-CiviCRM with its form from where user can data. In my case I want to have something like : User can register new application for keeping dangerous animal. It will then initiate workflow which will forward the application for its approval/decline process to admin.

It sounds like you want to use the CiviCRM Webform Integration module and start a case in CiviCRM when an application form is submitted?


How can arrange custom fields so they are side by side? I have a high number of 'outcomes' for a client in the format of 3 fields for each outcome as below:

'outcome words',  date identified,    date met

Problem is that custom fields are formatted as one below the other as:

'outcome words'
date identified
date met

Which means that the screen will be very deep causing the user to scroll down a lot.  What would be involved in re-formatting the screen so that these fields are all side by side?

The case custom fields are formatted as a series of one row tables.  You could add some jQuery to move them around.

For example:

CRM.$(function($) {
  $('#Outcomes table:nth-of-type(3n+1)').each(function (index) {
    // Combine 3 rows into 1
    for (var i = 0; i <= 1; i++) {
      $(this).find('td:last').after($(this).next().find('td'));
      $(this).next().remove();
    }
    // Merge tables
    if (index > 0) {
      $(this).prev().find('tr:last').after($(this).find('tr'));
      $(this).remove();
    }
  });
  // Remove labels if not wanted
  $('#Outcomes td.label').remove();
});

You can add it to your page in various ways, but I'd create a tiny extension and drop it in there.  See also wiki.civicrm.org/confluence/display/CRMDOC/Javascript+Reference

Without jQuery:

With jQuery:


500 error when creating action in rule ''Create linked drupal user account'' I am trying to create a rule based on the blog post here: https://civicrm.org/blog/petednz/creating-drupal-users-made-easy-for-single-or-multiple-contacts-via-civi-imports-and

I'm recreating the rule manually but when I try to create the action 'Create linked drupal user account' I get this error, does anyone know why?

  2016/11/07 15:09:43 [error] 28899#28899: *113846 FastCGI sent in
  stderr: "PHP message: PHP Fatal error: Unsupported operand types in
  /var/www/xxxxxx/includes/form.inc on line 2760" while reading response
  header from upstream, client: x.x.x.x, server: example.com, request:
  "POST /system/ajax HTTP/1.1", upstream:
  "fastcgi://unix:/var/run/php5-fpm.sock:", host: "example.com",
  referrer:
  "https://example.com/admin/config/workflow/rules/reaction/manage/rules_entity_tag_create_drupal_user/add/1/action"

We got this working using this rule:

{ "rules_friends_tag_account_create" : {
"LABEL" : "Self Create User Account and login",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"TAGS" : [ "CiviCRM", "CiviCRM User" ],
"REQUIRES" : [ "rules", "civicrm" ],
"ON" : { "civicrm_entity_tag_create" : [] },
"IF" : [ { "data_is" : { "data" : [ "civicrm-entity-tag:tag-id" ], "value" : "163" } }
],
"DO" : [ { "civicrm_entity_action_load_create_user" : {
"USING" : {
"civicrm_contact" : [ "civicrm-entity-tag:entity-id-contact" ],
"is_active" : "1",
"notify" : "1"
},
"PROVIDE" : { "civicrm_user" : { "civicrm_user" : "Created or Loaded Drupal User" } }
}
}
]
}
}


Why is no Receipt is being sent for a Contribution when using PayPal Standard? CiviCRM 4.6.5 and WordPress 4.2.4

When the payment processor Paypal Standard is chosen, the receipt is not being sent.

When returning from paypal, it goes onto the thank you page and the payment is marked as completed, so everything is fine for the payment processor.

When I choose "Pay later", the receipt is sent so the e-mail processor is fine too.

What could cause this issue?

Seems related to this issue: https://issues.civicrm.org/jira/browse/CRM-15629

But it was supposed to be fixed in 4.6.3

Thanks.

This is what I get in the ConfigAndLog file:

  Aug 25 12:00:17  [info] Contribution record updated successfully

  Aug 25 08:00:21  [info] $Fatal Error Details = Array (
      [message] =>
      [code] =>  )

  Aug 25 08:00:21  [info] $backTrace = #0
  /home2/sherbro3/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(364):
  CRM_Core_Error::backtrace("backTrace", TRUE)
  #1 /home2/sherbro3/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(1018):
  CRM_Core_Error::fatal()
  #2 /home2/sherbro3/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contribute/Form/Task/Invoice.php(478):
  CRM_Core_DAO::getFieldValue("CRM_Contact_DAO_Contact", NULL,
  "display_name")
  #3 /home2/sherbro3/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contribute/BAO/ContributionPage.php(922):
  CRM_Contribute_Form_Task_Invoice::printPDF((Array:1), (Array:2),
  (Array:1), NULL)
  #4 /home2/sherbro3/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/MessageTemplate.php(508):
  CRM_Contribute_BAO_ContributionPage::addInvoicePdfToEmail("398", "2")
  #5 /home2/sherbro3/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contribute/BAO/ContributionPage.php(412):
  CRM_Core_BAO_MessageTemplate::sendTemplate((Array:13))
  #6 /home2/sherbro3/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contribute/BAO/Contribution.php(2291):
  CRM_Contribute_BAO_ContributionPage::sendMail("2", (Array:36), FALSE,
  FALSE)
  #7 /home2/sherbro3/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Payment/BaseIPN.php(853):
  CRM_Contribute_BAO_Contribution->composeMessageArray((Array:28),
  (Array:9), (Array:36), FALSE, FALSE)
  #8 /home2/sherbro3/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Payment/BaseIPN.php(788):
  CRM_Core_Payment_BaseIPN->sendMail((Array:28), (Array:9), (Array:7),
  (Array:36), FALSE, FALSE)
  #9 /home2/sherbro3/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Payment/PayPalIPN.php(290):
  CRM_Core_Payment_BaseIPN->completeTransaction((Array:28), (Array:9),
  (Array:7), Object(CRM_Core_Transaction), FALSE)
  #10 /home2/sherbro3/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Payment/PayPalIPN.php(343):
  CRM_Core_Payment_PayPalIPN->single((Array:28), (Array:9), (Array:7),
  FALSE, FALSE)
  #11 /home2/sherbro3/public_html/wp-content/plugins/civicrm/civicrm/extern/ipn.php(52):
  CRM_Core_Payment_PayPalIPN->main()
  #12 {main}

This patch fixes the problem for me: https://github.com/civicrm/civicrm-core/pull/6900


SOLVED: 'DB Error: extension not found' after PHP upgrade to version 7.0 Civi: 4.7.11
Wordpress 4.7.2

Hi,
I was working on my database today and munged something up. No problem (I thought)... I did a back up beforehand just in case. Unfortunately, after restoring the database I now get the following when I try to access Civi from the front or back end. WordPress is running fine. (Note: The database restore was a red herring. It was a change of the PHP version at the same time that caused the problem)

Civi was working perfectly so I'm rather baffled as to what the issue would be since it's all the same data as before.

Any suggestions would be appreciated.

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

    [code] => -25
    [message] => DB Error: extension not found
    [mode] => 16
    [debug_info] =>  [DB Error: extension not found]
    [type] => DB_Error
    [user_info] =>  [DB Error: extension not found]
    [to_string] => [db_error: message="DB Error: extension not found" code=-25 mode=callback callback=CRM_Core_Error::simpleHandler prefix="" info=" [DB Error: extension not found]"]
)

ADD. 1

I've found two mentions of the same error
- CiviCRM Initalization Error: DB Error: extension not found
- https://issues.civicrm.org/jira/browse/CRM-17874

Both refer to the problem being the use of the MySQL extension. I'm a little out of my depth at this point. As far as I can tell there were no changes to the server in the short time between when I made and restored the backup DB.

ADD. 2

As mentioned in my reply to Kainuk below, it turns out the host upgraded the PHP from 5.4 to 7. I don't have shell access, or access to the folders mentioned in the links in my previous addendum, so I'll  have to get the host to look at it. Will report back with the results of that. (Turns out I didn't need to go to the host. I was mistaken about where to implement the changes)

ADD. 3

The host CPanel dashboard is still showing the old PHP version. I only discovered the PHP version was changed to 7 by running a phpinfo query.

The problem was resolved by implementing these changes
https://issues.civicrm.org/jira/browse/CRM-17874 in
/wp-content/uploads/civicrm/civicrm.settings.php

Summarising the above conversation:

The upgrade of PHP to version made the PEAR DB extension unavailable. So the exception "DB Error: extension not found" was thrown.
Changing to the database connection URL in the civicrm.settings.php using the prefix mysqli solves the problem.


How To Migrate CiviCRM From Wordpress To Drupal? We are using CiviCRM with Wordpress and would like to switch it to Drupal. I have created a fresh Drupal/CiviCRM install and gave CiviCRM it's own database. How do I go about transferring the data from the old Wordpress site to the new Drupal site?

Assuming that a) you gave CiviCRM a separate database under Wordpress, and b) you installed the same version of CiviCRM under Drupal:

Dump the current CiviCRM database to a .sql file.
Load that database into Drupal.
Review "Moving an Existing Installation to a New Server or Location" for relevant details regarding deleting caches etc.
Delete all the entries out of the civicrm_uf_match table in the CiviCRM database (while logged in as user 1).
Go to Administer menu > Users and Permissions > Synchronize Users to Contacts.

That should repopulate your civicrm_uf_match table and thus connect your Drupal users to contacts.  Log out and log in again (in a different browser) to make sure everything looks good - and clear your caches again!


How do I change what appears in the "quick actions" menu on the contact record summary page? I know this is possible because I have done it many times before but now I can't find it! I have looked in the admin interface, the documentation, and on this here stack exchange. I am hoping someone can remind me.

I want to change the items that appear in the quick actions menu from the contact summary:

Where do I go to do this?

THANKS EVERYONE!

Just noting here that if you have access to your database and set the civicrm_option_value.filter_value = 1 for the activity type it doesn't show.

That wont be the same for all the actions, but at least for the activity types.

Would probably be nice to expose this field in the UI sometime.


copies of events appearing continually Civi 4.6.10 Joomla 3.4.5

Our events after being created at some pointed are being copied by the system.  Note the following id numbers as well.  Original event was 4352.

LILA TEST RECORD  (ID: 4352)

Copy of LILA TEST RECORD  (ID: 4370)

Copy of LILA TEST RECORD  (ID: 4420)

Copy of LILA TEST RECORD  (ID: 4470)

This happened to us in the old version.  I have over 451 event copies to delete now.

here is another sample it even went back to 2012:

Copy of Advanced Air Sealing  (ID: 3871)
Smyrna  New York    Advanced Air Sealing    No  Aug 07, 2012 8:00 AM        Yes

Copy of Copy of Advanced Air Sealing  (ID: 4217)
Smyrna  New York    Advanced Air Sealing    No  Aug 07, 2012 8:00 AM        Yes

Copy of Advanced Air Sealing  (ID: 4218)
Smyrna  New York    Advanced Air Sealing    No  Aug 07, 2012 8:00 AM        Yes

Copy of Copy of Advanced Air Sealing  (ID: 4219)
Smyrna  New York    Advanced Air Sealing    No  Aug 07, 2012 8:00 AM        Yes

Copy of Advanced Air Sealing  (ID: 4022)
Smyrna  New York    Advanced Air Sealing    No  Aug 07, 2012 8:00 AM        Yes

Copy of Copy of Advanced Air Sealing  (ID: 4562)
Smyrna  New York    Advanced Air Sealing    No  Aug 07, 2012 8:00 AM        Yes

Copy of Advanced Air Sealing  (ID: 4563)
Smyrna  New York    Advanced Air Sealing    No  Aug 07, 2012 8:00 AM        Yes

Copy of Copy of Copy of Advanced Air Sealing  (ID: 4564)
Smyrna  New York    Advanced Air Sealing    No  Aug 07, 2012 8:00 AM        Yes

Copy of Copy of Advanced Air Sealing  (ID: 4565)
Smyrna  New York    Advanced Air Sealing    No  Aug 07, 2012 8:00 AM        Yes

Copy of Copy of Copy of Advanced Air Sealing  (ID: 4566)
Smyrna  New York    Advanced Air Sealing    No  Aug 07, 2012 8:00 AM        Yes

Copy of Copy of Advanced Air Sealing  (ID: 4567)
Smyrna  New York    Advanced Air Sealing    No  Aug 07, 2012 8:00 AM        Yes

Copy of Copy of Advanced Air Sealing  (ID: 4568)
Smyrna  New York    Advanced Air Sealing    No  Aug 07, 2012 8:00 AM        Yes

Copy of Advanced Air Sealing  (ID: 4332)
Smyrna  New York    Advanced Air Sealing    No  Aug 07, 2012 8:00 AM        Yes

again note the ID numbers....

It doesn't feels like a CiviCRM Core problem to me but I don't know what else it could be either.

The "Copy of" seems to indicate that it use the CRM_Event_BAO_Event::copy as if used by the Copy action in manage event page.

You may check for any custom code that could contains CRM_Event_BAO_Event::copy or something like that.

You could also try to disable CiviCRM extensions or Joomla extensions one by one and see if it keeps happening


Count data for smart groups is not currently calculated When I go to "manage groups", some of my smart group counts are listed as "unknown" and the notification "Count data for smart groups is not currently calculated" appears.

Does anyone know how to address this issue? I have the smart group cache timeout set to 5 minutes and I have "Rebuild Smart Group Cache" cron job set to always run when the cron runs. The cron task runs every 15 minutes.

I can manually click "Update Smart Group Counts", but the problem is that I have an automatic sync to Mailchimp. So whenever the smart groups fail to count themselves and Mailchimp tries to sync, it thinks everyone in the smart group unsubscribed when really Civicrm lost track of the smart group counts.

Any help would be appreciated.

This Q/A discussion "Should Manage Groups display the Smart Group contact count, or just display it as Unknown" may help including following the links to read the comments for issue CRM-21583.


How to create file type custom data with API? I was wondering how to do that. Didn't find it for that type of custom data.

If possible I want to do it via API, if not possible i'll try with CRM_Core files.

You can create a custom group with the CustomGroup API, and custom fields with the CustomField API. Is that what you mean, or do you mean updating the actual data within a custom file?


How to install civix and build an extension in drupal Please I don't know how to install civix and build an extension using civicrm. I
already installed drupal and civicrm module. but I have no clue how to write an extension or how to run anything here. I am totally new to it.

thanks

Have a look at the Developer Guide here: https://docs.civicrm.org/dev/en/latest/ as a start.

If at all possible I would recommend trying to find an expert near you who would be able to give you a developer training. You would have to pay for it but it will probably save you a lot of exploration time :-)


Why can't anonymous users make contributions? I want anonymous users to be able to make online contributions (both through standard contribution pages and through PCP pages). I have the "make online contributions" selected in anonymous user role, but my site still requires a user to create an account (both on standard and PCPs).

Using latest CiviCRM and latest D7.

Do you mean an account is required to even fill in your page, or that filling in the page creates an account?

If the former then it sounds like a permission issue such as Anon not having access to the following

CiviCRM: profile listings and forms
CiviCRM: access all custom data.

These Permissions are usually part of default permissions afaik

Within the Profile settings you want to make sure that you have not set Account creation required which can be found in the advanced settings: Administer > Customize Data & Screens > Profile.


Twilio extension stopped working; neither individual nor mass SMS go through Trying to run mass SMS on Twilio which worked great a few months ago, and now it falls apart. Also we hang when trying to send an individual SMS.
And right after trying to send SMS, the run-all-jobs-manually link on Scheduled Jobs throws an Internal Server (500) error.

Running my CRON command line via SSH gives me this:

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /[REDACTED]/wp-content/uploads/civicrm/ext/org.civicrm.sms.twilio/Services/Twilio/Resource.php on line 90
Warning: include(/[REDACTED]/wp-content/uploads/civicrm/ext/org.civicrm.sms.twilio/Services/Twilio/Rest/.php): failed to open stream: No such file or directory in /[REDACTED]/wp-content/uploads/civicrm/ext/org.civicrm.sms.twilio/Services/Twilio.php on line 9
Warning: include(/[REDACTED]/wp-content/uploads/civicrm/ext/org.civicrm.sms.twilio/Services/Twilio/Rest/.php): failed to open stream: No such file or directory in /[REDACTED]/wp-content/uploads/civicrm/ext/org.civicrm.sms.twilio/Services/Twilio.php on line 9
Warning: include(): Failed opening '/[REDACTED]/wp-content/uploads/civicrm/ext/org.civicrm.sms.twilio/Services/Twilio/Rest/.php' for inclusion (include_path='/[REDACTED]/wp-content/uploads/civicrm/ext/com.cividesk.email.sparkpost/:/[REDACTED]/wp-content/uploads/civicrm/ext/com.joineryhq.percentagepricesetfield-1.1/:/[REDACTED]/wp-content/uploads/civicrm/ext/net.ourpowerbase.report.advancedfundraising/:/[REDACTED]/wp-content/uploads/civicrm/ext/com.webaccessglobal.module.civimobile/code:/[REDACTED]/wp-content/uploads/civicrm/ext/org.civicrm.sms.twilio/:.:/[REDACTED]/wp-content/plugins/civicrm/civicrm:/[REDACTED]/wp-content/plugins/civicrm/civicrm/packages:/[REDACTED]/wp-content/plugins/civicr in /[REDACTED]/wp-content/uploads/civicrm/ext/org.civicrm.sms.twilio/Services/Twilio.php on line 9
Fatal error: Uncaught Error: Class 'Services_Twilio_Rest_' not found in /[REDACTED]/wp-content/uploads/civicrm/ext/org.civicrm.sms.twilio/Services/Twilio/Resource.php:47
Stack trace:
#0 /[REDACTED]/wp-content/uploads/civicrm/ext/org.civicrm.sms.twilio/Services/Twilio/Rest/Account.php(23): Services_Twilio_Resource->setupSubresources('applications', 'available_phone...', 'outgoing_caller...', 'calls', 'conferences', 'incoming_phone_...', 'notifications', 'outgoing_caller...', 'recordings', 'sms_messages', 'short_codes', 'transcriptions', 'connect_apps', 'authorized_conn...', 'usage_records', 'usage_triggers', 'queues')
#1 /[REDACTED]/wp-content/uploads/civicrm/ext/org.civicrm.sms.twilio/Services/Twilio/Resource.php(25): Services_Twilio_Rest_Account->init(Object(Services_Twilio), '/2010-04-01/Acc...')
#2 /[REDACTED]/wp-content/uploads/civicrm/ext/org.civicrm.sms.twilio/Services/T in /[REDACTED]/wp-content/uploads/civicrm/ext/org.civicrm.sms.twilio/Services/Twilio/Resource.php on line 47

This blew my lunch today & I still haven't wrapped my head around it:

PHP Fatal error: Uncaught Error: Class 'Services_Twilio_Rest_' not found in /wp-content/uploads/civicrm/ext/org.civicrm.sms.twilio/Services/Twilio/Resource.php:47

Lines 42-51, inclusive:

protected function setupSubresources()

{
    foreach (func_get_args() as $name) {
        $constantized = ucfirst(self::camelize($name));
        $type = "Services_Twilio_Rest_" . $constantized;
        $this->subresources[$name] = new $type(
            $this->client, $this->uri . "/$constantized"
        );
    }
}

Where should I begin?

Matthew Wire nailed it: the most current version of the Twilio extension for CiviCRM doesn't work with PHP 7.0 -- but luckily for us, a huge patch became available through GitHub just one week ago. Since we need PHP 7.0 for other stuff on our site to work, reverting to 5.6 wasn't a viable option.

As soon as the updated Twilio SDK extension was in place, I was able to run those scheduled jobs manually again. This experience also showed me how just one scheduled job that doesn't complete can derail the CRON train altogether. This gives me at least one idea for troubleshooting a persistent CRON headache in which our scheduled jobs run some of the time, yet we haven't yet isolated the problem. It's all connected, isn't it?


Batch Update the current relationship in CiviCRM I need your help. I need to disable a current relationship for 4000 records in the import process without using SQL command line.

There is no field for set active/inactive or expiry date of the current relationship in basic import process in CiviCRM.

Then I found this extension here https://civicrm.org/extensions/api-csv-import-gui,I've installed the extension and tried to inactive the current relationships.
I used contact_id_a and contact_id_b and relationship_type id and set the is_active to 0 in csv file.
But this extension gives me an error "Error with entity "create"! (Duplicate Relationship)". I'm going to update this relationship but this extension tries to create a relationship and fails because this relationship is already existed.
Do you have any idea how to solve this?

Or do you have any other solution for this?

CiviCRM version is 5.13.5.
And the relationship type is between two organization.

Edit: My requirement is:

Currently I have around 5000 records with a type of relationship in CiviCRM (organization to organization -one to many). Some of these records (relationship, name, email,...) have been updated in another system (A government system) and they gave the current list to me to update our current records in CiviCRM. I've updated contact details successfully but stuck in updating relationship, Because the CiviCRM basic import creates a new relationship not overwrite the existing one. If a relationship between 2 organization has changed in new file I need to disable the one that we have in civicrm and import the new one. So in future I know which records used to be in relationship but not any more. There is no option in CiviCRM import to do this (I couldn't find any). So I was thinking to find a way to disable the current one in CiviCRM and import new list. So if the relationship is no longer available in the new file, this has been disabled already in CiviCRM and if there is still a relationship between two records, it enables that again when I'm importing.

Thanks in advance

I used contact_id_a and contact_id_b and relationship_type id and set the is_active to 0 in csv file. But this extension gives me an error "Error with entity "create"! (Duplicate Relationship)".

Seems like you have relationship_type_id but not relationship id in the CSV file? If yes, I think you just need to add Relationship id to the columns.

The id is used by civicrm to update the records in the database instead of creating a new one.

Hence, try adding a new column in CSV and then proceed with the import.


Webform CiviCRM Integration and duplicate contacts I’m using Drupal 7.39, CiviCRM 4.6.7, and Webform CiviCRM Integration 7.x-4.12. I have a webform built whereas I’ve enabled the ‘Existing Contact’ field as I want the fields in the form to be filled out if the user has a CiviCRM contact record and those data are already entered.

If the user already has a Drupal account and a corresponding CiviCRM contact then all works well. The user logs and and goes to the form, sees the existing information, changes what needs editing, submits, and the corresponding CiviCRM contact record is updated with the new information.

The issue seems to be if there is a CiviCRM contact record and no associated Drupal account. If a user creates a new Drupal account then goes to the webform and submits it, a duplicate CiviCRM contact is created, the dedup rules are not used.

I noticed that when choosing a ‘Matching Rule’ there is this information:

  Note: Matching rules are only used if the contact is not already selected via "Existing Contact" field.

Is there a way around this? I need to have the form autopopulate if the Drupal user already has a CiviCRM contact record so they know what their existing information is and what might need to be corrected. But at the same time if they are creating a new Drupal account I want to avoid getting a lot of duplicate CiviCRM contacts created.

If they create a Drupal account is there already a duplicate before they fill the Webform? If so, you may be able to use a Profile on the Drupal account creation page that matches contacts to prevent duplicates there -- at which point the webform should function as expected.


Are there recommended directory ownership and permission settings for CiviCRM files? CiviCRM (and Drupal) issue warnings when a file directory permission presents risk.  However, periodic warnings also indicate that a file directory cannot be accessed because of a permission setting.  These warnings seem to contradict each other from time to time - recently using an extension.

Are here recommended settings for both ownership and permissions (assuming apache as group setting)?  For CiviCRM and Drupal files?  Are there guidelines for .htaccess files?   (individual forum posts address specific user situations but a more comprehensive guideline would help prevent issues)

These are the Unix/Linux permissions I tend to set my permissions for CiviCRM directories in Drupal 7:

chmod 555 sites/default
chmod 644 sites/default/settings.php
chmod 644 sites/default/civicrm.settings.php
chmod 770 sites/default/files
chmod 755 sites/default/files/civicrm

I generally have the ownership set to the hosting account username and the group to the server group, like apache so something like:

sudo chown username:daemon -R httpdocs


Self-service cancellation from a registered event seems to be broken The following error is reproduceable on a fresh install of CiviCRM 5.35.1 on WordPress 5.7. If self-service cancellation is enabled for a simple event, the cancellation or transfer request results in the following error:
CRM_Core_Exception: getFieldValue failed in /home/bbcadmin2016/sigstage57.net/wp/wp-content/plugins/civicrm/civicrm/CRM/Event/Form/SelfSvcUpdate.php on line 132
The stack trace indicates this:
CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Ev…', null, 'title') /home/bbcadmin2016/sigstage57.net/wp/wp-content/plugins/civicrm/civicrm/CRM/Event/Form/SelfSvcUpdate.php:132
I am reporting this again in the hope that it can be verified by someone else as a bug  - something that the core team requests before submitting the issue.

Can you try reproducing on https://wpmaster.demo.civicrm.org/ (I did try and wasn't able to).
Looks like its a environment issue. Could you please check your htaccess or server config? Or WP permlinks?


Newsletter Signup Page/Block I was looking around but haven't been able to find an obvious answer to my question, but has anyone ever dealt with a newsletter signup block or page just for site visitors? I've been trying to find examples but it doesn't really seem as though anyone's ever required this. We'd like to move our current newsletter signup form over to CiviCRM just so everything is all handled in one place, but I'm stuck as to how to accomplish this.

I'd appreciate any help or advice - Matt

There are two ways to do this in Drupal.

CiviCRM Profiles

Go to Administer » System Settings » Misc, and set Accept profile submissions from external sites to Yes.
Create a profile in CiviCRM with the "Add to Group" option set to add someone to the group in question.
Once the profile is created, select its more menu » HTML Form Snippet (see screenshot).
Paste the HTML snippet into a Drupal block.  Handle access to the block like any other Drupal block.

SPECIAL NOTE: This creates a bit of a security issue - when you enable the "Remote Profile Submissions", anyone who knows what your profiles are can add contacts to your system by recreating the form on a remote site.  If you choose this path, consider editing your web server to block access to profile URLs by IP address.

Webform CiviCRM integration

Alternatively, you can use Webform-CiviCRM integration to build webforms to handle this.  This is much more flexible, but can be trickier to get right, depending on your needs.  I'd probably try this first.

Bonus: WordPress edition

Create a profile in CiviCRM with the "Add to Group" option set to add someone to the group in question.
Use a shortcode to drop the profile into a page.  Use the Shortcode Widget if you want to drop it into a sidebar.


Embedding a listing or directory with variables I need to create a public list from civicrm. That part is straightforwards. A profile with shortcodes into WP would work. But the list needs to be filtered by country.  So it is not practical to have a profile for every country. What is the best way to embed a public list in a WordPress page based on a profile combined with a variable for country?

Add/edit 'Country' field to the profile and make is searchable.

This will allow you to filter the results based on country in the directory listing.

Demo: http://civi.intdms.com/civicrm/profile?gid=14&reset=1&force=1


Personalize browser version of email I'm trying to figure out how to get the browser version of an email to match an email using tokens in terms of personalization. The email shows the person's first and last name, the opt out and unsubscribe links, and the link to the browser version.

for example, the url for the opt out link in the browser version loses the id # as shown below. Same problem with the unsubscribe link. The first and last name also disappears.

Email version (with dummy IDs): https://mydomain.ca/civicrm/mailing/optout?reset=1&jid=5555&qid=55555&h=a5aa5a5aa555aa5a

Browser version: https://mydomain.ca/civicrm/mailing/optout?reset=1&jid=&qid=&h=

Any suggestions on keeping the personalization in the browser version?

Thanks!

This issue is recorded here:
https://lab.civicrm.org/dev/core/issues/1064

And there is currently some work being done on this here:
https://github.com/civicrm/civicrm-core/pull/14591

If you are keen to get this merged into core recommend testing it and commenting on the PR.


How can I edit the Subject of a CiviCase? Whilst Cases have subjects there appears to be no way to edit via the interface.

It seems from this forum post that the ability to edit the subject of a CiviCase has not been implemented, and that its implementation should be done by creating a new core/case Activity Type for 'Change Case Subject' so that any change was also tracked on the Case.

That sounds a reasonable improvement, in the meantime it seems the only option is to edit the field in the civicase table - which my brief testing suggests doesn't not bring the wrath of code down upon my head


Upgrade fails with CiviCRM_API3_Exception: "API error: Could not delete payment processor type" In upgrading to 5.20+ an error occured while running the database Case upgrade scripts.

Deletion Error
There is a Payment Processor associated with selected Payment Processor type, hence it can not be deleted.

CiviCRM_API3_Exception: "API error: Could not delete payment processor type"

#0 /dir/wp/wp-content/plugins/civicrm/civicrm/CRM/Upgrade/Incremental/php/FiveTwenty.php(370): civicrm_api3("CaseType", "create", (Array:9))
#1 /dir/wp/wp-content/plugins/civicrm/civicrm/CRM/Upgrade/Incremental/php/FiveTwenty.php(289): CRM_Upgrade_Incremental_php_FiveTwenty::_processCaseTypeLabelName(FALSE, "7")
#2 /dir/wp/wp-content/plugins/civicrm/civicrm/CRM/Upgrade/Incremental/php/FiveTwenty.php(265): CRM_Upgrade_Incremental_php_FiveTwenty::_changeCaseTypeLabelToName(FALSE)
#3 /dir/wp/wp-content/plugins/civicrm/civicrm/CRM/Queue/Task.php(88): CRM_Upgrade_Incremental_php_FiveTwenty::changeCaseTypeLabelToName(Object(CRM_Queue_TaskContext))
#4 /dir/wp/wp-content/plugins/civicrm/civicrm/CRM/Queue/Runner.php(217): CRM_Queue_Task->run(Object(CRM_Queue_TaskContext))
#5 /dir/wp/wp-content/plugins/civicrm/civicrm/CRM/Queue/Page/AJAX.php(52): CRM_Queue_Runner->runNext(TRUE)
#6 /dir/wp/wp-content/plugins/civicrm/civicrm/CRM/Queue/ErrorPolicy.php(106): CRM_Queue_Page_AJAX::{closure}()
#7 /dir/wp/wp-content/plugins/civicrm/civicrm/CRM/Queue/Page/AJAX.php(54): CRM_Queue_ErrorPolicy->call(Object(Closure))
#8 /dir/wp/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(250): CRM_Queue_Page_AJAX::runNext()
#9 /dir/wp/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:13))
#10 /dir/wp/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:5))
#11 /dir/wp/wp-content/plugins/civicrm/civicrm.php(1465): CRM_Core_Invoke::invoke((Array:5))
#12 /dir/wp/wp-includes/class-wp-hook.php(288): CiviCRM_For_WordPress->invoke("")
#13 /dir/wp/wp-includes/class-wp-hook.php(312): WP_Hook->apply_filters("", (Array:1))
#14 /dir/wp/wp-includes/plugin.php(478): WP_Hook->do_action((Array:1))
#15 /dir/wp/wp-admin/admin.php(254): do_action("toplevel_page_CiviCRM")
#16 {main}

This looks to be a problem with an entity_type row of PaymentProcessorType in the civicrm_managed table.

To show the offending row:
select * from civicrm_managed where entity_type='PaymentProcessorType';

Remove the offending row:
delete from civicrm_managed where entity_type='PaymentProcessorType';

Then re-run the upgrade.

After the upgrade was re-run, I had to re-add the offending row for the 'ExtenededReports' extension added reports to show up.  Installing the 'CiviCRM Log Viewer' extension without this line also gave the same error of database record already exists.  In this instance, this is dealing with a record from the extension 'Authorize.net eCheck.Net'.


Change log crashes - table entity_log_civireport doesn't exist - how to fix? After switching logging on, clicking the tab 'Change Log' hangs for ever and the following error occurs (full traceback availabe).  This is, I guess, a temporary table that for some reason Civi has failed to create.  Does anyone have any clues on fixing this problem.  Civi is 4.7.27 / Drupal and is otherwise functioning well (hosted at CiviHosting)

#9 /home/dcmadmin/www/www/sites/all/modules/civicrm/packages/DB/mysqli.php(933): DB_common->raiseError(-18, NULL, NULL, NULL, "1146 ** Table 'dcmadmin_civicrm.entity_log_civireport' doesn't exist")

(previously I raised this as a question about 'Unable to reach the server' but that's only a symptom of the above problem.

I wonder whether log tables are being created in the wrong order by the config change that switches on Logging? If the error you see always refers to this same table, maybe creation of another log table triggers expects dcmadmin_civicrm.entity_log_civireport to exist already. Chicken and egg?
David


Civi adds whitespace into contact images I have a problem in CiviCRM when I try to add a contact image into a contact record.

I'm using Drupal 7, CiviCRM 5.13.4 and PHP 7.1.

From what I can make out, something is adding in whitespace to the images that I try and upload which naturally shows the image as being broken.

When I look at the image in the file system, the image is fine there but if I go into the source code of where the image is in a contact record, the image downloads and when I open it, the top line is blank (whitespace).

I have seen this on several sites but can't seem to find an answer anywhere so it would be good to know any possible reasons for this to happen so the fix can be applied to several sites.

I am wondering if it is a rogue module or something similar that is causing the problems. I thought it may be the theme which I disabled to test but the issue remained so that got ruled out.

Any advice would be greatly appreciated!

After much digging, I found the reason why contact images were not appearing.

It was due to a module that had a PHP file with two new lines before the opening PHP tag <?php.

To figure this out, I created a local copy of the website and went through the modules list, enabling them one by one to see at what point the image broke.

Once I'd found which one broke the image, it wasn't hard to go through the files, searching for the whitespace.

Removed the two new lines before the tag and the image instantly worked.

Hopefully this will come to some use if anyone has a dodgy contact image!

On a side note, this also fixed the Mosaico problem I was having - Failed to locate Mosaico graphics driver


Export contacts as displayed? Is there a way to export contacts (to a csv) as they are displayed without having to create a field mapping?

From Search its not possible i guess unless you save the mapping and reuse it, but from report you can generate csv from the fields you have selected as to display


Staging and Production with WordPress I'm setting up a new CiviCRM and web site on WordPress. I'm used to working on dev/staging sites and pushing changes to production after they are tested and approved. What's the best way to do this with CiviCRM on WordPress? Here's what I would do without any advice:

Setup

Install WordPress and CiviCRM fresh on the production site.
Make a complete copy of the filesystem and database to create a staging site
Globally replace domain names in WP and CiviCRM files and DB tables, using guidance from the docs and
this answer.

Deployment

At this point, should staff use CiviCRM in production, or on staging? I think WordPress changes should be made on staging, and pushed to production. Maybe CiviCRM changes should be made in production and synced to staging? Should everything be done on staging, and then deployed by reversing the Setup steps?

Staff changes should happen on the live server.  This is doubly true if you have any public-facing pages, which will mean the database on the live server is updated by members of the public.

Traditionally, code travels from dev to staging to prod.  Data travels from live to dev/staging.

I prefer referring to "dev/test/live" server, since this better illustrates the flow, and is less jargon-y to non-tech staff.

Some changes don't flow well this way - for instance, you may want to create a contribution page on your test server, then transfer it to live.  In practice, this should be relatively infrequent, and you can redo your work on the live server.


Cron job has started producing output I have a cron job

/www/www/job.execute.sh

That runs the civiCRM scheduled tasks:

#!/bin/sh
drush -r /home/crwheelmen/www/www --quiet civicrm-api job.execute

This has been running successfully without any output for months. Now it has started producing this output:

Array
(
[is_error] => 0
[version] => 3
[count] => 1
[values] => 1
)

which has the effect of sending me an email with this content every hour. AFAIK, I did nothing to cause this, but it is very annoying. Do you know why this has started happening?

Not sure why it's suddenly started producing output when it didn't previously, but you could use:

#!/bin/sh
a=`drush -r /home/crwheelmen/www/www --quiet civicrm-api job.execute`
if echo $a | grep -qv '\[is_error\] => 0'; then echo $a; fi

(capture the output of drush to variable a then check whether is_error is 0.  If it is, do nothing otherwise show the output)


Edit 'Welcome Mr xyz' message on Contribution Form My Contribution Pages have a message at the top saying, roughly, 'Welcome Mr so and so.  To complete this form on behalf of someone else Click Here.'

A few weeks ago I edited this massage, but now I want to do so again and CAN'T FIND IT ANYWHERE.

Can anyone please direct me to where I can edit this message?

Thank you.

I think you're looking for the "Welcome Mr X (Not Mr X, or want to do this for a different person?)" message.  That text is in templates/CRM/Contribute/Form/Contribution/Main.tpl

It is possible to override templates - see https://docs.civicrm.org/dev/en/latest/framework/templates/customizing/ for details.  As the documentation warns, there are problems associated with doing this.


Trouble connecting to SparkPost - Joomla 2.5.28 / Civicrm 4.6.14 I installed the SparkPost/CiviCRM extension and followed the README and all seems correct but I can not connect to SparkPost SMTP server.  Is anyone else seeing a problem?

One possibility is that you are trying to send an email with a "From address" that is not in the sending domain(s) that you have verified in SparkPost. I think they only allow email from verified domains, so you can't send "from" a Gmail address in CiviCRM, for example.

If you are having trouble with the PESC Sparkpost extension you may want to try the one from Cividesk. It only requires inputting the API code and is pretty much plug and play.


Form no longer entering into CiviMember for free memberships CMS: WordPress 4.4.2

CiviCRM: 4.7.1

After upgrading from 4.6.6 to 4.7.1, when someone submits our contribution form for a free membership, the membership is not recorded in the contact record nor in the CiviMember area.

The contact makes it in the Contacts area and database OK but wondering why the connection to CiviMember was severed. We can manually attach a membership to the contact fine, but long-term this is not a solution.

Any ideas?

Edit: What's worse is that these contacts have no record of their "contribution" (they came from a contribution form). So, they aren't displaying in "Find Contributions" either. Our memberships are free, so there is no paid transaction happening.

I think the problem in your demo example is that you did it as a Test, which therefore doesn't show. If you go to Find Members, and set 'is test' to YES I then see the membership for a-test f-test if that is your example

also i did it for user = demo and did a 'pay later' option and that fired through fine.

so this may not be an answer to your original question but does answer your 'this is wrong on demo too' i believe.


How do I enter multiple payments for one pledge? I've entered a pledge.  The donor has only paid part of their first payment and plans to make a payment for the balance in a month.  However, the pledge bumped the overdue amount to the following year's pledge.  And it appears that I cannot enter a payment against the first year's pledge now.

Click to expand the pledge payment schedule and then click edit on the expected installment set up for next year - you can change the date back to the current year.

Unless you are dealing with multi-year pledges, consider creating them with a single installment to occur every one day - in this way, the system will transfer the remaining balance as being due the following day as opposed to the following year.

Hope this helps,
Tamar


How to use a different theme for a contribution page using Drupal The ability to use a mobile friendly theme for a contribution page is vital these days.  I used 'Themekey CiviCRM' along with Themekey which worked for a while but doesn't anymore. Fixing that would be good but it seems a bit of a cludge. Isn't there a better solution for this common requirement? Or should I be using a webform rather than the contribution page?  I'm using 'Seven' as the normal theme for the back office functions, and don't want to use a different theme for ALL public pages as then CiviVolunteer pages are themed differently. On 4.7.24 and Drupal.

Themekey does indeed support this, as long as you are using Drupal.  I couldn't get this to work until I found that as well as creating a record of the page and the theme you want to use, you have to do a bit more.  You must have 'Themekey CiviCRM Integration' installed and you have to first go to Configuration/Themekey/Settings/Compatability then check 'CiviCRM Theme (Define alternate themes for CiviCRM.)'  See also my comments.


auto_increment_increment issue CRM-7923 My activation of CiviCRM WordPress plugin was halted by database error message:

  "An auto_increment_increment value greater than 1 is not currently
  supported. Please see issue CRM-7923 for further details and potential
  workaround."

Have searched for number string 7923 but without any results. Does anyone here remember this issue or the potential database workarounds so that I can raise a focussed support ticket for my hosting supplier, please? It's one of just three red stripes remaining on the plugin installation screen. (One is a permissions issue, the other is about database triggers and may clear itself if I can resolve the auto_increment_increment issue. Otherwise, I've got green lines for the rest, which is good to go.)

I have never heard of this before, but did track down the issue for you:

CRM-7923: Installation procedure relies on contiguous auto increment ids

Read the thread more closely to be sure, but from a glance it looks like this command may be needed in your hosting environment:

cd sites/all/modules/civicrm/sql
sed -i '1i\SET SESSION auto_increment_increment=1;\nSET SESSION auto_increment_offset=1;' *.mysql


How to design ACL for a multi-level organisation We have an Organisation with cca. 400 local branches and have trying to achieve a following ACL behaviour:

-- Organisation members needs to be able to login and have access to their Organisation members records only.

-- Organisation admins may administer all members in their Organisations and Organisation itself (and in theory could be administering more than one Organisation thus more members).

-- Organisation admins need some kind of dashboard which gives them access to their own societies.

-- Main civiCRM admin(s) need to be able to assign ACLs to a user

We have Relationships in place, so each Organisation has it's members listed in Relationships tab in civiCRM. Now, this is a workaround which seems has to be done:

1. civiCRM side

1.1. Create Group (AccessControl) for each Organisation

1.2. Create Group (AccessControl) for each Organisation Admin Users (NB! SmartGroups wi not work since there is no AcessControl for them, there is a thread from 2007 regarding this: http://forum.civicrm.org/index.php?topic=1645.0)

1.3. Create ACL Role for each Organisation Admin

1.4. Assign each ACL Role to corresponded Organisation Admin Group

1.5. Create ACL for each Organisation where Role = Soiety Admin Role and operation = Edit and Type of Data = Group of Contacts and Group = corresponded Organisation Group

2.Drupal side

2.1. Create Role for each Organisation Admin

2.2 Grant access:

Admin Menu
CiviCRM: profile listings and forms
CiviCRM: profile listings
CiviCRM: access CiviCRM
CiviCRM: access Contact Dashboard

2.3. Create/move DrupalUsers based on Civi Contacts we'd want to be admins and assign each of them to own Role

2.4 Use "CiviMember Roles Sync" http://wiki.civicrm.org/confluence/display/CRMDOC/CiviMember+Roles+Sync to sync Drupal Roles with Civi Groups

We've studied some related threads:

"Multi-level Organization ACL Permissions"
Multi-level Organization ACL Permissions
( where multi-site workaround suggested sounds even more overhelming than current approach,since we have 380+ organisations and all Contacts data currently stored in single CiviCRM database ). Have tried also "local permissions extension we built for the National Democratic Institute" hoping that it would be possible to convert geografic-centered approach to Organisations-centered; may be it's a way to go, although it needs deep code diving.
"Allowing group management to users with limited permissions"
Allowing group management to users with limited permissions from where we've found out that " users can only view the groups for which they explicitly have an ACL for. " which doubles all work, since now we need a pair (Admins and Members) of Role,ACL,Group for each Organisation.
Yet another option found has been a "Related Permissions Module" extention from nz.co.fuzion ( http://github.com/eileenmcnaughton/nz.co.relatedpermissions/zipball/master )  suggested among related threads at stackexchange or forum.civicrm.org, however it doesn't seems to be compatible with most recent version of civicrm. This one sounds like a best "theoretical" approach so far since it tends to use component (Relations) which have been already installed and configured. However it's hard to find out from here if it worth investment of development hours to make it work since it's hard to say if it was working the way we need.

Afraid, not all related links from all sources are listed here (like related pages from book.civicrm.org or wiki.civicrm.org), we've studied a lot.

So, any fresh advice will be highly appreciated; can't believe CRM might have such,well, let's call it "complex"  permissioning system.

IMHO it seems like you really need a consultant for this stuff.  Hopefully an organization of your size (400 chapters with an unknown # of people per chatper) has budget for help.

But let me offer a few bits of advice:

the "corresponded Organisation Group" as you put it CAN be a smart group, thus people (not admins) can self-select their own groups when they signup and/or register if you use a custom data field for "select your chapter".

CiviMember Roles Sync doesn't work as you describe, that's Civi Group Role Sync for that functionality
I'm not sure why you feel people need to use CiviGroup Role Sync
Don't understand your point 2.3

So I hope that helps, I've done this on a smaller scale for a group with 12 national chapters and 20-30 people per chapter, it works pretty well.  Please remember I do think a consultant with experience on ACL is needed.


Contact which is both Organisation & Individual Is there a way for me to create a new contact that is both an Organisation AND an Individual sub-type?

I have a case where I have created a new Individual contact, he is a 'Lecturer' which is a sub-contact type we have created within 'Individual'. But he also Advertises with us so I want to be able to add him as an Organisation - sub-type: 'Advertiser'.

I know I can attach multiple sub-contact types within the main contact type, for example:

[Mr. John Smith] - Individual: [Member], Individual: [Lecturer]

OR [Mr. John Smith] - Organisation: [Society], Organisation: [Advertiser]

I cannot seem to mix the two: [Mr. John Smith] - Individual: [Lecturer], Organisation: [Advertiser]. Is there an easy way to do this other than creating duplicate contacts under each contact type?

I would rather think like this:

Something he/she is --> contact type

Something he/she does --> group

If he is a person, then the contact type should be Individual. Maybe he works with or owns an Organization, then create a relationship.

To be a lecturer or an advertiser can change ( if he change job), but he will always be an Individual.

So to me it gives more sense to create two groups called Lecturer and Advertiser, and put this contact and the others in the corresponding groups.


Can we add an approval process/queue to emails sent through CiviCRM? We're a fairly large NGO that is trying to consolidate and control emails to major gift donors (VIPs). We have an accounting department and a student sponsorship department that produce different content for VIPs. We'd like all emails to be consolidated through the major gift department, who can then act as personal assistants to the VIPs.

Currently we can be reactive, viewing Activities previously sent. Our boss wants us to add our own email addresses into VIP contacts, meaning all emails will be sent into our inboxes to curate when we can, and we can forward on the emails to the VIPs.

We were hoping for a different solution, like some sort of workflow approval queue that we could check when necessary. The sponsorship team sends a bulk mail to all sponsors, but it's not sent to VIPs until we go through the list and click "yes, yes, no, yes".

We've experimented with placing "Hold" on VIPs, but it means the content from the bulk mail (with tokens and media) is never created, necessitating manual creation.

CiviMail and emails sent through CiviCRM are different; is it possible to have such a 'quality assurance' queue for both?

(as an aside, is there any way to add a large visual indicator or something to a contact's page informing database users that 'this contact is a VIP'?)

I'd recommend a different concept - maintain a VIP group and then exclude those group members when you're creating a group to send the mail to (use custom search "Add/Remove Group").

The reasons are:
1) No further development required!
2) If you have to approve each bulk email they receive, they may receive a lot of emails at once. It effectively bypasses any frequency control your staff are producing for the main members.


CiviCRM exports displayed in browser – no download / header missing We're facing an issue with contact exports. They become displayed in the browsers as raw text.
We recently updated to php 7.1 and CiviCRM 5.25.0 but unfortunately and due to infrequent use of the export functionality we can't say if any of these changes directly led to the problem.
Does anybody has the slightest idea what could be causing this?
-- Update 2020-11-03 --
I'm stuck with this til today. I tried literally any detection method.
And exporting reports works.
When stracing apache for setting the header while exporting contacts or participants:
strace -fyp $(pgrep apache2|sed ':a;N;$!ba;s/\n/,/g') -s 30000 |& grep -i 'Content-Disposition:'

I get no results.
It would be too nice if anybody may shed some more light on this.
-- /Update --
Thx in advance

If you have something like a file with a blank line at the top that might get output before the export data and cause the output to be interpreted as http content-type text instead of a download.
Check civicrm.settings.php or extensions or files in the CMS that might have changed.
You could also try running this from the root folder of your CMS:
find . -type f -exec awk 'NR==1&&/^$/{print FILENAME}' \{\} \;
or maybe this if the line isn't completely blank, like a couple tabs:
find . -type f -exec awk 'NR==1&&/^\s*$/{print FILENAME}' \{\} \;
https://askubuntu.com/a/1072314


Unsubscribe Token for Subscription Reminders What's the best way to allow members to unsubscribe or opt out from Renewal Reminders?

Thanks!

Generally, there's not a way to opt-out of transactional emails, like receipts and reminders.

I found this in the documentation, which states

  Scheduled reminders are still sent to contacts who have opted out of
  bulk emails and those who have selected the privacy option Do not
  email.

It goes on to say

  If you want to exclude contacts who have opted out of bulk emails from
  a scheduled reminder you should:

  1) Find all contacts who have not
  selected the privacy options Do not email or NO BULK EMAIL.

  2) Create
  a smart group from the search results.

  3) Select this smart group as
  the Recipients of the scheduled reminder.


Upgrade error from 4.6 to 4.7 - WordPress I'm trying to upgrade, following the official guide, but when I get to the url :
wp-admin/admin.php?page=CiviCRM&q=civicrm/upgrade&reset=1

I get the folowing error message :

Initialization Error

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

    [code] => -1
    [message] => DB Error: unknown error
    [mode] => 16
    [debug_info] =>
SELECT
   option_value.id          as id,
   option_value.label       as label,
   option_value.value       as value,
   option_value.name        as name,
   option_value.description as description,
   option_value.weight      as weight,
   option_value.is_active   as is_active,
   option_value.is_default  as is_default
FROM
   civicrm_option_value_fr_FR  as option_value,
   civicrm_option_group_fr_FR  as option_group  WHERE option_group.id = option_value.option_group_id  AND option_group.name = 'languages' ORDER BY weight [nativecode=1449 ** The user specified as a definer ('pui'@'%') does not exist]
    [type] => DB_Error
    [user_info] =>
SELECT
   option_value.id          as id,
   option_value.label       as label,
   option_value.value       as value,
   option_value.name        as name,
   option_value.description as description,
   option_value.weight      as weight,
   option_value.is_active   as is_active,
   option_value.is_default  as is_default
FROM
   civicrm_option_value_fr_FR  as option_value,
   civicrm_option_group_fr_FR  as option_group  WHERE option_group.id = option_value.option_group_id  AND option_group.name = 'languages' ORDER BY weight [nativecode=1449 ** The user specified as a definer ('pui'@'%') does not exist]
    [to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::simpleHandler prefix="" info="
SELECT
   option_value.id          as id,
   option_value.label       as label,
   option_value.value       as value,
   option_value.name        as name,
   option_value.description as description,
   option_value.weight      as weight,
   option_value.is_active   as is_active,
   option_value.is_default  as is_default
FROM
   civicrm_option_value_fr_FR  as option_value,
   civicrm_option_group_fr_FR  as option_group  WHERE option_group.id = option_value.option_group_id  AND option_group.name = 'languages' ORDER BY weight [nativecode=1449 ** The user specified as a definer ('pui'@'%') does not exist]"]
)

Any help would be greatly appreciated as I'm new to Civi... thanks!

Turns out there's a problem if you're trying to move the Civi database from a server to another (in my case from production to my localhost).

You need to change the db user in the mysqldump file.
We did it using a script and the sed command


Error on recurring payment with one installment I recently launched a new donation page that allows recurring payments via PayPal Standard. I noticed a couple of recurring contributions had a status of "Pending (Incomplete Transaction)". It turns out both donors had entered "1" in the Installments field. I expect that would either be considered an input error or perhaps it would simply process it like a single payment. I tried it myself and found that the donation page will submit, but PayPal then displays an error:

  The link you have used to enter the PayPal system is invalid. Please
  review the link and try again

I assume the donors simply gave up at that point. I've reached out to both to find out. I suspect they thought the option for a recurring payment was actually a directive, and they entered "1" to ensure they were making a one-time donation.

Is there an option to force the Installments field to accept only values greater than 1?

While I was at it, I decided to try entering a zero in the Installments field. This makes no sense, but you never know what people will try. It actually processed the transaction with a payment. When I look at the transaction on "Find Contributions", it shows it as "Installments: (ongoing)". When I follow the link that is provided in the receipt to update the recurring contribution, it shows "Number of Installments 0".

To make it even more confusing -> installments = 0 actually means unlimited/open-ended recurring contributions in CiviCRM.

Your options:

Do not expose the installments field (that will then be = 0 or NULL
by default > so open-ended).
Add some jQuery to check the value of that field give the user a
notice that it can not be = 1. How to add jQuery - there are a number
of ways to do this - depending on the CMS that you use.


Trying to Create Rule to Fire When Someone is Added CiviCRM Group Using Drupal Rules, I'm trying to create a rule that will fire when someone has been added to a CiviCRM group.

Here is a blog post from petednz which describes how to do this when a tag gets added to a CiviCRM contact.

I'm looking for the same thing but with CiviCRM groups, the choice in the Rules' "React on Event" dropdown would look like "CiviCRM Entity Group has been created" but it's not there.

Is this possible? And if so, how?

And to provide a bit more context, I'm creating a Drupal account for the Contact (If they don't have one) and adding the person to a Drupal Organic Groups group.

Thanks.

Check out the new CiviRules extension from ErikH and others to do that - see his answer to my question here


CiviMail: How can I retarget the non-opens and/or non-clicks in CiviCRM? Right now I am exploring CiviCRM as a new CRM for my non profit organization. We have a whole wish list, and one crucial wish is to be able to send new emails to a non-opens and/or non-clicks group. We saw the report option, but can we use the groups in the report to make a new group to send email to? We cannot find the answer. Not in the test installation nor in the user guide. Thank you so much for your help! It's a crucial feature for us. Best, Anne

While we dont use it for privacy reasons it should be perfectly doable. Reports usually have the option to add its resulting contacts to a group.

If you dont mind german here is a screenshot from a mailing report for demo mailing with tracking:

Each link provides a report/search with a selected subset of contacts.

Additionally you can use the extended search to define your target group however you like and create groups or smart groups from there.


CiviCRM DB Error: syntax error during upgrade in Wordpress I have tried upgrading to several different versions (5.14.1 up to 5.28) and every time I run the database upgrade, I get a DB Error: syntax error message and can't figure out why.
Here is an extract from my log file.
Any help would be most appreciated.
Aug 08 09:06:01  [error] $Fatal Error Details = Array
(
[callback] => Array
(
[0] => CRM_Core_Error
[1] => handle
)
[code] => -2
[message] => DB Error: syntax error
[mode] => 16
[debug_info] => DROP TRIGGER IF EXISTS civicrm_group_contact_05Feb20-2049_before_insert [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '-2049_before_insert' at line 1]
[type] => DB_Error
[user_info] => DROP TRIGGER IF EXISTS civicrm_group_contact_05Feb20-2049_before_insert [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '-2049_before_insert' at line 1]
[to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="DROP TRIGGER IF EXISTS civicrm_group_contact_05Feb20-2049_before_insert [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '-2049_before_insert' at line 1]"]

)

My theory is you have a table called 'civicrm_group_contact_05Feb20-2049' in the database, maybe a backup whilst you were investigating an issue or something? If you drop this table prior to commencing the upgrade you'll probably have better luck.
Note that the reason its an issue is that CiviCRM will add audit log triggers to any table prefixed with 'civicrm'. So its trying to add/drop a trigger from that table and falling over. I'm not 100% sure on the reason, looks like trigger names dont support hyphens perhaps. In this case dropping or renaming the table (prefixing it with bkp_ or something) will stop the trigger drop/create failing.


How to retriev tag information via sql I am working on a report and part of the requirement is to have pull the list of tags per individuals, households and organizations.
I was able to pull the groups by using civicrm_group_contact and civicrm_group tables and join by id. I see a table in civi called civicrm_tag, it contains list of tags but I don't know how to connect it with the associated records or identify the people assigned to theses tags.

Thanks in advance

Regards

Edward

The table is civicrm_entity_tag; make sure you use a WHERE or JOIN to ensure that entity_table = 'civicrm_contact'.


Drupal CiviCRM Rules module: How to use the action "CiviCRM Mailing: Send email"? I need to schedule CiviMail mailings through Drupal rules. I see that the CiviCRM Rules Integration module has an action labeled "CiviCRM Mailing: Send email" but it's not clear what this action is supposed to do. My assumption was that it would create a scheduled CiviMail bulk mailing. But this is the default body text, which confused me:

A new mailing has been scheduled: {mailing.name}

{mailing.viewUrl}
You can review the mail here: {mailing.editUrl}
You can schedule the mail for here: {mailing.scheduleUrl}

The content of the email is:
<pre>
{mailing.html}
</pre>

I don't understand. Can this rules action be used to schedule a CiviMail mailing? Or is it intended for a different purpose? Any experience or insight would be greatly appreciated.

The integration of CiviMail with the rules module is primarily for workflow purposes. i.e. they allow another person to approve a scheduled email. Thus a CiviMail has to be scheduled and approved before it can be sent out (if this has been enabled within CiviMail settings screens)

The action by itself does not create or schedule a CiviMail. It just approves it and/or sends it back to the creator (a link via email) for further edits and revisions.

This was work done in support of the New York State Senate's usage of CiviCRM an CiviMail


How to change the display of case listings to show and/or sort on case ID My client makes extensive use of cases, and the case ID is an important identifier. CiviCRM tends to downplay the case ID, however, often placing more emphasis on the case subject, which isn't as helpful to us.

The default results list display when searching for cases does include the case ID in the 'Client' column (along with client name and phone number), and so this results list is not sortable by case ID. If I wanted to edit the template file  that describes this results listing, how could I go about that in order to have the case ID in its own column, and be a sortable column?

We also use the listing of cases visible from the 'Cases' tab of a contact's summary screen. This presents a similar listing of case, but in this instance the case ID is not shown at all. Again, how would I go about changing this display in order to have the case ID in its own column, and be a sortable column?

I've spent a fair bit of time digging into this so far, and to be honest I'm struggling even to identify the correct template files to customise (it feels a bit like going down the rabbit hole in Alice in Wonderland!)

For both pages you're talking about it's templates/CRM/Case/Form/Selector.tpl, but what's interesting is that I know case id used to be there. Browsing the code history it looks like it was removed around v4.5, but without investigating further I can't say why. But take a look at 4.4 for example to see how it used to be. It's not sortable there, but might get you started.
https://github.com/civicrm/civicrm-core/blob/4.4/templates/CRM/Case/Form/Selector.tpl


how can I add Members of a Groups (JCVA Color Guard group) to event participants for a Color Guard event I have created events for our association's color guard to present the colors for different and various Organisations and they are showing as Events in CiviCRM.  I would like to be able to place color guard groups members in these events and track who (color guard group members) is participating in what Color guard events.  I don't see a way to add group members as event participants.

if you carry out a contact search (selecting the group your interested in) and select all of the results, one of the actions you see in the actions menu will be to add them to an event (Register Participants to an event). Have you tried that approach?

Once registered you'll be able to carry out all the tracking/reporting you've highlighted.


Inserting images in mailing When creating a mailing, the draft looks fine, but when sending a test, , the images seem to be in all sorts of strange sizes for some people, as if redefining the size in the draft didn’t happen (the original images are quite large). It looked fine in my inbox, but for 2 people who had to click on “download pictures” those images showed up strange. I don’t know if this can effect it too, but I’m on a Mac and they’re not. All are on Outlook.

I then tried to resize the original image and upload those instead of adjusting the size in the draft by replacing the existing ones, but it didn't help. I noticed the image url leads to a mail chimp gallery, so that might be the problem.

I now want to start from scratch instead of replacing old images, but I don't have an image url to use and so I can't upload the images. When I send images to server or browse server, nothing shows up.

This feels like it should be simple but I have no idea what else to try.

Hel and thanks!

There are two issues going on here.  First, you have images that you attempt to resize, but they are appearing wrong for many recipients.  Second, you can't fix the images.

I can't answer the second issue without knowing your particular server environment.  I'm especially puzzled how you got your images up there in the first place but are having trouble now.

However, I can explain the first issue.  When you resize an image in the editor window, all you're doing is adding HTML parameters or inline CSS to constrain the images to a given height or width.  You have to trust the recipient's email client or webmail to carry out your instructions, though.

It's not uncommon for email clients to strip out the inline CSS that scales images, so that's what you're facing.  You're on the right track: get the actual image file to a size that is reasonably close to what you want, and then only trust the editor for fine-tuning.


How can I fix [civicrm.root] variable on an addon domain? I believe [civicrm.root] is being computed incorrectly. Entering the absolute URLs in Settings > Resource URLs has been sufficient to fix most problems, but some problems persist.

For example, when i encounter an error like  crm.ckeditor.js  getting an error, the console tells me it can't find it at https://mysite.org/mysite.org/wp-content/plugins/civicrm/civicrm/js/wysiwyg/crm.ckeditor.js.

You'll notice that mysite.org is repeated.

I'm running (CiviCRM 4.7.22) on an "Addon Domain" on my host. When you manage files for your addon domains, they show up as a folder on in your file manager. So my Civi files are installed at:

/home/username/public_html/mysite.org/wp-content/plugins/civicrm/civicrm/

I assume that when Civi is computing the [civicrm.root] variable, it just assumes it can replace /home/username/public_html with the base url defined by CIVICRM_UF_BASEURL, which would explain why I'm getting this https://mysite.org/mysite.org/wp-content....

So how do I fix this permanently? Clearly using absolute URLs in Settings > Resource URLs isn't sufficient for every case. To clarify the values frrom settings.civicrm.php:

define( 'CIVICRM_UF_BASEURL'      , 'https://mysite.org/');
$civicrm_root = '/home/user/public_html/mysite.org/wp-content/plugins/civicrm/civicrm/';

tl;dr: Uncomment and fill in the define('CIVICRM_CMSDIR', '/path/to/install/root/'); in civicrm.settings.php.

I traced through the functions that go toward building the URL for loadins crm.ckeditor.js.  It seems there's a problem with the logic of the WordPress cmsRootPath function.

I can't tell you what the specific issue you're having that's causing that function to fail; I know it struggles with symlinks, and I'd guess there's other edge cases as well.

If I understand this line of code correctly, in addition to $civicrm_root, there's also a lesser-known cousin CIVICRM_CMSDIR, which is actually the relevant data here.  In my 4.7.22 WordPress instance's civicrm.settings.php, that constant is present but commented out.

See also: CRM-18221 for what appears to be a similar issue on earlier versions of Civi 4.7.


Adding a new participant status I keep trying to add a new participant status, but the page isn't letting me. I hit save, but nothing happens. I thought it was my browser, so I switched. I thought maybe a bug, so I upgraded to the latest CiviCRM. Still can't save it. I've tried clicking on Save as well as just hitting Enter when in one of the fields. Nothing.
Drupal 7, CiviCRM 5.27.0
Console shows the following error:
An invalid form control with name='visibility_id' is not focusable

I figured it out - I didn't have a Visibility selected. There isn't an asterisk next to it letting you know it is required and no error pops up telling you that you need to choose a visibility. So it is indeed a CiviCRM issue - it's missing the asterisk and a message letting you know that you need to choose one.


How can I add (e.g. "add to group") to membership search results or other Action lists? Our Membership chair entered all of our membership records without assigning them to a group ("Members") but "Add to Group" is not an option in the Membership report screen as it is in other search screens. I don't find a way to add that Action in the Custom Fields, Profiles, or any other menu that I have checked.This is likely to come up in other contexts and similar mods can be done in other areas, so there may be an easy way to do this that I can't find. Otherwise I will have to go in and modify each record.
Any help much appreciated.

So there is this perverse magic - wash your car and it rains, get in the shower and the phone rings. Post a question on Stack Exchange and find your answer eight minutes later.
If you go to Reports | Membership Reports | Membership Details, the default action is "Add to a Group".
Now if I only had a group for Impatient Idiots, I could add myself.


How to add "ACTION" Column in a custom Search? I have a custom search extension for contacts. Search result shows by default "VIEW EDIT" option in "ACTION" Column.

How Can I bring the "MORE" option just like the one appears if I use built in Basic search function from Search menu?

Content of my customsearch.php

        <?php

class CRM_Guestsearch_Form_Search_Guestsearch extends CRM_Contact_Form_Search_Custom_Base implements CRM_Contact_Form_Search_Interface {

      function __construct(&$formValues) {
        parent::__construct($formValues);
      }

      function buildForm(&$form) {
        CRM_Utils_System::setTitle(ts('Recently Registered Guest (Unassigned)'));

        $form->assign('elements', array('name'));
      }

      function summary() {
        return NULL;
        // return array(
        //   'summary' => 'This is a summary',
        //   'total' => 50.0,
        // );
      }

      function &columns() {
        // return by reference
        $columns = array(
          ts('Contact Type') => 'contact_sub_type',
          ts('Name') => 'sort_name',
          ts('Phone') => 'phone',
          ts('Email') => 'email',
          ts('Date of visit') => CIVICRM_GUESTSEARCH_CUSTOM_COLUMN_NAME,
        );
        return $columns;
      }

      function all($offset = 0, $rowcount = 0, $sort = NULL, $includeContactIDs = FALSE, $justIDs = FALSE) {

        return $this->sql($this->select(), $offset, $rowcount, null, $includeContactIDs, NULL);
      }

      function select() {
        return "
          contact_a.id                  as contact_id  ,
          contact_a.contact_sub_type    as contact_sub_type,
          contact_a.sort_name           as sort_name,
          phone.phone ,
          email.email  ,
          date.
        " . CIVICRM_GUESTSEARCH_CUSTOM_COLUMN_NAME;
      }

      function from() {
        return "
          FROM      civicrm_contact contact_a
          LEFT JOIN civicrm_activity_contact a ON (a.contact_id = contact_a.id)
          LEFT JOIN civicrm_phone phone ON (phone.contact_id = contact_a.id)
          LEFT JOIN civicrm_email email ON (email.contact_id = contact_a.id)
          LEFT JOIN " . CIVICRM_GUESTSEARCH_CUSTOM_TABLE_NAME . " date ON (date.entity_id = contact_a.id)
        ";
      }

      function where($includeContactIDs = false) {
        $params = array();

        $where = "contact_a.contact_sub_type = 'Guest' AND activity_id IS NULL ORDER BY date." . CIVICRM_GUESTSEARCH_CUSTOM_COLUMN_NAME . " ASC ";
            return $where;
          }

      function templateFile() {
        return 'CRM/Contact/Form/Search/Custom.tpl';
      }
    }

The custom search interface does not implement an API for those actions as yet. I dont think those are hookable right now, but I suspect the best first step would be to modify the code (and submit the patch back) to make those actions hookable.

Once that is done, it should be relatively easy, for the custom search interface to expose the hook as an API