Hacked getContactRelationshipSelector in core, how do I implement as an extension? I'm looking to show additional fields in the relationship tab for contacts (e.g. Job Title) - the fields are part of the relationship object, but aren't defined in getContactRelationshipSelector (CRM\Contact\BAO\Relationship.php) and attempting to use them as columns in the table via editing the template gives an error.

Adding the fields here in getContactRelationshipSelector makes everything work:

 $relationship['start_date'] = CRM_Utils_Date::customFormat($values['start_date']);
        $relationship['end_date'] = CRM_Utils_Date::customFormat($values['end_date']);
        $relationship['city'] = $values['city'];
        $relationship['state'] = $values['state'];
        $relationship['email'] = $values['email'];
        $relationship['phone'] = $values['phone'];
        $relationship['job_title'] = $values['job_title'];
        $relationship['links'] = $values['action'];

        array_push($contactRelationships, $relationship);

I started making an extension to implement hook_getContactRelationshipSelector - but this doesn't seem to exist, or at least there's no reference to it in the documentation and test code didn't seem to do anything.

Not sure how to proceed with implementing this properly as an extension, any tips would be appreciated.

Since this function is used from an ajax callback, your extension could do 2 things:

Override the template, which allows you to specify a different ajax path for the dt.
Create your own ajax callback which starts by calling that function, then appends its own data.


One Contribution page with multiple webforms Has anyone had any issues with using one contribution page from CIVI together with multiple webforms.

For example - One webform processing annual memberships, another processing life memberships but using the same contribution page.

Many thanks,

One thing you might want to consider is that the webform uses the receipt language configured on the contribution page you're using, so you might check to confirm that the verbiage is sufficiently generic to cover both types of membership.

Lesley


NodeJS error on latest CiviBuild Encountering the following npm related issue on using the latest buildkit. Any suggestions? NPM is already at latest.

If someone has a working buildkit they could tell me which version of npm they're on that'd be great.

Thanks.

vagrant@civi:~$ ~/buildkit/bin/civibuild create "4719" --admin-pass "password" --civi-ver "4.7.19-rc" --type "drupal-demo" --url "http://4719:7979" --force
npm WARN npm npm does not support Node.js v0.10.25
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm You can find the latest version at https://nodejs.org/

/usr/local/lib/node_modules/npm/lib/install.js:298
        [this, (next) => { computeMetadata(this.idealTree); next() }],
                       ^
npm ERR! Unexpected token >

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/vagrant/.npm/_logs/2017-06-04T20_40_46_477Z-debug.log

Looks like you need to upgrade your nodejs version - https://nodejs.org/en/download/


Event registration times out with invoicing enabled Environment: shared hosting (LAMP), CiviCRM 5.18.2, Backdrop 1.14, PHP 7.2.23
When invoicing is enabled (pay later, no payment processor), event registration times out after confirmation screen is confirmed by user. No final confirmation/thank you screen shown, or email sent with pdf invoice.
PDF extension selected in CPanel PHP Selector > Extensions though throws same error if not selected; PHP timeout extended to 120 seconds, though this does not seem to override host settings (cannot restart Apache after changing).
Error message:
"[09-Oct-2019 23:57:10 Europe/London] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in ~/modules/civicrm/vendor/dompdf/dompdf/src/FrameDecorator/Block.php on line 193" Any thoughts gratefully received.
Disabling invoicing allows registration, and confirmation email sent with pdf invoice with no invoice number, just no contribution record or ability to generate copy invoice etc.

Generating a pdf can take a lot of memory and time. If you can turn of the PDF option, that should skip the problem, as Laryn suggested try to turn if off, at least to be sure it's the root problem.

But ff it really takes a lot of time (300 sec is a lot) it might be that you changed the layout of the pdf and/or include too many heavy things (like a huge heavy image for your logo?)

If you do need complex/heavy pdf, one workaround is to let civi delegate the hard work of generating that pdf to an external program. Check if your hosting provider can install wkhtmltopdf and under Admin/system settings/misc put the path of that program into "Path to wkhtmltopdf executable"

I use it for instances that need to generate loads of complex pdfs, the default civi way should work fine for "simple" pdf, it's likely you have something in your setting that is an issue (either faulty pdf layout if you customised it, non optimised images or something)

X+


Would this be a fit for us? We are a small nonprofit that conducts medical missions and are looking for software to help us organize our missions. Your software looks like it could help us, but I have a few questions before signing up for a demo based on our core needs:
1. Can volunteers fill out their own profile that they manage themselves? As in, they sign into a profile and answer questions themselves.
2. Can we edit all the questions asked of volunteers in their profiles?
3. Can we AND volunteers upload documents?

Thanks,

Nadine...

You've asked more than one question, but I'll try to hit them all

1) CiviCRM lets you create public forms (profiles) that users can use to manage information in their contact record, such as email addresses, phone numbers and addresses. Depending on the CMS platform you're using, there are some other ways to allow for self-service updating of information, for example, on Drupal, there's a module called Webform that has excellent CiviCRM integration.

2) The profiles are completely configurable with all the core (built-in) CiviCRM fields and can include custom fields that you've set up in the database.

3) CiviCRM and all the supported CMSes allow for file uploads. CiviCRM lets you store attached files to contact records and activity records and can be configured for other record types, too.

You don't mention if you're going to be managing volunteers with CiviCRM. There's a video with some information about the CiviVolunteer extension on YouTube
https://www.youtube.com/watch?v=7hkAlLYBc2Q


Error al introducir un contacto -- Entered a contact name incorrectly He introducido como segundo nombre el primer apellido de un contacto:
Irene Martínez Mas. Cómo puedo corregirlo? La aplicación me dice que no tengo permiso para hacerlo.

I have entered as the second name as the first name of a contact: How can I correct it? The message tells me that I do not have permission to do it.

Puede ser que tu registro de usuario no incluye el permiso "CiviCRM: editar todos los contactos" - tendrias que pedir al administrador del sistema que añade este permiso a un perfil que está asociado tu registro de usuario (e.g. personal, editor, etc.).

Espero que esto ayude!

Tamar


Missing fields and reports in database after migrating to a new server What's the best way to migrate CiviCRM to a new a server? I haven't been able to get it to work. I've been following this guide. Here are the steps I've been taking to for the migration.

1.) SQLDump and exclude the flowing tables in old database.

db_name.civicrm_domain

db_name.civicrm_acl_cache

db_name.civicrm_acl_contact_cache

db_name.civicrm_cache
db_name.civicrm_group_contact_cache

2.) Setup new CMS (WordPress, Joomla or Drupal) I have tried all three platforms

3.) SQLDump old database into new

2.) Clear cache and rebuild menus

I know that I must be missing steps. Here are some of the problems I'm running into:

1.) There is a problem when trying to run custom reports that repopulate after rebuilding the menu. The message I get is (error: You have tried to access a report that does not exist.) Where do you find custom reports made on the old system? Whats the best way to transfer them, copy paste?

2.) When clicking a a link on the menu or running search I get this (error: DB:no such field).

I'm guessing that when I transfer the custom templates/reports (not sure the proper nomenclature) the database error will resolve itself?

Here is the database error from the CiviCRM error log:

[code] => -19
[message] => DB Error: no such field
[mode] => 16
[debug_info] => SELECT civicrm_uf_group.id, civicrm_uf_group.title, civicrm_uf_group.created_id, civicrm_uf_group.is_active, civicrm_uf_group.is_reserved, civicrm_uf_group.group_type, civicrm_uf_group.description
                    FROM civicrm_uf_group
                    LEFT JOIN civicrm_uf_join ON (civicrm_uf_group.id = uf_group_id) AND civicrm_uf_group.is_active = 1
                          WHERE civicrm_uf_join.module = 'Search Profile' ORDER BY civicrm_uf_join.weight, civicrm_uf_group.title [nativecode=1054 ** Unknown column 'civicrm_uf_group.description' in 'field list']

There are a few questions combined here I think. From what you describe there may be other problems afoot, but hopefully these two suggestions may help you make some progress.

Why do I see the error DB Error: no such field with Unknown column 'civicrm_uf_group.description' in 'field list'?

It sounds like your source and destination CiviCRM may be different versions. Check the codebase of your source and destination CiviCRM and if the destination is newer, make them match.

Up to you whether to run the upgrader on the source before migration or on the destination afterwards. It may be as simple as visiting the CiviCRM upgrade URL on the destination server.

Why doesn't the DB migrate when I exclude those tables?

The docs actually say If copying an existing install don't skip the cache tables they will not be created automatically, so you should NOT exclude those tables if you are migrating CiviCRM to a new server.

(It looks like the docs could be improved there, they give different-yet-kinda-identical advice for dumping Drupal and Joomla and don't mention how to deal with WordPress?)


UK Gift Aid tax percentage We are running civicrm 5.30.0 and UK Gift Aid 3.4.6. Our tax calculation is set to 25% and yet imported contributions or those added on-line all calculate at 33.33%?
I cannot find anywhere else that this figure is set

I was advised by another organisation to set the tax rate to 20% and this is now working correctly showing the correct gift aid amount as calculated at 25%. So this matter is now sorted.


Is there a way to integrate CiviCRM with Ticketspice.com and other Event ticketing platforms like Eventbrite? We're on Civi 4.6.17 and Drupal.

We're using ticketspice.com for an Event ticketing page, mostly because I have not figured out a way to create an Event registration page in Civi using the Discount codes extension. Our Ticketspice event registration page is here.

Has anyone created an integration between Ticketspice event pages and CiviCRM, or Eventbrite event pages? I have not had a chance to check out either the Ticketspice or Eventbrite APIs or webhooks.

UPDATE: We're using Authorize.net to process payments for tickets purchased on the Ticketspice event page, and it seems like there should be a way to pull in that data from Authorize to Civi. We also use the same Authorize account to process contributions, event fees/tickets made through Civi pages and price fields.

Much easier to get Events working in CiviCRM and/or with CiviDiscount than to API integrate a third party ticketing system! You'd have to think about how to handle duplicate Contacts, get the monies right - where are any refunds being recorded etc.

Where are you stuck with Events in CiviCRM w/ CiviDiscount? What version of CiviCRM? Post a question on it - and we'll try help you out.


Send an Email from CiviCase is there a way I could add the "Send an Email" activity to the CiviCase timeline? I was hoping to file an activity in the timeline so that x number of days from the Open Date, the user can "Send an Email" via an email template.

Yes and no. You can add a plain reminder to send an email to the timeline, but to send the actual email they'd need to expand the roles section and click the mail icon.

Or they can send a regular email from their mail program and use the email processor feature, which will autofile inbound emails on the case if the subject has the right code in it. See http://book.civicrm.org/user/current/case-management/setup/ down where it says "filing emails on cases".


A question on my ability to import? I cannot find a tab or any import button to import my data I have on excel. I'm not admin, but I have the ability to add cases, organisations and individuals. Do I have to be the admin in order to do this?

You do need permissions like import contacts to import contacts. You will need to ask for that permission to be added to your current role.

The permissions for various import functionalities are defined in CRM/Core/xml/Menu/Import.xml


CiviCRM select box items can't be selected in wordpress page create In wordpress, when adding a new page or post, a CiviCRM button is available to add content from Civi.  The "Insert CiviCRM Content" dialog box opens as expected, but the select box doesn't allow a selection.  The select box contains "User Dashboard", "Profile", "Contribution Page" and "Event Page", but these options open underneath the dialog box and can't be clicked.

Turns out that this is because the select box has a z-index of 399,999. I can't find any CSS conflict that would cause this, and there is no JS error in the console.  Any suggestions would be appreciated.

I had a similar problem with this - See CRM 18496.  It turned out that there may have been interference with CiviCRM's jQuery and CSS from a Wordpress plugin.  You could try deactivating any plugins that you have installed, one by one, to see if there is conflict.  My problem went away without me discovering which of the many plugins I have was the culprit but one of them that I deactivated was Jetpack.

Unfortunately, you can't test this out on the demo site because you can't there create a new page in which to enter the appropriate civicrm shortcode.


Can't use button without forcing client to log back in and never redirects back to where it should CentOS release 6.8
cPanel 56.0 (build 25)
Apache (v. 2.4.18)
PHP (v. 5.6.22)
MySQL (v. 5.6.30)
WordPress (v. 4.5.3)
CiviCRM (v. 4.6.19)

When clicking a button the client is forced to log back in using wp-login.php with a long redirect appended to the URL which changes of course depending on which button they pressed.

This was brought up when one of the clients tried to export a constituent report as csv but after snooping around trying to resolve the issue I have found that it happens on every grey button when in the CiviCRM backend.

Also I have not been able to locate any output in any logs as it is just redirecting.

I had a hunch that it had something to do with SSL being enabled recently but I haven't made way with that assumption either.

I also went ahead and updated CiviCRM to 4.7.11 to see if this issue would resolve itself and it made no difference, so for the sakes of not changing unnecessary settings/files I reverted back to CiviCRM 4.6.19

Any help as to what to do to get this to stop would be greatly appreciated as it greatly hinders what can be done in the backend.

It could be the SSL.   Verify the home url (WordPress General settings) and the CIVICRM_UF_BASEURL in the civicrm.settings.php file.

These should match exactly including the https://  If not that can be the issue.

If it matches I would look for a plugin or theme conflict next.


Unsubscribe Confirmation Page Shows Too Much Information When users click to unsubscribe from our newsletter, to confirm their unsubscribe they are taken to a page in CiviCRM that shows them all of the groups that the email was sent to.

Is there anyway to change it so that these groups are not visible to them?

Write an extension and use hook_civicrm_buildForm( $formName, &$form )
where you can change the values for the specify page

please use this link for reference for more details
http://wiki.civicrm.org/confluence/display/CRMDOC43/hook_civicrm_buildForm


Webform contact autocomplete only searches the first character of external ID I have a webform set up with a contact autocomplete box, searching using the external ID. Our external IDs are in the format ec1234567.

The problem I have is that when searching for a contact, it starts to autocomplete on the first character 'e' (and shows the results as it should), but when entering the second character 'c' and subsequent digits, it shows no results, only the 'create contact' option.

Does anyone have any ideas why this might be, and what could be done to make it search for the full external ID?

For a large org who also could not use any Name autocomplete (just too many Contacts) - I create a Enter Contact ID Form Widget (for _contact_existing). If you adapt your processes to do lookup by Contact ID - this new Widget is in current versions of Webform CiviCRM module. If you continue to want to lookup by External ID - have a look at the code and mimic it after this example or alternatively sponsor a bit of time and we'll be happy to get that done for you.


Securiy certificate expired for installation documentation I can't get to the installation documentation (e.g. https://wiki.civicrm.org/confluence/display/CRMDOC/Installation+and+Upgrades) at the moment because it says the security certificate expired in the early hours of this morning. Hopefully someone can fix this soon!

Thank you for reporting this, I believe the certificate issue has now been fixed. Future issues like this should be reported in the infrastructure channel of CiviCRM chat https://chat.civicrm.org


What is the join logic when using API chaining with action = get? I read about API chaining and I'm using it with get actions to learn more about how it works. I'm confused by the inconsistent behavior of the following two API calls:

CRM.api3('participant', 'get',
  {"id": 12345, "api.Event.get": {} });

That gets a participant record and embeds the single associated event record within the results. Cool.

But this one works differently:

CRM.api3('participant', 'get',
  {"id": 12345, "api.ParticipantStatusType.get": {} });

It gets the same participant record, but embeds all status type records within the results. Why?

In general, I'd like to understand what logic CiviCRM is using to filter the results of chained calls.

Chaining will attempt to "guess" at the id of the chained entity. In your first example, the fetched participant record has an "event_id" and the api chaining controller passes that into the chained Event api call as the id.

The guessing is pretty basic though. For everything else, you should specify params explicitly. You do so by using the magic "$value" notation. E.g.

CRM.api3('participant', 'get', {
  id: 12345,
  "api.ParticipantStatusType.get": {id: '$value.status_id'}
});

Note that you can also use joins for this type of thing, which is generally more efficient than chaining. Check out joins in the Api explorer.


Problem exporting due to multiple addresses of one location type (e.g. two 'home' addresses) I have run into a problem where someone created a Webform using Webform_CiviCRM and for some reason added two address field sets to the contact, with the street address in one of them and the city/state/zip in the other. Now the contacts in CiviCRM have two incomplete addresses, both of the type 'Home'. When I try to export them, I'm just getting one of the incomplete addresses.

This old forum thread seems to be related. It looks like the UI on the main contact page prevents creation of multiple addresses of the same type, but the API must still not enforce?

Anyone have a suggestion for how to tackle this and get the addresses merged/squashed into a single address?

I would fix this either partially or wholly with SQL.  The general approach I'd use is:

Change the location_type_id on one of the two addresses for each contact to an unused location type (creating a new location type if need be).
Export the contacts with both the "Home" and the unused location type.
Reimport the data with all address fields designated as "Home" addresses.
Delete the extra addresses with a SQL statement.

The basic query you want is:

SELECT MAX(id), contact_id, COUNT(id) FROM civicrm_address WHERE location_type_id = 1 GROUP BY contact_id HAVING COUNT(contact_id) > 1;

MAX(id) is the id of the second address created; MIN(id) would return the first address id.

Due to this constraint of MySQL, you can't just use this SQL query that would meet the requirements of the first bullet point:

UPDATE civicrm_address SET location_type_id=4 WHERE id IN (SELECT MAX(id), contact_id, COUNT(id) FROM civicrm_address WHERE location_type_id = 1 GROUP BY contact_id HAVING COUNT(contact_id) > 1);

You can use of the answers on that SE question to work around that (e.g. with a temp table).


Adding a google pixel to a Contribution Page What is the best way to integrate google Adwords to CiviCRM? Specifically we want to add a pixel to the contributions page, without messing with civi's functionality.

Thanks in advance!
Jaime

You have two options:

Set up a sidebar in your WordPress theme that only appears on contribution pages that contains the pixel.  I know how to do this in Drupal using Blocks; I don't know how to do it in WordPress off the top of my head, but I'm sure it's doable.
If you are or have access to a coder, you can write a CiviCRM extension to do this.  I've written one for Facebook Conversion Pixels for successful donations.  My guess is you could modify this pretty easily, or hire someone to do so.


Geocoding Provider Error Contributions have been processed correctly so far, but when clicking on continue in both Paypal and Redsys (credit card) the following error appears (both Live and Test)

php_network_getaddresses: getaddrinfo failed: Name or service not known

Array

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

    [code] => 0
    [message] => php_network_getaddresses: getaddrinfo failed: Name or service not known
    [mode] => 16
    [debug_info] =>
    [type] => PEAR_Error
    [user_info] =>
    [to_string] => [pear_error: message="php_network_getaddresses: getaddrinfo failed: Name or service not known" code=0 mode=callback callback=CRM_Core_Error::handle prefix="" info=""]
)

backTrace

#0 / ...  /modules/civicrm/CRM/Core/Error.php(182): CRM_Core_Error::backtrace()
#1 [internal function](): CRM_Core_Error::handle(Object(PEAR_Error))
#2 / ...  /modules/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(PEAR_Error))
#3 / ...  /modules/civicrm/packages/PEAR.php(566): PEAR_Error->PEAR_Error("php_network_getaddresses: getaddrinfo failed: Name or service not known", 0, 16, (Array:2), NULL)
#4 / ...  /modules/civicrm/packages/Net/Socket.php(156): PEAR->raiseError("php_network_getaddresses: getaddrinfo failed: Name or service not known", 0)
#5 / ...  /modules/civicrm/packages/HTTP/Request.php(737): Net_Socket->connect("query.yahooapis.com", 80, NULL, NULL, NULL)
#6 / ...  /modules/civicrm/CRM/Utils/Geocode/Yahoo.php(127): HTTP_Request->sendRequest()
#7 / ...  /modules/civicrm/CRM/Core/BAO/Address.php(387): CRM_Utils_Geocode_Yahoo::format((Array:13))
#8 / ...  /modules/civicrm/CRM/Core/BAO/Address.php(144): CRM_Core_BAO_Address::fixAddress((Array:13))
#9 / ...  /modules/civicrm/CRM/Core/BAO/Address.php(120): CRM_Core_BAO_Address::add((Array:13), TRUE)
#10 / ...  /modules/civicrm/CRM/Core/BAO/Location.php(69): CRM_Core_BAO_Address::create((Array:34), TRUE, NULL)
#11 / ...  /modules/civicrm/CRM/Contact/BAO/Contact.php(348): CRM_Core_BAO_Location::create((Array:34), TRUE)
#12 / ...  /modules/civicrm/CRM/Contact/BAO/Contact.php(1897): CRM_Contact_BAO_Contact::create((Array:34))
#13 / ...  /modules/civicrm/CRM/Contribute/Form/Contribution/Confirm.php(2066): CRM_Contact_BAO_Contact::createProfileContact((Array:35), (Array:14), "7327", (Array:0), NULL, "Individual", TRUE)
#14 / ...  /modules/civicrm/CRM/Contribute/Form/Contribution/Confirm.php(594): CRM_Contribute_Form_Contribution_Confirm->processFormSubmission("7327")
#15 / ...  /modules/civicrm/CRM/Core/Form.php(423): CRM_Contribute_Form_Contribution_Confirm->postProcess()
#16 / ...  /modules/civicrm/CRM/Core/StateMachine.php(160): CRM_Core_Form->mainProcess()
#17 / ...  /modules/civicrm/CRM/Core/QuickForm/Action/Next.php(61): CRM_Core_StateMachine->perform(Object(CRM_Contribute_Form_Contribution_Confirm), "next", "Next")
#18 / ...  /modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Next->perform(Object(CRM_Contribute_Form_Contribution_Confirm), "next")
#19 / ...  /modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Contribute_Form_Contribution_Confirm), "next")
#20 / ...  /modules/civicrm/CRM/Core/Controller.php(351): HTML_QuickForm_Page->handle("next")
#21 / ...  /modules/civicrm/CRM/Core/Invoke.php(312): CRM_Core_Controller->run((Array:3), NULL)
#22 / ...  /modules/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:15))
#23 / ...  /modules/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:3))
#24 / ...  /modules/civicrm/drupal/civicrm.module(454): CRM_Core_Invoke::invoke((Array:3))
#25 [internal function](): civicrm_invoke("contribute", "transact")
#26 / ... /web/includes/menu.inc(527): call_user_func_array("civicrm_invoke", (Array:2))
#27 /... /web/index.php(480): menu_execute_active_handler()
#28 {main}

I need help. Anyone got any ideas?

Thks

Like William says, the error is due to the geocoding, which may even be happening after the contribution completes. Your system is trying to geocode with the domain http://query.yahooapis.com/ which no longer has a dns entry.

Chances are you are running a very old version of CiviCRM and need to upgrade it, but in any case, you can just remove geocoding in Administer -> System Settings -> Mapping and Geocoding, i.e. this path:

/civicrm/admin/setting/mapping?reset=1

You could install the new geocoding extension at some point, but I'd think your priority would be to get rid of the errors.


CiviEvent detailed schedule When creating multi-day events, I'd like to display a more detailed schedule than what's shown by the "When" field. The "When" field essentially shows the duration of the event, but I'd also like to have a "Schedule" field to show the days and times of the week. Is something this possible?

When      March 1st, 2016 7:00 PM   through   May 26th, 2016 9:30 PM
Schedule  Mondays 7:00 - 9:30 PM
          Wednesdays 7:00 - 9:00 PM
Location  ...

You could setup a custom field for the event (not the participants, but the event itself) such that you could input a schedule as needed.  More details here: http://book.civicrm.org/user/events/setup/


Creating a public Member organisations directory with CiviCRM in Wordpress i'm new to CiviCRM but i've been trying to Create a public Member organisations directory with CiviCRM in Wordpress.

i've tried to configure a public report of members but it appears empty when i'm not logged in see here...
http://phils07813188309.esy.es/?page=CiviCRM&q=civicrm%2Freport%2Finstance%2F37&reset=1

I don't know if this is a permissions issue, something to do with privacy settings or that i'm approaching the problem from entirely the wrong angle

And advice or pointers would be appreciated...

Ta

phil

The best practice for this is to create a profile (Administer menu > Customize Data and Screens > Profiles).  Check out this page in the section labeled "Displaying information on public pages", and also "Making directories with Profiles", further down that same page.


CiviCRM_API3_Exception: "DB Error: constraint violation" Under How to Transfer Big Data to a Different Domain, I asked a question about transferring data to a different domain, but I couldn't find a solution. Before writing a comment, please read the information I have provided here. So I tried to implement my own solution. However, according to my mistake, my own solution steps did not work.

Namely;

I installed a joomla and CiviCRM from scratch. I didn't make any customization and updates in my installation.

Then I threw the following tables and all log tables into new SQL. I have not encountered any errors in this transfer. (I transferred by typing _bacup next to the existing table names to avoid conflicts.)

civicrm_activity
civicrm_activity
civicrm_activity_contact
civicrm_contact
civicrm_custom_field
civicrm_custom_group
civicrm_email
civicrm_log
civicrm_option_group
civicrm_option_value
civicrm_phone
civicrm_setting
civicrm_uf_match
joomla_usergroups
joomla_users
joomla_user_usergroup_map

Now when I try to log in to CiviCRM I get an error like the following. Do you know about the solution to this error?

CiviCRM_API3_Exception: "DB Error: constraint violation"

I share my solution for the problem. First of all, I did this because of a partially loaded database problem. I was getting this error when I did any CiviCRM version upgrade.

When I checked the database, the information in the "civicrm_domain" table was displayed as "5.14.alpha1.upgrade". However, because the site was an FTP update CiviCRM version 5.19.1 was.

First of all, I set up a backup of a time before 5.14 with a different subdomain. Then I upgraded the Joomla and CiviCRM version of this backup to the version I had problems, ie 5.14.1.

Then I deleted everything in the database, including Joomla tables. I have thrown the SQL files with the actual site data into the SQL files of the new subdomain. In the "civicrm_domain" table, I manually changed the version information to "5.14.1".

After that I started the update with the URL of CiviCRM 5.15.0 in Joomla Plugin Update and this time I didn't get "partially loaded database" error and the whole update was successful.

The only problem is that any update, installation and uninstallation of the CiviCRM plug-ins is displayed. I have raised a question for this error. You can also follow it if you want. Of course, that problem will be corrected.


Command failed (cv php:boot --level=settings) when trying to run tests I'm trying to run CiviCRM's unit tests, but I hit on this error when running scripts/phpunit AllTests:

RuntimeException: Command failed (cv php:boot --level=settings) in ...tests\phpunit\CiviTest\bootstrap.php

This is on the master branch of CiviCRM on a local development machine.

Using Windows 7 with a XAMPP stack
PHP Version 5.6.15
The civicrm-core directory is up to date with the master branch

I recommend you install and use buildkit:
https://github.com/civicrm/civicrm-buildkit

It comes with lots of tools - including those you need to run tests.

I use it on MAMP but from what I understand this will work on Windows as well.

Alternatively - if you like you can also:
https://github.com/civicrm/civicrm-buildkit-vagrant


How to compare CiviCRM to Salesforce? I'm advising a small NGO and trying to figure out what is the best solution for them. Their data is essentially:

client data: phone numbers, identification numbers, gender, etc.
client-wise logs, e.g.: "January 1, 1970, 12:00 - contacted client foo and spoke with them on the phone regarding xyz. January 2, 1970, 13:00 - client foo contacted us and asked a question"
appointment data: so-and-so has an appointment with this translator in that room at such-and-such a datetime.

Though I could maintain a custom piece of software myself, I think it's better if as much control as possible is put in the hands of the non-coders (not yet!) who are running the organization. In this situation, reinventing the wheel is probably not the right choice which is why I am considering CiviCRM.

There is discussion of using Salesforce because it is established and familiar. My intuition is to avoid the bloated and expensive Salesforce software, even if they have some sort of discount license.

I'm sure that comparisons have been made to Salesforce before but it might be useful to compile some of them in a single place.

Aside from the general arguments against Salesforce, which are well-detailed elsewhere - it's designed for business-to-business interactions.  That results in odd architectural decisions.  For instance, all individuals must have an organization they're tied to.  That often doesn't make sense in the non-profit world, with individual donors, social services clients, etc.

To combat that, a group of folks with the financial backing of the Salesforce Foundation created the Salesforce Non-Profit Starter Pack (NPSP).  This is available at no cost, and alleviates a lot of the pain of using Salesforce in the non-profit context.

Unfortunately...in the past year, Salesforce Foundation has decided to create a new package called "NGO Connect", and it's much more expensive.  Instead of 10 free user seats, you get 2 - and after that it's $90/user/month.  Salesforce Foundation has started to redirect its resources there.  As a result, a lot of features that many non-profits consider essential are ending up in the more expensive NGO Connect, and will likely never end up in the NPSP.

Whether this matters to your clients, who sounds like their CRM needs are quite basic, I'm not sure - but this is the primary concern with the non-profit Salesforce ecosystem right now.

EDIT: By request, I'm updating this with more info.

Here's a comparison of NPSP vs. NGO Connect.  I wouldn't expect features developed for NGO Connect to be available for NPSP users, or they'd kill their differentiation.  In fairness, NPSP seems to still be under active development.
The power of Salesforce is in its integrations.  However, the integrations are a) additional paid packages, b) are generally priced for enterprise use.  You can end up spending a lot to get a strong Salesforce experience.
The Salesforce real-time API is slow, and you're subject to API limits.  Those API limits are dinged every time you use a non-Salesforce native integration.


How to enable "Manage Extensions?" I'm trying to get some extensions enabled on a Joomla 3.6.2 CiviCRM 4.7.11 installation. For some reason the "Manage Extensions" option is missing from the Admin menu. I was able to get to the necessary page by logging into the demo and grabbing the URL for the extensions area, but how do I get it added to the Admin menu? The demo is running Civi 4.6.18, but I wouldn't think this option has been removed in 4.7. Screenshot below:

On some of our (older but since upgraded) instances the Manage Extensions still shows under Admin > Customise, rather than Admin > System Settings - just in case your is there, but just not where you expect it ;-)


Bug?: Repeat activities won't accept edits after 4.7.31 upgrade We've noticed that we cannot edit recurring activities after upgrading to 4.7.31 on WordPress 4.9.4 running PHP 5.6.34.

On making a change to any activity in a series and hitting "Save", we get the usual three options:

How should this change affect others in the series?

Only this activity
This activity onwards
Every activity

However, on selection, none of the options are working and the system continues to display the activity in editing mode.

This also is the case if we try to delete the Activity by clicking delete here:

Attempting to delete in this fashion also brings up the same non-working 3 radio buttons noted above.

HOWEVER, we do note that if we select a checkbox in a list of activities, we can successfully delete the single activity.

In short, none of the radio buttons that appear after trying to edit/delete an Activity during its view seem to work anymore and, as such, a series of activities cannot be modified after creation, accept for deleting en masse via checkbox commands.

Troubleshooting suggestions appreciated.

We're still having the issue with 5.4.2 and I've made a better thread here since my observations may not have been expressed clearly.

After creating/saving an activity, re-opening it to edit won't allow links and drop-downs to be changed

Suggest future discussion occur at that link and this be closed.


How to search for multiple attendees linked to single payer in CiviEvent I've CiviEvent webform that allows a payee to register multiple attendees on behalf of a single organization. When the transaction is completed the Participant List shows that each attendee from the same organization has paid independently without any reference to the payee or organization. Somehow I would think that Soft Credit would be involved here but is not. Please advise.

Soft credits, by definition, allow you to credit a contact for a donation made by someone, for example the person who inspired the actual donor to make a donation. Paying for something on behalf of someone else is not considered a soft credit.

That said, the participant list that you access via the Participants hyperlink to the right-hand side of the event in question (e.g. under Events > Manage Events) is a simple search meant to show you how many attendees you have. If you want additional information such as who registered/paid for a given person, you would be better off using a report, however, there does not seem to be one that will fit your needs:

The built-in participant report (Reports > Event Reports > Event Participant Report) will show only the Registered by Participant ID (not the name) and does not have grouping or sort options for either Registered by or Organization.

The Extended Report extension, on the other hand, gets you pretty close with
Extended Report - Participants (Reports > Create Reports from Templates > Event Reports):

As you can see from the screenshot of the left-hand side of the report, Extended Report - Participants does offer the Registered by Participant Name and allows you to sort by the same, however (and this will be the same for any report you use) the person who submitted the registration will not have a value in the registered by field, so while you can group the additional participants together, the actual registrant will be listed in the "None" group.

The Fee Amount (which corresponds to the Fee Level) will always be divided up according to the selections made for each participant - this is important when you need to know who ordered what regardless of who actually paid. Both reports offer you the option of the Net Amount field (Total Amount less any Transaction Fees) that would only be populated for the person who paid, but neither of the reports offer you the Total Amount field (which would not exclude any transaction fees - screenshot below shows the right-hand side of the report):

So, in short, there does not appear to be something out of the box or available through an extension that will suit your needs, but from a development standpoint it is a simple thing to add additional fields to a given report.

Sorry not to be the bearer of better news,
Tamar


Error during registration for multiple participants I'm running into an issue for event registrations where multiple participants can be registered.  The first registrant goes through fine, however, when submitting registration #2, the following error occurs:

Call to protected method CRM_Event_Form_Registration_Register::getRegistrationContactID() from context 'CRM_Event_Form_Registration_AdditionalParticipant'

I am running Joomla 3.7.2 and Civicrm 4.7.19

Thoughts on where to go?

The error is due to call to the protected function getRegistrationContactID() in CRM_Event_Form_Registration_AdditionalParticipant class for multiple event participants registration.

The issue got resolved in my installation (civicrm 4.7.19) after changing the access control of the function getRegistrationContactID() from protected to public.

The file location is civicrm-module/CRM/Event/Form/Registration.php


How can I add/rearrange custom fields in the default contact view template? We would like to rearrange the output of custom fields on the basic contact view page (in Drupal, /civicrm/contact/view?cid=NNNN&reset=1) in CiviCRM 4.5 on Drupal 7. Specifically, since this is a university student organization, we have a custom field called "Class Year" (simple text, field id 31, in custom data group 1 "Enrollment information") that we would like to display in the main title, after the display name. Thus, the page headline would say Joan Smith 2017 instead of the default Joan Smith.

The template to override we found easily enough in /sites/all/modules/civicrm/templates/CRM/Contact/Page/Inline/ContactName.tpl. The question is then what is the template variable for this custom field?

We could not locate this in the documentation, and all the forum threads that come up seem to be about customizing event or contribution pages, not the contact page itself.

With debugging on, adding the &smartydebug=1 parameter to the query string on the record returns this value for {$viewCustomData}:

Array (3)
1 => Array (1)
  1421 => Array (7)
    title => "Enrollment information"
    name => "enrollment_information"
    help_pre => ""
    help_post => ""
    collapse_display => "0"
    collapse_adv_display => null
    fields => Array (11)
      31 => Array (5)
        field_title => "Class Year"
        field_type => "Text"
        field_data_type => "Int"
        field_value => "2017"
        options_per_line => null
      2 => Array (5) [snipped]

Based on this and examples of template overrides elsewhere, we have made a number guesses, among them

  {$custom_value_31}
  {$profileFields_1.custom_31}
  {$viewCustomData.1.fields.31}
  {$viewCustomData.1.1421.fields.31}

but they have all been fruitless.

Google finds very few forum threads at all that even mention {$viewCustomData}, so any enlightenment is greatly appreciated.

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}


Bounce Handling with Amazon SES/SNS I have a setup with CiviCRM and Amazon SES, everything is working fine.

A Problem arises with the bounce handling. Amazon can either do that internally via Amazon SNS, or just forward the mails to your domain for common handling (Catchall or VERP).

I wanted to use the SNS mechanism, and amazon sends the mail correctly to the specified address, but the email isn't a typical bounce mail, but instead the original headers are JSON encoded like this:

{   "notificationType": "Bounce",   "bounce": {
    "bounceType": "Permanent",
    "bounceSubType": "General",
    "bouncedRecipients": [{
      "emailAddress": "bounce@simulator.amazonses.com",
      "action": "failed",
      "status": "5.1.1",
      "diagnosticCode": "smtp; 550 5.1.1 user unknown"
    }],
    "timestamp": "2017-11-20T11:05:06.477Z",
    "feedbackId": "0102015fd91a6479-ae22395c-1f7d-4423-a9e5-e0715bffc731-000000",
    "remoteMtaIp": "1.2.3.4",
    "reportingMTA": "dsn; a4-8.smtp-out.eu-west-1.amazonses.com"   },   "mail": {
    "timestamp": "2017-11-20T11:05:04.000Z",
    "source": "bounce.crm+b.83.52.2a7c92a4101dd5fd@example.com",
    "sourceArn": "ARN_INTERNAL:identity/example.com",
    "sourceIp": "1.2.3.4",
    "sendingAccountId": "__ID__",
    "messageId": "0102015fd91a5ca3-93c245fe-e333-46ae-8fed-96160d20cfab-000000",
    "destination": ["bounce@simulator.amazonses.com"],
    "headersTruncated": false,
    "headers": [{
      "name": "Received",
      "value": "from crm.example.com (mx02.example.com [1.2.3.4]) by email-smtp.amazonaws.com with SMTP (SimpleEmailService-2638500019) id MbY8b9mKuaex7LdPcwd8 for bounce@simulator.amazonses.com; Mon, 20 Nov 2017 11:05:04 +0000 (UTC)"
    }, {
      "name": "MIME-Version",
      "value": "1.0"
    }, {
      "name": "Content-Type",
      "value": "multipart/alternative; boundary=\"=_99c8dccfc484a99b0f6101141a34c4ae\""
    }, {
      "name": "Reply-To",
      "value": "\"Example Company\" <info@example.com>"
    }, {
      "name": "Return-Path",
      "value": "bounce.crm+b.83.52.2a7c92a4101dd5fd@example.com"
    }, {
      "name": "From",
      "value": "\"Example Company\" <info@example.com>"
    }, {
      "name": "Subject",
      "value": "Bounce Test – Monday 4"
    }, {
      "name": "List-Unsubscribe",
      "value": "<mailto:bounce.crm+u.83.52.2a7c92a4101dd5fd@example.com>"
    }, {
      "name": "job_id",
      "value": "83"
    }, {
      "name": "To",
      "value": "Tom TestUser <bounce@simulator.amazonses.com>"
    }, {
      "name": "Precedence",
      "value": "bulk"
    }, {
      "name": "X-CiviMail-Bounce",
      "value": "bounce.crm+b.83.52.2a7c92a4101dd5fd@example.com"
    }, {
      "name": "Date",
      "value": "Mon, 20 Nov 2017 12:05:04 +0100"
    }],
    "commonHeaders": {
      "returnPath": "bounce.crm+b.83.52.2a7c92a4101dd5fd@example.com",
      "from": ["Example Company <info@example.com>"],
      "replyTo": ["Example Company <info@example.com>"],
      "date": "Mon, 20 Nov 2017 12:05:04 +0100",
      "to": ["Tom TestUser <bounce@simulator.amazonses.com>"],
      "subject": "Bounce Test – Monday 4"
    }   } }

Civi cannot handle this type of message (to the best of my knowledge) and it is then moved to the ignored folder.
I'm pretty sure I am not the first one to have this problem, but I couldn't find any solutions to this. Maybe someone has written a parser for those type of messages already?

Help/Suggestions are welcome!

I've created an extension to handle bounces through Amazon SNS notifications, see civicrm-ses.

It exposes a webhook to process SNS notifications and map and create bounces when appropriate.

Hope you find it useful.

PS: although the extension is in alpha stage, I've been using it in production for a month (~60,000 emails processed), test in a dev environment first if you like :)


Can I use different financial types for membership registrations and renewals without losing functionality? This page
http://book.civicrm.org/user/current/contributions/setup/
mentions

  Be careful when editing core Financial Types or adding new types,
  because CiviCRM has useful built-in functionality that depends on the
  core Financial Types.

Does anyone know more details ?

More concrete question: my client uses different accounting codes for membership registration and membership renewal. Can I use a different financial type for membership registration (other than 'member dues') without losing functionality ?

As a member of the CiviCRM documentation team I will follow up on that quote, as I am not sure what it means myself. It may be left over from earlier times and no-one has been brave enough to modify or delete it.

From experience I can tell you that you can create the new financial types for income that you need.

My organisation also uses different accounting codes for new memberships and for renewals and I have created a different financial type for each.

For historical reasons we use a different contribution page for our renewing members than the one set up for our new members. You would not need to do that if you are prepared to have two price sets on the same page, one for new members and one for renewals.

In terms of reporting, you may need to use the line-item report from the Extended Reports Extension to give the income broken down by financial type.


Profile creation workflow message, where is it located? I would like to modify format and content of profile creation notification email message. Which template is it?

Administer -> CiviMail -> Message Templates -> System Workflow Messages tab -> Profiles - Admin Notification

Looks like it, although personally I haven't tried this before.


add CiviCRM extensions to local site I am working on a redesign of an existing site.  I've gone ahead and created a local site and imported the CiviCRM database.  The client wants to allow the user to add a discount code while subscribing to an on-line magazine (part of the redesign).  I've followed these directions https://wiki.civicrm.org/confluence/display/CRMDOC/Extensions and got to installing the manage extensions page where when I click on the install CiviDiscount Module Extension it redirects me to the log in page on the live site.

I am thinking that there must be a configuration issue somewhere.

Sometimes CiviCRM sends you to an absolute URL, even though most of the time you navigate through links with relative URLs.

CiviCRM uses the base URL in your civicrm.settings.php file to build the absolute URLs, and it caches that base URL for performance.  I suspect that your situation is either:

the base URL in the settings file still points to the live site, or
the cache still has the live site URL even though you updated the settings file.

To fix this, confirm that the settings file has the right URL, and then visit Administer > System Settings > Clear caches and update paths.  Update the paths there, and you should be good to go.


How to handle deadnames? Are there any recommendations with how to store the deadname of a contact that is undergoing a gender change? i.e. They have not yet changed their legal first name and we want to communicate with them using their (corrected) first name, but legal/financial documents must use their deadname.

A custom field works well, but I would also consider repurposing the nickname field via Word Replacements, since you can enable QuickSearch on nickname.

With regard to legal/financial documents, I'd probably repurpose the postal and email greetings for normal communications and communications requiring the deadname.  If you're already using those, you could also create a deadname salutation using the Salutations extension.


How to associate drupal content types with civicrm new group? I have created the 10 contents(Article content type) in the Drupal.

And now, I want to associate these contents with new group in CiviCRM.

Please tell me how to associate these things ?

You may also want to look at Organic Groups, which you can also sync with civicrm, so a contact in a civicrm group is a member of an Organic Group, or vice versa. Then you can use OG as containers for your content. Probably not worth it if you only have a few pages of information.


Linking CiviCase with a CiviEvent This one may have an obvious answer, but I just cant seem to find a simple solution.
Running Wordpress 4.2.2 CiviCRM 4.6.3

In a nutshell We want to use CiviCase to coordinate Event management. The Events will be using CiviEvent to deal with venue and participant sign ups etc.

So the Case will be auto assigned to an Event Manager (case coordinator), and also their boss (case supervisor), the Event Manager will go through the steps of the case, such as getting quotes for venue, then tick off from supervisor, then A/V system etc, then any talent issues, then setting up promo etc etc.

So What i want to do is work out a simple way to connect the Case to the particular CiviEvent that will already have been created - so you can easily say click through to the Event from the case..

An obvious way would be to Make the CiviEvent the equivalent of the client, meaning the Case coordinator, and supervisor end up with a role / relationship with the target which is a CiviEvent instead of an individual client - but the case set up does not quite work like that, and it seems case relationships cant be with Events only contact types.

At the most basic it could just be a link in custom field I guess?

But this leaves the problem - who or what should be the client when setting up a new case? Perhaps a dummy Contact could fill this role..

As I said maybe I am just missing a simple solution here, any help appreciated..

Who are you organising the event for? Your organisation seems to be the most natural, but having a client of a case (used to be?) is tricky. If it doesn't work easily with your org, I'd put the event manager as the "client".

As for creating the link, I'd put a custom field (integer) that contains the id of the related entity. I'm not sure I'd put the event id on the case of the case id on the event, depends of your workflow and which one is created first, and a tiny extension to display the id as a link instead of the number.

X+


Is it possible to add contribution note when renewing membership in (one of) the next release? I ran into this problem for a client who needs to specify, when renewing a membership, the bank name.

So I decided to store this value into contribution note, but when renewing, this field does not appears in the form.

I added this on line 409 of CRM_Member_Form_MembershipRenewal.php

   $this->add('text', 'contribution_note', ts('Note'),
    CRM_Core_DAO::getAttribute('CRM_Core_DAO_Note', 'note')
  );

And this on line 730 of CRM_Member_Form_MembershipRenewal.php

$note = new CRM_Core_DAO_Note();
$note->entity_table = 'civicrm_contribution';
$note->entity_id = $temporaryParams['contribution_id'];
$note->note = $formValues['contribution_note'];
$note->contact_id = $formValues['contact_id'];
$note->modified_date = CRM_Utils_Date::getToday();
$note->privacy = 0;
$note->save();

Here is the .tpl modification on line 176

{$form.contribution_note.label}
{$form.contribution_note.html}

I would advise you to avoid changing the core files (php or template). You should write an extension that adds the field (in the buildform hook) and save it whilst processing the form.

However, It might be better to use other ways to save that information. The financial type for instance where you can create several, based on the bank (assuming it's the client bank) or use the check number or source (both existing fields in the contribution) if it's an information about the member's bank.


Social media sharing only shows Twitter We've had social media sharing for our events ("Allow sharing through social media?") enabled "forever".

Now it only shows the twitter birdie. Inspecting the page reveals that there is some code there for each of G+, Facebook and LinkedIN, but nothing shows.

We are running CiviCRM 5.13.4 on Joomla 3.9.6.

I can't find any indication that it should be configurable somewhere either.

How do I get my Social Media Sharing Icons/Links back?

Turned out that it was the browser's adblocker that made the icons disappear.


Any justification for separate database Since the days of CiviCRM as a standalone project are long passed, is there any reason, in 2016, to have a separate database for Drupal and one for CiviCRM? If so, what is the compelling reason? For the record, I only see downsides, not the least of which is backup and restore should disaster strike. I've just taken over the care and feeding of an existing site where separate databases were used in the setup. The customer used the backup_migrate module to do regular database backups and, you guessed it, only the Drupal DB was actually getting backed up.

Thanks for your insight.

-- Marcel

To add to Erik's, here are three advantages to separating the databases:

1) Upgrades.  When we are working to upgrade Civi, I know that the website side of the house is largely unaffected (not completely unaffected, but mostly), and if something in the upgrade goes awry, I'm only having to deal with the Civi side of things (especially in the event of downtime).

2) Restoring backups.  Should you need to restore a backup of your website (like we did last year), you are only losing the web changes made since the backup, not the Civi changes as well.  The same is also true if you need to restore the Civi backup -- you then don't lose the website changes made since the restoration point.

3) Multi-site installations. See the documentation here: Multi Site Installations


How to make tables with fixed header and left column - scroll vertically and horizontally In our use case we need to batch update participants with large tables - up to 45 columns and 20-50 rows. For this to have any hope of success we had to find a way of getting the table to scroll vertically and horizontally, while fixing the header and left column. How to do it? Read on...

We found a way that may perhaps be helpful for others, so we're posting the answer here. This applies to Drupal 7, Civi 4.6.17:

We needed to add extra fields to the Batch update profile code, as per this answer.
We used some javascript and custom css and allocated it to our batch update pages as a Drupal block, using php to target pages with '_qf_Batch_display' in their query string. (Actually, the Css went in our custom css file.)
You can find a simplified example containing the javascript, html and css here.

Hope this might give others a leg up to a system that has worked really well for us.


Dealing with CiviCRM contact records of Drupal blocked accounts Is there a way to automate removing the contact records of Drupal accounts that are blocked such as because of spam? I am using the spambot module to block accounts and remove their spam.

I fear that there are thousands of bogus records in our CiviCRM with no way to confirm their legitimacy.

Drupal 7 and CiviCRM 4.7.27

We didn't find a great way of dealing with this. I think we found the best approach was to use Drupal Views and VBO and probably civicrm entities so that we could grab the civi records of the users who we wanted to cull, and then delete the civi record and then delete the user record. If I can dig out the View I will share


Import custom field to fill duplicate contacts I am importing two custom fields and an email address (which is used to match up with the contact)

I have 1000 rows and successfully imported 800.  The error reason for the 200, was'record duplicates multiple contacts'.

I believe this is because there's duplicate contacts (2 or more contacts with the same email).  Therefore I want to import these but fill in the two custom fields into each duplicate contact.

So one row but into multiple contacts with the same email.

Is there a way to do this?

Drupal. Civi CRM 4.5.8

Many thanks in advance,
Andy

One way to do it is to place these 200 records in a separate csv and add a column with the CiviCRM contact id and use that as the matching identifier. In that case you would also need to copy the records for each contact with the same email address.

Another one is to do the same, but then use the "external identifier" field as the matching identifier.

Quite a bit of manual work.

All other solutions I see would be with custom coding (or custom import scripts).


Why unexpected attached files are loaded in all mailings by default? We upgrade recently from 4.5.8 to 4.6.6 on four of our CiviCRM instances.

In one of the instances ocurrs something very strange and compromising. When we create a new mailing, in the attachment tab appears one/two random files uploaded previously to event custom fields.

However if we try to delete the attached file/s we get the following error:

  "Failed to run permission check: Unrecognized target entity table
  (civicrm_participant)"

Why they appear if they have no connection with the mailings?

Edit: Screenshot

I think I've found the cause. Check out bug CRM-16544, it matches your problem exactly (except theirs was Grant and yours is Event). I think we can fix this by adding civicrm_event to the array on line 210 of Container.php, but I'm not familiar enough with the Symfony stuff to be sure. I think your best bet is to file a bug.


Default localisation Can you please tell me if you can set the default localisation to one country, so that language/currency/address country are already set?

Many thanks

Paul

Defaults for localisation you can set :

Go to,

CiviCRM->Administer->Localization->Language,Currency,Locations

You can set,

a) Preferred languages Options
b) Date formats
c) Addresses settings under   Administer menu.


Private Files Readable How can I fix this error on CiviCRM. Thanks.

Preventing access to those files should be taken care of by .htaccess files.

You should have .htaccess files under files/civicrm/ConfigAndLog, files/civicrm/upload, files/civicrm/custom with content:

<Files "*">
  Order allow,deny
  Deny from all
</Files>

What webserver are you using?  Is this on a hosted environment or your own server?  The server needs to be configured to use .htaccess files

For Apache, see https://httpd.apache.org/docs/current/mod/core.html#allowoverride

For nginx, see other posts on this site - eg:

Files in the data directory (Upload | Custom)should not be downloadable. (Nginx)
Is CiviCRM compatible with Nginx?
Security Warning on Dashboard (pantheon / nginx)


How do I add a Membership Expiry view-only field to a user profile page in Wordpress? I want to let members see their membership expiry date. I am running Civi 4.6 with Wordpress 4.4.1. I have tried creating a Membership Details profile with one field "Membership Expiration Date" in it, but whenever I try and view the field, I get "Profile search, view and edit are not supported for Profiles which include fields for more than one record type."

If you want to fetch this information directly, the following code should get you started. It displays the logged-in user's membership expiry date:

// get current WP user
$user = wp_get_current_user();

if ( civi_wp()->initialize() ) {

    // get contact ID
    require_once 'CRM/Core/BAO/UFMatch.php';
    $civi_contact_id = CRM_Core_BAO_UFMatch::getContactId( $user->ID );

    // get CiviCRM membership details
    $memberships = civicrm_api( 'Membership', 'get', array(
        'version' => '3',
        'page' => 'CiviCRM',
        'q' => 'civicrm/ajax/rest',
        'sequential' => '1',
        'contact_id' => $civi_contact_id,
    ));

    // show expiry date
    echo $memberships['values'][0]['end_date'];

}

Obviously your production code would include error checks after fetching the CiviCRM Contact ID and the Memberships that they may or may not hold. It would also convert the date to a more friendly format.


How can I install/manage CiviCRM patches on Drupal 8 (using Composer)? I sometimes need to fix a bug in CiviCRM before that bug is fixed in the latest version of CiviCRM.  With non-composer installations, I patch my dev site, commit my changes to git, and push them to a repo, then deploy to test/live sites.

Using composer, CiviCRM isn't in my git repo.  What's a reasonable way to manage patches so they a) persist across upgrades, b) can be managed in git?

Alternately: I'd like to test a patch that someone thinks will fix a bug in my CiviCRM installation.  How can I do that?

Drupal 8/CiviCRM has the composer-patches package already installed.  So you can add a section to the "extra" element in composer.json called "patches", and list out the patch with a title and a URL (or path) to a .diff file.  Here's an example where I add four patches to standard CiviCRM:

diff --git a/composer.json b/composer.json
index 453ff74..5827a69 100644
--- a/composer.json
+++ b/composer.json
@@ -68,6 +68,14 @@
         ]
     },
     "extra": {
+        "patches": {
+          "civicrm/civicrm-core": {
+            "core#609, PR 13390.": "https://patch-diff.githubusercontent.com/raw/civicrm/civicrm-core/pull/13390.diff",
+            "core#580, PR 13373.": "https://patch-diff.githubusercontent.com/raw/civicrm/civicrm-core/pull/13373.diff",
+            "membership#9, PR#13553 (membership renewal notification fix)": "https://patch-diff.githubusercontent.com/raw/civicrm/civicrm-core/pull/13553.diff",
+            "reporting#8, PR 13653 (thank-you dates on contribution reports)": "https://patch-diff.githubusercontent.com/raw/civicrm/civicrm-core/pull/13653.diff"
+          }
+        },
         "patchLevel": {
             "drupal/core": "-p2"
         },

Note: If you don't use the excellent roundearth/civicrm-composer-plugin but instead use the full manual process to update CiviCRM, you'll need to perform the update steps every time you run composer install with patches.


Where to modify billing information form ≥ 4.6? One of the first things we're asked to change in any installation is the billing block:

Nothing too fancy, just some changes to layout and labels, usually yielding something along the lines of

This was for a long time a simple matter of copying BillingBlock.tpl to create a custom template (customtemplates/CRM/Core/BillingBlock.tpl), as indicated in the wiki. But the hard-coded billing fields were removed in 4.6, and instead we they are printed out from the $billingDetailsFields array.

While I can't fault this from a technical perspective, I do wonder what would be the best practice as far as manipulating the layout and order for this form goes now. In the override template, would we remove the for block and output the old fields one by one? Is there a place where these values can be changed in the db or even through the admin UI?

Your best option is to do what you were doing previously.

However, you will need to modify your customized template to extract details from the $billingDetailsFields array rather than the hard coded fields. I suspect the names are the same, so the translation should be relatively simple. You can use smarty debug to get more details on the contents of the array.


Change the layout of CiviCRM > CiviCase Dashboard > Find Cases I've only started trying to change some features of an existing CiviCRM database in a testsystem (using CiviCases). So I am still a beginner, I excuse myself if this is a silly question, and any hint will be appreciated :)
My goal is to change the layout of the search results in Find Cases. Specifically, I want to change the line height. I tried editing this in the CSS file but didn't succeed.
Do you have any hints for me?
Edit: In the civicrm.css, I tried setting the line height for example in this part (the class of the table lines is even-row or odd-row, among others):
.crm-container tr.even-row td,
.crm-container tr.odd-row td,
.crm-container table.display td,
.crm-container table.pagerDisplay td {
  border-color: #efefef;
  border-right: 1px solid #efefef;
  border-collapse: collapse;
}

Did you try civicase v5 extension? It has got nice UI to manage cases.


What are the advantages of a multi-site installation? I am working with an organisation that is already using CiviCRM in English. It is developing with teams in a number of countries each of which is recruiting supporters, running training events and working in a different language. We now have Spanish, French, German and Finnish speaking teams. What advantages would we gain from a multisite installation?

The current English installation of CiviCRM is in a Joomla environment.

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.


Is a Scheduled Reminder possible when something doesn't happen? A client has asked that an email or SMS reminder be sent if a user fails to submit a weekly report.  The weekly report would be created as an activity - for example, by noon every Friday.  I can't quite see how this can be done, but others may have more imagination then me!  So, is this possible?  Perhaps using a combination of CiviRules and Scheduled Reminders?

How about something like

create a Group of all possible recipients of the reminder (X)
create a Smart Group of all those who did the Report (Y)
create a Smart Group Z = X-Y (use 'Custom Search = Include/Exclude)
use Z as your 'target' in Scheduled Reminders

Alternatively

create the Activity for every person who needs to do this
set the Activity to Scheduled
ensure that submitting the Report sets the Activity to Completed
set Reminder to go to all those that are still set as Scheduled


Data is not loading in CiviHR In the CiviHR installation, data is not displaying in self service portal. In menu like My Leave under self portal showing angular js error in console.

But in HR menu I'm able to see all my contacts. there are no errors at all.

This installation is hosted in DigitalOcean 2GB RAM and 2CPU.

Is CiviHR required more RAM?

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


Prevent users from changing membership type when they renew? Does anyone know an easy way to prevent users from changing membership type when they renew via the renewal page?

Thanks in advance!

Does your membership renewal page show multiple membership-type options?

You may need to set up different membership renewal pages for different membership type.


Can I run a Test Installation? If so, how? I'm part of a non-profit organization - the Center for Jewish Nonviolence - that is looking to use CiviCRM. We are very impressed with what we've seen on your website thus far and want to move forward but have two outstanding questions.

First, can Civi be downloaded onto an individual computer and played around with? How so?
The hope is to test out the system itself (outside the demos) and get started with our work.

Secondly, if we wished to start an account now then delete it, would that be possible?

I've read through the first part of the guide and can't locate an answer to my questions. Could you let me know how to proceed or point me in the right direction?

Thanks so much!

Sincerely,
Michael D. Evers

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.


Strange consistent log notices. Where do they come from? I haven't tried asking on stackexchange before (only the old forums), so please excuse me if I do it in the wrong fashion... I did google this, but couldn't find anything that helped me remove these. I may of course have done something stupid again..

I have some cron-triggered notification messages that keeps appearing on every cron run. They are:

  Notice: Constant CIVICRM_USE_MEMCACHE already defined in include_once() (line 314 of /wwwroot/sites/example.org/civicrm.settings.php).

  Notice: Constant CIVICRM_MEMCACHE_HOST already defined in include_once() (line 320 of /wwwroot/sites/example.org/civicrm.settings.php).

  Notice: Constant CIVICRM_MEMCACHE_PORT already defined in include_once() (line 325 of /wwwroot/sites/example.org/civicrm.settings.php).

  Notice: Constant CIVICRM_MEMCACHE_TIMEOUT already defined in include_once() (line 331 of /wwwroot/sites/example.org/civicrm.settings.php).

  Notice: Constant CIVICRM_MEMCACHE_PREFIX already defined in include_once() (line 341 of /wwwroot/sites/example.org/civicrm.settings.php).

I'm worried they are more serious than they appear, and they anyway do clog up my log files. What could be the reason for these appearing?
I recently did an upgrade to version 4.6.4 (drupal 7.38), but I'm not sure if this was what triggered this.

Appreciate any suggestions!

Since it's coming from include_once I suspect you have two civicrm.settings.php files.

The correct location is sites/<default or example.org>/civicrm.settings.php

If there's a file in sites/civicrm.settings.php, rename or remove it and see if that ends the errors.

--

EDIT: OK, having reformatted your question I can see the file path isn't actually sites//civicrm.settings.php ... StackExchange was hiding your sites directory because of the angle brackets.

SO - either you have two files (eg sites/default/civicrm.settings.php AND sites/example.org/civicrm.settings.php) OR your site somehow include_once's it after it's already included (?).

Let's use grep to look for files which define that constant:

grep -riE '^define.*CIVICRM_MEMCACHE' /path/to/site/root

If that identifies multiple files with this constant defined, then you probably want to eliminate one of those files. If it only locates a single file, then you may need to dig further to identify why that file is being included twice ... especially when the second time, it's being included using include_once :)


Broken SMTP after switching to PHP 7.2 Recently I updated CiviCRM to version 5.10.4 and while I was at it updated Drupal to 7.64 (using drush). Everything appeared fine. Then I noticed in the CiviCRM System Status report that PHP 7.1 which I had been using was no longer recommended and that I should upgrade PHP to 7.2. When I did that, the CiviCRM System Status reported "PHP Missing Extension 'mcrypt'". Not knowing that mcrypt could reek havoc on my server, I dutifully went to add it. Long story shortened, right now I'm feeling very confused and SMTP isn't working either in Drupal (not a big deal since I only use Drupal as a platform for CiviCRM) or in CiviCRM (a very big deal). Just to be clear, everything was working fine before I did the upgrades.

My inclination is to nuke PHP and reinstall it. I'm seeking advice as to whether this could work, or is there an easier way to solve my problem. I'm running Ubuntu Server 18.04. If I tried something like:

apt purge ^php*

Would that completely remove PHP from my system? A bit of background that may be relevant, when I first set up the server (apache2) I had installed three versions of PHP, 7.1, 7.2, and 7.3. I'm pretty sure that somewhere I've missed some configuration files and that some of my problems come from version issues. When I went to do a PECL install of mcrypt it successfully created the module but PHP complained that it was compiled against a different API.

The old warning was actually just dealt with yesterday (https://github.com/civicrm/civicrm-core/pull/13770).

If you can remove mcrypt, you can get smtp working again by going to the admin screens in civicrm to reenter and resave your password. My understanding is it will be stored unencrypted in the database, but at least will work.


civiCase missing relationships to reports and new system category I am getting errors about a missing case relationship to reports:
[error] $Fatal Error Details = Array
(
[callback] => Array
(
[0] => CRM_Core_Error
[1] => exceptionHandler
)
[code] => -19
[message] => DB Error: no such field
[mode] => 16
[debug_info] => SELECT a.id as `id`, a.name_a_b as `name_a_b`, a.label_a_b as `label_a_b`, a.name_b_a as `name_b_a`, a.label_b_a as `label_b_a`, a.description as `description`, a.contact_type_a as `contact_type_a`, a.contact_type_b as `contact_type_b`, a.contact_sub_type_a as `contact_sub_type_a`, a.contact_sub_type_b as `contact_sub_type_b`, a.is_reserved as `is_reserved`, a.is_active as `is_active`, a_to_civicrm_value_relationship__37.display_block_on_contact_summary as `custom_157`

FROM civicrm_relationship_type a
LEFT JOIN civicrm_value_relationship__37 a_to_civicrm_value_relationship__37 ON a_to_civicrm_value_relationship__37.entity_id = a.id
[nativecode=1054 ** Unknown column 'a_to_civicrm_value_relationship__37.display_block_on_contact_summary' in 'field list']
[type] => DB_Error
[user_info] => SELECT a.id as id, a.name_a_b as name_a_b, a.label_a_b as label_a_b, a.name_b_a as name_b_a, a.label_b_a as label_b_a, a.description as description, a.contact_type_a as contact_type_a, a.contact_type_b as contact_type_b, a.contact_sub_type_a as contact_sub_type_a, a.contact_sub_type_b as contact_sub_type_b, a.is_reserved as is_reserved, a.is_active as is_active, a_to_civicrm_value_relationship__37.display_block_on_contact_summary as custom_157
FROM civicrm_relationship_type a
LEFT JOIN civicrm_value_relationship__37 a_to_civicrm_value_relationship__37 ON a_to_civicrm_value_relationship__37.entity_id = a.id
[nativecode=1054 ** Unknown column 'a_to_civicrm_value_relationship__37.display_block_on_contact_summary' in 'field list']
[to_string] => [db_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM_Core_Error::exceptionHandler prefix="" info="SELECT a.id as id, a.name_a_b as name_a_b, a.label_a_b as label_a_b, a.name_b_a as name_b_a, a.label_b_a as label_b_a, a.description as description, a.contact_type_a as contact_type_a, a.contact_type_b as contact_type_b, a.contact_sub_type_a as contact_sub_type_a, a.contact_sub_type_b as contact_sub_type_b, a.is_reserved as is_reserved, a.is_active as is_active, a_to_civicrm_value_relationship__37.display_block_on_contact_summary as custom_157
FROM civicrm_relationship_type a
LEFT JOIN civicrm_value_relationship__37 a_to_civicrm_value_relationship__37 ON a_to_civicrm_value_relationship__37.entity_id = a.id
[nativecode=1054 ** Unknown column 'a_to_civicrm_value_relationship__37.display_block_on_contact_summary' in 'field list']"]
)

By "report" I assume you mean a CiviReport? It sounds like you used to have a custom field when the report was created and then the custom field was deleted. You can try recreating/resaving the report.


How to display a contribution page in a drupal block (NOT USING WEBFORM) Normally Webforms would be a go-to solution but I have an urgent need and it is lacking recurring contributions + a few other necessities.

I have a contribution page and would like to put in panels or a drupal block.  I realize I can display a drupal block on a contribution page, but is it possible to display the page (no header, footer, etc.) in a block using an API call?  I know hooks are used when civicrm creates a page but I'm looking to do this in a drupal block (without something crazy like an iframe?

I don't think it'll work, no. Normally this might be done with &snippet=1, but it looks like that has a different meaning on contribute pages:

http://d45.demo.civicrm.org/civicrm/contribute/transact?id=1
http://d45.demo.civicrm.org/civicrm/contribute/transact?id=1&snippet=1


Contribution page - the field labels are missing I have installed civicrm and created a new contribution page. But the field labels are missing. Below is the link:

http://ny.missionaryfamiliesofchrist.us/index.php/donate

I would appreciate any help to fix this.

Ron

They are there, however, your label text is white on a white background.


CiviCRM Wordpress Cron not running - DB Error connect failed I've installed CiviCRM in one of my Wordpress site, It installed fine but it is showing me popup window that "No Cron is running", i've tried to setup Cron from my Cpanel with PHP-CLi method, I use this command:

/usr/local/bin/php /home/thetia/public_html/wp-content/plugins/civicrm/civicrm/bin/cli.php  -s thetia.com.au -u database_user -p database_user_password -e Job -a execute

When cron executes it send me Email with following error:

Sorry but we are not able to provide this at the moment.

DB Error: connect failed

I'm providing right username and password but even then it is showing me this error, i don't know what am i doing wrong, any help will be very appreciable.

The reference for cli is Manage Scheduled Jobs. It tells

  This method requires a valid Username and Password (for a Drupal, Joomla or WordPress user who has adequate permissions for the job or jobs being run).

So try to run it with a Wordpress user and password.


Manually 'Grant' last event places by 'Pending from waitlist' and override 'max participants' When an event fills as an event organizer you want some flexibility on who you would grant the last places from your waitlist to. For our summercamps we take into account if people already have brothers and sisters in our other camps and if the family also booked in the last years.

This means we would like to manually 'grant' the last places to some of the people on our waitlist. Therefore we change the participant status to 'Pending from waitlist' in order for the registrant to finish the registration.

Unfortunately this cannot proceed, because of the 'maximum participants' setting. I would advocate for a setting to be able to override the max.participant setting when people finish their registration.

I do not know which files would be related to this 'maximum check' and what good ways would be to be able to override it.

Currently we use this as a workaround:
In CRM/Event/Form/Registration/ParticipantConfirm.php we manually edit the emptyseats to allow the registration to finish.

//Allow confirmation even when waitlist is still on
$emptySeats = 99
//$emptySeats = CRM_Event_BAO_Participant::pendingToConfirmSpaces($this->_eventId);

In this way the event is still full and new registrations will be on the waitlist. But the people I manually edited to "pending from Waitlist" can finish their registration.


I have a list of requirements I am looking to fill -- Can CiviCRM do these? Thanks for the help. Our organization, and registration is fairly complex. We have three branches: volunteers, athletics, and scouting. All branches support all ages. We have one general membership fee that covers all members (except volunteers, of course), and as a member you could be in any and all branches. So here is what we need a system to do...

One account to manage multiple members (i.e. parent creating an account to create 2 memberships for his children)
Householding
Setting primary contact (i.e. for members under 18, a parent is the primary contact; for members 18+ they are their own contact)
The membership application needs to include two file uploads (that can be extracted/downloaded)
Member group - we (admin) need to have the ability to assign each
member to individual groups like "Boys Basketball age 5-7 Team 1" and
"Boy scouts troop 2". Again each member might be in more than one
group
The ability to filter and contact by groups above. That is we need to be able to filter to everyone in basketball, or everyone in basketball on 5-7 age teams, etc
Ability to create an event calendar by each group/team
Process yearly membership dues
Ability to filter for and contact unpaid members

So I think this is most everything -- please let me know if you need clarity on the above.

CiviCRM can do all the things you described above, with two caveats:

Some of the requests you're making around primary contact and one account managing multiple members work in CiviCRM with any CMS - but if your CMS isn't Drupal, you'll end up with some clunky public-facing data entry.  Stack Exchange is littered with people asking how to do forms like you're describing in WordPress and are largely disappointed.  If you're starting fresh, definitely use CiviCRM atop Drupal, and use Webform-CiviCRM integration to handle your public-facing forms.
Ditto the calendar - a WordPress or Joomla person can tell me if I'm wrong, but if you want a calendar in a calendar view (instead of, e.g., an events listing) I think you need Drupal.
Finally - you're right, this is definitely a complicated setup, no matter what CRM you choose!  I would dissuade most people new to CiviCRM from attempting something this complex on their first go-round.  Consider hiring someone, or be prepared for a challenge!

Fortunately, several of the items you're requesting (grouping into multiple groups, searching/contacting by groups, file uploads, processing membership dues, filtering for/contacting unpaid members) are all pretty out-of-the-box.  In fact, all of this is doable out-of-the-box (except the calendar, which requires a Drupal module), but the devil's in the details - specifically in the public-facing form details.


Can cv handle custom Wordpress installs? A wordpress install I'm adding CiviCRM to is setup in a non-standard way, specifically:

docroot
\- civicrm.settings.php
\- wp-config.php
\- content/
|  \- plugins
|  | \- civicrm
|  \- uploads
|     \- civicrm
\- wp (wp codebase in here)

I've got CiviCRM working fine, but I can't get my tests to run that rely on booting CiviCRM from cv php:boot. Trying to run CIVICRM_SETTINGS=civicrm.settings.php cv -vvv ... from the docroot just silently dies. I'm using cv version b3db22c.

Thanks to the helpful comments, I conclude: Yes it can, with a bit of help.

TL;DR

you need to define CIVICRM_CMSDIR in your code
you need set CIVICRM_SETTINGS as an environment var

Longer version

As far as I can work out, cv sources civicrm.settings.php before it sources wp-config.php. So if, like me, you have config set in civicrm.settings.php that depends on constants defined in wp-config.php you'll have to find a solution for that (e.g. use if (defined('...')) or put them all in a separate file and require_once(...) it.)

Then you need something like this in your civicrm.settings.php:

define('CIVICRM_CMSDIR', __DIR__ . '/wp');

Basically CiviCRM is going to expect to find wp-includes inside that directory, so adjust as you need to.

You don't need to call cv from within any particular directory, according to my tests.

You need to set the environment variable CIVICRM_SETTINGS to point to the civicrm.settings.php file. This can be a relative or absolute path.

I was then able to get cv to run, e.g. to use the API. Now if only I could get my tests to run....!


Contact type is read only in contact summary Why is the contact type read only in the summary tab for a contact? The 'contact_type' field is easily edited directly in the database, but I can't find a built in civicrm form to do this.

It isn't allowed and with very good reason! People do not morph into organisations (in my experience), therefore a CRM does not allow it. What is the problem you are trying to solve? Bad import?


Twilio Extension: "The selected contacts have no valid phone, or prefer not to receive SMS, or are deceased." I am on Drupal 7.51 / CiviCRM 4.7.12

I have just installed Twilio (SMS) Extension, purchased a number (+33... (France) from Twilio), upgraded my account, and configured Twilio Extension accordingly (as per https://wiki.civicrm.org/confluence/display/CRMDOC/Setting+up+a+SMS+Provider+for+CiviSMS) : filling username and password with the LIVE API Credentials specified at https://www.twilio.com/console/account/settings.

When I test it (on a test Group), I get the following Error Message :

The selected contacts have no valid phone, or prefer not to receive SMS, or are deceased.

(I did not configure inbound SMS)

Any suggestion would be welcome

Just the start of debugging, but maybe it evolves to a complete answer. I focus on the fact that the Send SMS menu does not show on a contact with a valid mobile phone. Can you execute the following script with your test contact_id (my test contact id = 204)?

<pre>
<?php
  $testContactId = 204;
  civicrm_initialize();
  if(CRM_SMS_BAO_Provider::activeProviderCount()){
     echo "SMS provider configured\n";
     $mobileTypeID = CRM_Core_OptionGroup::getValue('phone_type', 'Mobile', 'name');
     echo "Mobile type id =  $mobileTypeID \n";
       print_r(CRM_Contact_BAO_Contact_Location::getPhoneDetails($testContactId, $mobileTypeID));
  } else {
     echo "NO Sms provider configured\n";
 };
?>
</pre>

To execute the script save it to a file (for example test.php) and run it with

drush scr test.php

Hopefully, we get a hint if the configuration of the provider is the problem or the details of the test contact.

Update
When you have only web access the code can be executed on a Drupal instance as follows:

Enable the Drupal PHP Filter module.
Create a new Article
Past the script as contents of the article
Set the filter to PHP Code
Use the preview button for the result.

A word of warning, enabling the PHP Filter is a security risk because it allows the execution of arbitrary PHP code in every Drupal page.


Need to know how to print annual donation statements for our donors We are a church using CiviCRM.  We are at the time of year where we need to print out or email statements to our donors showing the tax deductible contributions they made so they can itemize these deductions on their tax returns.  How do I print individaul statements for these donors? Is there a way to sort this report so it will print all individual statements or would I have to run each report one at a time?  All donations have been properly input into the system and are ready to go.

Use a Thank-You Letter.

Run a contribution report for 2016.
Select the individual(s) you want to create reports for
In the Actions dropdown, select "Thank-You Letters for Contributions"
Select your Grouping (I use Contact)
Select Your separator-- Comma will put all information into groups separated by commas, Table Cell will separate each contribution into it's own row (Table Cell is buggy)

Here is a very helpful posting about this
https://github.com/civicrm/civicrm-user-guide/blob/master/docs/contributions/manual-receipts-and-thank-yous.md

Somethings I have learned along the way:
1. The bugginess of the Table Cell option can be overcome with Foreach code. I can send you my code but we use LineItems with all our donations so it might not work so well for your setup.
2. There are limits of how many letters Civi can handle at one time. I think it is 600 and that may be due to the PDF generator limits.


Why is the clear option missing on a custom field with radio options? When a custom field with radio options is created it has sometimes a clear option (see below)..

And sometimes it's not available like the color field. The first thought is that the reason is that the color field is mandatory, so the clear option is not needed, but that's is not the case. It is also optional. The missing clear option is annoying because it's not possible to undo a wrong choice. The used CiviCRM version is 5.28.

The difference is in the definition. The color field has the Options Per Line set. This has as a side-effect that it disables the clear box (and the change options wrench). Clearing this field makes the clear option return.


CiviMobile "unknown error" on Wordpress Does the CiviMobile Android app work with Wordpress based CiviCRM? When I enter my username and password and site URL into the login screen of CiviMobile, it just shows "Unknown error". But the demo account works fine.

There is the current situation with CiviMobile app and WordPress:

New CiviMobileAPI extension(https://civicrm.org/extensions/civimobileapi) is platform independent and works for all CMS Drupal/Joomla/WP.
But, there is an issue in standard CiviCRM API for WP. This issue prevents our extension to use API properly.
We proposed a quick fix for this problem. Our fix was rejected by the Core Team. And they started wider discussion in few threads. Please start reading here https://github.com/civicrm/civicrm-core/pull/12813#issuecomment-428152827

As now, we are still working on quick API patch for WP. I hope it will be available in the next few days. I will let you know as soon as it is ready.

As a long-term solution, we need a permanent fix which will be approved by the Core Team and included into standard CiviCRM code (see the issue above).

Thank you,
 Sergiy


Getting volunteer role in to email template We are using CiviVolunteer, and trying to setup a email template in that need to display volunteer role.  I think volunteer role is in activity record type. It does not show up in the token list in email template. I can get all the custom fields I have created in the volunteer signup profile.
Looking for a way to get volunteer role as token, please help

Thanks
Naheed

If you need something in a token that isn't a default token, you may need to create a custom token. Here's an earlier post with some example code. (You would switch out the logic that searches for the Drupal username with some logic that pulls the Volunteer Role from CiviCRM and inserts it into the token.)


How can i match CiviCRM ID on two installations? I have two instances of CiviCRM, not all the CiviCRM ID's match. How can i get the contacts on both databases to have the same CiviCRM ID (ie CiviCRM ID of contact A in db1 = CiviCRM ID of contact A in db2)?. The use case is as follows:

I have two civi dbs (I will refer to them as A and B, and they are not in sync), B is a copy of A, A is open to public for events registration, B is restricted only to internal network and is used for projects. Data in B is seen as more up to date and reliable because it is entered by staff. I don't want to sync B to A because they have unrelated activities. I want to pull data from A for reporting and if some fields are empty in A (e.g. date of birth), get this data from B if CiviCRM ID A = CiviCRM ID B

Depending on your end goal, one solution is to set the External ID of a record in instance B, to the Internal ID from instance A.

The Internal ID (civicrm_contact.id) is a primary key; the database engine assigns that field, and you risk data corruption by trying to keep it in sync yourself. The reliable way to keep them in sync is to have instance B act as a Replication Slave of instance A, where data changes in A are copied to B (but not vice versa).

If you can tell us more about what you are actually trying to achieve (as a new question), perhaps we can help you with the greater goal.


Batch Entry of NEW Pledges? We have a unique organization (large homeschool coop) that has various oddball requirements for membership types, durations, payments, etc.

I think I'm going to be using Pledges to solve some of our woes, and am wondering if it is possible to do a batch entry of NEW pledges. I see that you can do a batch entry of pledge payments, but can I do something like this?

Search for memberships with a certain status.

Take search results and create a new pledge for those people and set the details like Campaign associated with it, total pledge amount, pledge status?, and monthly payment plan.

Thanks!

Drupal 7.41
CiviCRM 4.6.10

If you export your search results to a CSV, you can then import them as pledges with the API csv Import GUI extension.  Setting up the columns correctly for the import will presumably take a little trial and error.


How to customise Shoreditch? When I do a contact search with the default layout my screen shows 13 contacts - I then have to scroll to see the rest.  When using Shoreditch, I can see only 4 contacts before scrolling because so much of the screen is taken up with title,  header and other areas that are generous in size & perhaps not optimally located.  This is on a newish laptop with a 15.4" HD screen (1920px x 1080), which must be a pretty common device.  This is using Firefox, full screen.  With Chrome, full screen, only 2 contacts are visible before you have to scroll!  My guess is that the developers of Shoreditch have 26" screens on which the layout probably looks great!!   But it really doesn't suit a smaller screen and for that reason I wouldn't change my clients to Shoreditch.  Is there a way it can be customised to fix this problem ? - apart from tinkering with the CSS, that is. With Coleman's wonderful summary screen layout extension depending on Shoreditch, Civi may be unwittingly going down a route of excluding itself from smaller screens, like my laptop - and my client's laptops. That would be a bad mistake.
By the way, in case you're thinking, 'make the font smaller' when I do this to the point where I can still just read the screen, I now can see only 7 contacts!

Your question appears to be:

  When using Shoreditch, I can see only 4 contacts before scrolling. Is there a way it can be customised - apart from tinkering with the CSS, that is?

Shoreditch does nothing but modify the look of CiviCRM via CSS. So, if you're unhappy with the out-of-the-box layout, CSS is what you'll have to use to modify it.

FWIW, my opinion is that http://thereisnopagefold.com/ but I agree that Shoreditch still needs to implement some responsive design for smaller screens. I'm guessing that one of the issues holding this back is that core templates need to be modified to achieve this.