Why can't I upload images to mailings? I'm using civiCRM 4.6 Wordpress 4.1.5 hosted on Bluehost.

Can you upload images to mailings via image properties>upload>send to server?

This seems to navigate to page that doesn't exist and the image does not get uploaded.

If you go to image properties > browse server it just navigates to this page: http://lmysite/wp-content/plugins/civicrm/civicrm/packages/kcfinder/browse.php?cms=civicrm&type=images&CKEditor=crmUiId_1&CKEditorFuncNum=3&langCode=en and says page not found (with my header and footer).

I think my directories are correct.
image upload url: http://mysite/wp-content/plugins/files/civicrm/persist/contribute/

resource URL: http://mysite/wp-content/plugins/civicrm/civicrm/

And my civicrm.settings:
$civicrm_root = '/serverpath/public_html/wp-content/plugins/civicrm/civicrm/';
if (!defined('CIVICRM_TEMPLATE_COMPILEDIR')) {
define( 'CIVICRM_TEMPLATE_COMPILEDIR', '/serverpath/public_html/wp-content/plugins/files/civicrm/templates_c/' );
}

I don't know if this is also related to another unresolved problem I have to do with mailings: Why do 'track click through' links not redirect to correct address?

This seems to be related but is for Joomla: https://civicrm.org/blogs/kurund/enable-image-uploads-and-server-browsing-for-ckeditor

This is a similar problem but the conclusion is unclear: http://forum.civicrm.org/index.php?topic=30066.0

This may have been a bug in 4.6.0. Can you try upgrading to the latest version and see if that fixes it?


Problem with navigating search results Working on a site running civicrm 4.4.11

Using Find Contacts to find contacts of type "organisation"

Returns 1206 contacts paged over 25 pages.

We can use forward and back to navigate between results pages, but when using the option go to page x/25. Sometimes the search results disappear and it returns to the find contacts page with the error message

  No matches found for:
  Contact Type - 'Organization'

  Suggestions:

  check your spelling
     try a different spelling or use fewer letters
     if you are searching within a Group or for Tagged contacts, try 'any >group' or 'any tag'
     add a New Individual, Organisation or Household
     make sure you have enough privileges in the access control system

I've tried flushing the drupal and civicrm caches, and still get the error.

Anyone got any suggestions?

Cheers

Craig

This is a known bug in 4.4 (CRM-16056).  I fixed this in Civi 4.6.  If you can't upgrade for whatever reason, it's a very simple fix.


Different payment processors for different price fields? Is it possible to specify different payment processors for different price fields in a price set on a single contribution page?

I have a contribution page with two prices: £A for EFT, and £B for Direct Debit. £A is more expensive than £B to incentivize Direct Debit.

Direct Debit is chosen by the user selecting the Direct Debit price field, £B, selecting the pay later option, and then the user is directed to the DD form which they fill in and send.

However, a user can select price field £B and then select Credit/Debit Cards, thus paying the cheaper £B price.

I've found the extension 'Direct Debit for Membership Extras' (https://civicrm.org/extensions/direct-debit-for-membership-extras), but after testing with it, it still doesn't solve the issue of a user being able to choose the price field without limiting the choice of payment processor. Is this possible? The only workaround I can think of is to have two separate contribution pages, one for EFT price and one for DD price.

I've found some old posts (Fee based on payment processor, Adding a dynamic “cover processing fees” checkbox to CiviCRM contribution form, and https://forum.civicrm.org/index.php?topic=33098.0) but I'm hoping there exists a more recent extension to solve this issue.

Probably not the best solution however you can give the user the option for either payment method on the contribution page.

Then utilise JavaScript to automatically react and select the correct payment method.

This is assuming is a small difference and you don't need it to be 100% secure etc. etc.


Add Civilcrm member detail in third party tcexam I was working in a drupal civicrm. I made a contribution for the course and succeed in a payment, but I have to update the data in the third party like tcexam. Is there a way that we can add a member details in the tcexam after success payment process in civicrm.

You can do this, but you need to be a programmer, or hire one.

CiviCRM is well suited to this, TCExam is not because it has no API.  If they both live on the same server, that's not too bad though.

Write an extension for CiviCRM that uses hook_civicrm_post.  When a completed contribution is added, make a connection to TCExam's SQL database and insert a new user record.

Instructions for writing an extension are available here and here.


WYSIWYG editor not appearing in CiviCRM and Drupal I am trying to edit a "Message Template" in CiviCRM 4.7.30 and Drupal 7.57, but the "HTML Format" is not showing a WYSIWYG editor, just a plain text editor.

I have gone to CiviCRM -> Administer -> Customise Data and Screens -> Display Preferences.  The "WYSIWYG Editor" setting is "CKEditor" (this is the only option).

In Drupal, I have the WYSIWYG module installed.

Any thoughts?

Thanks,

Carl

Ah, I've figured out the problem after looking at the code in ./sites/all/modules/civicrm/CRM/Admin/Form/MessageTemplates.php. The WYSIWYG editor is only shown if the message template is not a system message


How can you use Credit Card test credentials to test out a Webform-CiviCRM form that uses a Contribution page? Title pretty much says it all. I want to be able to run some tests of Contributions via a Webform.

I have test credentials for the Credit Card, so i can use 'test mode' on the contribution page directly, but can't see any way to set the webform to use the test option.

Maybe it is just a feature waiting to be asked for?

There is a field on the Contribution tab within the CiviCRM tab of webform. The field is called "Payment Processor Mode" and gives you the following options
-User select-
Live transactions
Test Mode


How to add a Matcher Plugin in CiviBanking as I get "No Matcher Plugin Found"? I was able to Import Bank Statement To Civicrm with the help of this
CiviBanking : No valid booking date detected. Not imported!

Now my second task is to add Matcher Plugin.
In Wiki Docs,
I see a list of matchers

  Default Options - creates two default suggestions: manual
  reconciliation and ignore

  Batch Matcher - matches to payment batches

  Contribution Matcher - matches to existing contributions  Create

  Contribution Matcher - creates suggestions to create now contribtuions

  Ignore Matcher - can be configured to automatically ignore certain
  transactions

  Membership Matcher Plugin - records transactions as
  membership dues

  Recurring Contribution Matcher Plugin - reccords transactions as > installments of recurring contribtuions

  SEPA Matcher - intgrates with the CiviSEPA extension

I see a configuration in json format here :
https://github.com/Project60/org.project60.banking/blob/master/configuration_database/matcher/default/EnglishDefaults.json

{
    "generate": 1,
    "auto_exec": false,
    "manual_enabled": true,
    "manual_probability": "50%",
    "manual_show_always": true,
    "manual_title": "Manually processed",
    "manual_message": "Select this after you have manually processed this transaction.",
    "manual_contribution": "Please enter the resulting contribution ID here (if applicable):",
    "manual_default_source": "Offline",
    "manual_default_financial_type_id": 1,
    "ignore_enabled": true,
    "ignore_show_always": true,
    "ignore_probability": "0.1",
    "ignore_title": "Not CiviCRM related",
    "ignore_message": "Choose this option if you are positive that this transaction has nothing to do with CiviCRM.",
    "value_propagation": {
        "ba.name_id": "contribution.custom_14",
        "btx.financial_type_id": "contribution.financial_type_id",
        "btx.campaign_id": "contribution.campaign_id"
    },
    "lookup_contact_by_name" : {
        "soft_cap_probability": 0.8,
        "soft_cap_min": 10,
        "hard_cap_probability": 0.4
    }
}

Where do we need to add this configuration in database so that I can see the matcher plugin?

A matcher is added just like an importer on the configuration screen. The configuration screen has different sections. The top one is the importer, then the matchers, then post processors and the last one are exporter plugins.

See below for a screenshot:

After you click on Add a matcher you are able to select a matcher type and a configuration for that matcher type.


A way to continue a mailing that was cancelled? Currently when a mailing is scheduled if we see a change that is needed, we have to cancel the mailing, then reuse it, fix the mistake, and send it again. Then we have to delete the original if we want to get it out of the interface.

Is there a way to simply "Continue" the cancelled mailing to save a few steps and avoid creating a duplicate and cluttering the interface?

This is not pretty, but you can use the API from your browser to un-schedule the mailing.

Find the ID of your mailing

Go to Mailings > Scheduled and Sent Mailings
Find your scheduled or canceled mailing within the list
Determine the ID of the mailing by hovering over Report and looking for the number after mid= in the URL

Open a javascript console in your web browser

Begin with your web browser on any CiviCRM page.
In Firefox go to menu > "Developer" > "Web Console". In Chrome, go to menu > "More tools" > "Developer Tools" > "Console".
If you can type 2+2, press Enter, and see 4, you're all set.

Execute some API commands to un-schedule the mailing

Copy-paste the following code into the console (but don't press Enter yet)

var mailingID = 0;
CRM.api3('MailingJob', 'get', {'mailing_id': mailingID}).done(
  function(response) {
    CRM.api3('MailingJob', 'delete', {'id': response.id});
  }
);
CRM.api3('Mailing', 'create',
  {'id': mailingID, 'scheduled_id': '', 'scheduled_date': ''});

Update the number 0 after mailingID to your own ID value determined above.
Press Enter to execute the commands.

See the results

Go to Mailings > Draft and Unscheduled Mailings and find your mailing here, waiting for you to Continue


How to pull an event report that lists how many people bought tickets at the different level of ticket prices I need a report for an event on Civi that lists how many guests bought tickets at the different levels we had our tickets for sale at. How can I do that? I can't figure out if it's possible with any of the 4 default reports Civi offers for events.

You will want to use: https://civicrm.org/extensions/extended-reports extension - it gives you access to many more templates - including price set - line item ones.


Frontend profile search problems When using a profile to search from the frontend (via the listings mode), using the Contact subtype field causes nothing found, even when there are contacts that should be shown.
In other words:

Fields - individual first & last name, contact - contact subtype
Searching only by first name works as it should, BUT
Choosing a contact subtype causes no contacts found, even when there are contacts matching the search
Filling the last name causes it to be used both as a last name and subtype name, thus nothing is found again

I tried this on the WP demo as well, the above happened. Anyone knows how to fix/avoid this?

I just successfully replicated this as well.  You've found a bug!

You can report this at http://issues.civicrm.org.  See the page "Reporting a bug", starting with step 7.

That said - "CiviCRM is free to use, but not free to write."  Given the limited resources of the core team, they're very unlikely to fix this without someone stepping up to help with either money or a fix.  That's the economics of free software!  So your choice from here is to:

Submit this to the paid issue queue.
Fix the bug yourself, or, assuming you're not a programmer, find someone to fix this bug for you.  Submit the fix to the core team via Github.
Work around the bug.  Maybe you can restructure your data.  If you were using Drupal, I'd recommend using Drupal Views integration, but unfortunately there's no real equivalent to Views for Wordpress.


Allowing users to update information without logging in I have now followed all the instructions in the CiviCRM Cookbook (https://www.packtpub.com/web-development/civicrm-cookbook) as well as a similar post here on Stack (allow anonymous users to view profiles in WordPress?) but had no joy getting the URL right to get people to update their profile without having to log in.

The instructions state the following:

Using the CiviCRM checksum token in combination with a profile allows you to bypass the requirement to log in.

Create a profile you wish to use. The profile contains all the fields of information that
you want the user to complete.
Make a note of the profile ID.
Enable Profile Listings and Forms access for anonymous and authenticated users
in your CMS.
Now create a CiviMail mailing in the normal way.
You now need to use the {contact.checksum} token and the {contact.
contact_id} token to construct a link back to edit the profile you created:
http://www.myorganization.org/civicrm/profile/
edit?reset=1&gid=N&id={contact.contact_id}&{contact.checksum}
Substitute your website for http://www.myorganization.org.

Perhaps there was a print error in the book because I have tried numerous variable options to get this working without joy.

Any thoughts? Thanks

EDIT: Added example below.

https://crm.example.com/civicrm/profile/edit?reset=1&gid=1&id=2798&5fb7dfc93d6b855d75659da64805ac82_1503574955_179

The construction differs depending on your cms.

Best info imo is at docs.civicrm.org/dev/en/master/framework/civimail/tokens

You have pasted

civicrm/profile/edit?reset=1&gid=1&id=2798&5fb7dfc93d6b855d75659da64805ac82_1503574955_179

In point 5. you stated ** and the {contact. contact_id}** but i don't see that in your example.

You need to have cid={contact. contact_id} in the string so will not work


Mosaico - ImagickDraw unable to load any image on templates After enabling the latest Mosaico on one site, we found the icons are not loaded after adding a new template. After dragging the image from the left to place on the template the image is displayed as below -

On opening the ajax url in a new window, it says -

  The Image <258*150_url> cannot be displayed because it contains errors`

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

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

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

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


open source for call center compatible with CiviCRM I am a new CiviCRM user, I need a software open source compatible with CiviCRM to do a Call center (a bit like callhub).
Any suggestion will be welcome.

Thanks

Moustapha D.
SPA Canada
society for the protection of animals Canada

According to Alternativeto.net, there are no open source alternatives to Callhub.  Arguably Asterisk VoIP is an alternative, but you would have to add a lot of software on top of it.

Regardless - while Callhub has CiviCRM integration, there are no alternatives that already have CiviCRM integration.  You would have to create it yourself.


Is there a way to regenerate the display and sort names? After changing the display settings (/civicrm/admin/setting/preferences/display) for sort_name or display_name, is there a way to regenerate the sort_names and display_names currently in the database to the newly configured format?

As mentionned here :

You can export the first name, last name and the internal ID
Re-import the data by matching the internal ID

This process should regenerate the sort name and display name based on the current settings.


Upgrade or Replace CiviCRM 4.7.31 We are using Wordpress 5.7.  Our current CiviCRM version is 4.7.31.  As of August 2020, CiviCRM event registration stopped working due to the Wordpress update.  Now, we can not seem to process memberships through CiviCRM either.  As of now, I am sending people directly to PayPal, but for membership registration should upgrade, update, or replace our current CiviCRM version as it no longer working compatibly with our Wordpress site

I think you're asking whether to try upgrading or just start with a fresh install. It is definitely possible to upgrade from 4.7.31. You'll want to update php too since you're probably still using php 5 and that won't work with the latest civi.


webform how to change live options I am trying to add in some additional dropdown options on a component of a webform

I dont want to use static options and  need to alter the live options

How do do find the fields that the live options refer on CIVI so I can change them? So that they will come up as live options

Hope this makes sense!

Good question. Best way is to click on the CiviCRM Tab on the webform, and then look at the fields that are checked either on the relevant Contact, or on the Activity, Membership or Contribution section. That should show you both the 'name' of the field and the 'name' of the fieldset (field group).

The other option would be to look at the webform component itself and the 'field key' would look something like civicrm_1__1_cg16_custom_152. in this case the '16' is the id of the fieldset (field group) and the 152 is the id of the custom field.

You should therefore be able to look at /civicrm/admin/custom/group?reset=1 and click on View and Edit Custom Fields on any of the field sets, and then change the id in the url, eg such as /civicrm/admin/custom/group/field?reset=1&action=browse&gid=27 so instead of '27' to '16'

If the field is still not obvious then you can repeat this process, ie click on any of the 'fields' and change the id, eg from /civicrm/admin/custom/group/field/update?action=update&reset=1&gid=16&id=1 so you change the '1' to '152'

At that point you should have access to the 'options' for the field and should be able to add new options.

Gosh that seems long-winded, but hope it helps.


Drupal 8: How do I shift a project/site from using the roundearth installation method to the CiviCRM official composer asset plugin From an existing site set up using the roundearth composer plugin method as detailed -> https://www.mydropwizard.com/blog/better-way-install-civicrm-drupal-8
composer create-project roundearth/drupal-civicrm-project:8.x-dev some-dir --no-interaction
How do I update this to use the newer https://lab.civicrm.org/dev/drupal/snippets/43composer require civicrm/civicrm-asset-plugin:'~1.0.0' pear/pear_exception:'1.0.1 as 1.0.0' civicrm/civicrm-{core,packages,drupal-8}:'^5.25' --prefer-source

Depending on how your initial site set up was created you might need to take a more extreme option detailed below but hopefully the following will work:
If you want you can copy composer.json , composer.lock to a new directory (or local) and use issue composer installto check the below works this can be useful if you are having problems and need to remove composer.lock and vendor. But I'm assuming you are going to be doing this on dev/staging.
composer remove roundearth/civicrm-composer-plugin --no-update
composer config extra.enable-patching true

civicrm/civicrm-{core,packages,drupal-8}:'^[civicrm latest version without the point version]'
Apart from the removal of the roundearth/civicrm-composer-plugin you want to follow the install steps outlined here:
https://docs.civicrm.org/installation/en/latest/drupal8/
(Note D9 Drupal recommended you'll need to set the minimum stability from stable to dev if you haven't already).
If you are still on an older version of civicrm you might need to include pear/pear_exception:'1.0.1 as 1.0.0' in the above require. But the latest version doesn't require this anymore.
Assuming this is successful you will then want to
drush updb
drush cr
I'd also recommend clearing out
web/libraries/civicrm/
and then repopulating with composer civicrm:publish
This is something you might need to repeat on live.
Note hopefully soon "pear/pear_exception:'1.0.1 as 1.0.0'" will not be required. Check the install instructions and mirror them.
Options to make things easier.

If your civicrm is not latest either upgrade first (best option) or use '[civicrm latest version]' (note missing '^' and you want full version with patch level i.le. '5.26.2' not '^5.26') to lock yourself to the specific civicrm version in composer.json - you will want to update to add the '^' in once complete and remove the point version to allow upgrades - or you might want to leave it like this to prevent composer update upgrading civicrm.
If you get composer conflicts in your dev/sandbox environment remove vendor and composer.lock. This will mean that you then end up running upgrades on everything - so best to do these first, or lock anything you need not upgraded in composer.json.
If you forget to remove roundearth/civicrm-composer-plugin you'll run into problems with resources not being copied correctly across to web/libraries. If you are not seeing the menu on load or are missing seeing an error for a missing file extension-compatibility.json you might need to make sure you have removed roundearth/civicrm-composer-plugin fully.
add --no-update to the second require then you can use composer update --dry-run along with all the packages you are adding/removing.

As per below check your civicrm.settings.php file and make sure the following are either removed or match the location where the libraries are stored.
$civicrm_paths['civicrm.root']['url'] = '/libraries/civicrm/';
$civicrm_paths['civicrm.packages']['url'] = '/libraries/civicrm/packages/';

The extreme version below assumes you have no custom themes/modules or file uploads. If you have any of the above. You probably want to follow a different root!
I had done this once and I described it at https://lab.civicrm.org/dev/drupal/-/issues/115#note_34161

Backup civicrm.settings.php and drupal settings.php.
Delete everything in the root folder, including drupal.
cd <one folder up from root>
composer create-project drupal/recommended-project:8.x.y <root folder>
cd <into root folder>
SET COMPOSER_MEMORY_LIMIT=-1 (or export COMPOSER_MEMORY_LIMIT=-1 for unix)
composer require civicrm/civicrm-asset-plugin:~1.0.1 civicrm/civicrm-core:dev-master civicrm/civicrm-packages:dev-master civicrm/civicrm-drupal-8:dev-master
restore civicrm.settings.php and drupal settings.php
If you have the two extra lines in civicrm.settings.php that were needed after roundearth+civi5.23, then you don't need them anymore, i.e. remove these lines

 $civicrm_paths['civicrm.root']['url'] = '/libraries/civicrm/';
 $civicrm_paths['civicrm.packages']['url'] = '/libraries/civicrm/packages/';

log in and clear caches

CAVEAT: As described in that thread it really depends where you started from and additionally what else you have installed via composer on that site and so you might not want to remove the whole drupal folder. The above was a pretty plain stock site and I was also converting to drupal-recommended at the same time. If you keep some things and for example if you've installed fancy modules, you may see composer throwing up irreconcilable differences.
Also the above was for a dev install, using dev-master. Replace dev-master with a specific 5.x.y or ^5.x as desired.
Further disclaimer: Civi + d8 has been a constantly moving target. It's repeatedly come up that what worked "2 months ago" doesn't quite work "now". I have not tried the above in the last 2 months.


Idea for extension Someone Else Pays - any feedback? We are thinking about creating a native CiviCRM extension Someone Else Pays.

In CiviCRM you could use the soft credits (with a new soft credit type) to register another contact pay for an event registration, a membership and in theory any contribution.

Our customer Domus Medica is using that at the moment. We encounter some issues though. Some of the issues are possibly bugs but some are also because we think soft credits is originally not meant to cater for this. It was meant to cater for soft credits. So we prefer to create an extension rather than fix a few issues in a hackish way and then finding out we have some more.

At this point in time our thinking would be to:

generate a new table (sep_contribution_payer) where the contribution_id and the paying contact_id are stored if there is a different payer
add a new collapse window on the contribution forms (also membership and event registration) to show this link if it is there, and enable the setting of 'someone else pays' in the UI
create API's (get, create, delete)

Any comments, suggestions, tips, offers to co-fund?

Here's how we get someone else to pay! This is an Example of an Event Registration:

Primary Contact -> and 4 Participants; Key is: register each Contact separately;

Use Conditionals to help with how many # participants fields you need - and configure the Events webform elements - to be a checkbox for the Primary Contact;
End result: if Primary Contact (in this example often a Director of a ChildCare program) is simply registering and paying for Staff to attend a Conference -> the Director pays and all the Participants are added.
Example: KarinG will register Karin G:
KarinG has paid - but has no Events:

Karin G is the Participant but has no Contributions:

Receipting? Does it work? Almost -> the person who paid (KarinG) gets a transaction receipt showing those who have been registered (Karin G) [triggered via the API - sendConfirmation to be exact)
And what about sending a Confirmation to the Participants that their Director has signed them up. That works too - with a little help from... CiviRules! Trigger: participant add; All I needed to do was write a small custom module to generate some participant tokens;

Ok what does not work as well yet -> CiviCRM native is a bit confused about Payments; and the invoicing is a bit off -> it should really look much like the receipt that you can get at with sendConfirmation - but you can't. It's not clear at all that KarinG paid for Karin G to go to the Conference - Fuzion has helped make this work - by adding a Participant Name to the LineItem before webform_civicrm uses the lineItem API to create the lineItems:
What really does not work is -> if you sign up more than 1 Participant -> their Event Participant View -> shows the total $ for all the participants - not just for their lineItem (so CiviCRM native thinks that each single participant is owed a refund);
If I were tasked to do this in an Extension -> use the APIs that webform civicrm uses to get this registered by functionality up and running; no extra table required; use the registered_by -> to properly link payments and event registrations; Extend the registered_by at the Event level to the Membership level -> (that would be a gift membership e.g.);


Configuring Inbound Email Config I used to have CiviCRM Inbound Email processing perfectly, but now it no longer works. Whenever the process is run, I get the following error:

Full message:
Finished execution of Process Inbound Emails with result: Failure, Error message: A fatal error was triggered: Could not connect to MailStore for [prefix]@[domain].org@imap.gmail.com

Error message:

An error occured while sending or receiving mail. The IMAP server did not accept the username and/or password: A0001 BAD Too many arguments provided 136-v6mb280518080wmm.

Please help me fix the config (or if the config is correct I'll set about debugging). The password is functioning perfectly (I emptied it before taking a screenshot of the config). How can I fix this?

This is for a domain hosted by Google.

I would guess from the error "A0001 BAD Too many arguments provided" and this unrelated github issue that you may have a space in your password (or some other character that needs better handling).

That CiviCRM also triggers "A0001 BAD Too many arguments provided" error suggests CiviCRM doesn't handle spaces in passwords correctly for IMAP/POP3.

Here's some advice on debugging the inbound mail process in CiviCRM, which might be useful!


Civirule - Action : force override status Is it possible to override permanently a status from 'pending' to 'new' with a civirule ?

CiviCRM doesn't do it automatically (issue I can't fix until now) and it would avoid me to do it manually every time a new member paid with credit card :-(

I can identify the right status :

  Contact has Membership of Status and Type : Membership type Est l'un de Adhésion annuelle & Membership status Est l'un de Pending

but I don't find out how to override the status

have a great day

Guillaume

I reckon you should be able to do that with CiviRules but I am not sure if the action already exists? If not, you can create your own actions, documentation: https://docs.civicrm.org/civirules/en/latest/create-your-own-action/


Error 500 on Print/Merge Document page when doing Thank-Yous I'm getting an Error 500 result when trying to produce Thank You letters for contributions since upgrading to 4.7.10 (and Drupal 7.50). Other Print/Merge operations are functioning normally. Backtrace and debug do not produce any additional information. The error comes ~1 second after clicking "Make Thank-You Letters"--seeming as though it's not even processing the information.

I've eliminated the following variables as the cause: Number of records, which records are selected, document type, thank you document body, page format, grouping.

I read that Error 500 is often a permission error. Everything seems correct, but I'm no expert in that realm. Tried the sandbox demo and it's not a bug there.

General recipe for Errors like that is to find a clue as to what's going on in the log files: first two places to check:

check the CiviCRM log in /files/civicrm/ConfigAndLog/
check your php and/or php-fpm error log (location of that depends on your install one possible option is: /var/log/httpd/


Paypal IPN failure - As referenced here and other places in the forum:

https://forum.civicrm.org/index.php?topic=29753.15

IPN's from paypal are apparently not passing muster with CiviCRM. The errors in the log are somewhere along the lines of "Could not find an entry for contactID in GET". This log is generated by testing using curl, like so:

curl -k -X POST -d "[paste in IPN params from Paypal IPN log]" https://oursite.org/sites/all/modules/civicrm/extern/ipn.php?reset=1&contactID=[contact_id]&contributionID=[contribution_id]&module=contribute

The words in brackets are my substitutions; clearly there is an integer contactID in the GET request; what's going on here?

UPDATE: More perplexing is that the civicrm_system_log table varies depnding on how the IPN is sent. From Paypal, it shows all the info from the IPN as it's logged in Paypal - with the GET parameters first, followed by the POST parameters, all within the same JSON-looking structure, in the log table's 'context' field. If I simulate a re-send of the same IPN using curl as described above, the parameters from the GET part of the request are missing from the context field. I'm not sure if they're supposed to show up in the log or not, as it seems the POST variables are what show up in the log, so it's a little tricky to know how to debug this.

In any event, the actual IPN's that came through from Paypal, and which Paypal says were met with 500 errors, are logged in the database, and there are no corresponding entries in Civicrm.[hash].log from those times indicating any errors, so presumably the IPN should have processed correctly. This is rather complicated and confusing.. could someone please help?

Update: Including the GET data in the curl request with -X GET -d "reset=1&contactID=[contact_id]&contributionID=[contribution_id]&module=contribute" results in a "302 found" response, but no more information than that, and I cannot find any evidence in the database log of the request, and there is no mention at all in Civicrm.[..].log.

Addendum: The PayPal IPN simulator reports that it cannot successfully handshake with either the dev or live sites. That is strange considering that IPN logs are appearing in the live site's civicrm_system_log table..

UPDATE: Apparently here's what was happening. I have a Civi extension where I call a function defined in a Drupal module, and the 500 error was about calling an undefined function. I fixed that in the extension code, but the function in question called the Drupal watchdog(..) function, which is also undefined in the context of being called from ipn.php. So here's a better question: What's the solution to this problem? Do I edit ipn.php and bootstrap Drupal before doing anything else? It seems odd that, just for IPN's, something would break because it is not running under the same assumptions that the rest of Civi runs under.. of course, I could also switch from Drupal watchdog in my extension to whatever the Civi equivalent is.. any suggestions?

We have a little trick for this situation.

This extension

https://github.com/eileenmcnaughton/nz.co.fuzion.notificationlog

allows you to replay processing IPNS from the system log - e.g after installing try

drush cvapi NotificationLog.retry system_log_id=xxx


Development - Refresh of parent page Wordpress with CiviCRM 5.3.2

Hi guys, I'm struggling with a small problem.
I've added a tab (using tabset) to create a new tab while viewing a contact.
That tab lists any dogs registered to that particular person.
I've added an 'edit' and 'delete' link to the far right of the listing and all of that works.  I wrote a quickform that opens when the 'edit' link is clicked.  I can update the dog's information, click submit and it does update the entity in the database.  The issue is, how do I tell the parent of this edit popup to refresh?  The change I've made in the edit is not reflected in the listing until I reload the page manually.
I've read in a lot of places of some ways of doing it but I haven't figured out WHERE to initiate it.  In particular there is a CRM.refreshParent and/or the crmPopupFormSuccess.  I don't know where I would put these?  I used civix to create the basic form, then made modifications to the php file to do a preprocess and postprocess, of which does the update, etc.
So, how and where do I tell the parent page to refresh when I close the popup of the form? Some direction would be appreciated.

Norm

There should be a .tpl template file that goes along with your .php file. You can put the javascript in that file.

The files created for your form via civix and their locations are described here:
https://docs.civicrm.org/dev/en/latest/extensions/civix/#generate-form


CiviMail scheduling problem due to timezone issues i have a mailing that looks like it has been caught out due to timezone issues. The person who set it up was in NZ, but moved to Europe but didn't change their timezone. Looks like the Mailing got the scheduled time using NZ timezone, but civi sees it as happening in the future so is not sending it. Am i okay to change scheduled_date in civicrm_mailing table directly?

I've never changed the scheduled date directly in civicrm_mailing, but it seems like a pretty harmless maneuver.

If your CMS is WordPress, I have a fork of wp-cli here that lets you specify the time zone in which a cron job should assume it runs.  It's specifically to handle a WordPress/Civi multisite where different sites are maintained by users in different time zones.  Each site's cron job runs in that site's local time zone.


How can I efficiently dedupe a very large number of records? I'm working on a database with about 600,000 records, of which approximately 200,000 are believed to be duplicates.

Has anyone got experience/advice for doing dedupe at scale?  I imagine that we'll need to export and do some sort of external dedupe.  Has anyone successfully used the datamade dedupe with Civi?  I know that the "merge" API got some love a couple months ago - will any of that help me?

We did a lot of work to the dedupe processes in CiviCRM and in 4.7 its a much easier process to de-dupe large databases then it used to be. It was presented by Eileen in this years London CiviCon, worth a look before you get into trying to do it outside of CiviCRM with all the pitfalls that brings with it!


Do I need to know Linux to administer CiviCRM? Do I need to know Linux to administer CiviCRM? This is not a rhetorical question :) . And it's a question I wish I had asked three and a half years ago.

My answer now, to my self of three and half a years ago, would be: No, knowing Linux is not strictly necessary, especially if you use a hosted version of CiviCRM, like Powerbase or CiviDesk, or have a partner like Fuzion or CiviCoop doing your Linux server set up and maintenance; but Yes, knowing how to use a flavor of Linux would be really helpful, regardless, especially if you want to understand what's going on "under the hood" with your Linux server, if that's what your CiviCRM installation is hosted on.

I believe there are three good answers to this question - Yes, No and Maybe.

Your thoughts appreciated....

The question is tricky because it's a bit imprecise -- different people may interpret "know Linux" and "administer CiviCRM" a bit differently.

It might be clearer to rephrase the issue this way:

To administer the data model, profiles, contacts, events, mailings, etc, you need an analytic mindset and a general understanding of data-management, but you do not need sysadmin skills.
To administer the installation, backup, or upgrade, you do need sysadmin skills (for HTTP/MySQL/PHP on your chosen platform). For a general GNU/Linux hosting platform with Ubuntu/Redhat/etc, general GNU/Linux skills should do. For Windows or cloud platforms, you probably need more advanced/niche skills.

Additionally, there are the wildcards -- adding new features or perfecting the appearance within your site or debugging hard problems. These are wildcards because the required skills vary widely. Sometimes basic point-and-click will do; sometimes you need robust skills in a dozen systems.

As others have mentioned, a good model is to partner with someone more experienced. You can handle a lot of administration yourself -- and when/if a task comes up which needs more skills, reach out to them.


How can I add an additional email id for "work" through API? I need to add an email id to a CiviCRM contact through the API. Existing email ids of the contact should be kept unchanged and the new email added as type "Work" (the contact doesn't have any "Work" emails yet, if that should make it easier).

I tried to find a suitable API call through the API Explorer (civicrm/api/explorer) but the autocomplete didn't offer an Email field anywhere.

I also found an old forum post using some civicrm_location_update($params). But this left me confused and I can't find anything like it in the API Explorer.

Here is an example for creating a new email on an existing contact. Note that the default "Work" is location_type_id 2:

  $params = array(
    'contact_id' => 99,
    'location_type_id' => 2,
    'email' => 'myemail@work.com'

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


Emailing people who didn't open a campaign I'm looking for the simplest way to email a group of people who did not open a given civiMail campaign. Thanks

One option is to put all the contacts that opened the mailing into a group. Then when you setup the next mailing in recipients include the group from the previous mailing and exclude the new group of contacts who opened it.


Adding repeating event registration shortcode in wordpress I added my repeating weekly event registration to my wordpress post using [civicrm component="event" id="XX" action="info" mode="live"].
I would like people to register every week for the event.
Is there a way to make the post update automatically to the next week's event (as each event has a new event ID) or do I need to update the event ID each week?

You may be able to achieve what’s required with the WordPress CiviEvent Widget extension -

https://civicrm.org/extensions/civievent-widget


Is CiviCRM a good choice for a website front end AND membership management? We are looking for a CMS (or similar) for our Big Band.  We need

A page for the public to see our next gigs
Membership management to keep a list of band members, deputies;
An events calendar diary for rehearsals and gigs;
A file store so that PDFs of our set lists,  music charts etc can be stored and available for all band members;

It's clear to me that CiviCRM would be fine for 2 & 3, but not so clear that it will also cover items 1 & 4.

Any thoughts/help appreciated.
Pete

welcome to the community.

In short:

Q1. & Q2. are easily met with CiviCRM.

Q3. Can be done with a little effort.

Q4. This would be provided by your Content Management System (CMS). CiviCRM works with Drupal, WordPress, and Joomla!. For this, I'd go with Drupal (with which you could do this through configuration), but this functionality may also be provided by Joomla! and WordPress plugins.

Hope this helps!


Get URL of custom image field I would like to display pictures which are defined as custom "File" fields within an event. I currently to this by generating URLs having the following format:

MY_URL?q=civicrm/file&reset=1&id=FILE_ID&eid=EVENT_ID

There's another question that has been answered and can be seen here.

Using this worked, until CiviCRM recently introduced a security patch (i'm on version 5.10.3). Now, the picture urls have some sort of hash attached to them (the url contains fcs=...). Since that update, I can't display the pictures anymore.

Is there a standard, API way of getting images defined in custom fields? I know there's an Attachment API, but when I try to retrieve my file I get the following error:

{

"error_code": 0,
"entity": "Attachment",
"action": "get",
"is_error": 1,
"error_message": "Failed to run permission check: Unrecognized target entity table (civicrm_event)"
}

Check how this bug was fixed elsewhere https://github.com/veda-consulting/uk.co.vedaconsulting.pcpteams/pull/216


What is the latest version of CiviVolunteer? I have version 4.7.21-2.2.3 of CiviVolunteer installed, but when I look at the list of extensions Civi recommends updating to 4.7.31-2.3.0  I am running 4.7.27 by the way, so I'm assuming that this release doesn't apply.  Is that correct? The list of releases at https://civicrm.org/extensions/civivolunteer adds to the confusion as the 2.3.0 version was released before the 2.2.3 version.  Can someone explain?

I think there is confusion on release date. Version 4.7.31-2.3.0 was released on March 2018 not March 2017. I guess the maintainer forgot to update the year to 2018 in info.xml file.

HTH

Pradeep


Batch alter Relationship Contact Permission only While trying to alter Contact Relationships Permission ("Contact A can view and update information about Contact B") using this code:

$result = civicrm_api3('Relationship', 'create', array(
  'debug' => 1,
  'contact_id_a' => 111,
  'contact_id_b' => 111,
  'relationship_type_id' => 111,
  'id' => 111,
'is_permission_a_b' => 0, /* <- This was manually set as 1 and need to be altered */
));

we've got "duplicate relationship" error message

"error_message": "Duplicate Relationship"

Deprecated "setvalue/update" suggestion is "Use "create" with an id instead." and we do have all IDs in place.  Does 'Create' for Relationships work as it works for Contacts or we've missed something?

UPDATE 1
After some debugging it has turned that  we have exactly same situation described here How to change the direction of a relationship type with existing data , but we weren't aware that changing Relationship direction via GUI doesn't make change in a database. Sounds like another civicrm bug.

UPDATE 2
Even after Relationship directions have been altered, same error "Duplicate Relationships" appears at an attempt to ALTER one of Relationship parameter  using CREATE Action via CiviCRM Api.

After some debugging it has turned that  we have exactly same situation described here How to change the direction of a relationship type with existing data , but we weren't aware that changing Relationship direction via GUI doesn't make change in a database. Sounds like another civicrm bug.

We've ended up by direct Mysql intervention with this query (in case someone will face this issue in future):

UPDATE
 civicrm_relationship
SET
  contact_id_a=contact_id_a+contact_id_b,
  contact_id_b=contact_id_a-contact_id_b,
  contact_id_a=contact_id_a-contact_id_b
WHERE ** ... conditions set ...  **


CRM API shows only the first char of the result? I'm absolutely embarrassed. I try to get value as it in this thread (and sorry for the wrong use of the topic).

I try get a custom value via CRM API. With the API Explorer I can create the expression:

{crmAPI var='result' entity='Contact' action='getvalue' sequential=0 return="custom_13" id=$contactId}
{foreach from=$result.values item=contact}
  {$contact.some_field}
{/foreach}

I can see the right result in the API Explorer. I insert it as it is into my tpl file, and I get back only the first character of the result.

What do I wrong?

Since you are using getvalue, $result will be the contact's custom_13 value, so you don't need a foreach loop.

Try using below snippet

{crmAPI var='result' entity='Contact' action='getvalue' sequential=0 return="custom_13" id=$contactId}
Custom 13: {$result}

Pradeep


Is there a recommended way to customise the quicksearch? I'm trying to customise the top-left quicksearch box so that it recognises some of our internal codes without selecting a specific option in the dropdown.

I used to adapt xavier's great Quick Contact Autocomplete extension, but this uses the crmAutocomplete action which I think went away in 4.5.

Is there a particular recommended way of doing this in 4.5+?

I found it quite hard to replace the customization done with hook_civicrm_contactListQuery (CiviCRM <= 4.4) with the new hook_civicrm_apiWrappers (CiviCRM >= 4.5).

So I am sharing my results here.

My goal is to have a way to search quickly either by contact name, or by a custom field that stores a member identifier (different from internal identifier and external identifier).

My old code looked like this :

function myext_civicrm_contactListQuery( &$query, $name, $context, $id ) {
  if ($context == 'navigation') {
    // if not name / email search, just keep the standard behavior
    if (!isset($_GET['tableName']) || $_GET['tableName'] != 'cc') return;

    // if the search is a number, try to look for the custom member id
    if (is_numeric($name)) {
      $query = "SELECT cc.id as id, CONCAT_WS( ' :: ', CONCAT(sort_name, ' (', im.num_ro_de_membre_37, ')') ) as data, sort_name
                FROM civicrm_contact cc
                LEFT JOIN civicrm_value_r_sum_de_membre_6 im ON ( cc.id = im.entity_id )
                WHERE im.num_ro_de_membre_37 = '$name'
                AND cc.is_deleted = 0
                LIMIT 5";

    } elseif (strlen($name) < 2) {
      $query = "";
    }
  }

}

And now :

function myext_civicrm_apiWrappers(&$wrappers, $apiRequest) {
  if ($apiRequest['entity'] == 'Contact' && $apiRequest['action'] == 'getquick') {

    // search by member id if the search is a numeric value
    if (is_numeric($apiRequest['params']['name'])) {
      $wrappers[] = new CRM_Myext_APIWrapper();
    }
  }
}

// i need to do this because there is no function civicrm_api3_contact_getlist
function emulate_civicrm_api3_contact_getList($params) {

  // not loaded by default
  include_once "api/v3/Generic/Getlist.php";
  include_once "api/v3/utils.php";

  $apiRequest = array(
    'entity' => 'Contact',
    'action' => 'getlist',
    'params' => $params,
  );
  $res = civicrm_api3_generic_getList($apiRequest);

  // reformat the output to look like getquick
  foreach ($res['values'] as $idx => $value) {
    $res['values'][$idx]['data'] = $value['extra']['sort_name'] . " ({$value['extra']['custom_37']})";
  }

  return $res;
}

And a new APIWrapper class in a dir CRM/Myext/APIWrapper.php :

class CRM_Myext_APIWrapper implements API_Wrapper {

  public function fromApiInput($apiRequest) {

    // change api call - getquick is deprecated and doesn't work with custom field
    $apiRequest['entity'] = 'Contact';
    $apiRequest['action'] = 'getlist';
    $apiRequest['function'] = 'emulate_civicrm_api3_contact_getList';

    // change name param to field custom_37 and remove useless params
    $apiRequest['params']['params']['custom_37'] = $apiRequest['params']['name'];
    unset($apiRequest['params']['name']);
    unset($apiRequest['params']['field_name']);
    unset($apiRequest['params']['table_name']);

    // restrict return data (getlist doesn't use return param)
    $apiRequest['params']['extra'] = array('sort_name','custom_37');

    return $apiRequest;
  }

}


How can I access an activity's grouping value in CiviCases? I've only started trying to change some features of an existing CiviCRM database in a testsystem (using CiviCases). So I am still a beginner, I excuse myself if this is a silly question, and any hint will be appreciated :)
I want to include a feature that will exclude all the activities with the grouping value "system" from the case view. Right now, the case view is spammed with activities not relevant to the users (for example, "Case type changed from ... to ...").
The activities are given this grouping value in a table called civicrm_option_value.
So I suppose I have to include some filter into the file /civicrm/CRM/Case/Form/CaseView.php, accessing each activity's grouping and testing it for "system".
Can you give me any hint how I can access the activities' grouping value?
Thanks in advance,
emma

The function that is responsible to build the list of activities on case is CRM_Case_BAO_Case::getCaseActivity(). It is very difficult to alter the function via custom module/plugin/extension.
I would create an extension that would alter the page callback for 'civicrm/ajax/activity' to custom function (eg CRM_ExtName_Page_AJAX::getCaseActivity using hook_civicrm_alterMenu hook. Copy CRM_Activity_Page_AJAX::getCaseActivity() into your custom php file i.e CRM_ExtName_Page_AJAX::getCaseActivity() and change the line below line to your custom function which will basically copy paste of CRM_Case_BAO_Case::getCaseActivity function with change the where clause to include your conditions
$activities = CRM_Case_BAO_Case::getCaseActivity($caseID, $params, $contactID, $context, $userID);

HTH
Pradeep


Default Activity Subject Is it possible to set a default subject for specific Activity types?

We would like to set a default text on the “subject” of each activity that can be created for a case.

Hi @Vijailakshmi AFAIK you can not set a default for an activity type subject without coding. If you do have some PHP skills it is fairly easy though :-) Let us know and we will detail what needs to be done.


name "suffix" is missing from import mapping list name "suffix" does not appear in the field names to be mapped.  I have that data in my contacts.csv file but can't see how to map it.

Use individual suffix/prefix option for this.


How can we have recurring related fields on custom report? I want recurring related fields on the custom report, but there is only one field available as per the civicrm i.e. Recurring contribution ID.

The fields that I was looking for are Recurring Units, Recurring Intervals, Offer Installments. I am quite unsure if there is some configuration available on civicrm with which we can achieve this. Also please help if there is any API hooks that I can use it to make this happen.

If you're using CiviCRM 4.6, there's now a CiviCRM report template that uses the recurring contribution table as a base and gives you access to a bunch of those related fields.

I've got a custom extension here: https://github.com/adixon/ca.civicrm.contributionrecur
which backports that report to earlier CiviCRM versions, and also adds a few more fields.

I notice in your picture you are actually trying to export records, presumably to generate a report in a separate piece of software. You can do something similar from any (CiviCRM) report, i.e. it has a csv download option, and the ability to select which fields to show.


In CiviMember, can one set a rule where expired members, when renewing, are assigned probation status We have assigned status rules in Civi member, which flow as follows:
Member joins = Probation
After 6 months = Current

In next year, until end of March if hasn't renewed = Grace-Voting
If renews = Current

After March, if hasn't renewed = Grace Non-Voting
If renews = Current

If Grace Non-Voting for full year = Expired

If expired and renews = Current

Our membership rules state that where members renew after their membership has expired they must serve the 6 month probationary period. Hence rule should be:

If expired and renews = probationary

Is it possible to set this status rule in CiviMember?

Welcome Lawrence: One thought would be to take the approach that if an expired member signs up again, that rather than renewing the original membership, it creates a brand new one - in which case i assume your existing Probation process would work fine.

I don't recall if there is an Extension or just a setting to change CiviMember to always create a new membership but i know it has been done as some Ors prefer that.

If you think that could work for you, I or someone else can probably post a link to it if providing you with the idea is not enough to help you find it yourself.

UPDATE

Also note that eg for Drupal there is a Member Role Synch module that lets you specify what User Roles are given/removed based on the civi membership type and status


What is Best Approach When integrating custom payment gateway to CiviCRM/Wordpress When integrating custom payment gateway to CiviCRM/Wordpress what is the best approach to use so that when you update CiviCRM to newer versions your payment gateway integration files will not be affected?

Put your code in a native CiviCRM Extension! There are a number of Payment Processor Extensions already available - go here:

https://civicrm.org/extensions/home?title=&body_value=payment&field_extension_cms_tid=All&field_extension_ready_value=All&sort_by=title&sort_order=DESC

That will find most of them!


Can you use a theme with side bar items with shoreditch? I'm experimenting with the latest version of Shoreditch on Drupal and it looks great with a theme like Seven (that has no sidebars).

It seems to work with Bootstrap - which does have side bars. But, the sidebars in bootstrap seem to push everything to far to the right.

Is this a bug? Or is shoreditch designed to take up the whole width of the screen and I should try to use it and have sidebars?

I just tested Adminimal on a site with shoreditch, and while not pretty, i did get a sidebar


Contribution Status Updates, no more 'overdue' I've been trying to follow the contribution status updates and found this link very helpful: http://wiki.civicrm.org/confluence/display/CRM/CiviAccounts+Data+Flow#CiviAccountsDataFlow-Otherchangestocontributionstatus

I have a follow up question/thought. The 'overdue' status is no longer an option for contributions. We had been using this in the case that a donor who had previously indicated they would mail in a check, or the like, never did. We give is a 90 day grace period but then change the status to overdue. (Although we like the language 'expired' better when talking to donors.) We like that this is a separate status than 'cancelled'. In our workflow they represent two different concepts. This is especially helpful when it comes to talking to the owners of PCPs - we can easily see if we cancelled a donation (something we removed due to an error or request) vs a pending donation that simply never came in.

How hard (or crazy) would it be for me to add a custom contribution status?

Adding the contribution status itself is pretty easy. You can do that with Administer/System Settings/Option Groups, find the one for Contribution Status and click on 'options'. You will then get the possibility to add a value.

This is just adding a status, so I assume the settings of the status will be done manually. If you want to automate that you will have to develop a small extension that acts when a contribution is added or changed, and sets your status in relevant cases.

Am I making sense?


Email Templates when sending invoices I have created an email template for when I send out my invoices. I can't seem to integrate it into the invoice email.

When I send out my invoices by email in CiviCRM I have the option to add email content as in the body of my email. I would like to use a template that I have created for this email being sent out with the invoices. The templates as you know can be added when a person has registered for an event but I can't seem to use a template for sending out my invoice. The invoice is an attachment, so I don't want to write the body of the email every time.

As you have surmised, the option to select a template when emailing an invoice from the contribution is not currently an available feature but it is an interesting feature request. I took the liberty of creating the feature request on JIRA on your behalf: https://issues.civicrm.org/jira/browse/CRM-19155

Kind regards,
Tamar


Is there any information that tells the last action of membership record (edit or renewal)? I'm going to write a hook to distinguish a saved membership record, how do I know the last action of saved membership record is edit or renewal?

CiviCRM keeps track of membership changes in civicrm_membership_log table for all changes to membership attributes like start date, end date, status. But it will pretty difficult for you to guess if the membership is actually being renewed or updated unless you perform some more checks with different log entries from civicrm_membership_log table.

The other and most easiest/convenient way to know renewal or status change is through Activities. CiviCRM create different activities for membership when a membership is added, renewed and status/type is changed etc(see in attached image list of Activity types for membership). So it will be easy to use post or pre hook on Activity to guess the context.

HTH

Pradeep


Link State to Country in Custom Fields Using 4.6, I have a custom field group, and from that group a profile.  It includes a State select dropdown and a Country select dropdown.

How would I go about "linking" the Country custom field to the State, so that when I change the country, it reloads the State, filtered by the country?

In older versions, adding the following script snippet with the specific custom field names worked fine, but it doesn't seem to work on 4.6:

{literal}
<script language="JavaScript" type="text/javascript">

cj(function()
{

      countryID       = "#custom_122"
      stateProvinceID = "#custom_99"
      callbackURL     = "/civicrm/ajax/jqState"

  cj(countryID).chainSelect(stateProvinceID, callbackURL, null );
});

</script>
{/literal}

Well, after hunting around on my own, I think I may be able to answer my own question.  For others who want to "link" a Profile's custom field Country to a custom field State so that changing the country automatically refreshes the list of States, I was able to do this via the civicrm_buildForm hook.  This hook allows one to modify attributes of specific form elements, and that's all I needed to do.

As of 4.5, I think, the Country/State chaining interaction is done through data-callback and data-target attributes, not through a JS snippet. So, one way to make this work is to add those specific "data-" attributes to the custom fields via the hook.

Here is my example code (apologies for bad formatting).  My State field is custom_99 and my Country field is custom_122.  Once I applied the attributes, my team registration form finally worked as before; changing the Country updates the State list.

function xxx_civicrm_buildForm( $formName, &$form )
{
  if ( $formName == 'CRM_Event_Form_Registration_Register' ) {
    // Modify the classes/attributes for country and state fields so the country dropdown will dynamically update the state dropdown
    $form->updateElementAttr('custom_99', array('class' => 'crm-select2 crm-chain-select-target crm-form-select', 'data-callback' => 'civicrm/ajax/jqState', 'data-name' => 'custom_99', 'data-select-prompt' => '- select -', 'data-empty-prompt' => 'Choose country first', 'data-none-prompt' => '- N/A -'));
    $form->updateElementAttr('custom_122', array('class' => 'crm-select2 crm-chain-select-control crm-form-select', 'data-target="custom_99"', 'placeholder' => '- select -'));
...
} // end function

By the way, civicrm_buildForm is a pretty powerful hook, I use it to set defaults and required fields based on the Event Type and values of other custom fields.


What is the database schema for groups and parent groups? I need to manually delete a group that is corrupt. Already tried a few things. This corrupt group assigned itself as the parent to other groups and continues to add additional children groups every time 'managed groups' is open. I tried to delete the group via civicrm ui and directly in the db but then unable to edit any records or import records. Error message is below.

I also manually removed parent child relationships directly in the database and then disabled the corrupt group in civicrm. This disabled all the group that were just removed as children.

Also, cannot delete records from the group. And the number of records in this group changes every time 'managed group' is opened. Obviously corrupt and needs to be deleted. Any info on the data schema for groups and parent groups appreciated.

Here is the error when this corrupt group is deleted:

  $Fatal Error Details = Array (
      [callback] => Array
          (
              [0] => CRM_Core_Error
              [1] => handle
          )

[code] => -3
[message] => DB Error: constraint violation
[mode] => 16
[debug_info] => REPLACE INTO civicrm_group_contact ( group_id, contact_id, status ) VALUES ( 58, 39435, 'Added' ) [nativecode=1452 **

  Cannot add or update a child row: a foreign key constraint fails
  (xxx_civicrm.civicrm_group_contact, CONSTRAINT
  FK_civicrm_group_contact_group_id FOREIGN KEY (group_id)
  REFERENCES civicrm_group (id) ON DELETE CASCADE)]

Groups are stored in civicrm_group.  Parent/child relationships are stored in civicrm_group_nesting.  However, based on the error you've posted, that's not the issue.  The issue is that the group was deleted, but there are still contacts who are a member of the group (which is stored in civicrm_group_contact).

I'm not sure how you did that - as the error reports, there should be a "delete cascade" when you delete a group to remove the civicrm_group_contact records.  To fix this, make sure you have a backup, then:

Temporarily disable foreign key constraints.
If your group id is 54, run DELETE from civicrm_group_contact WHERE group_id = 54.
Re-enable your foreign key constraints.

Hopefully that should clear this error!


Using CIVICRM API can I get both mobile and phone number? I am trying to work out how to call both a phone number and a mobile number using the API. I am in civicrm/api and can get one or the other but not both. Can anyone suggest a solution!?

Thanks
Caroline

you can get both Phone and Mobile in a single API call as below

    $result = civicrm_api3('Phone', 'get', [
  'sequential' => 1,
  'contact_id' => 203,
  'phone_type_id' => ['IN' => ["Phone", "Mobile"]],
]);

I have created the test example against https://dmaster.demo.civicrm.org

I guess this helps !!!

Thanks


On the Campaign dashboard I would like to prevent one specific type from being listed Unfortunately the searchColumns hook is not called by this form. It is a DataTable, but trying to use the stuff that is documented in the DataTable API (like .rows() or rowCreated do not seem to work either?

How can I manipulate a row from this dataTable and who would like to have a go at adding a dataTables chapter to the Developer Guide (or is it already there and am I missing it?)

There lots of screen that uses datatable to retrieve list of results which do not support any hooks to manipulate results or add additional clause or columns. We have altered the ajax request post/get data using jquery to send filters. In some cases it works, like in your case it may work if you want to filter it using campaign type. Here is a small snippet that i would call on the campaign dashboard page

{literal}
<script type="text/javascript">
CRM.$(function($) {
  $(document).ajaxSend(function(event, jqxhr, settings) {
    let url = decodeURIComponent(settings.url);
    if (url.indexOf('datatable/called/url') != -1
      && url.indexOf('[otherparameter]') != -1
    ) {
      if (!$('#campaign_type_id').val()) {
        settings.data = settings.url + '&searchCriteria=campaign_type_id&campaign_type_id=' + '1,2,3';
      }
    }
  });
});
</script>
{/literal}

The other alternative method is support hooks like selectWhereClause or rewrite whole logic to use api so that it can altered using hook a and submitting PR.

HTH

Pradeep


Trouble with upgrade to ubuntu xenial I'm trying to get civi to run on Ubuntu xenial and drupal7. I installed the php5 repositories as per: https://askubuntu.com/questions/761713/how-can-i-downgrade-from-php-7-to-php-5-6-on-ubuntu-16-04

I successfully upgraded my database to 4.7.7 but then I get stuck on a screen that shows the following:

localhost
Error
The website encountered an unexpected error. Please try again later.
Error message
CiviCRM_API3_Exception: DB Error: no such field in civicrm_api3() (line 45 of /usr/share/drupal7/modules/civicrm/api/api.php).

Not sure if it has something to do with the access_compat errors I was getting while installing, things like this in my apache 2 error.log
[Tue May 17 14:22:54.236734 2016] [access_compat:error] [pid 32145] [client 127.0.0.1:35040] AH01797: client denied by server configuration: /usr/share/drupal7/sites/default/files/civicrm/ConfigAndLog/CiviCRM.63a720ea8e0f63f2f91fb59f72af16dc.log

Any leads appreciated!

I think I may have gotten it. I upgraded to Ubuntu Xenial holding back with apt-mark all packages that matched drupal7, php, mysql and apache. Booted into my new system and all seems ok for now so I have my up to date desktop and a working civicrm setup. Thanks for listening.


No Text Alignment option in CiviMail WYSIWYG Editor We are using civi 4.7.29 on wordpress 4.9.1
Some of our Administrators are not going to know HTML when they are creating a new mailing.  I noticed there are not any text aligning options in CiviMail for Left Align, Center, Right Align. Shouldn't there be?  Am I forgetting to install something?

Solved.
Go to Admisister > Customize and Data Screens > Display Preferences
Scroll down and click the Configure CKEditor Button
In the space for "Plugins" Find "Justify" and save it.  While you are at it, add "colorbutton" and "font"


What is the easiest way to see the MySQL queries run by a CiviCRM page? When debugging CiviCRM pages, is there a native way to emit the SQL statements being run, eg on a Search page? I'm looking for something easier than finding the code for the page and putting in a debug_var kind of statement. I'd prefer to not have to rely on a Drupal module like cTools, since we work with other CMSes frequently these days.

If you want to see everything, you can enable MySQL logging as follows (don't do this on production!):

From the mysql console (or within an application like MySQL Workbench), run:

SET global general_log = 1;
SET global log_output = 'table';

Look at all queries run within the last 15 seconds

select *
from mysql.general_log
where
  command_type = 'Query' and
  event_time > now() - interval 15 second;

Try to find queries on the civicrm_contact table

select * from mysql.general_log
where
  argument like '%civicrm_contact%' and
  argument not like '%general_log%'
order by event_time desc;

Clear the log

truncate table mysql.general_log;

Turn off logging

SET global general_log = 0;


How to sort in descending order the results of CiviCRM API I need to find the external identifier with highest value and hence need to sort in descending order .So I need to use sorting feature but unaware of what value should be added in screenshot shown.I tried with 'desc' but it gives an error.

sort option takes the parameter followed by sort_order in civicrm api.

For eg - the following works fine -


How to get Geocoding to use my Google API key? I'm getting a Geocoding over-limit error, even though I've enabled a billing profile with my Google Maps Geocoding API key. (I hope! :) )

Using: Civi 4.6.14, Drupal 7.43,
Geocoding settings:
Mapping provided by Google, with my Google Maps Geocoding API key
Geocoding provided by Google, with the same Google Geocoding API key, on a standard account.
I have setup a billing profile with the key, so it should handle over-usage.
Scheduled job: geocoding=1, address parsing=1, throttle=1.

The Scheduled job returns this error:

  Parameters parsed (and passed to API method):  a:4:
  {s:7:"version";i:3;s:9:"geocoding";s:1:"1";s:5:"parse";s:1:"1";s:8:"throttle";s:1:"1";}

  Full message:  Finished execution of Geocode and Parse Addresses with
  result: Failure, Error message: A fatal error was triggered: Aborting
  batch geocoding. Hit the over query limit on geocoder.

Also, my Google developer's console shows no activity on my API key.

So, I'm wondering if I have missed something in Civicrm... for instance I found this link:
https://wiki.civicrm.org/confluence/display/CRMDOC/Mapping+and+Geocoding
It says at the bottom:

  Usage Limits Some providers have usage limits on their Mapping and
  Geocoding APIs. If you go over the limits you may receive a overlimit
  error when trying to save an address. Currently there is no support
  for integrating the Google APIs Console license (which is needed for
  sites whose usage is over limit). Contact info at civicrm dot org if
  you are interested in helping implement this.

Does this mean that Civi can't handle over-billing?

OR: perhaps I have not configured my Google API key properly. I think I've set it to only accept connections from our server's IP, and with our domains.

Any ideas?

I've subsequently followed the advice here to switch mapping to Open Street Maps and Geocoding to Yahoo, and re-activated the Scheduled Job. That is currently running with no errors... :)

You weren't imagining things. CiviCRM 4.6 and 4.7 until recently was ignoring the Google API key altogether! I'm not sure the history of that, but it would have been great if someone had documented that in the settings. As of the latest 4.6 and 4.7 the Google API key is getting recognized again (https://github.com/civicrm/civicrm-core/blob/4.6.23/CRM/Utils/Geocode/Google.php). Once I upgraded, I checked the URL getting passed and it now attaches the key and uses https (the other requirement of Google). And in the API dashboard I'm now seeing activity.

So the answer to your question is: upgrade CiviCRM to the latest in order to get Geocoding to use your Google API key.


After upgrade to 4.7 on Drupal 7, Can't edit a contact I get the following error and backtrace. If I disable the Formal title option in Admin Display Settings then I dont' get the error.

Exception: "Unsupported html-element "

#0 /home/saintfran/www/www/sites/all/modules/civicrm/CRM/Contact/Form/Edit/Individual.php(81): CRM_Core_Form->addField("formal_title", (Array:0))
#1 /home/saintfran/www/www/sites/all/modules/civicrm/CRM/Contact/Form/Contact.php(766): CRM_Contact_Form_Edit_Individual::buildQuickForm(Object(CRM_Contact_Form_Contact))
#2 /home/saintfran/www/www/sites/all/modules/civicrm/CRM/Core/Form.php(540): CRM_Contact_Form_Contact->buildQuickForm()
#3 /home/saintfran/www/www/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Display.php(92): CRM_Core_Form->buildForm()
#4 /home/saintfran/www/www/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Display->perform(Object(CRM_Contact_Form_Contact), "display")
#5 /home/www/www/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Contact_Form_Contact), "display")
#6 /home/www/www/sites/all/modules/civicrm/CRM/Core/Controller.php(351): HTML_QuickForm_Page->handle("display")
#7 /home/www/www/sites/all/modules/civicrm/CRM/Utils/Wrapper.php(113): CRM_Core_Controller->run()
#8 /home/www/www/sites/all/modules/civicrm/CRM/Core/Invoke.php(286): CRM_Utils_Wrapper->run("CRM_Contact_Form_Contact", "New Contact", (Array:1))
#9 /home/www/www/sites/all/modules/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:13))
#10 /home/www/www/sites/all/modules/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:3))
#11 /home/www/www/sites/all/modules/civicrm/drupal/civicrm.module(454): CRM_Core_Invoke::invoke((Array:3))
#12 [internal function](): civicrm_invoke("contact", "add")
#13 /home/www/www/includes/menu.inc(527): call_user_func_array("civicrm_invoke", (Array:2))
#14 /home/www/www/index.php(21): menu_execute_active_handler()
#15 {main}

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

Similar issue is being filed here https://issues.civicrm.org/jira/browse/CRM-17831.

This has been fixed in 4.7.2 at https://github.com/civicrm/civicrm-core/pull/7770/files.

Update: As xml files are not included in the downloaded Civi. For the time being, can you please make the following changes at fields() function in CRM/Contact/DAO/Contact.php.

'formal_title' => array(
   'name' => 'formal_title',
   .
   .
   .
   'export' => true,
   'html' => array(        <--- include this
     'type' => 'Text',
   ) ,
 ) ,


Why don't links work from CiviCase Dashboard to filter by case type? This works correctly on the Joomla demo server with 4.6.0, but not on my Joomla with CiviCRM 4.6.8.  Not sure if this is a problem with the more recent CiviCRM versions, or something else in my configuration.

On the demo server, if you create cases in CiviCase, then go to the CiviCase dashboard, you can click on the numbers in the grid layout showing how many cases of what case type have what case status.  This works by adding parameters to the URL of &status=2 and &type=2 (for example).

On my installation, the destination page seems to pick up status correctly, but even when type=3, it comes to a page giving an error that it couldn't find any cases, and shows the wrong search criteria for type:

 No matches found for:
Case Status(s) = Processing ...AND...
Case Type(s) In 1 ...AND...
Application = All Applications

Why does it think I want case type of 1, when the URL specified type=3 ?

If, from this screen, I select the Case type I want and click Search it gives a correct report as expected.  But it's very inconvenient to have those direct links from the dashboard not work.

This is fixed in newer versions

//find the code change here.. every time you click on dashboard link, in the CRM/Case/Form/Search.php file line number368,369, its hard coded to 1. it needs to be $caseTpe(which is getting the actual case type value)

 $this->_formValues['case_type_id'][$caseType] = 1;
  $this->_defaults['case_type_id'][$caseType] = 1;

change the above lines to use $caseType variable:

  $this->_formValues['case_type_id'][$caseType] = $caseType;
  $this->_defaults['case_type_id'][$caseType] = $caseType;

hope this helps some one


For an extension, to modify database data, is it better to use SQL or API Simple question here,
From a computing and 'civicrm correctness' point of view, is using SQL (via CRM_Core_DAO::executeQuery or similar) or using the API ( civicrm_api3('Contact', 'create', $params)) better?
Thanks,
V

Generally, it is wisest to always use the API.  Many necessary updates actually touch multiple tables and the API takes care of it nicely.  This is especially true with financial updates. The API also encapsulates the database structure so as to effectively hide any database structure changes that may happen over time.

IMHO, pretty much the only time that SQL might be called for is if you are doing a huge bulk update wherein using the API would take excessively long.


Update to WP 4.3 Broke CiviCRM Dashboard in CiviCRM 4.6.8 I just updated my Wordpress site to WP 4.3 and updated CiviCRM to 4.6.8. Now my CiviCRM Dashboard is being "polluted" with widget content destined for other parts of the main site.(see screen capture) It only happens when a "dashlet" has been dragged into place, but without dashlets, the dashboard is kind of useless. I tried clearing Civi's caches via the Admin menu, with no luck there. I'm hoping I don't have to go hunting for a new WP Theme, but I know that WP 4.3 made big changes in the theme widgets and customization user experience, so I'm worried.

Anybody else experiencing this? Any advice?

I wonder if you still need help with this or not. I tried to replicate with WP 4.3 and Civicrm 4.6.8 and dashboard was loading without any issues, i would suggest update your wordpress version to the latest at of now, 4.9.1 and i think problem will be solved.

Thanks


Mass Emailing based on event day and time I have read different resources, but still can't determine the best way to email all attendees registered for a specific event date and time the day prior or the day of the event.
I'm sure this can be done but not sure of the correct steps.  Does a group have to be created each time, can it be automated???
Thanks,
E

You can use schedule reminders to send notifications based on event dates and status


Certain Emails, not all are falling into SPAM We have an install where on certain contacts if you send an email directly from the contact record it goes through correctly. If an email is triggered via CiviRules it goes to SPAM. The email content is the same as well as the from address. This also happens when emails are sent from CiviMail (traditional). We are using mail() for outbound mail.

Is there a process difference when mail is triggered by CiviRules or CiviMail rather then directly from the contact record?

Install is in WordPress 5.2.2 with CiviCRM 5.13.4.

The SPF record for the domain references the web server.

Receiving mail servers use a variety of different metrics to give your mail a 'spaminess' score to decide whether it is spam or not.

  Is there a process difference when mail is triggered by CiviRules or CiviMail rather then directly from the contact record?

There are small differences in the email headers generated via different routes. These may be affecting the score. The differing content is likely having an effect as well (even simple messages can appear spammy to receiving mail servers).

My hunch is that you don't have DKIM set up. Setting up DKIM will reduce your score and put you under the threshold in both cases, though it wouldn't work if:

your emails (headers and content) look really spammy to the receiving mail server's algorithms
clients using the receiving mail server keep on marking your emails as spam

Typically a receiving mail server will add a header to the email with 'authentication results' that typically refer to DKIM, SPF and DMARC. For example, when google receives a mail, it adds a "ARC-Authentication-Results:" header.

Posting those headers would be useful so we can check what it says about DKIM and SPF:

If you are sending via mail() is it likely not using DKIM. The easiest way of adding DKIM is to switch to a third party mail provider.
Also, you may have (in the eyes of the receiving mail server) a mis-configured SPF record, so worth checking.

A couple of final things to note:

Each receiving mail server / service has its own algorithms. What works for one, might not for another.
You need to give the receving mail server time to get used to this new source of mail (regardless of whether the config is correct or not). If the total  volume of mail is low, receiving mail servers may never get used to it. This is one reason why many people choose to use a third party service.


Error message on contribution: too many redirects We have a contribution page via an embedded short code that, upon submit, intermittently throws a "too many redirects" browser error.  When this happens, the contribution is not written to Civi, nor does anything get to auth.net.  Contributions do work successfully for some visitors, but not for others. For example, we can have success on a desktop, but then retest immediately on a cell phone and get the error message. Doesn't seem to matter whether the cell phone is on the same network as the desktop or if it's on it's mobile network.  Also, doesn't seem to matter whether the user is logged in to admin or not.  Clearing cookies or cache doesn't solve the issue.

We're running CiviCRM 4.7.15 on a WordPress (4.8.1) site. The site has a Let's Encrypt SSL and both the Wordpress general settings and the Civi base URL are the same (https).  Server rewrite rules also rewrites to https.  Caching is handled through CloudFlare and W3 Total Cache plugin. We're using authorize.net for our payment processor.  All auth.net ip's are whitelisted in WordFence as well as CloudFlare.

Appreciate any suggestions or advice.  We're stumped!

I was having the same issue and stumbled upon an answer to a very similar problem, although it didn't appear to be random like mine and yours. This is a pretty old issue, so not sure if my "answer" helps. All I did was navigate to CiviCRM >> Administer >> CiviContribute >> CiviContribute Component Settings. Set 'Default invoice payment page' field to the contribution page that was causing the "too many redirects" when we pressed Confirm. It was previously pointing to a contribution page associated with an expired campaign, which doesn't explain at all why the redirects error appeared to be random. We are running Wordpress 5.2.3 and CiviCRM 5.12.4.


Lots of failed Static function errors after upgrade to 4.7.13 (Joomla) Just upgraded from a very old (4.4 something) release to 4.7.13. Lots of things are working, but getting lots of these:

Call to undefined method CRM_Contact_BAO_Query::processSpecialFormValue()

Seems to be just static functions.

Anyone else seeing this?

Solved. There were some old customised files hanging around that are no longer needed.


AMAZON SES Rate Limit Question I am looking at using SES for a small 1,500 email list that is not super time critical.

Setup went fine - exiting the sandbox was easy - daily quota of 50k more than I will ever need.

14 emails per second - that sounds like it could be an issues - but hard to tell - How fast is the SMTP call in CIVI.Mailer

Can I use throttle time and add 100,000 microseconds between each email to lower my rate to 10 per second. For that matter I could do 500,000 and do 2 per second

Trying to avoid having to use a postfix installation.

Thoughts

Thanks

I've used Amazon SES for a similar sized mailing list to you for a client.  I was confused initially and then surprised when they gave me a 14/s send limit.

However, when you work it out that's just over 50,000 per hour so the only issue is how to keep below the 14/s limit.  Well, as you've mentioned, CiviCRM has the very helpful "Throttle Time" which you can set to 75000microseconds to limit the send rate from CiviCRM to just under 14/second.

The client has found SES to be extremely fast and reliable. Just make sure you've got access to your DNS so you can configure necessary DNS entries to allow SES to send email for you.


Altering form values I have a Custom Group with two custom fields:
Field A is a view only input field (ID: custom_32)
Field B is a select with a few options (ID: custom_33).

When the user selects one option from Field B and hits save I would like to add a value to Field A based on the selected option.

Which hook shall I use for this?

I tried civicrm_preProcess, civicrm_postProcess and civicrm_validateForm.

My aproach to the problem is to alter the submitted (empty) value in the form object but it doesn't seem to work.

function insert_value_for_b($formName, &$form){
    //determine $newValue
    //other business logic
    $data = &$form->controller->container();
    $data['values']['CustomData'][$customIDforB] = $newValue;
}

Could someone advise please?

View only fields can only be updated via the API, see: https://issues.civicrm.org/jira/browse/CRM-17843

So you could use one of the hooks (eg: hook_civicrm_pre) to 'detect' when that field has changed, and read the value, and then use the API to set the other value. _pre might be more reliable than the form hooks, as the field might be set by other methods than by submitting a form.

For example:

function foo_civicrm_pre($op, $objectName, $id, &$params) {
  if ($objectName == 'Contact' && empty($params['custom_xxx'])) {
    // make an API call to set custom_yyy
  }
}


How do I search for contacts with no contributions? Is there a non-code way to search for contacts with no contributions recorded?

(A search in search builder will only result in contact with contributions with null values, which is not the same as no contributions at all.)

It could be a search, or a report, or even an extension. But how do you find contacts with no contributions?

You can do it in two steps:

Search for all contacts, and put these in a tag (or group).
Do a second search, for all contacts WITH a donation. And then remove these from you tag (or group) using action Untag Contact (or Remove contact from group).


Placing RESTful calls to the CiViCRM demo I do not wish to go down the road of installing the CiViCrm CRM but I do have a requirement to place REST calls to the API. Ideally I would like to do this (for simplicity) against the public accessible demo site. Can this be achieved? Presumably I would need need to generate an API Key?

This isn't possible, sorry.  Could you say a bit more about what you're trying to achieve?  I'm not sure how useful it is to do REST calls against a demo site.


How to automatically select a radio button? For a civi event registration form, is there a way to select a radio button if one of 2 other fields has data? We want to require a security deposit if the person selects one of 2 other options on the form, but only if one of those 2 fields is selected/has data entered. Once it is selected, the user should not be able to deselect it, but the form should deselect the radio button if the user removes the options that caused the radio button to be selected.

The Profile Conditionals extension is intended to meet this need.  However, it doesn't have a user interface, so it requires some tech-savvy to deploy.


How can I create a new type of block in Mosaico? The Mosaico CiviCRM Integration extension includes a base template that provides several different types of blocks to use in composing emails.

I need a type of block that's not included in that base template. My block type would contain a name (editable text) on the left, a signature (uploadable image) below the name, and a logo (uploadable image) to the right.

How can I create this custom block type, and make it available in my templates?

I believe you can use hook_civicrm_mosaicoBaseTemplates() hook to create your own new mosaico block template definition (alternative to versafix-1).

Documentation on how you can use this hook can be found here.

HTH

Pradeep


What is required to run CiviCRM on Pantheon? pantheon.io is a managed hosting service & devops infrastructure with support for Drupal and WordPress.

What additional considerations are there for hosting CiviCRM on Pantheon?
Are there any specific configurations or patches required?
Is there any functionality which differs from hosting CiviCRM on a "standard" LAMP stack?

There are two approaches, use the CiviCRM Starterkit which currently is available as an upstream for Pantheon, or use a fresh CiviCRM install with some patches.

CiviCRM Starterkit

The starterkit is a Drupal distribution will get you most of the way since it includes a few patches so CiviCRM will work more smoothly on Pantheon's architecture. In order to use the the starterkit in Pantheon use the option provided when creating a new site from the Pantheon dashboard (and not from the distribution hosted on drupal.org). Unfortunately, the original maintainer is no longer working on CiviCRM projects so has been unable to maintain the distribution.

CiviCRM with patches

The other approach is to install CiviCRM manually on top of the default Pantheon upstream for Drupal and apply the patches from the Starterkit which patch CiviCRM core. One can then maintain the appropriate patches so they can be applied to each CiviCRM upgrade, similar to the repo "CiviCRM for Drupal on Pantheon" we've maintained for a client (though there are differences currently in what people are patching).

Dealing with a dynamic system

The main change required for CiviCRM to work with Pantheon is get around CiviCRM's approach of hardcoding the absolute paths to all its configuration. Pantheon (and other similar hosts) use environment variables to set the server paths and the database connections. That's because its app bindings will change depending on whether the fallback server kicks in to deal with the load on the site. I've found that this can happen often, especially when a large mailing is being sent out.

First the paths and database connections are set up dynamically in civicrm.settings.php (as described in Kalamuna's post and patched in the Starterkit and the alternative patches). Then one needs to deal with CiviCRM's caching of absolute server paths (at least up to 4.7). For now one can simply bypass the caching of configuration entirely with no discernible downside.

Using Redis for caching and template storage

Pantheon uses Redis caching to improve the handling of the Drupal cache (Redis can handle it better than MySQL). In order to get CiviCRM to also use Redis caching as the default for CiviCRM cache one needs to set up a new Redis caching class in CiviCRM and set it as the default in civicrm.settings.php. This has been merged into CiviCRM core for 4.7. (based on this git repo).

To use Redis for storing the compiled Smarty templates follow the approach outlined in this forum post, which for some has made noticeable improvements to the speed at which CiviCRM loads templates in Pantheon. It can be done by either using Drupal caching functionality cache_get and cache_set or with CiviCRM to store cache in Redis (patch). You may notice some side-effects with using scripts in extern/* folder that don't bootstrap the CMS, so you may find these patches.1 2 useful (for PaypalPro).

There are a few other minor patches as part of the Starterkit but these main ones will get you a long way to a stable and efficient CiviCRM on Pantheon.

Cron

By default Pantheon runs cron once an hour. In order to run cron more often, which is useful for more granular control of CiviCRM cronjobs (also useful for Drupal's Elysia cron), one needs to use an external cron or ping service.

Emails and SMTP

For basic Drupal setups on Pantheon just using their email service for sending basic transactional emails is okay. But it is highly recommended to use an external SMTP service for emails on CiviCRM (and for Drupal). CiviSMTP and Mandrill (with a CiviCRM extension) will work for Civimail and CiviCRM transactional emails.

Benefits of CiviCRM on Pantheon

As others have noted, being able to quickly clone the site into a new branch with MultiDev, or even just clone between the default environments, can be a big time saver for small development firms and for freelancers without the knowledge or support of building a similar system.


Visually group custom and standard fields on screen For the activity type 'petition signed', I want to add a custom field 'event' next to the standard field 'location', because my organization wants to store information about the specific event where a petition signature was obtained and I want to keep the 'location' field clean (= only geographical location).

I can add a custom field, but on the Activity screen, the fields are now visually separated.  I want to keep them together for a better user experience.  Is this possible in any way?

I found easier to move fields on the client side (using jQuery). you could write a simple extension that:

adds a custom javascript on the specific page(s) you want to modify
and that javascript would move the fields to their new location, and presumably hide the custom group "activity metadata"

It's mostly robust, but you would need to check everytime you do an upgrade that the selectors you used are still the same between different civicrm versions


Editing the Batch entry form/template fields I am looking at the batch data entry form and wondering if it is possible to modify this:

For example, I'd like to remove some columns (e.g. Invoice ID) and add others (e.g. Campaign).

Is there a way?

I was overthinking this and missed the memo in green in my own screenshot. Another case where the solution is in the Reserved Profiles.

Administer > Customize Data and Screens > Profiles > Reserved Profiles > Contribution Bulk Entry


Problem with permissions to edit message templates I have recently upgraded from CiviCRM 5.24 to 5.27.2 (on Drupal 7.72), and a user reports a new problem with editing message templates, specifically the User Message Templates.  She can open the template, select edit, make the changes, but when she tries to save it gets an Authorisation Failure message.
She has the permissions Edit Message Templates, and Edit User-Driven Message Templates, which worked OK before.
Is there some change I need to make to the configuration, or is this a regression bug?
Thanks, Tony
The Error message is:
"Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or service provider with more details about what action you were performing when this occurred.
Authorization failed"
on a white screen.
The template text is the following, but get the same error with a single line of text without any formatting at all.:
{capture assign=doctype}{activity.scheduled_reminder}{/capture}
{capture assign=renewal}Renewal Reminder{/capture}
{capture assign=lapsed}Membership Lapsed{/capture}

{if $doctype == $renewal} LALG Renewal Reminder{/if}

{if $doctype == $lapsed} LALG Membership Lapsed{/if}

     {contact.first_name} {contact.last_name}
     {contact.street_address}
     {contact.supplemental_address_1}
     {contact.city}   {contact.postal_code}

{contact.email_greeting}

{if $doctype == $renewal}

Your membership will expire on  {latestcurrentmembership.end_date}

Membership Type:  {latestcurrentmembership.type}

You can find all the details as to how to renew your membership  by visiting  the LALG Website

Membership can be renewed online or by downloading a form from the website and taking this with your payment to David's bookshop.

Yours sincerely,

Elaine Fox

Chair

{/if}

{if $doctype == $lapsed}

Your LALG membership has recently expired, and you will no longer receive the monthly newsletter or other membership benefits.

Membership can be renewed online or by downloading a form from the website and taking this with your payment to David's bookshop.  You can find all the details as to how to renew your membership  by visiting  the LALG Website.

Membership Type:  {latestcurrentmembership.type}

Expiry Date:            {latestcurrentmembership.end_date}

Yours sincerely,

Elaine Fox

Chair

{/if}

I've identified the source of the problem and suggested a hack to work around the issue.