Civimail - How to manage Headers, Footers, ... in Message Templates?

The header and footers are used for civimail, the usual way is to have templates that don't contain any header or footer but choose them when you compose the email

Another option you might consider is the new mosaico extension, that should make it easier to style your mailings


A contribution batch containing transactions of more than one currencies causes fatal error

I believe the standard workflow for accounting requires a single currency per batch. At least that was all that we aimed to support. Please create an issue at lab.civicrm.org indicating that there should be a 'friendly' error message preventing transactions that have a different currency from ones already in the batch from being added. This should include an error in case of an attempt to simultaneously add transactions in more than one currency.


How can I keep track of a "role" in an organisation (eg. secretary) over time (1980-1995)

Welcome to CiviCRM StackExchange Daniel!

The CiviCRM relationships functionality will work perfectly for your use case scenario -

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

You can have different relationship types (roles) and they can be linked between individuals and organisations. A contact can also have multiple relationships.

And of course relationships include both a start and end date.


Listing only some event types with CiviEvent Widget

The document says you add custom filters on shortcode

try adding

[civievent_widget custom_filter='{"start_date":{"IS NOT NULL":1},"id":{"IN":&#91;9,10,11&#93;},"is_public":1,"options":{"sort": "start_date ASC"}}' admin_type="custom" custom_display='{"event_title_infolink":{"title":0,"prefix":null,"suffix":null,"wrapper":1},"description":{"title":1,"prefix":null,"suffix":null,"wrapper":1}}' limit=5]

Also you will need to amend the patch below to decode html entities

diff --git a/civievent-widget.php b/civievent-widget.php
index e973ce0..c3c2da4 100644
--- a/civievent-widget.php
+++ b/civievent-widget.php
@@ -223,7 +223,7 @@ class civievent_Widget extends WP_Widget {
                                $standardDisplay = true;
                        } else {
                                // Get custom filters.
-                               $customFilters = json_decode( CRM_Utils_Array::value( 'custom_filter', $instance, '' ), true );
+                               $customFilters = json_decode(html_entity_decode(CRM_Utils_Array::value( 'custom_filter', $instance, '' )), true );
                                $filterParams = array(
                                        'start_date' => array( '>=' => date( 'Y-m-d' ) ),
                                        'is_public' => 1,


If membership status is 'Cancelled' get 'Lifetime' error message when trying to renew

I wrote a patch for this bug some time ago - but I didn't find time to follow up and improve it the way my reviewers requested.  If you feel comfortable applying this though, it will solve your problem for now.


Do manually added contacts stay in a smart group forever?

It is answered here: https://docs.civicrm.org/user/en/latest/organising-your-data/smart-groups/#adding-and-removing-smart-group-members-manually
"You can override the criteria by manually adding or removing contacts from the group". So, unless the group is deleted or you remove them, my assumption is yes they will stay 'forever'.


How do I bulk update organization subtypes using a profile?

This problem sounded vaguely familiar, and I just found out why.

This is logged on the (old) CiviCRM issue tracker as CRM-17451.  The answer was that someone would have to write this functionality or work with the core team to do so.  However, I also see that I found a workaround back in 2016.  From the page:

  In non-technical terms: Profiles secretly have a contact type they're
  associated with. You can see this if you try to add an
  organization-specific field to a profile, then an individual-specific
  field. You'll get the error "Cannot add or update profile field type
  Individual with combination of Household or Organization". That's
  because Civi has decided this is a profile associated with
  Organizations. However, when you don't have any contact type-specific
  fields on a profile, your profile defaults to a contact type of
  "Individual" for many purposes. So individual contact subtypes are
  loaded.

  The workaround: Add an organization-specific field (like "Organization
  Name") to your profile, and this problem goes away.


Upgrade Wordpress CiviCRM Version from 4.5.2 to 4.6.5

I had a similar issue upgrading from 4.5.8 to 4.6.4, what worked for me was to manually remove the civicrm_mailing_abtest table from the database.
Restore your database backup before the upgrade and login to mysql

Update:
To restore your backup database:

mysql -u root -p // login to mysql

drop database civicrm; // delete the current database, the one is failing to upgrade

create database civicrm; // create a new empty database

quit // logout from mysql

Restoring the database backup

mysql -u root -p -h localhost civicrm < /path/to/your/database/backup/civicrm-database-backup.sql // write the backup to the new empty database

Replace "/path/to/your/database/backup" with your backup directory and "civicrm-database-backup.sql" with the name of your Civicrm backup SQL file.

Check for the existing civicrm_mailing_abtest table

mysql -u root -p

use civicrm; // replace civicrm with the name of your database

show tables; // it will give you a list with the civicrm database tables

If the civicrm_mailing_abtest is listed in the output, remove it, as it shouldn't be there, the A/B Test mailing was introduced in CiviCRM 4.6

drop table civicrm_mailing_abtest; // this will remove the table

After that proceed with the upgrade again.

Hope this helps

Update 2:
If you have permission errors after the restore, you will need to grant permission to the civicrm mysql user

mysql -u root -p

grant all on civicrm.* to 'username' identified by 'password';

flush privileges;


CiviCRM + Webform + Paid Events - no price displayed in table

Some thoughts:

ad $0 ->

do you have the Event (in CiviCRM) configured as an is-paid event?
are you already registered perhaps? It is clever enough to know you
do not need to pay again. So you'll be deleting your Participant records lots when you're testing a Webform CiviCRM that has an Event enabled;

ad on building your Participant Fee ->

create regular drupal select and/or checkboxes to gather the data you need to build the Participant Fee Then use Conditionals to say:
if select = full day (example) and category = student -> then Participant Fee is set to: $50;
if select = half day (example) and category = student -> then Participant Fee is set to: $30;
if select = half day (example) and category = regular -> then Participant Fee is set to: $90;

Key is you need to build your own Participant Fee - of course this is also what gives you huge flexibility as to what you can create.

I have some code in testing/review that will check the priceset that is configured on a contribution form in order to create lineItems with the correct price_field_value_id - that's critical financial types (and thus sales taxes to be applied properly), under some conditions. You'll know what I mean when you do encounter it yourself. It's the first bit we actually do with priceset configs in Webform CiviCRM.

What you can (recently) do is add more lineItems to a contribution [purchase calendar + make a donation scenario] - and it will create a contribution with two lineItems - priceset like. But for Event fee you can build the conditionals - and even add in discount codes - as I've illustrated here: How can I emulate a CiviDiscount when using Webform CiviCRM?

I hope that helps you along. If you have any further questions don't hesitate to ask.


How can I make civibuild use "Seven" as the default Drupal theme instead of "Bartik"?

Two options: 1) edit your own buildkit script  or 2) prepare a PR for buildkit and convonce Tim seven is a lot more useful than Bartik; I'll second that!

A third could be a config option; 3) PR a change to buildit where the theme you like become a config option when running amp config


"nativecode=1060 ** Duplicate column name 'created_id'" when upgrading from 4.4.14 to 4.6.2

That looks very strange error, it appears to be complaining that the created_id column is being created twice, However looking through the upgrade sql files on the github repo, I can only see the one reference to creating created_id column on that table and that is in the 4.6alpha7.sql file. I do note that it came from this JIRA case https://issues.civicrm.org/jira/browse/CRM-15970. Perhaps you should raise it as a bug in the Jira system but also would recommend looking through the upgrade sql files on your system to see if they match what is in the git repo


Views: Filter results by current logged-in user

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

Create a relationship

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

Add the filter criteria

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


Issues with Civi Member Sync and Groups Plugin

As far as I can tell from your screenshots, Groups is either (1) not installed or (2) not configured. Here's what you should see:

Note the extra column which shows the Groups groups.


Go to search - advanced search.
In the dropdown where it says "display results as" choose "Cases".
Expand the relationships section.
For relationship type choose the case manager type (e.g. "homeless services coordinator is").
For target contact put the name or partial name of the manager.
Click search.

Another way is:

Go to the manager's contact record.
On their relationships tab look for the manager type (e.g. "homeless services coordinator is").
On the far right under the "More" link it will say "Manage case #7", and you can click that to go to that case.


I've seen this when the CiviCRM plugin directory is not actually located inside wp-content/plugins but a symlink is used instead. The solution is my case was not to use a symlink.


Can I run a Test Installation? If so, how?

I would add a few more specifics to petednz's answer, because we were in exactly the same boat a year ago. I got a free non-profit (we are the San Diego County Bike Coalition) account on Dreamhost, where I installed both Wordpress (clone of our mature website) and the latest (at that time) version of CiviCRM. This is a shared hosting account and NOT recommended for your final deployment, but it sure was a good test platform for us. If you want something more local, I also set up XAMPP environments on both a linux and windows laptop. XAMPP gives you a local Apache web server, PHP, MySQL (MariaDB), all on your laptop or desktop. That way I really couldn't break anything. Both these environments, temporary hosted website or local XAMPP website, are definitely DIY. If those are foreign to you, a CiviCRM partner would be recommended.

Having an actual hosting site like Dreamhost for the initial setup and test period was crucial if you have multiple people working on it, as you each need to have access to the evolving configuration through a browser. Now that we are fully hosted on a VPS, I still rely heavily on my local XAMPP instance(s) to test out new things and also to run updates locally first, as updating either Wordpress or CiviCRM always has the potential to zap your website. Realize that a local desktop/laptop setup, though, is only useful for ONE person.

I might add that it is quite easy to migrate/move your test configuration into a different location or different server. We follow religiously the steps at https://wiki.civicrm.org/confluence/display/CRMDOC/Moving+an+Existing+Installation+to+a+New+Server+or+Location.

I think you will love CiviCRM. We are amazed, nearly daily, at all the functionality it provides. By taking care of the administration on our own, we have saved the SD County Bike Coalition at least $5,000 annually by dropping commercial packages for contact database, transactions, mail management, event management, which all had monthly or annual fees and didn't integrate well together. The real savings, though not easily measurable but way more than the $5K material savings, was in eliminating staff time and frustration having to learn 4 different applications and constantly dealing with manual intervention because they were so poorly integrated. If your organization fully embraces it, don't forget to contribute to CiviCRM, because it does need to be supported to be sustainable.


WordPress 5.27 membership renewals failing

Looking at this url https://example.com/?civiwp=CiviCRM&q=civicrm%2Fcontribute%2Ftransact  It appears the base page is missing.
Can you look at :

make sure that the base page is set - go to https://example.org/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fadmin%2Fsetting%2Fuf&reset=1

Review the Base Page setting and value, it cannot be blank

Make sure there is a published page that matches the one in that page

If there is no value there, add one, civicrm is the default and then create a WP page with that slug

Make sure the page is public and visible to all

Once you've done that (or confirmed the base page exists) Visit this page https://example.org/wp-admin/options-permalink.php

Confirm that your permalinkls are set to anything EXCEPT Plain

If it is set to Plain change to one of the other options and save

If it is not set to plain, you can exit the page

Flush CiviCRM Caches go to https://example.org/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fadmin%2Fsetting%2FupdateConfigBackend&reset=1  and click cleanup caches

After all that is complete, try a test membership renewal.


Can I safely trim civicrm_job_log and civicrm_log?

I think you can safely trim the civicrm_job_log, only the latest entries are probably useful (and given how little information the cronjobs return, I'd even doubt that ;)

As for the civicrm_log (or subscription history), it might be more risky to remove as you will loose "useful" history of what happened with your contacts, but from a technical point of view, it shouldn't be an issue, as long as you are ok losing that history.


The membership status ID field on a membership record is a single-value field - so this isn't doable without adding the new membership statuses.  I'd recommend either a) adding the new statuses and updating your smart groups, or b) creating reports based on membership end dates to use those to follow up with members.


you should be able to do this via Find Members or Advanced Search. Use either and select your Group. Search. Select all records. Under Actions find "Record Activities for Contacts". On the next screen you should see all members of your group. And there should be an option to "Create a separate activity for each contact."


Assign civi group by membership subscription?

in principe you could do that with the CiviRules extension (which you can get from https://civicrm.org/extensions/civirules). With this extension you can set up a trigger 'new membership' (or possibly a change of membership status?), add a condition for the specific membership type if required and add an action to automatically add the contact to a group.
There is a cookbook on CiviRules on the Wiki documentation: http://wiki.civicrm.org/confluence/display/CRMDOC/CiviRules+Cookbook


There are two ways to do this in Drupal.

CiviCRM Profiles

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

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

Webform CiviCRM integration

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

Bonus: WordPress edition

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


Why are donations left as "pending" in CiviCRM when they went through in Paypal?

The way it works with paypal standard is that paypal informs civicrm that the payment has been done in the background via IPN (instant payment notification)

It means that paypal is sending information to a specific page on civicrm with the proper data (eg this payment has been successful) then your server sends these information back to a specific page on  paypal to check it's a genuine confirmation and paypal returns a page that confirms it's one

Something in the chain isn't working sometimes. It might be a firewall, your site too loaded, connection issue...

Did you check the log? are you using drupal?


Can you check if directory path and resource url is set for extension?


How can I have a fixed date membership with no rollover date?

I tested this a bit and you are correct.  If someone signs up Dec 31st they get the whole next year.  Probably the easiest thing to do is not offer a discount for the Dec.  Pay the full price and then make the rollover date Dec 1.  Yes they will get one month free but only the first time.

Probably the code should be changed so that it is greater than and not >= since the membership starts the next day by default anyway.  Or if you set the start date and rollover date the same, it doesn't give you two full periods for the price of one.


How can I find contribution pages or membership pages where Profiles are used?

If you have access to your db then you can look for the field in the civicrm_uf_field and look for the uf_group_id, then look in the civicrm_uf_group table to see which Profile it is used for, and then look in the civicrm_uf_join table to see where those uf_group_id are used. EG you may see that uf_group_id xx is used for civicrm_contribution_page that has entity_id yy


Assigned Activites not showing up on users Contact Dashboard

Maybe over complicating things a lot here. But assuming you have confirmed this isn't possible directly via 'permissions' and the users Contact Dashboard, I would try the following in Drupal. Build an Activities based Views block which uses Contextual Filter and Views 'relationships' (to get the Activity assignee) which will show the user 'their Activities'. Assuming that gives you the list you want, then add a link to each Activity in the View that jumps them to a Webform-CiviCRM with the activity ID in the URL. That might be getting you close.


Contact Names showing up on Google Search even when they are not public

I took a look at this.  The pages that listed individuals' names were pulling the Display Name for the page title via civicrm_entity.  So even when though the filtering was working correctly to not display the View, the name would still come through.  It was corrected by giving a generic title and moving the name into the View.


CiviCase - remember user choices in search filters for activities

The setting Preserve activity filters as a user preference present in Display Preferences is limited to only Activity tab displayed on the contact summary page. As of now, there is no way to save the user choices in case activity tab.

Similarly, to select Scheduled as a default option for status, you might need to write a minor customization in an extension to make it work. Either using the buildForm hook and setting default value OR using a smal js code snippet.


Attaching Email reply to a contact in Civi

See https://docs.civicrm.org/sysadmin/en/latest/setup/civimail/inbound/#autofiling-email-activities-via-emailprocessor where you can set up either a mailbox you can bcc that will add email replies to contacts, or you can set it up to pull from a specific folder in your own mailbox after-the-fact to do the same thing.
In terms of the earlier part of your question, when you say "contacts within orgs", Civi won't send to contacts who are employees of orgs, but if you set up Groups, then you can mass email to the group. See https://docs.civicrm.org/user/en/latest/email/mass-mailings-using-civimail/


It's not really an answer, but I did fiddle around with things enough to break it into working again.  I ended up dumping the DB to a backup, dropping both new columns, civicrm_price_field_value.help_pre_en_US and civicrm_price_field_value.help_post_en_US, then changing the DB version back to 4.7.9.  I then re-ran the upgrade and got a "Table already exists" error on another table.  Dumped the backup back into the DB, recreated the two columns from above, changed the version back, and now everything seems kosher for the most part.  I can add/delete/change price sets and therefore work with Events. Can't edit the broken events, but that's a leftover issue I can work around.


How to redirect user when a civicrm error message shows up?

May be 'CiviCRM Report Error' extension may do your work! The extension does have setting to redirect from error page.


Why is Civimail sending exactly 30 emails every cron run through Office365 SMTP Relay?

I'm not familiar with Office365 Relay, a quick search indicates it's for devices to send emails via Office365. It was a quick search so I may be wrong.

Given that you are only able to send 30 emails at a time and that Office365 has a 30 emails/minute limit sounds like it is something to do with Office365 not a CiviCRM setting issue.

You may want to look at a SMTP service, here's a blog post that compares some services that work with CiviCRM.


Picture selection for CiviEvent name badge - KCFinder not useable

The problem was caused by the CiviMobile extension which injected script code before the original page content and before the OnLoad event for loading the JQuery library. After removing this plugin, the upload page comes up properly.


You can customize receipt templates at Administer > Communications > Message Templates > System Workflow messages

You can find more information on CiviCRM Documentation The guides are searchable.


Have you enabled the Send Scheduled Reminders scheduled job? You can check by going to Administer > System Settings > Scheduled Jobs. Scroll down to Send Scheduled Reminders and ensure that the Enabled? box is set to Yes.

You'll also need to ensure that you have a cron job enabled for your Civi installation.


You could try creating you own extension with your own xml file that use the same path as the one you want to change.

You should use civix to create the core file of the extension. The new extension needs only 3 files :

info.xml (to be completed after civix has generated it)
yourextension.civix.php (you don't have to touch this one)
yourextension.php (only touch it if you need additionnal customization like hook call)

Then you just have to add a xml file in yourextensionpath/xml/Menu/ that contains the modified menu entry like :

 <?xml version="1.0" encoding="iso-8859-1" ?>
 <menu>
   <item>
     <path>civicrm/admin/scheduleReminders</path>
     <title>Schedule Reminders</title>
     <desc>Schedule Reminders.</desc>
     <access_arguments>administer CiviCRM;access CiviEvent</access_arguments>
     <path_arguments>action=update</path_arguments> (also tried with <path_arguments>group=scheduleReminders</path_arguments>)
     <page_callback>CRM_Admin_Page_ScheduleReminders</page_callback>
     <adminGroup>Communications</adminGroup>
     <icon>admin/small/template.png</icon>
     <weight>40</weight>
   </item>
 </menu>

After activating your extension, you may have to go visit civicrm/menu/rebuild&reset=1 to clean the cache.


LIKE search in API for membership_type_id

SQL doesn't support LIKE for integer fields. For something like membership type id I'm not even sure what it would mean unless you have 10 or more, and even then still not really meaningful.


Send scheduled reminders to relationship contact

two thoughts off the top of my head:

1: create a tag, apply that tag to the org contacts, use the tag to create a smartgroup; send email to the smartgroup

2: set a relationship between the org and individual (contact person is; is contact for) and set up a smartgroup that includes all individuals with an active relationship of that type


Turned out to be a problem with my Resource URL paths. Changed from the relative CiviCRM URL variables to absolute paths.


CiviCRM module "Group-Based Prising" doesn't work in Joomla

Can you confirm that's the correct directory for extensions by going to Administer menu » System Settings » Directories and looking at the Extensions directory listed there?  It may also need to be updated from the Drupal location if you copied the database.  If there's a token like [civicrm.files] you can click the question mark in the blue circle in the text at the top of the page to see what that token resolves to.
If the directory is correct, it's likely a file permission issue.


The culprit is often the website field which has no filters that enable you to specify which of a number should show and hence they produce multiple rows. But like others say, it could be Address, Email or Phone if you haven't specified either the location type or Primary only. Or multiple relationships etc.


How can I view queued Scheduled Reminders?

AFAIK Scheduled Reminders are not actually queued, they are selected when the Scheduled Reminders cron job runs. But if they are queued you should be able to see them in the civicrm_queue_item table.


So you have two issues, that are probably not directly connected:

1) mail() working only when 'Save & Send Test Email'
it uses a different sender (the default site email, as opposed at the one defined as the bounce mailbox)

They are various reasons so the later could fail, the most common ones are that you didn't configure properly the bounce mailbox or that your mail server prevents you to "impersonate" the bounce mailbox (eg if you use a gmail account for the bounce)

The documentation on how to configure is usually helpful, but if you can't walk through the steps, could you create a new question?

2) no smtp connection
It depends on how your server is configured, check with your host provider what is your smtp server, if it on the same box as your webserver, if it accepts local connections, or if it needs authentication.

if you really have the same error message when you put localhost, try 127.0.0.1, if it works, you might have another problem (wrongly configured dns on the server), because localhost must be seen as a valid address (ie. I was expecting a different error message)

Lastly, what hosting provider are you using? if you went for a "low cost" option (ie. less than 5$/month) you often have providers that actively prevents you to send mass emails and you will spend way more struggling with your server than the cost of switching to a more mass mailing friendly.


It turned out to be a user mistake. The members were included wrongly in the smart groups because of a parent / child issue.

  XXX is included in these Parent group(s) based on belonging to
  group(s) which are their children.


The library in use in civicrm is not language aware. Here's a patch that is working for me on 5.27:
diff --git a/packages/recaptcha/recaptchalib.php b/packages/recaptcha/recaptchalib.php
index 78d2b14..c869a09 100644
--- a/packages/recaptcha/recaptchalib.php
+++ b/packages/recaptcha/recaptchalib.php
@@ -114,7 +114,8 @@ function recaptcha_get_html ($pubkey, $error = null, $use_ssl = false)
         } else {
                 $server = RECAPTCHA_API_SERVER;
         }
-
+        $locale = CRM_Core_I18n::getLocale();
+        $server = $server .'?hl='.$locale;
         $errorpart = "";
         if ($error) {
            $errorpart = "&amp;error=" . $error;


I found out the issue. The reason that some of them were read only and some weren't was due to a bad import. It seems like the Contacts that were having those issues, had more than 1 empty Supplementary Addresses. There would be 1 Main Address with it geocoded and filled in, but there would be like 4 empty address entries. Removing all the invalid supplementary addresses fixed the issue. Not too sure why those addresses would mess up the results but hey, at least it got fixed!


Custom Search Problem - Unknown column contact_a.id in field list when tagging returned contacts

I just tried to reproduce the issue in 4.6.11 and wasn't able to; though, it's possible I didn't pick the "correct" criteria.  I know there has been some work done on the dynamically created sql, which this is, in more recent releases that might have fixed the issue.  I suggest you try to reproduce it in one of the demo databases.

When I've run into things like this before, sometimes, though not always, I can get around the issue by running the query, creating a smart group out of it and then doing an advanced search with the only criteria being the contacts are in that smart group.  Then doing the tags or whatever with that resultant set.


Why is the field "contribution_id" in "civicrm_line_item" sometimes NULL

For every contribution, a line_item is being created. The contribution_id field is the FK reference to the civicrm_contribution table.

If I manually delete the Contribution record related to the Contact, the contribution gets deleted from civicrm_contribution table, which results in contribution_id to be NULL in civicrm_line_item.


Cannot submit form on CiviCRM 4.7.7, might be related to CRM-18510?

This looks likely to be the same underlying problem as the issue described in CRM-18510. There's a fix referenced there: https://github.com/civicrm/civicrm-core/pull/8317 . If you test this out, do report your findings here and on CRM-18510 . Hope it works for you.

Regards,

Dave


Duplicate users being created by... something!

This was resolved by removing the user's current employer, saving the record, and then re-adding the current employer.  Seems potentially to have been some problem around the cascading membership?


Currently, you can't do this. If you try, you will get the notice:

  API (CustomValue, delete) does not exist (join the API team and
  implement it!)

This is true for CiviCRM version 4.7.7, which is current at time of writing.


Negative searches: volunteers WITHOUT relationship to supervisor

CiviCRM is good at doing searches for a "negative" when it's, "find an empty field"; you can use Search menu » Search Builder for that.  However, for finding whether someone is missing an Activity, Relationship, etc. you need a custom search.  By default, CiviCRM has such a custom search for groups and tags, but not relationships.

Until someone writes that search, here's the workaround:

Do a search with no criteria, which will return all your contacts.  Create a smart group from this search called "All Contacts".
Do an Advanced Search for folks that DO have the supervisor relationship.  Create a second smart group called "Volunteers with Supervisors".
Note: If not ALL of your contacts are volunteers, then modify both of the searches above to only search the "Volunteers" group.
Go to Search menu » Custom Searches.
Click Include / Exclude Search.  On older versions of CiviCRM, this is called, Include/Exclude by Group/Tag.
For "Include Groups", select "All Contacts".  For "Exclude  Groups", select "Volunteers with Supervisors".

The search result you get back is the list of "All Contacts" minus "Volunteers with Supervisors" - which should be volunteers without supervisors.  You can create a smart group out of it so that less data-savvy users can just use the new smart group to generate the list.


Call to undefined function getRequiredMarker() - CiViCRM

I found the issue:

It is because of asp_tags extension. Need to turn off it.

Either turn off it from php.ini file(globally disable)

OR

by putting this line in .htaccess file(locally disable)

php_flag asp_tags off


Webform civicrm Conditionals not working

webform conditionals is native to D7 webform module - and independent of webform civicrm module.

If conditionals for D7 webform module are not working as expected you may have some javascript issues on your site. Look in the browser's console to check for errors.

If your test system is using a different front end theme and if admins with permissions are able to use admin theme - then it's very likely that your javascript issues are inadvertently caused by your front end theme. Perhaps it requires jquery update module e.g.?


The example calls $result = civicrm_api('UFMatch', 'get', $params); to get the Drupal user id that it passes to user_load() to get the rest of the  user info.

If you just want the id then it is the value being passed to user_load():

$result['values'][0]['uf_id'])


Guidance Request : SSO between CIviCRM & WordPress!

If you moved CiviCRM over to WordPress (same instance) you would have no problem, but as you have been running on Drupal for some while I expect that you'd have to change various things and it would change the user experience a bit so probably not the route you want to take.


CiviCRM Entity Tags does not appear in Rules

Try this:

{ "rules_self_create_user_account_and_login" : {
"LABEL" : "Create User Account",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [ "civicrm", "rules" ],
"ON" : { "civicrm_entity_tag_create" : [] },
"IF" : [
  { "NOT civicrm_entity_user_exists" : { "civicrm_contact" : [ "civicrm-entity-tag:entity-id-contact" ] } },
  { "data_is" : {
      "data" : [ "civicrm-entity-tag:entity-table" ],
      "value" : "civicrm_contact"
    }
  },
  { "data_is" : { "data" : [ "civicrm-entity-tag:tag-id" ], "value" : "XXXX" } }
],
"DO" : [
  { "civicrm_entity_action_create_user" : {
      "USING" : {
        "civicrm_contact" : [ "civicrm-entity-tag:entity-id-contact" ],
        "is_active" : "1",
        "notify" : "1",
        "signin" : "1",
        "username_format" : "email"
      },
      "PROVIDE" : { "civicrm_user" : { "civicrm_user" : "Created Drupal User" } }
    }
  },
  { "redirect" : { "url" : "civicrm\/user?reset=1" } }
]

}
}

set XXX to be your Tag ID

EDIT (thx to jackrabbithanna) Make sure Entity Tag is enabled here: admin/structure/civicrm-entity/settings


Auto-renew option not appearing for membership

Chris,

I just tested this on my site, and you're right.

If you have the "Pay Later" option selected, the auto-renewal checkbox does not appear.

The checkbox should always appear, and then when the page goes through verification if 'Pay Later' is selected, and the 'auto-renew' box is selected, that should throw an error to the user.

I've created an issue report on this:

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


form to unsubscribe from a newsletter but from all

You should be able to do this by directing folk to eg  www.yourdomain.org/civicrm/mailing/subscribe and if you have your Mailing List groups set up correctly (ie as public) then they should be able to unsub.

for folk using Drupal you can also do this via Webform

also review instructions at https://docs.civicrm.org/user/en/latest/email/set-up/


This sounds something wrong with the Drupal Rules module. Did you try to upgrade the Drupal Rules module as well


civiCRM Cron only run one mail_report scheduled jobs?

You have to create 3 instances of the mail_report scheduled job.

To do that, use Add New Scheduled Job button on the Settings - Scheduled Jobs page (civicrm/admin/job?reset=1)

On the creation page, set API call to Job / mail_report (api.job.mail_report) and define in Command parameters the appropriate instanceId and format options.


To use a hook, you can:

Write a CiviCRM extension.  This is the preferred method.
Write a Drupal module.
Write a Joomla or Wordpress plugin.

The easiest way to write a CiviCRM extension is to install civix and run civix generate:module org.myorg.myextension.  Then you can edit myextension.php and paste in that code.

However, as that page says - this presumes that you have a basic knowledge of PHP, Unix, and object-oriented programming.  If that's not a skill you're going to learn today, and you want to cheat a little - take an existing extension and hack it!  Download an existing function, preferably one that does very little, and modify it to your needs.  I just uploaded an extension to Github that fits this need exactly here.


How to change the date on an exported batch

A financial batch once exported cannot be reopened through UI. But you can reopen/update a batch using a api.

If you want to change only title of the batch than i would recommend you to change the batch only title using api rather reopening the whole batch.


Why am I getting Javascript errors/ unable to save when creating a new mailing?

Got rid of WP Super Cache and Wordfence. No longer getting the errors. Thanks for the help tho!


help needed in importing multi value custom fields

Not sure but I don't think you can import both the records in a single go. You might need to create two csv file with each value(B.Tech and BBA) of the custom field and import it one by one.


Is there a way of removing 'View' from event reports

This is a bug.  In replicating it I saw it was easy to fix, so I did.

See the bug report here: https://issues.civicrm.org/jira/browse/CRM-19782

If you don't want to wait for this to be incorporated, you can patch your CiviCRM using the fix here: https://github.com/civicrm/civicrm-core/pull/9546/files


Civivolunteer won't show link unless logged in as admin

Solved,
Be sure to set permissions in Administer > Users and Permissions.
Check all roles you want to access volunteer opportunities at CiviVolunteer: register to volunteer and CiviCRM: access AJAX API


Check the new release, I think it has a fix included for this issue: https://civicrm.org/blog/yashodha/announcing-civicrm-4619-and-479-release


Where can I download the latest version of CiviCRM?

You can always find the latest version on the CiviCRM website, or on Sourceforge. If using the Sourceforge link, there is a direct link to the latest version (Drupal) (others who may be interested in other CMS's can select the version for an alternate CMS):

(per @petednz) It is a good idea to double check that you are getting the latest version if you use the big green "Download" button as occasionally that button lags behind the latest version slightly.


Count data for smart groups is not currently calculated

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


Admin-generated receipts show server name in email 'from' field

This is now fixed and should be part of next release hopefully. You may wait for next release or apply patch manually from here.


What are the advantages of a multi-site installation?

CiviCRM multisite allows you to have several organizations sharing the same instance of CiviCRM, but only a superuser can see the data across all sites.

The most common example is an organization with multiple chapters.  You mention your organization is active in different countries.  If:

You require that users from country A not be able to see contacts entered in country B;
Users in a "head office" need to see contacts from multiple countries in a single place;

Then multisite is for you.


Unable to Connect to MailStore for Bounce Processing

A common issue is to have missing php extensions, are you sure your php has imap extension enabled?

(the command to install it depends on what OS or distrib you use).


WordPress w/ CiviCRM - Using Gutenberg in CiviMail

HTML email is a bear, even with templated services like MailChimp. For that reason Civimail will not be compatible with Gutenberg. Why? Because most HTML5 editors are not compatible with email-style HTML. In order to ensure that an HTML email looks pretty much the same for all users across platforms, you end up having to use old-school borderless tables with styles embedded in the HTML. Style sheets and divs simply don't translate to email because html mail protocol is still over a decade behind browser html technology. Develop a simple html mail template with borderless tables and embedded styles. Make the template a fixed width of 500px. Even more critical is whether the email has images embedded or stored on your site, but that's beyond the scope of this response.
Frankly, younger users eschew email altogether at this point. You're better off creating a short text, twitter or instagram post with links to a news or newsletter post on your WP site. Of course your post on the WP site itself would be Gutenberg friendly.
Edit: Of course you could also go with an extension like CiviCRM Mosaico as Fabian suggested above. ;)


Get or generate a contact checksum via API?

I have never seen the checksum available in the API.

I have successfully obtained it programmatically though with code similar to:

$cs = CRM_Contact_BAO_Contact_Utils::generateChecksum($contact_id);

(This snippet is adapted from core code in CRM/Utils/Token.php)


Why would bounce processing put all emails into CiviCRM.ignore mailbox?

It looks like CiviCRM uses the domain specified in the bounce mailbox settings to generate a regex to match incoming bounce messages.

From the info in your question, I suspect CiviCRM is directing bounces to a (subtly) different domain name. As a result, it doesn't think the bounces are intended for CiviCRM to process, and moves them to the ignored folder (as CiviCRM would with other "not for me" email).

See your mail account settings (Admin > CiviMail > Mail Accounts).

Try ensuring both the return address and site domain match, and see if the problem persists.

Once correctly configured (or, temporarily misconfigured to match the misspelled inbound address!), you can move those messages back from the CiviCRM.ignored mailbox to the INBOX, and re-process them.


API vs GUI language code inconsistency or how to best use ISO 639-3?

First I needed to find a source of ISO-639-3 to import in MySQL. I found this one at the SIL website
I used phpmyadmin to import the table, used \t as column delimiter and used iso_639_3 as table name
I used phpmyadmin to discover that (in my case?) the language option_group_id equals 78. Just search for a language for instance Dutch and you will find the row with the value.
Knowing this value you can now delete all default language options:

DELETE FROM civicrm_option_value WHERE option_group_id = 78
Alternatively you can also deactivate them:

UPDATE civicrm_option_value SET is_active=0 WHERE option_group_id = 78
I used this query to import all languages in active state:

SET @weight := 0;
INSERT INTO civicrm_option_value ( option_group_id, label, value, name, weight, is_active )
SELECT 78, Inverted_Name, Id, Id, (@weight := @weight + 1 ), 1
FROM iso_639_3
ORDER BY Inverted_Name ASC
Alternatively I found that this query allows me to import all iso-639-3  options but only a subset activated:

SET @weight := 0;
INSERT INTO civicrm_option_value ( option_group_id, label, value, name, weight, is_active )
SELECT 78, Inverted_Name, Id, Id, (@weight := @weight + 1 ), (SELECT Id IN('nld','eng','fra','deu','ita','por','spa'))
FROM iso_639_3 iso
ORDER BY Inverted_Name ASC


Since upgrade, dompdf.php is presenting a security risk?

You can (and should) resolve this by removing that dompdf.php file from your system. It sounds like the previous version codebase was not removed during your most recent upgrade.

CIVI-SA-2015-001 was a security release which removed dompdf.php from the CiviCRM installation, as it permitted attackers to read arbitrary files from your webserver. This permits an attacker to retrieve the contents of files they would not normally be permitted to view - even system configuration files.

CiviCRM upgrade instructions advise to back up and then delete previous version code files before installing the new CiviCRM codebase, since leaving old code files in place may affect the behaviour of CiviCRM (and in cases like this, the removal of a file is the fix required).

A full list of recent CiviCRM security advisories is available at https://civicrm.org/advisory, and CiviCRM site administrators should sign up for security upgrade notifications


CiviCRM database issue with views and the definer

It is possible to recreate the views using the following script. (It also recreates the triggers and stored functions that can have the same problem

<?php
   civicrm_initialize();
   Civi::service('sql_triggers')->rebuild(null, false);
   CRM_Case_BAO_Case::createCaseViews();

Run the script with drush scr <script.php>


Where do Custom Fields for Contributions appear?

They should appear at the bottom of your contribution form, like so:


How to make a daily bithday report at morning?

My guess is you have a cron job scheduled to do this. See https://docs.civicrm.org/user/en/latest/initial-set-up/scheduled-jobs/#timing for how to adjust your timing.


allow anonymous users to view profiles in WordPress?

Go to CiviCRM's **Administer menu » Users and Permissions » Permissions
(Access Control).
Click "WordPress Access Control".
In the "Anonymous User" column, check "CiviCRM: profile view".
If your profile contains custom fields, check "CiviCRM: access all custom data".
Press "Save" at the bottom of the page.

Note that this is a quick-and-dirty approach that assumes you're OK with ANY profile being accessible by anonymous users if "Standalone Form or Directory" is checked.


Where does the content of a bulk sms get stored?

I figured it out.

It is stored in the table civicrm_mailing as body_text or body_html


CiviCRM periodically rebuilds triggers, and when doing so it drops ALL existing triggers - see \Civi\Core\SqlTriggers::rebuild().

One solution to this may be to create an extension which adds your custom trigger to the list which CiviCRM will generate when performing this task. That way your trigger will persist through CiviCRM's schema rebuilds. See hook_civicrm_trigger_info() for this.

Another may be to configure that custom field to be an auto-increment or calculated value. I thought there was a way to add incrementing fields directly via the CiviCRM interface, but the only method I see on a local test site is setting the value to "View only" then populating it from PHP. You could implement equivalent functionality to the trigger above from a custom extension, perhaps hook_civicrm_post() will suit your needs for this.

Generally, it's only recommended to interact with CiviCRM's schema via the API interfaces CiviCRM provides. The application defines (and redefines, as you've discovered!) the underlying data structures, and directly modifying the database (at least, the tables belonging to CiviCRM) can have unexpected results.


How do I add CiviCRM Activity attachment to View

I attended a session yesterday at CiviCon (https://denver2015.civicrm.org/sessions/civicrmdrupal-integration-showcase; the slides are up already) about exposing more Civi tables to Views.

CiviCRM Entity 1.x might display the table you need.  CiviCRM Entity 2.x-dev most definitely will.  (https://www.drupal.org/project/civicrm_entity)  The session slides have lots of details on installation and use.

A sandbox module is also available to expose the Civi tables to Views (https://www.drupal.org/sandbox/markusa/2474103).

The inherent (edited) difference is the sandbox module is just exposing the data to Views. The CiviCRM Entity module will make Civi data available to all of Drupal as entities.


I looked in CRM.config to see if there was a helpful variable, but there isn't.  I think you need to add this variable via PHP.

From the CiviCRM Javascript Reference on Server-Side Variables:

In PHP:

$config = CRM_Core_Config::singleton();
CRM_Core_Resources::singleton()->addVars('myNamespace', array('extensionsUrl' => $config->extensionsURL));

In JS:

src = CRM.vars.myNamespace.extensionsUrl + "/images/myimg.png"


Changing our contact email address in Event Templates

I assume the email address you are referring to is on the location tab.  If so, the assumption is a location has a fixed email address.  When you change the email address on a location it changes it everywhere that location is used.

So you need to create a new location.  Unfortunately, location appears to only look at the address part so if you create a new location with the same address as another but a different email or phone number, it doesn't create a new address.  It just updates the existing address.

The work around is to make the address part different.  I'd suggest using the Supplemental Address 1 to indicate who the coordinator is.   You could simply put their name there or something like Event Coordinator: Name or Attn: Name.


Backbone isn't loading on Civi 4.6.11/WP 4.4.1

I think that when I had this it was caused by a theme loading a newer version of Backbone. Can you dequeue the script in that theme's functions.php? And try queuing the Civi version direct? Admittedly a bit of a long shot.


Use an extension's templates dir

Creating a simple extension via civix provides a templates/ directory in the extension. This is searched before the default templates, so you can intercept and provide your own.

If that doesn't go far enough & you want to dynamically select a template (eg replace Form.php, but only when foo=123), these options are available:

Use CiviCRM's hook_civicrm_alterTemplateFile()

Alters template files, based on the form & form data. This is something you'd do in an extension or CMS module. (Function signature refers to $form, I'm not sure what this will mean if you're rendering a page.)

Nest templates

Copy the default template Foo.tpl to your custom (or extension) template dir as Foo-default.tpl and Foo-123.tpl, create a wrapper Foo.tpl which uses Smarty to insert the correct template based on your criteria.

This last method can be done without creating a custom extension.


Users with Case roles cannot edit activities assigned to them: is this a bug?

I've posted a preliminary fix in JIRA.

Joseph


WordPress Cron Events for running scheduled jobs on CiviCRM

In CiviCRM  go to Administer > System Settings > Scheduled Jobs

https://docs.civicrm.org/user/en/stable/initial-set-up/scheduled-jobs/
https://wiki.civicrm.org/confluence/display/CRMDOC/Managing+Scheduled+Jobs


How to include source page URL in donation page email receipt?

I think the short answer must be "no". Once the client is on a CiviCRM page, there are usually a few clicks before you get to the email receipting code, so at that point, there wouldn't be any record of the referrer (unless you have some code that is saving it).

There should be a way to construct at least one version of a contribution page url, if you have that in your smarty variabloes, using the contribution page id, like:

https://yourdomain.org/civicrm/contribute/transact?reset=1&id={contribution page id}

There's probably a way to convert that to a wordpress shortcode if you're smarter than I am about such things.


Embed webforms into site that is custom php

CiviCRM standalone profile forms can be embedded anywhere. They are just cut-n-paste html snippets.
http://book.civicrm.org/user/current/organising-your-data/profiles/


CiviCRM is very flexible. The current (4.6) core integrates simultaneously with Drupal 6 & 7, Wordpress 4.x, and Joomla 2.5x & 3.x. With a few tweaks it can even work as a standalone app without any CMS.
Could it work with Backdrop? Undoubtedly yes, and it might even be as easy as you suggest. Will it be released with a Backdrop version? I think that's up to everyone. If this is a priority for the community, then it will be a priority for the community.
UPDATE: Take note of CRM17711 on Jira for this topic ("Add Support for Backdrop")
UPDATE2: Backdrop support is officially in place, with a stable download and its own installation page on the Wiki.

The Backdrop team has been working together with Tim Otten to provide support for Backdrop CMS within CiviCRM.
As you may know, Backdrop is a fork of Drupal that maintains most of the APIs of Drupal 7 while providing new functionality like configuration management, more powerful layouts, and built-in Views in core. Backdrop is trying to bring down the cost of ownership by shifting Drupal's backwards-compatibility approach. Drupal basically commits itself to drastic changes every few years, while Backdrop is committing to a more WordPress-like approach of minimized API changes while providing new functionality.
Backdrop's primary audience is budget-restrained sites; putting us in the SMB, education, and non-profit space. Basically, the same we hope as CiviCRM. Supporting Backdrop would be a great way to bolster both projects.
As Backdrop is so similar to Drupal 7, we expect the porting to go fairly quickly, though it may result in a lot of similar code to the existing Drupal integration. Considering Backdrop (or Drupal) may diverge further in the future, it's likely that adding Backdrop as a new top-level CMS (e.g. the same as WordPress or Joomla) would be a better long-term approach for maintenance.


Relationship type id stored in the wrong custom group column?

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

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

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

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

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

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

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

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


Contributions- on behalf of existing organisations only?

If you are using Drupal you could potentially set this up using webform-civicrm since that allows you to set the Organisation fields to require it to be an existing contact.
For Contribution Pages in general, the 'on behalf of' works on principle that an individual is signing up and registering that the membership belongs to the Organisation. I am not sure that maps so easily to a situation where the administrators are doing all the work, which is what i understood from your description.


When reinstalling CiviCRM, it will not allow connection to a database with preexisting data

You'll need to use mysql or phpmyadmin or equivalent to run sql/civicrm_drop.mysql. You may also need to manually remove the civicrm_install_canary table.

What it's technically complaining about is that you still have data in the civicrm_contact table.

UPDATE for more instructions using phpmyadmin: On the Import tab browse for the sql/civicrm_drop.mysql file and then click the Go button. You won't be able to browse on the server, so you'll need a copy of the civi download unzipped on your machine to browse for it.

To drop civicrm_install_canary, go to the SQL tab and enter DROP TABLE civicrm_install_canary and click Go.


when upgrading should i delete all files AND all folders in templates_c directory?

Yes also the en_US subfolder. Actually especially that folder, since that's where the precompiled files get stored.

You can also use the menu option under Administer -> System Settings -> Cleanup Caches, which will do it for you.


Why is Activity statuses Scheduled and Completed added?

This is a bug and has been reported here

Note, it closely resembles other issues affecting 'Edit Smart Criteria' eg

Tags (affects only 4.6.x but not 4.7.x) and
Privacy Radio Buttons (affects 4.6.x and 4.7.x)


Where can I find information about CiviCRM?

Thanks for your interest in CiviCRM.

As Peter says, a good place to start is to read the documentation.  I would also suggest that you look at the CiviCRM website if you haven't already done so.

To answer your specific questions:

Anyone can implement a CiviCRM system.  The software is open source and feely available to download.  However, it does require a reasonable degree of technical knowledge to do so.  For this reason many organisations choose a partner to do this for them.  You will see that there are partners around the world.  But, if you want to do it yourself read the Installation guide.
CiviCRM is used by more than 10,800 organisations including the Wikimedia Foundation, Amnesty International and the UK Green Party. Take a look at the many case studies to see some examples.
I would suggest that you try a web search for comparisons with other CRM systems.  Whether it is suitable for your organisation depends on how you would use it.  It is difficult to comment on this without more detail about the needs of your organisation.
CiviCRM is specifically designed for the needs of non-profit organisations.  But there is nothing to stop it being used in other sectors and much of the core functionality would be appropriate for any organisation that is looking to manage contacts.

I hope that helps, but please post again if you have more questions.


Civimail & Drupal Multisite -- tracking url looks in wrong location for civicrm.settings.php

KEY thing is that when you have a Drupal multi site config - make sure that each civicrm is in its corresponding /sites/example.com/modules

You can structure that too: put your CiviCRM versions in one central place eg /var/www/ so you have a civicrm/4.6 a civicrm/4.7 etc - then add a symbolic link in each projects /modules directory to the /var/www/civicrm/4.x version it's on.

This way you can now easily update both minor Drupal and minor CiviCRM versions across all your sites/projects!

EDIT: example:
in /home/karin/org.ca/modules

  lrwxrwxrwx.  1 karin karin    20 Jan 15 13:37 civicrm ->
  /var/www/civicrm/4.6


How do I use import and export php classes with aegir?

To execute a PHP script in the context of a selected site, use drush php-script or drush scr.

In your question you specified the site using -s example.org, and I suspect you may be looking for -l (--uri) rather than -s (--simulate) to determine which site to load. See the first section of drush help output for these flags.

If -l doesn't do it, you can also use aliases which Aegir automatically creates for each site - you should find that drush @example.org vget site_name works and returns the name of the expected site, because there will be alias files in eg /var/aegir/.drush/EXAMPLE.ORG.alias.drushrc.php for each site.

So, you probably want something like: drush -l example.org scr /path/to/export.php

If drush vget site_name returns the name of the expected site, you've confirmed Drush can connect to Drupal.
If drush cvapi Contact.get returns contacts from your site, you've confirmed that CiviCRM works when called via Drush.
If drush scr import.php or drush scr export.php still don't work, that sounds like those scripts don't bootstrap "normally" for CiviCRM and there may be work to do to get them to behave.

I don't actually know how import.php/export.php are expected to behave - so I might have led you astray. Looking at them, I'd expect export.php probably works via Drush, but I see import.php is looking for $_GET['file'] which Id' expect to require special treatment for Drush use (but I see this SE answer says it works using --file=blah.csv, and that you should call them via php import.php not drush).


After looking Civi log it seems that problem is with civicrm_uf_group.frontend_title field. I would suggest you to do incremental upgrade i.e

Upgrade CiviCRM to 4.6.x to 4.7.30
Upgrade CiviCRM to 4.7.31.

  On a separate note make sure you disable all the CiviCRM extension or
  wp plugin and also disable wp post or pages that have CiviCRM profile
  shortcode before upgrading.

HTH

Pradeep


Is there a way to preserve existing data when importing into multiselect and checkbox fields?

Depends on how you define non-manual. Only non-technical I know of is

import just the cid, add to group as part of import, then export
do a vlookup, and get your new data and old data for those fields on same spreadsheet
use CONCATENATE to combine your new 'option values' with the existing 'option values'
do import


if you are using Drupal - and you aren't needing to use clever "enter the book number and have all the details pulled in from external software" when adding a new item to your library, then i could see a relatively easy path of making each item a node, using unlimited group of fields to track 'out date, in date, person'- and use civicrm entity 'contact reference field' to track which civi contact has the item

and do the rest with views and webforms

there is also https://www.drupal.org/project/library but it may be as much effort as building from scratch imo


The form validation hook:
http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_validateForm

When you say "until it has passed through...", in the hook you could look up the prior activity revisions.


Error Could not find valid session key wordpress

I'm no WordPress expert, but my reading of the codex is that wp_update_user() will remove cookies for the logged-in user. The docs say it "Uses: wp_clear_auth_cookie()".

I would try to do the same with wp_insert_user() instead, it says in the codex that this can update OR create new users.


The iATS extension is not CMS specific. If you’re running into issues you can post in the issue queue: https://github.com/iATSPayments/com.iatspayments.civicrm
and we can try help you out there.


Can Civirules differentiate between 'pending' and 'added' group status?

You should add a Field Value Comparison condition.  This lets you only fire the rule if a field has a certain value.
For Condition Parameters set the following values:
Entity: GroupContact
Field: Group Contact Status
Operator: is equal to
Compare value:Added


Disclaimer, as with other answers, this is aimed at a fairly technical person who kinda understands what they're doing and has made lots of backups :-)

As Sophie points out you can find the exact problem looking at the latest log in the ConfigAndLog directory.

For several of us the problem has been that there's a key defined incorrectly and the script's current response is to try a CREATE INDEX... statement, but it already exists, so it fails. Furthermore dropping this index with a simple DROP KEY <keyname> ON <table> .... cannot be done where a foreign key (FK) depends on having an index on those columns, as pointed out by Aidan

Temporarily disabling FKs can be problematic. The way I got it up and running was as follows:

Run the fixer, either from the status page or (for drupal users) with

drush cvapi System.updateindexes

If it didn't work, read on.
Inspect the latest file in ConfigAndLog to find the table where it died. In my case this looked like

CREATE UNIQUE INDEX UI_case_contact_id ON civicrm_case_contact
(case_id, contact_id) [nativecode=1061 ** Duplicate key name
'UI_case_contact_id'

So it's the UI_case_contact_id key that's the problem here.
Attempt to delete that key, if this works you can go back to step 1.

drush civicrm-sql-cli
MariaDB [your_db]> DROP INDEX UI_case_contact_id ON civicrm_case_contact;

If deleting the key fails due to a FK constraint, e.g. like this:

ERROR 1553 (HY000): Cannot drop index 'UI_case_contact_id': needed
in a foreign key constraint.

Then create the same key with a different name - copy the definition from the error message in (2), e.g.

CREATE UNIQUE INDEX my_temp_key ON civicrm_case_contact
(case_id, contact_id);

You should now be able to go back to step 3 and successfully delete the original key since now the FK can depend on your new key called my_temp_key.
Re-run the updater, hopefully it's ok  (on that table/key at least) now. If so you can then delete your my_temp_key with

DROP INDEX my_temp_key ON civicrm_case_contact;

Nb. Several of us have had this part fail. This means the update script has not created the index for some reason. If this happens I'd advise it would probably be best practise to reissue the original CREATE INDEX command from the log (step 2 above), then you should be able to drop your temporary key ok. This way you leave the schema exactly as CiviCRM expects it to be, which is definitely going to be helpful in the long term.

I put this solution together standing on the observations shared by others credited above, just thought it might be useful for me to spell out a step by step process. :-)


Normal to have API error while saving a Case Type?

No, not normal. And not, AFAIK a known error. In order to make sense of something like this devs usually need debugging information. There is error output in the log files in the ConfigAndLog directory - on drupal sites this will usually be in sites/default/files/civicrm/ConfigAndLog


Removing Membership Status Message on Front End Webform

I suggest you disable the membership types you are no longer using in your system (per Pete's suggestion in the comments).

I've just patched webform_civicrm to ensure it takes this into account, so it will no longer display messages about disabled membership types. That will be included in the 7.x-4.16 release, for now you can upgrade to the -dev version of the module to get this new functionality.


How to add extra text field in Civicrm Contribution page?

You can create custom field from civicrm UI and add that field to your contribution page.


How do I get CiviCRM working with varnish on wordpress?

A big part of the pages in civi are not public, so as you might serve different pages to every user, they can't be cached.

But I think your problem is elsewhere, if you are "alone" on your admin pages, it should not be slow, even without varnish

Have a look at the demo pages, are you experiencing the same speed on your server? if not, there is something wrong in your install, and I'd fix that, so you do not need varnish

X+


It's tempting to discard this question as being too vague to give an accurate answer to, but capacity planning is a real and difficult challenge.

Is CiviCRM resource intensive?  That depends what you compare it with - compared to a static site, yes.

A CiviCRM site with a few users occasionally looking up a contact needs far fewer resources than one with hundreds of users using it all day long for complex reports.

Are your multiple sites likely to have similar workloads?  Will the sites be used concurrently?  What virtualisation/containerisation are you using?  What memory requirements are there besides Civi?  What other resources might be contended - like network bandwidth or storage?

You could look at the specs offered by the various CiviCRM hosting providers and see what configurations they have arrived at based on their experience of hosting a large number of mixed sites.  If you search this site you will find a few recommendations of 2GB for a VPS.

There are some critical limits, eg if the php memory limit is too low then processes abort, but mostly things "go slow" rather than fail if you try to put "too much" on a server so determining how many sites you can put on your box involves understanding acceptable performance.

In practice, you probably just need to try it and see.  Monitor your resource utilisation and perceived performance and see what effect adding another site has.

Alternatively, use a hosting provider and pay them to figure it out :-)


Is it possible to do geocoding in cronjob only?

I suspect you can pass skip_geocode to the params of 'fixAddress' a number of ways (such as injecting it with tpl override or javascript).

Check CRM/Core/BAO/Address.php line 381-382.

// check if geocode should be skipped (can be forced with an optional parameter through the api)
$skip_geocode = (isset($params['skip_geocode']) && $params['skip_geocode']) ? TRUE : FALSE;

Leave geocoding enabled so the cron process completes it, but it is skipped when accessing via web.


Installation error for CiviCRM in Wordpress

The link that is supposed to provide a solution for this is broken...on this page:

https://docs.civicrm.org/sysadmin/en/latest/install/wordpress/

If you are on a Windows machine and get the message "The user account used by your web-server needs to be granted write access to the following directory in order to configure the CiviCRM settings file: C:/wp-content/plugins/civicrm/" even after changing directory permission in
Explorer, see:

http://forum.civicrm.org/index.php/topic,5056.msg23720.html#msg23720


Adding barcode in Event confirmation email

I just found this forum post : https://forum.civicrm.org/index.php?topic=23767.0 which seems to propose a solution based on a old version of CiviCRM but the method is still valid in principle :

either using an existing service on the web (https://developers.google.com/chart/infographics/docs/qr_codes?csw=1) or configure your own that generate a QR code image
calling the url from within the src image in your template : <img src="https://chart.googleapis.com/chart?cht=qr&chs=120x120&chl={$participantID}&choe=UTF-8" alt="Ticket ID: {$participantID}">


Permission errors when embedding civi-event on home page

You should take a look at the permissions of the CMS CiviCRM runs on (e.g. Drupal). You need to grant anonymous users the permission to "register for events" and probably also "view event info".

Maybe you could also add your CiviCRM version as well as the one of your CMS.


The easiest way to do this would probably be to add a teeny script to the page footer of your webform that does:

CRM.$.fn.crmSelect2 = function(){};


CiviCRM 4.7.4 (Joomla version) contains Drupal version of civicrm.config.php

It does look like Joomla should be excluded from having civicrm.config.php generated for it. So you might try moving that file away from the directory it's in - keep a backup in case! - and see if Joomla "comes right".

If this fixes the problem for you, the issue should be reported to the CiviCRM bugtracker @ https://issues.civicrm.org/

You might also look back at older CiviCRM downloads (eg Joomla for 4.6.10) and see if the civicrm.config.php was recently added to the Joomla zip.


I had recently looked into this for our website, so I think I can answer this question.

First, it is important to understand what this is.  It is not accepting PayPal through Authorize.net, which is what it sounds like.

What happens is you setup a PayPal account for your organization, and then you link it to your Authorize.net account.  That linking though is only for a record of transactions.  The funds collected through PayPal never make it to your Authorize.net account.  So you are left with money in your PayPal account that you still need to manage.

The only thing this is good for is consolidating records, as all of your PayPal transactions will be recorded in your Authorize.net account along with your Authorize.net transactions.

For us, that was not worth it.  If that is a benefit for you folks this sort of setup could work well.

Let me know if you have any more questions, or if you need me to clarify anything for you.


How would I view an attachment PDF that is attached to a contact activity, through the REST API?

I think you're right. The table that links attachments to what they're attached to is civicrm_entity_file, and the table with details of the file itself is civicrm_file. In 4.4 (and indeed 4.6 and 4.7) the former has its own DAO but isn't its own API entity.

If you want to get details of the attachments on some entity, you might need to write a custom API function wrapping CRM_Core_BAO_File::getEntityFile.

One way you can present a link to the user to download the attachment, is /civicrm/file?id=<file ID>&eid=<activity ID>, but they'll need the 'access uploaded files' permission. On Drupal (I don't know about roles and permissions in Wordpress) this means they'd either need to be actually logged into Civi with a role that has that permission, or the permission would need to be granted to anonymous users, which would mean anybody could grab any attachment by guessing the numbers.

Another way you could allow your app to download an attachment is to write a custom API that base64-encodes the file contents and includes that in the API result.


Adding Facebook tracking pixel to contribution confirmation pages

You can add the code using one of the below method

Use buildform hook to add JS code using region method.
Add pixel code in CRM/Contribute/For/Contribution/ThankYou.extra.tpl in your custom template directory.

Note: Won't be difficult to make it generalized for each contribution page and also have it extended to event registration.


It's not a perfect solution, but to help declutter you could create an "Admin tags" tagset and make all the admin tags children of that one. They'd still be available to the non-admins but wouldn't be in the regular list of tags -- they show up as an autocomplete field underneath:


Have you connected a contribution page to your webform? via the civicrm tab and within that the contributions tab.

If so then you need to set up the contribution page to send a receipt.

If you don't have a contribution page connected and you don't need one then you might like to consider using Webform Emails found at /node/#/webform/emails to send your emails


Configuring cron using wp-cli on local server with Mamp Pro

Here's an example wp-cli command I use that works:

/home/ubuntu/wp-cli/wp-cli --require=/home/ubuntu/wp-cli/civicrm.php --path=/var/www/wordpress civicrm api job.execute > /dev/null

I hope that helps!

UPDATE: I see your problem!  "/path/to/wp" means, "path to wp-cli, including wp-cli".  I completely looked past that part at the beginning, since that's not generally where the problems are found.

Usually, "wp-cli" is aliased to "wp" so it can automatically include the CiviCRM extension - but with cron, I usually just use the require directly.

So log into your computer and type which wp-cli.  Let's say it returns /usr/bin/local/wp-cli.  Replace ONLY the first path to WP with that, so it looks like:

To forestall your next question about why it doesn't work - the  is a placeholder, and the angle brackets should NOT be included in the actual statement.  Angle brackets are a common way in documentation of command-line programs to say, "insert your value here".  So instead of <philnicoll>, just write philnicoll.

You should be left with something like:

/usr/bin/local/wp-cli --user=philnicholl --url=http://thetestsite.dev:8888 --path=/users/phillip/Sites/thetestsite.dev civicrm api job.execute auth=0


First CiviCRM API call is slower, are unnecessary resources loaded?

They are several distinct issues:

Calling civicrm_api3, this isn't REST, and (unless requested) the code runs as admin, so probably not linked with authentication

Here, a common issue is the database access, the first time you access the underlying tables (civicrm_contact and co), mysql might not have kept them in the cache, but the second time they are and it will be several order of magnitude faster.

My guess would be that most of the difference in time is due to the database layer (that might has well be kept some cached in the DAO layer) but mostly the difference between an empty mysql cache.

When you compare with running directly the executeQuery, which one do you run? They are likely quite a few sql queries inside the api call. Do you run them after having called the api?

if you want to dig into the detail of where the time is spent, I'd recommend you to use a profiler, because it's hard enough th it, and black magic and speculation without

The REST interface. It's always going to be slower, both because of the overhead of the network and the extra authentication step (based on the keys you provide)
It will be faster if you provide a return param to the api call, to specify which fields you want. by default, it will returns tons of fields that you probably won't use, some that are from related joined tables (eg. email, phone, address, name for options or pseudo constants...).

adding a return="first_name,last_name,email" would avoid fetching stuff you don't need.


Exporting group contacts to an excel file

The User Guide has instructions and screenshots here for exporting contacts: https://docs.civicrm.org/user/en/latest/common-workflows/exporting-your-contacts/

Search for the contacts and select the Export Contacts action from the drop-down list.


Bug datepicker field when more than one on contribution page

Hello you can see here the way my datepicker field are displayed when two are on the same form.

This bug is also present with a fresh install

Thanks for help


How do you visually update a select2 widget?

Figured this out. I needed to wrap my jQuery code in:

CRM.$(function($) {

});

The change trigger - and other select2 events - started working once I did this.


CiviCRM does not have permission to write temp files on new server

I found out the culprit was SELinux. Once I disabled it everything worked fine.


Several interpretations here.

If 'remove from email list' is the equivalent to 'unsub from group x which is used for a Mailing List' then you should be able to 'remove' them directly from the group.

If it means 'stop sending me any bulk mailings' then you can set their email to "on hold"

if it means 'never ever email you' you can set their record to Do Not Email which should stop even one to one emails from the system


I would use content views wordpress plugin along with content views civicrm integration plugin and data processor civi extension to list what you want.


How to create extension using phpStorm 2018.2.5

You can study about creating CiviCRM extensions here: https://docs.civicrm.org/dev/en/latest/extensions/

You would need to use Civix to create extensions and can use PHPstorm as text editor to write code i guess.

Thanks


how to change the size of groups for ab testing?

so what I did was to search the contacts in the original a and b groups, and added them into a new group already-tested, that I then excluded this group from the cloned ab testing.

note that i had to copy paste in the new ab-test, as the re-use feature doesn't properly clone the ab experiment, just one of the version


How do I set a case open date and/or close date with a webform?

I don't think so, no. But then, I don't think you can do this through the regular CiviCase UI either.

Perhaps the solution would be to expose the opened and closed dates to the webform as fields? This would require patching webform_civicrm/includes/utils.php to add them under function wf_crm_get_fields). If that works for you, please submit a pull-request back :)


What we have done is to add 3 custom fields to the contribution (utm_source, utm_media and utm_campaign) that store the tracking codes, the same way google analytics work.

To make it more automatic, we have an extension that does automatically adds these codes to all the links sent from civimail, so we have end to end tracking.

We haven't yet published this extension in civicrm.org, but you can fetch it from our github repository.
https://github.com/WeMoveEU/utmaltor


Can't Get CiviCRM BuildKit files From Repository

At that point in the install script, it is attempting to run sudo apt-get -y install for a bunch of packages.

It looks like you have added a ppa for midori but that does not have a bionic release yet.  You can run sudo add-apt-repository -r -u ppa:midori/ppa or find the entry for midori in /etc/apt/sources.list or /etc/apt/sources.list.d and comment it out and run sudo apt update

Once you can get sudo apt-get -y install to run cleanly on some (any) package, try again with the get-buildkit.sh script.

Note also that bionic comes with php 7.2 which is marked as 'not yet tested' in https://docs.civicrm.org/sysadmin/en/latest/requirements/#php-version so unless you are only interested in the very latest releases and debugging 7.2 issues, you probably want php 7.1 (see eg https://tecadmin.net/install-php-7-on-ubuntu/).  However, if you do that you'll need to install the 7.1 version of the php extensions.  Look at the php7.1-* list in the 'do_system_artful' function of get-buildkit.sh


Summary fields creates a collection of custom fields that it populates. It populates them when you first set the extension up, and then it also updates them as new contributions are stored.
I suspect that it doesn't recalculate all the fields when you update your fiscal year, you probably need to ask it explicitly to do that, eg. by resaving the configuration of the extension.


Drupal Webform for Activities - CiviCRM Permissions

I think the issue in your case was that Contact 1 was not set on the form


Why doesn't API for Contribution Get work with multiple Financial Type ID values?

Instead of

'financial_type_id' => array("Campaign Contribution", "Donation")

try

'financial_type_id' => array('IN' => array("Campaign Contribution", "Donation"))

The API Explorer can generate this code for you if you select the IN operator.


How do I add CiviCRM fields to a layout box / container in a form created using webform-civicrm?

when you're on the Webform tab - you can drag and drop your fields into the Layout Box - here's what it will look like:

And re: the second part of your question - no - you don't need Drupal Form Builder. When you've downloaded and enabled webform_civicrm module - you'll see a CiviCRM tab (on the far right side) and this is where you tell the module to pull in certain Fields from your CiviCRM:


I think you could use hook_webform_submission_presave

http://api.drupal.psu.edu/api/drupal/modules%21contrib%21webform%21webform.api.php/group/webform_hooks/nittany7

But hook_civicrm_pre might be better
https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_pre/


This is a bug affecting versions 4.6.23 and 4.7.13.

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


Composer 2 and CiviCRM Installation Error

As per comments there were some leftover installed vendor files and removing composer.lock and the entire vendor folder and also web/modules/contrib/civicrm and then trying again clears it.


The option should appear once you select the amount. If it does than set default one of the option from amounts tab of contribution page


CiviCRM on Debian 10 gives warning about PHP MySQL Driver (libmysqlclient)

Thanks to @Dermerit, the answer seems to be to upgrade!

This code change:
https://github.com/civicrm/civicrm-core/pull/14864/files

Seems to have removed the erroneous warning.


Ooops - my mistake. I had included "http://" in the href before the token. Sorry for the trouble and the answers


Advanced Search Using Custom Profile as Display View that Includes Groups Not Working after Upgrading to 5.9.0

Pretty sure the "1 row" problem only shows if you search using one custom Profile then switch to using a second custom Profile

Ie

Reset Form
then use Default, (all rows show)
then switch to profile with Groups field (all rows show)
then switch to profile with Tags field - only 1 row shows.

Reset Form
then use Default, (all rows show)
then switch to profile with Tags field (all rows show)
then switch to profile with Groups field - only 1 row shows.

So the problem seems to relate to switching between one custom search Profile and a second one.

NOTE: above came to light when trying to demo to Eileen that i could replicate https://lab.civicrm.org/dev/core/issues/679

UPDATE: Fix at https://github.com/civicrm/civicrm-core/pull/13533


How to export civievent participant list to a csv file?

What version of Civi are you using?

Under Events > Reports > Participant List, Mine shows "Export CSV" as an Action Option

Under Search > Find Participants, it just says "Export List", But when I export it I get a CSV file.

But even if you get a .xls or other Excel file you can always save it as a .csv in Excel. If you do not have Excel, then run it through an online file converter. You can even open the Excel file in Google Sheets and then download it as a csv to convert it.


in CiviMail, when using "view in browser" link, how can forward to a friend be disabled?

Try wrapping those items in <span class="hiddenElement"> </span>. Civi's css will hide it on your website, but email clients will not.


In fact, if you use HEX() function, you can guess it's the ASCII code 01 which is not really readable :

MySQL> SELECT substring(besoins_sp__114, 1,1)
       FROM civicrm_value_besoins_sp_cifiques_v_nements_26 LIMIT 1;
+---------------------------------+
| substring(besoins_sp__114, 1,1) |
+---------------------------------+
|                                |
+---------------------------------+
1 row in set (0.00 sec)

MySQL> SELECT HEX(substring(besoins_sp__114, 1,1))
       FROM civicrm_value_besoins_sp_cifiques_v_nements_26 LIMIT 1;
+--------------------------------------+
| HEX(substring(besoins_sp__114, 1,1)) |
+--------------------------------------+
| 01                                   |
+--------------------------------------+
1 row in set (0.00 sec)

From there, you can do reverse operation using UNHEX.
So, if you need to replace this char by another more readable one, you can do the following :

MySQL> SELECT replace(besoins_sp__114, UNHEX(01), '|') AS special_needs
       FROM civicrm_value_besoins_sp_cifiques_v_nements_26;
+---------------+
| special_needs |
+---------------+
| |AL|          |
| |AL|          |
| |VG|          |
| |VG|          |
| |VG|          |
| |VG|          |
| |VG|          |
| |VG|          |
| |VG|          |
| |VG|AL|       |
+---------------+


We have some examples of how to customize Contribution forms in our iATS Payments extension. Essentially the recipe involves: buildForm hooks, custom templates and JavaScript. I'll try and explain below how they all tie together:

buildForm hook

https://github.com/iATSPayments/com.iatspayments.civicrm/blob/master/iats.php#L285

Here we check what form we're on (event, contribution, backend, frontend, etc.). For the main contribution page we're:

case 'CRM_Contribute_Form_Contribution_Main':
  $fname = 'iats_civicrm_buildForm_Contribution_Frontend';

function iats_civicrm_buildForm_Contribution_Frontend(&$form) {

https://github.com/iATSPayments/com.iatspayments.civicrm/blob/master/iats.php#L781

Let's say we have ACHEFT (debit) payment processor and currency is CAD - and we want to customize the contribution form - to use Canadian language for direct debit, display Canadian instructions and help the user fill out the fields by displaying a Canadian cheque image.

if (!empty($acheft[$form->_paymentProcessor['id']])){
  iats_acheft_form_customize($form);

function iats_acheft_form_customize($form) {

https://github.com/iATSPayments/com.iatspayments.civicrm/blob/master/iats.php#L612

$fname = 'iats_acheft_form_customize_'.$currency;

function iats_acheft_form_customize_CAD($form) {

https://github.com/iATSPayments/com.iatspayments.civicrm/blob/master/iats.php#L660

Here we addElement-s, addRule-s; setLabel-s:

 $form->addElement('text', 'cad_bank_number', ts('Bank Number (3 digits)'));
 $form->addRule('cad_bank_number', ts('%1 must be of length 3.', array(1 => ts('Bank Number'))), 'rangelength', array(3,3));
 $element->setLabel(ts('Bank Number + Transit Number'));

and inject the CAD template:

CRM_Core_Region::instance('billing-block')->add(array(
    'template' => 'CRM/iATS/BillingBlockDirectDebitExtra_CAD.tpl'
  ));

In that https://github.com/iATSPayments/com.iatspayments.civicrm/blob/master/templates/CRM/iATS/BillingBlockDirectDebitExtra_CAD.tpl

We load js (to move the fields around):

We inject a CAD Cheque image:

and render the fields we just created - e.g.:

{$form.cad_transit_number.label}

{$form.cad_transit_number.html}

The js files are located here:

https://github.com/iATSPayments/com.iatspayments.civicrm/blob/master/js/dd_acheft.js
https://github.com/iATSPayments/com.iatspayments.civicrm/blob/master/js/dd_cad.js

In them you we do quite a few things - like move fields around and run some validations on the bank number and the transit numbers that were entered.

Hopefully these examples will be useful to you! I realize it's probably more than you bargained for! But once you get these techniques under control - you'll be able to gain full control over all your CiviCRM form pages.

End result for this example:


Add "sender/from" line to postal mailing labels

My solution for Question 1:

I create labels with the recipients in CiviCRM and save it. Than i create a label-sheet with the same format in libre-office only with the "from"-line and safe it as pdf. then i use "pdf chain" (for linux) to merge this two files together. in "pdf chain" it called "backround/stamp". so it "stamps the "from"-pdf as often as needed in to the pdf from CiviCRM.


CiviCRM_API3_Exception: "DB Error: no such field" When Editing CiviMail

No such field errors after an upgrade are most commonly caused by not having run the DB upgrader.

For Drupal, visit ?q=civicrm/upgrade&reset=1 or civicrm/upgrade?reset=1
For WordPress, visit wp-admin/admin.php?page=CiviCRM&q=civicrm/upgrade&reset=1
For Joomla, visit /administrator/index.php?option=com_civicrm&task=civicrm/upgrade&reset=1

For full upgrade advice and various troubleshooting tips, refer to the upgrade documentation page for your CMS.


Is there an extension for adding a custom field type calculated field?

Paul, very interested in this idea as well. Don't have a great answer, but here's an idea - since you're on Drupal, I wonder if this would work - using Views, Views Calc and Views Aggregator Plus (perhaps along with webform-civicrm) to do the calculation - add the survey answers to get a score - then saving that score back into Civi in a custom field?


What CMS integrations are available for CiviCRM?

CiviCRM has a complete set of APIs that you can use for such purpose, but you would have to custom-develop the part that sits within this other CMS. So for example you can use (Contact, Get) with the email address of the logged-in user in the CMS to achieve function 1 in your list, or (Contact, create) to create leads in CiviCRM from a website form and achieve function 2 in your list, or (Activity, create) to track website activities in the CRM and achieve function 3 in your list.


Page - specific Datepicker config in jcalendar.tpl

You can set a datepicker's default value in the setDefaultValues() method of the form.  Here is a snippet of code that sets a date to today if none exists, and to a saved date if it does:

    if (empty($data['thank_you_date'])) {
      $defaultValues['thank_you_date'] = date('Y-m-d');
    } else {
      $defaultValues['thank_you_date'] = $data['thank_you_date'];
    }


Search criteria dropdown choices disappeared

This may have been a non-problem. Our developer noted that the particular variable I am concerned about is a custom variable, and it seems that custom variables do not present drop-down menus as do the standard variables. One then has to construct the search using the values defined for the custom variables (which would have to be looked up elsewhere in CiviCRM).


Does Authorize.net's MD5 Hash End-of-Life affect CiviCRM?

There is a PR from Monish to remove md5 hash support from Authorize.net payment processor in CiviCRM. Its now merged in master branch and should be part of 5.11 release.

Cheers

Pradeep


Mapping of CiviCRM's Contact card fields to Drupal user entity's

In general the way to sync drupal entities with CiviCRM fields is to enable the civicrm_entity module.

Documentation can be found here.


Wordpress CiviCRM site unusable after database upgrade from 5.4.0 to 5.5.1

People using 4.7 are out of date - 4.7 is end-of-life.  You should definitely go with 5.x for most use cases.

I would check your error logs in the ConfigAndLog directory - then come back here and edit your question to add the relevant logs.  In general, there's a troubleshooting page in the documentation, but most of the suggestions aren't applicable to upgrade failures.


Why does the civicrm upgrade stop after each step of the upgrade eg at 4.7.19 then again at 4.7.20

As per the code, retry and skip seems to be shown with the value set for debug. Note Enable Debugging if it is turned on/off on Administer-> System Settings -> Debugging and Error Handling.

Need to confirm this on another upgrade I do, but for now, it seems retry and skip would show up if debugging is enabled and the upgrade would progress only after Retry button is clicked. So for continuous upgrade, one should have debug set to No?


Is it possible to have a user that's only capability is to work with Mosaico. Specifically to Create/modify templates

Unfortunately there is no single Mosaico privilege. You would achieve what you want using a combination of CMS permissions and CiviCRM ACL.
I would do the following:

Create a special account for this volunteer, that they will use just for creating the the templates.
Create ACL so that the volunteer account has access to only one group of contacts, a testing group, where you will have a single contact. This is just for them being able to select a group when they want to create a new mailing ( this stem is option, i.e. if you want them creating the mailing and preparing everything for you to review and then just send it to the real group if you are satisfied. (If you want them just to edit templates Mosaico then this step isn't necessary)
Subtract all the unnecessary CMS permissions. I am not sure which permissions would that be, since I don't have a WP installation (I am on Drupal). You will want that user to have:

backend access
access to uploaded files
CiviMail access

Additionally, you can use the navigation menu settings (Administer -> Customize Data and Screens -> Navigation Menu) to add a permission requirement for any menu entry, effectively hiding any option you wouldn't like them to see in the menus.


How to add a drop down with option groups and option values?

If it's a setting for your extension, then take a look at the settings framework: https://docs.civicrm.org/dev/en/latest/framework/setting/#creating-a-new-setting-in-an-extension

If you're modifying a form, then you can get the value when the person submits the form using hook_postProcess: https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_postProcess. One way it to use $form->_submitValues which is an array.


How can I programmatically authenticate a contact (via checksum or other method)?

CRM_Contact_BAO_Contact_Utils::generateChecksum($contactId) is the function used to generate checksums.

Ideally your extension would call this via a corresponding API method, but I don't think one exists yet?

There's corresponding code (see validChecksum etc below that) which is used in some CiviCRM pages to identify a request with a checksum parameter.

Simple code to identify a checksum and persist against the contact is the following -

if ($cs = CRM_Utils_Request::retrieve('cs', 'String' , $this, false)) {
  if ($id = CRM_Utils_Request::retrieve('cid', 'Positive', $this, false, $userID)) {
    if (CRM_Contact_BAO_Contact_Utils::validChecksum($id, $cs)) {
      $session->set('userID', $id) ;
    }
  }
}

If they are landing on your callback already, then you can just dispense with using the checksum parameter and set the session directly before redirecting them to the page they authenticated to use.


@Zeno when you have create option you don't have to look for replace

please use create key word to create new or to update the record if record exist

$result = civicrm_api3('Address', 'create', array(
  'sequential' => 1,
  'contact_id' => 202,
  'location_type_id' => "Work",
  'street_address' => "test",
  'street_number_suffix' => 506,
));

Please try the above - This will work


How can I add/rearrange custom fields in the default contact view template?

The template templates/CRM/Contact/Page/Inline/ContactName.tpl does not contain any custom fields. Instead of adding smartyDebug=1 in the url, which dumps variables in the main template, try adding the smarty tag {debug} in this specific template to see the available local variables.

At minimum you will probably find the contact id, and from there you could use the api to fetch necessary data (note the api explorer can generate this syntax for you):

{crmAPI var='result' entity='Contact' action='getvalue' return="custom_1" id=123}


Are you using both the HTML and plain text formats? Some email clients or user preference will pick the plain text version and if you don't have the content there, it will be blank for these people.