Upgrade Paystation processor to 4.7 compatible After fixing some notices/warnings, I was quite able to configure and enable this processor on the contribution page.

When using this on a live page, I see an error after like

PHP Fatal error:  CRM_Contribute_Form_Contribution_Confirm::preProcess():
The script tried to execute a method or access a property of an incomplete object.
Please ensure that the class definition &quot;nz_co_fuzion_paystation&quot;
of the object you are trying to operate on was loaded _before_ unserialize()
gets called or provide a __autoload() function to load the class definition
in /Users/jitendra/src/civicrm/CRM/Contribute/Form/Contribution/Confirm.php
on line 323

I think as it doesn't actually follows the hierarchy CRM/Core/Payment/... this error is thrown.

Any thoughts?

Note:   $this->paymentProcessor['object'] has a class named __PHP_Incomplete_Class though it contains the paystation object.

I cloned it from https://github.com/eileenmcnaughton/nz.co.fuzion.paystation

Okay, I've just done a civix install using the developer guide and managed to get it done using the latest code formats. Things I did was:

Migrated the files to CRM/Core/Payment/...
Created a mgd file which automatically inserts the payment processor into the db.
Fix errors/warnings encountered during testing.

Sample upgrade commit - Link


Workflow for managing duplicate cases We've found an issue where a member of staff has created a new case for an existing contact instead of adding an activity to an existing case (Training and documentation is being addressed)
But it leaves us with a list of multiple cases of the same type on several client records.
There's no way of merging cases, so the best workflow I can think would be to identify one case as the "main case" to keep and work through the other cases and move any activities onto the main-case record.
Anybody got any other suggestions?

There is a merge case feature. The clients need to be the same client on both cases so you may need to merge contacts or change the client first. The feature is a little blue link about 1/4 way down the manage case screen.
You may also want to look at https://lab.civicrm.org/extensions/mergecaseandkeepid since, for unfortunate historical reasons, the case id changes when you do a merge.


Manually adjusting a contribution in the database I need to manually change a one-time Failed contribution in the database to a Completed contribution.  (See How do I change an incorrect contribution status to Completed? for context).  What tables and fields in the database do I need to adjust in order to make the change successfully?

Drupal 7, Civi 4.6

In Civi 4.6, when a contribution is made, an entry is recorded in the following three database tables: civicrm_contribution, civicrm_financial_item, and civicrm_line_item.  If a contribution is marked as Failed, other entries in other tables do not get made (these other entries are needed for CiviAccounting features like Exporting Accounting Batches).  To change the Failed contribution to Completed after the fact, follow the below steps:

In the civicrm_contribution table, the contribution_status_id for the contribution in question needs to be changed from 4 to 1.
In the civicrm_financial_item table, the status_id for the contribution needs to be changed from 3 to 1.  (You can identify the exact contribution in this table using the entity_id field.  The entity_id here comes from the id field in the civicrm_line_item table.)
In the civicrm_financial_trxn table, create an entry.  (This entry must be created before Step 4, so the entries in Step 4 have a financial_trxn record to reference).
In the civicrm_entity_financial_trxn table, create two entries.

4a) The first entry will have 'civicrm_contribution' in the entity_table
field and the contribution ID of the contribution itself in the
entity_id field.  The financial_trxn_id field will use the the
id from the entry you created in Step 3.

4b) The second entry will have 'civicrm_financial_item' in the entity_table field and the id from the civicrm_financial_item table in the entity_id field.  Again, the financial_trxn_id field will use the id from the entry you created in Step 3.


Customizing foreign language event confirmation email I have been looking around for a long time, here is what I want to do:
I am using Civi on Wordpress in German language. Now also the confirmation emails for event registrations are in German - great so far.

However, the German texts in the confirmation mails for the "send to a friend" are just way to formal and I would like to customize them. However, I can nowhere find the German texts. I have looked at the message templates, but there is nothing in foreign languages there. Where do I find it?

Thank you for your support in advance
Dennis

For information about how CiviCRM handles languages, see https://lab.civicrm.org/development-team/translations/wikis/home

Text strings in the templates are wrapped in {ts} ... {/ts} tags - that is what triggers the translation.

You could customise the German translation, or if your confirmations are only being sent in German, you could customise the confirmation message itself directly in German - see https://docs.civicrm.org/user/en/latest/email/message-templates/


How to Identify Contact as Deceased We have a contact in our database that is now deceased. We would like to maintain their historical records for archival use, but want to ensure that we stop sending mailings.

How do I identify someone in CiviCRM as being deceased?

Inside a contact, under demographics (gender, age, etc.) when you choose "Edit demographics" there's an option for "Contact is deceased".


Redirection to Organization Dashboard in Employer of Relationship When you create an Employer of relationship in Civicrm and the person who signs up on behalf of the Organization logs in he is usually redirected to his own dashboard. How do you redirect civicrm such that when he logs in he is redirected to the dashboard of the Organization?
Any help will be appreciated. I know that a redirect wil be implemented but what is the url of the organization dashboard?
Am using Civicrm 4.6.8 with wordpress 4.4.2

No need to redirect.

Make sure that in the employee's Contact > Relationships tab that by Permissions it is checked that the Employee can View and Edit the Employer Contact.
When the Employee logs into their dashboard, scroll all the way to the bottom and you will see a Relationship section showing "employee" as Employee of "Employer". Over to the right you will see Edit Contact Information & Dashboard. This will allow you to access the "Employer" Dashboard.


Search contacts with attachments I want to search for all contacts that have an attachment. How do I do this? I have looked under custom and advance searches. as well as searched all help documents for an answer.

I figured out how to create a custom search using 'search builder' and it has an option to search for attachments in the drop down.

Issue resolved


creating summary token for same donor but different categories I'd like to send out to our donors a summary of all their contributions in the past year.

I am using a token that summarizes the total donation amount for the past year. The issue is we have different Types of donations and don't want them all summed up together. So the question is
1. is there a way to get the sum only for specific transactions which i choose from the find contributions list
and if not
2. is there a way to save the tokens for different transaction types as different tokens and if so how?
Thanks alot!

Have you seen the summary fields extension?  I don't think it does exactly what you need out of the box but you can define additional fields using your own criteria with a little coding.


CiviCRM still creates MyISAM tables which results in Warning CiviCRM 4.7.10 --- WordPress 4.6

The following warning message appeared in CiviCRM System Status:

  Your database is configured to use the MyISAM database engine. CiviCRM
  requires InnoDB. You will need to convert any MyISAM tables in your
  database to InnoDB. Using MyISAM tables will result in data integrity
  issues.

This message appeared 5 days after upgrading to 4.7.10 from 4.7.8. The table with the MyISAM engine was: civicrm_task_action_temp%. I corrected it in MySQL using:

ALTER TABLE civicrm_task_action_temp% ENGINE=InnoDB;

On inspecting the code, I found the following in civicrm\civicrm\CRM\Contact\Form\Task.php on line 145

  $sql = "CREATE TABLE {$form->_componentTable} ( contact_id int primary
  key) ENGINE=MyISAM DEFAULT CHARACTER SET utf8 COLLATE
  utf8_unicode_ci";

and civicrm\civicrm\CRM\Export\BAO\Export.php on line 1494

  CREATE TABLE {$exportTempTable} ( ... ) ENGINE=MyISAM DEFAULT
  CHARACTER SET utf8 COLLATE utf8_unicode_ci;

All other MyISAM tables are defined as TEMPORARY.

Prior to performing the upgrade, I cleaned the caches using CiviCRM/System Settings/Cleanup Caches and Update Paths. Hence the reason civicrm_task_action_temp% was recreated.

Hopefully, this fix can be included in the next update.

Based on Dan's pointer to https://issues.civicrm.org/jira/browse/CRM-15601 , it seems like this used to work. It probably regressed with https://github.com/civicrm/civicrm-core/commit/3fa9688a5 which introduced a very subtle change to how it ignores temp tables. Compare:

(Old) strpos($dao->Name, '_temp') !== FALSE
(New) TABLE_NAME NOT LIKE '%temp'

Proposed fix: https://github.com/civicrm/civicrm-core/pull/8930


Creating specific Report How would we go about achieving the following report results? (I have looked at the report page but haven’t worked with this yet)

I have pasted a snippet below.

Zephyr,

The report you looking for is not available in CiviCRM. You will need to program to add such report through an extension.

Thanks

Pradeep


Intermittent instances of duplicate participant rows created - is this a MySQL issue? CiviCRM 4.4 install that has been running for ~ 2 years now, no update to code - in the past week I have seen 3 instances of duplicated participant rows (same contact_id, same event_id, fee, but register timestamp shows difference of 7 minutes to 1 hour).  The participant_id is different of course. Has anyone seen this or have suggestions how to debug this - MySQL server is hosted so I cannot get logs.

I have seen similar and it has always been traced to the user submitting the (in our case) membership form twice.

For some reason the final "Your membership has now been created" (or whatever it says) message has not been displayed, so they think it has failed and submit again.  Worse still they may get  "We cannot provide that at this time", which they interpret to mean the transaction has failed when really I thnk it is a timeout message for displaying that final "Done" message.

They should have received a confirmation email, but they have given the wrong adress, or it is caught up in a spam filter or delayed in transmission or ?

Why three times in one week? Perhaps there has been a heavier-than-usual load on the shared server leading to time-outs for that final message.


Can't access contribution page without a login I have recently updated CiviCRM in Joomla 3.x to the latest 5.5.2 build. I'm finding on my main contribution page (used for subscriptions), that I can't access it unless I'm logged in. When logged in, it loads fine. As a public user, I get just HTML on the page, which is an error saying I can't access it. The main part of this HTML is:

Sorry, due to an error, we are unable to fulfill your request at the moment.
You may want to contact your administrator or service provider with more details about what action you were performing when this occurred.

You do not have permission to access this page.

My Joomla menu item that is used in the URL for the page is set to public access. The settings for the contribution page itself haven't changed. What could I be missing here?

You may need to check/add necessary permission that is required to access contribution page for anonymous user.

You can check by navigating to CiviCRM >> Administrator >> Users and Permissions >> Permissions (Access Control). Click on 'Joomla Access Control'.


Problem selecting civiMail recipients I have two instances of civiCRM, both versions 4.7.30, both running under Joomla 3.8.5.

On one instance, I can select the recipient groups and see the items selected...
In the other instance, the Recipients box isn't behaving the same -- if I try to select groups, I don't see them in the list box afterwards, and the Recipient count always reports "No Recipients".

Both instances have public mailing lists, with positive Contact counts.

our developer resolved this as described here: https://issues.civicrm.org/jira/browse/CRM-21780


Volunteer Report does not report on 'Role' When I assign volunteers to shifts via the 'Assign Volunteers' screen, the roles are missing from the Volunteer Report.
When I assign volunteers to shifts via the api though, the Volunteer Report shows their roles.
But if i remove the same volunteers from a role via the 'Assign Volunteers' screen, to mark them as available, then again the Volunteer Report is not responding and shows the person as still having the initial role that the api was able to assign.
Am i doing something wrong? This happens on the latest Civi 4.7.19 on wordpress , but also on a new clean install of Civi 4.7.14 on wordpress .

It looks like you've found a bug in CiviVolunteer, which I've been able to reproduce, but it's not with the report -- it's with the assignment.

If you assign the volunteer by dragging them from "Available Volunteers" to a volunteer opportunity, the role is erroneously not populated. You can see this by opening up the contact's record and inspecting the activity on the activity tab.

If you assign the volunteer using the magnifying class in the top right corner of the volunteer opportunity, the role is populated as when you use the API. You can validate this by opening up the contact's record and inspecting the activity on the activity tab.


How do I set up CiviMail on Wordpress CiviCRM plugin? I'm using CiviCRM as a Wordpress plugin on localhost. I'm trying to configure outbound email service. I'm using Linux system.

I go to Administer > System Settings > Outbound Email (SMTP/Sendmail), select the mail() option and then when I send a test mail, I receive the following error.

It would be great if someone could help me with this.

I would recommend testing if you have sendmail configured properly on your server by trying to send from the commandline (http://tecadmin.net/ways-to-send-email-from-linux-command-line/). Follow general sysadmin approaches to solve that problem, not least of which is to get the ISP support to help you. Once you know your sendmail is delivering from the commandline, you will want to make sure that the PHP run by Apache or Nginx for this site is using the same sendmail.

Hope these pointers help. Sorry it isn't a step-by-step recipe but OS environments vary significantly.

Another alternative worth exploring a bit before going too far down the rabbit hole of setting up sendmail on the server is whether one of the other mail sending options available on that CiviCRM page works.


Mail not working url for third party app I’m doing a basic automation with scheduled reminders: I want to send a survey to every one where a certain activity is completed.
For the survey I use a nice third party app: surveypal.com. As I want to personalise the survey, I need personal data from civi to surveypal to identify the response.

Surveypal has nice documentation on how to do this. The url send to a potential respondent should look like:

https://my.surveypal.com/app/form/ext?_d=0&_sid=261570634&_k=2kpdVu0Y20GKuXoMnpsCYQ6c43g82T4PWT29J4Kj5TFRIBltoKRMpAng0p
iVLOtX&externalId=[ID]&meta=[{"key":"Gender","value":"Male"},{"key":"Age","value":"15"}]

where sid and k are the id’s of the survey in surveypal, externalID could be the contact_id from civi and the data in meta data could be other civi fields.

Building a message template in civimail, including some tokens for the personal data, this url so becomes:

https://my.surveypal.com/app/form/ext?_d=0&_sid=xxx&_k=xxxxx&externalid=[{contact.contact_id}]&meta=[{"key":"email","value":"{contact.email}"},{"key":"SRdonorcontactid","value":"{contact.contact_id}"},{"key":"firstname","value":"{contact.first_name}"},{"key":"lastname","value":"{contact.last_name}"},{"key":"Aanspreking","value":"{contact.addressee}"}]

When sending manually this message template using an individual email (activity -> send an email). This works perfect. Civi does send an email to the particular contact, and the person gets a nice link, participates the survey in surveypal and I have all the response data I need.

But, when I use this same message template to set a scheduled reminder link to an activity, then the email is send automatically correctly, but the url is changed towards something like &meta:[,,,,,,] So no personal data is transferred. The potential respondent gets an error message when clicking the url that the url does not exist.

Any idea’s: what happened, what is wrong?
I’m afraid it has something to do with the {} used for tokens in civimail, while used to group data in the surveypal-url.

Indeed, seems to be an issue with the reminder trying to read the "for surveypal"...

So you need to "escape" the { } that you want to keep for the end result so they aren't processed by civi and wrongly identified as token.

I think we are using smarty to process the token for the reminders, you can try putting {ldelim} instead of "{" and {rdelim} instead of "}".

Could you try if it works using scheduled reminder?

Unfortunately, civicrm has different ways of parsing the token using different tools (smarty is one way), so you might have one working for "normal" mails and that won't work on another part (reminders), and the workaround is potentially specific for each of these, so it makes the testing a bit more complicated than "just" sending an email.

X+

P.S. It's probably not as user friendly as surveypal, but you can quickly get something working with webform and webform_civicrm to make simple surveys directly integrated in your site, including being able to store the response as an activity of the contact.


Membership state deceased Can anyone please explain why a membership state Deceased exists (along with the contact's state)? Is there a use case where the membership is Deceased, but the contact is not?

I wouldn't have thought that just a membership would be deceased. As for logic, I've always made the assumptions that it's a safeguard from 'accidentally' soliciting membership renewals.


AngularJS issues with Drupal 7 + CiviCRM I recently installed CiviCRM 4.6.2 in our multisite Drupal 7 environment, running on IIS 8. I have CiviCRM 4.3.2 running on a Drupal 6 base without any issues on the same server; my plan is to migrate the D6 install and most of the data (contacts, etc) to D7.

Installation and configuration of CiviCRM went fine, as did importing contacts. However, I'm currently stuck on an issue that appears to have something to do with AngularJS and Windows/IIS paths, though I can't say that for sure.

When I go to Mailings -> New Mailing, it hangs - all it says on the page is "Initializing..." In Chrome's console, I see this error:

TypeError: a.headers is not a function
  at n (angular.js:9720)
  at angular.js:13248
  at n.$get.n.$eval (angular.js:14466)
  at n.$get.n.$digest (angular.js:14282)
  at n.$get.n.$apply (angular.js:14571)
  at l (angular.js:9698)
  at M (angular.js:9888)
  at XMLHttpRequest.F.onload (angular.js:9829)

In Drupal's watchdog log, I get this error (identifying path info changed):

LOCATION    https://www.fake.com/civicrm/ajax/angular-modules?l=en_US&r=fE7WM

REFERRER    https://www.fake.com/civicrm/a/

MESSAGE     Warning: file_get_contents(E:\webroot\drupalroot\sites\all\modules\civicrm/ang/crmMailingAB/E:\webroot\drupalroot\sites\all\modules\civicrm/ang/crmMailingAB\EditCtrl/report.html): failed to open stream: Invalid argument in Civi\Angular\Manager->getPartials() (line 203 of E:\webroot\drupalroot\sites\all\modules\civicrm\Civi\Angular\Manager.php).

It definitely looks to me like AngularJS is getting confused by Windows paths, but I'm not 100% sure that that's what's going on, nor how to fix it if I'm right.

As discussed in CRM-16499, the bug involves processing file relative-paths and absolute-paths on Windows. I reproduced the bug with D7 and XAMPP for Windows. There's a pending fix (.patch).

It might get merged before tomorrow's release (4.6.3); otherwise, it'll go out with 4.6.4.

Note: For general advice on how to interpret/evaluate pending patches, see http://wiki.civicrm.org/confluence/display/CRM/Verify+a+patch


How do I rebuild the training demo sites? After ssh'ing in:
$ ssh joemurray@www-training.civicrm.osuosl.org
I was going to restore the first 3 of 25 training sites using:

civibuild restore PARM_SITES="01 02 03"

as per the documentation for buildkit at  https://github.com/civicrm/civicrm-buildkit/blob/master/doc/civibuild.md#rebuilds and a tip from Tim about the parameter.

However, the civibuild command wasn't available in my path and I couldn't find the file either. I was expecting it to be available on this server. Has it been renamed?

The demo sites are built as a scheduled job in Jenkins. Authenticated users in Jenkins can start builds from the gui. Please contact the core team via email (totten or dave or coleman or kurund, at civicrm.org) if you need a login to that site.


The dashboard does not render The dashboard when I log in to CiviCRM does not render, it just continues to say "loading".
I have tried:

refreshing dashboard
reconfiguring dashboard
going to another page and coming back to dashboard.

I can't see any obvious errors in the javascript console in Firefox (firebug) or Chromium.  There are no errors in the apache logs either.

 CiviCRM 4.6.4, Wordpress 4.2.1, Apache 2.4, PHP 5.6.9-1, Mariadb 10.0, Debian Wheezy/Sid hybrid

A few things may cause issues like this.

Webserver cannot make HTTP(s) requests to itself

If CiviCRM / PHP cannot make a request to the CiviCRM site itself, it will be unable to retrieve the dashboard data. This can happen for multiple reasons:

Webserver is behind a proxy and proxy does not permit requests from internal network
Webserver has DNS which won't deliver request to the webserver
Webserver is not permitted to make HTTP requests
Webserver fails SSL negotiation (PHP5.6 requires a valid certificate chain installed, see note below)

Misconfigured base URL / access URL

CiviCRM requires a single configured canonical base URL, and it might be that if this doesn't match the URL you're using then CiviCRM won't handle the dashboard requests correctly. Check that the value defined for CIVICRM_UF_BASEURL in your civicrm.settings.php corresponds to the URL you're using - including both schema (http:// or https://) and hostname (example.org or www.example.org).

Because this can cause various issues, I recommend setting up an automatic redirect to prevent visitors viewing the site via the "wrong" URL (which will appear to work fine, except when it doesn't). See your webserver's documentation for how to do this - I think both Drupal and WordPress .htaccess files contain example rewrite snippets?

PHP5.6 and SSL sites

A few reports are surfacing of the changed default in PHP v5.6 affecting sites ability to connect to themselves (and to CiviCRM.org). In addition to having your SSL certificate correctly installed, PHP requires a correctly installed certificate chain to connect to SSL sites (including the local site). If your CA chain is outdated on the webserver, this may lead to failed dashboard and other issues when communicating with remote sites using SSL (payment processors, CiviCRM.org, and local requests such as dashboard widgets and API over HTTP).


getting past event by participant I am setting up views loading civicrm events and loaded the uid of user, and wanted to match the UID with the event he/she is registered from,

in views, I can not connect to participants through anywhere, when I tried loading relations ships :

    <select class="ctools-master-dependent form-select ctools-dependent-processed" id="edit-group" name="group">
<option value="all">- All -</option>
<option value="civicrm-custom--contact-person">CiviCRM Custom: Contact Person</option>
<option value="civicrm-custom--moderator">CiviCRM Custom: Moderator</option>
<option value="civicrm-custom--panelist">CiviCRM Custom: Panelist</option>
<option value="civicrm-custom--workgroup">CiviCRM Custom: Workgroup</option>
<option value="civicrm-events">CiviCRM Events</option><option value="civicrm-phone-details">CiviCRM Phone Details</option>
<option value="civicrm-price-set-entities">CiviCRM Price Set Entities</option></select>

I tried using the civicrm phone details but when connecting the civicrm participants its not loading anything

anywhere to connect it?

thank you

If you are wanting to show 'my events' you can create a View based on civicrm participants, then use Relationship to pull in "CiviCRM Contacts: Drupal ID", then set a views Filter to 'user: current = yes". Done.

But if i misunderstood then pls clarify the outcome you want and in what context.


Online contributions are marked as Pending (Incomplete transaction) status Whenever any user makes donation using Paypal payment option, it does not auto complete the payment in CiviCRM contribution dashboard. It shows it as "Pending (Incomplete Transaction)" status.

This was working (was marking the contribution with complete status) till May 2016 end, since June 2016 begining it stopped marking contribution to Completed status.

I believe what's being described here is a particular case of CiviCRM issue financial/27 - PayPal Standard doesn't handle IPNs.  The issue mentions recurring payments, but any payment involving an IPN is likely affected.

You can help solve this by testing the proposed fix and reporting on whether it solves your problem, creates new problems, etc.

Note also that this sounds related to the same section of code improved in financial/14 which deals specifically with PayPal Express.  You may want to see if upgrading to Civi 5.3.0 helps matters.


Sending invoices to members in bulk Is there any solution that can bulk email invoices to the members? For example a combination of the two features below:

Email invoice: https://docs.civicrm.org/user/en/latest/contributions/invoicing/

Mass mailings: https://docs.civicrm.org/user/en/latest/email/mass-mailings-using-civimail/

I have found the issue. It was a known issue of civicrm v5.25. Here is the details: https://github.com/civicrm/civicrm-core/pull/17164/files

"Invoices - print and email" has been appeared in the dropdown menu after implementing the patch. Thanks everyone for the help


Can I import contacts from Outlook into CiviCRM? Is it possible to transfer a contact list from Microsoft 365 Outlook to CiviCRM using a csv. File?

I don't understand this formating business, it's a simple enough question.

There is a very good explanation about importing contacts in to civicrm using csv in this chapter of the book. It doesn't matter where those contacts' data originated.

https://book.civicrm.org/user/current/common-workflows/importing-data/


How to get Views to work in CiviCRM on Drupal9 with separate CiviCRM database On based the answers on this question How to get CiviCRM Views to work in Drupal 8 with separate CiviCRM database I'm trying to get work Views on Drupal9. Drupal9 and CiviCRM has different databases, but the database user who is trying to work with the databases has access for both databases, and I installed CiviCRM Entity module (the latest Drupal8 version).
I put a second $databases['civicrm']['default'] = array {......}; to the end of my settings.php file with the correct informations, but on the Views preview page I get always the SQLSTATE[42S02]: Base table or view not found: 1146 Table 'xxxxxDEVxxxxx.civicrm_contact' doesn't exist: SELECT "civicrm_contact"."modified_date" AS "civicrm_contact_modified_date", "civicrm_contact"."id" AS "id" FROM {civicrm_contact} "civicrm_contact" ORDER BY "civicrm_contact_modified_date" DESC LIMIT 11 OFFSET 0; Array ( )  error -- xxxxxDEVxxxxx is my Drupal9's database.
Is it possible somehow the get Views work? Thank You!

Do it exactly like was done in Drupal 7..
You should be able to goto path: civicrm/admin/setting/uf?reset=1
And then copy the integration code for the settings.php or settings.local.php from the "Views Integration settings"


How can I see all test data in CiviCRM? I'm doing tests on a test server, but when I make changes using test data, the test data is hidden. I know this is by design, but it makes it impossible to actually check if things are working.

I have a membership that was entered as a test, so it doesn't show up for the user.

Now, that would be fine if it was a live server. But I'm running a test server, so I would like to be able to just turn test data on across the whole install.

OR, ideally, be able to turn test data on for my user.

So no one else sees the test data...

Either solution is fine.

IS there a way of doing something like this?

Thanks

I am unaware of a way to turn on test data as you put it but here are some work arounds.

To find test the records, in searches (advanced search, membership search etc) there is a field "Membership is a Test" by default this is set to No but if you want to find test record such as the one specified above you can switched this to Yes.

Another option, if the reason you are using test mode is to test a payment processor without spending money and this site is just for testing then I would put in your test processor details into the live payments section for you payment processor. Then you can run "Live" actions but not spend money. You can always change these details back afterward.


Issue field DEDUPE "0 Argument 1 passed to" After upgrading to civicrm version 5.21 we detected a problem in one of the fields of the form linked to a custom profile.

For some reason, every time you try to insert that data from the form in the frontend it returns the error message:

0 Argument 1 passed to civicrm_api3() must be of the type string, null given, called in /public_html/administrator/components/com_civicrm/civicrm/CRM/Dedupe/BAO/Rule.php on line 62

It is an alphanumeric text field, the same as others that populate the form.
Has anyone else come across this problem? What can it be caused by?

EDIT - the field in question is used for DEDUPE RULE (for control of duplicate entries), looks like there is something broke with that

We are experiencing a similar type error on staging site running 5.21

-we have created a custom field in the civicrm profile used for site registration, e.g. that matches on a unique identifier (card Number)

-The error we are getting looks likes this :

TypeError: Argument 1 passed to civicrm_api3() must be of the type string, null given, called in /home/ibew90v2/master/sites/all/modules/civicrm/CRM/Dedupe/BAO/Rule.php on line 62 in civicrm_api3() (line 84 of /home/ibew90v2/master/sites/all/modules/civicrm/api/api.php).
ERROR
The website encountered an unexpected error. Please try again later.

The error appears to state that it is looking for null value (?) and cannot handle any input (alphanumeric or otherwise in the field)
Placing nothing in the custom field it allows the profile submission and creates the account.

The latest release notes here reference a change to the api https://github.com/civicrm/civicrm-core/blob/master/release-notes/5.21.0.md
https://github.com/civicrm/civicrm-core/pull/15817

"Fixes a formatting issue in the api explorer output where IS NULL and IS NOT NULL clauses would output invalid code due to the missing value piece of the clause."
it appears that the api did not update, somehow when doing the upgrade, that it is still referencing the apiv3 folder .

Notes :

first part of the error references line 66 in the rule.php file, e.g. /home/ibew90v2/master/sites/all/modules/civicrm/api/v3/Rule.php
"This api exposes CiviCRM (dedupe) rules."

The second part of the error references the api.php file at /home/ibew90v2/master/sites/all/modules/civicrm/api/api.php
it is breaking down here, line 84 :
 function civicrm_api3(string $entity, string $action, array $params = []) {  $params['version'] = 3;

However 5.21 per release notes is using api v4 -- are these old files ? need to be replaced or updated?

Possible fix here : https://github.com/civicrm/civicrm-core/pull/15817/files


ERROR: No CMS user associated with given api-key I have just installed a fresh CiViCRM 4.6.5 with new Drupal setup. I'm trying to fetch all events from CiViCRM.

$api = new civicrm_api3 (array ('server' => 'http://localhost/civicrm', 'api_key'=>'123456789', 'key'=>'82666e3fdc5cc88c6c31ddbef2a74cxx'));

// Get all events from CiViCRM
if ($api->Event->get()) {
    print_r($api);
} else {
    echo $api->errorMsg();
}
exit;

Any idea how to solve above issue?

Any help would be appreciated. Thanks.

Actual problem was that there were two CiVi contacts having the same API key set, and one of them was connected with Drupal user but another wasn't, so that was the main issue here.


Drupal Webforms: Can I use the Conditions to control how the contacts are filtered? I have a webform for staff members to record supervision with volunteers, and each staff member has approximately 10 volunteers that they are the named 'Link Worker' for. The webform has a field for the Staff member's name and a field for the Volunteer's name (both using autocomplete so that it allows users to select from contacts already in the database).

My question is, is it possible to filter the volunteer contacts by the Staff Member? (i.e. if we select "John Smith" as the Staff member, can we restrict the volunteers to those who John supervises?)

I think the answer is no, it's not possible, but just wondering if anyone has any suggestions....

We ran into the same issue and didn't want to customise the webform module as it is heavily relied on for a lot of data input and needs to be kept secure and easy to maintain.

So we built a Drupal view displaying the Volunteers based on their relationship to the Staff member (I'm assuming they are related in CiviCRM). When the Staff Member visits the page, it can restricted to show only those the have an active relationship to using a contextual filter to the Drupal User.

This post should help if you've not done this before: How to create a Drupal View with multiple CiviCRM relationships?

We then created a link (using the views Global Text field) to the webform to prepopulate the Volutneer as cid2 or contact 2 (assuming the staff member is cid1) which looks something like this:
myorganization.org/node/1?cid2=[id] where [id] is the id of the volunteer.


Cannot filter on contact subtype in Drupal8 views I don't know the depth of CiviCRM's official commitment to Drupal 8 yet, but I've followed the instructions posted here for setting it up.

After creating a contact subtype of "Committee" and creating a Drupal view for "CiviCRM Contacts", I attempted to filter on the Committee subtype.  When saving, I got a raw server error displayed:

The website encountered an unexpected error. Please try again later.

Checking the Apache logs, I saw:

Uncaught PHP Exception InvalidArgumentException: "The configuration property display.default.display_options.filters.contact_sub_type.value.Committee doesn't exist." at /var/www/html/web/core/lib/Drupal/Core/Config/Schema/ArrayElement.php line 76

This seems to imply that the CiviCRM Views integration isn't providing something that the Views module wants in order to validate the filter value.

Anyone have any suggestions for next steps?  Is CiviCRM's dev team developing for Drupal 8 and do they want related bug reports?

You may find it helpful to join https://chat.civicrm.org/civicrm/channels/drupal which is where some active discussion about D8 is happening.

Including this update about webform integration


Update DB Query fails sporadically when saving contact; nativecode=1205 ** Lock wait timeout exceeded The exact query and issue is below.

UPDATE  civicrm_contact  SET contact_type = 'Individual' , contact_sub_type
= NULL , sort_name = 'XXXXXX XXXXXX' , display_name = 'XXXXXX XXXXXX'
, first_name = 'XXXXXX' , last_name = 'XXXXXX' , email_greeting_id = 6 ,
postal_greeting_id = 1 , addressee_id = 1   WHERE (  civicrm_contact.id =
27636 )   [nativecode=1205 ** Lock wait timeout exceeded; try restarting
transaction]

There are also a number of other "database deadlock" errors cropping up in the CiviCRM log.

Essentially, the person using the CRM is complaining that randomly they'll be editing a contact and it will fail to save, instead simply timing out (I haven't reproduced the behavior but I trust it).

After some research/reading, it appears CiviCRM has a contact_cache table in regards to Smart Groups it refreshes periodically via CRON. This specific CiviCRM install has thousands of contacts, and many large Smart Groups. So what I assume is happening is:

The site issues a "job" for refreshing the smart groups and data in the contact_cache table.
While the "job" is running, every single contact record affected by the smart group is "locked" in the database, and cannot be altered until the "job" finishes.
The user does not know the job is happening in the background, saves a contact, and produces an UPDATE query for the contact.
If the contact record is locked, it waits a certain specified amount of time (innodb_wait_timeout I believe) for the row to be unlocked, before failing the query altogether.

My problem is, if the above is true, I don't know how I can resolve the problem. Upping the timeout from 50 seconds to 120 seconds for example, would only increase the amount of time they wait for the request to fail, because the Smart Groups take over 120 seconds to be refreshed.

Other relevant info: Drupal 7, CiviCRM 5.9.1, PHP 7.0.33

Thanks!

We have seen this on large instances. Things to do:

upgrade to 5.13.5 (this also puts you close to the next ESR - a paid for service - which will be released on Nov20).

There have been performance improvements - this will help.

cull your smart groups; do you really still need all of them.
reschedule the cron job -> ask yourself how up to date your smart groups need to be.


How can I use existing tokens to send out a single Scheduled Reminder to both the Org and the Employee Scenario is:
Acme has a membership which is inherited by employees.
John is a permissioned employee - and hence should be able to renew 'on behalf of' and hence goal is that he should be sent Scheduled Reminders pertaining to the membership (in 4.6)

To be able to use a single reminder that makes sense whether it is sent to the Org or the Employee I need something like:

Regarding membership of {contact.organization_name}{contact.current_employer}

That way the Reminder that goes to the Org, shows its name, and for the one going to the employee it grabs the employers name, and the unsuccessful token will just not show in both cases.

Currently afaik there is no such token for {contact.organization_name}.

We have done this with {membership.owner}, which works for the email that goes to the main contact (with inherited membership) and the organization email.

E.g. TestOrg’s membership is due for renewal //// {membership.owner}’s membership is due for renewal


CiviRules Multiple rules per trigger - What happens? When using CiviRules, what happens if two rules match a single trigger?  Rule one says "if group X is added, filter matches X location, then send e-mail X."  Rule two says "if group X is added, filter matches Y location, then send e-mail Y."  Do both rules trigger?  Does it dump after triggering the first applicable reached rule, even if the filter doesn't match?

It should do both. I have two rules with the same trigger -  membership changed with different conditions- (a) membership status is one of the ones I consider active and (b) membership status is one that I do not consider active. Both are working. But I'd still do some tests on your precise requirement to see that it does what you want.


Membership -Turn Renewal Reminders Off (only for certain contacts) We are having a handful of members who we don't want to send auto renewal reminders to. Our board or other other staff are in regular contact with them and auto generated renewal reminders are adding confusion.

Has anyone been in the same situation or does know a work around to disable auto renewal reminders, but only for a few contacts (organizations)?

Thank you A Davidson and Peter for your ideas. After doing some more digging (did not find this post before), I came across this post, explaining how to limit the recipients of a scheduled reminder to a defined group.

I think this option will work for us.


How can I set up registration and payment for an ongoing event that happens every saturday the event happens every Saturday of the year, rain or shine with a limited participant number.

The fee is based on household so many people can be registered under one registration.  So I'd need to sign up several people to one payment.  But also have the event close once he max participation is reached

Thank you!! :)

This question has a lot of aspects. I will focus on the fact that the fee is based on the household. Does it mean that the household is your actual customer and that you are not interested in the details of the participant? And you only want to prevent that the event is overbooked? If this is the case you can use Price Fields.

Create as part of a Price Set a Price Field set a Text/Numeric Quantity field (in my example Seats).
Enter the participant count, make this 1 (see (1)).
Set the price on 0.00 (this field is only used to track participants see (2)).
Uncheck the Display Amount option.

Now in the online registration form you can enter a number in the Seats field and this will add up to the total number of participants.


What's the cause of this "Unexected token" JavaScript error? Just did a fresh install of CiviCRM 4.6.5 on Drupal 7.38 and the JQuery/Ajax isn't working. I get the following 2 errors in the Chrome Developer Console:

Uncaught SyntaxError: Unexpected token <  en_US?r=7WtZJ:1
Uncaught SyntaxError: Unexpected token <  XrTF2AAu:1

I have gone through the "Troubleshooting popups, autocompletes, or other javascript problems" document and have verified everything and cleared my Drupal cache.

This an old thread, but I just encountered the same problem. In case anyone else lands here, here's what I found:

The issue was that I had a typo in the domain for the URL settings, which I'd defined in civicrm.settings.php. My super-helpful ISP redirects the request to http://searchassist.verizon.com/main?a-bunch-of-params-including-my-typoed-domain. That URL contains HTML, of course, not JavaScript. When the browser gets back HTML from a script src, it throws a parse error.


What is the best practice for tracking total number of attendees? I have been using activities to track "events" for my Church. These are not events that one would register to attend but rather things like Bible Study, Sunday Worship, etc. I've been double working by creating the activities and then creating drupal nodes for the public calendar. I don't want to have to do that anymore. I tried to find a way to get an Activity feed from Civi (with ability to filter by activity type) so that I could use Feeds in Drupal to import them to nodes but could never find a solution. Events has a feed that works with Feeds and so I'm thinking of moving to using civiEvent to track these. Here's the issue....Most of these "events" we don't track who actually attends but instead only the total number of people in attendance. I thought of creating custom fields to input this on the Events but that then shows that data publicly when the Event is viewed.

Any suggestions on how I can stop double working and still be able to track this information?

You can use this extension to hide private fields (eg the number of attendants)

https://civicrm.org/extensions/allow-have-private-custom-fields-event-arent-displayed-info-page

check out the documentation, you have to give a specific name (starting with "private" to the group containing the fields you want to be hidden


How to add a radio button with the help of buildQuickForm() Showing data in the form of radio buttons.

  Data

$data[$count++] = array(dao->id,dao->names);

Above code return an array of id and names which is retrieved from database.
I want to put this data as radio button.
How to do that using buildQuickForm();

Its pretty simple to add it as a group of radio button, adding below snippet on how you can add (not tested)

    $choice = [];
    forach ($data as $id => $value) {
      $choice[$value[0]] = $form->createElement('radio', NULL, '', $value[1], $value[0]);
    }
    $form->addGroup($choice, 'element_name_of_radio_button', ts('label of radio button'));

HTH

Pradeep


How can I increase the rate at which the 'fetch bounce' job works The scenario is that bounces weren't being fetched and there is now a major backlog, and that running 50 every cron is too slow to make real progress.

Here is one approach - modify /civicrm/CRM/Utils/Mail/EmailProcessor.php

so it has multiple iterations specified (in example below = 40) then run via

drush cvapi Job.fetch_bounces

around line 178

// process fifty at a time, CRM-4002
    $iterations = 0;
    while ($iterations < 40 && $mails = $store->fetchNext(MAIL_BATCH_SIZE)) {
      $iterations++;
      print("\nBeginning iteration $iterations ");
      foreach ($mails as $key => $mail) {
        print(".");


How to send an email message with CiviMail to a certain % of contacts in a group I want to send a newsletter twice (or more) a week to certain contacts in a group, but I don't want to send people more than one e-mail per week. In this scenario, what I need is to limit the number of people whom I will send the first newsletter (let's say the 50% of the group) just to keep some users to send them the second newsletter (let's say the other 50%).

Is there any option to limit the number of recipients in CiviMail? Or any other ideas?

Thanks!

CiviMail allows you to exclude recipients of a previous mailing. I think this is what you need.

Lets say you are sending to the Newsletter Subscribers group:

1) Send your First mailing of the week out as normal

2) When you are ready to send the Second mailing, choose the same newsletter group as last time, but choose to exclude recipients of the First mailing.

In your case, it sounds like you want to send out a message to an arbitrary 50% (now I understand why you asked the question!) or so of the first group. Unfortunately, there is no limit to 50% button. One approach would be to create another group based on Newsletter subscribers that contains ~50% of your initial group and use this for the first mailing. Another approach might be to do an Advanced Search with the criteria a) Newsletter recipients b) some other criteria that splits the group in half (a smart group for users with an odd contact ID, maybe?!) and then choose the action Email - schedule/send via CiviMail.

Whichever method you choose, once the first email has been sent, you can use the approach mentioned above to send the second email.


WkhtmlPDF issues with the path in CiviCRM This is my first time trying to sort out wkhtmltoPDF. I'm having issues in civiCRM when trying to make mailing labels from the membership database. When clicking on make mailing labels the next page is a blank URL.

Someone suggested that it could be to do with wkhtmltopdf needing to be installed. I have unpacked a .rpm for wkhtmltopdf to my server. I have also put in the URL path for this folder. But I am coming up with a blank as to why it won't accept the path.

Does anyone have any experience on fixing this?  The server environment is Cpanel.I have attached a screen shot of the issue with the path for someones attention.

Thanks in advance,

Aaron

You need to give it the FULL path, and include the actual executable file, e.g.

/usr/local/bin/wkhtmltopdf

The path you have in the screenshot has 3 problems:

it's missing the wkhtmltopdf executable at the end
it's not absolute, i.e. starting from the very top level / directory
it would be really unusual to have usr/local/bin under public_html. Your installed executables shouldn't be under public_html (security risk) and I doubt an rpm would put them there unless you manually put them there. When you say "unpacked" do you mean installed (rpm -ivh) or just extracted the files inside and put them under public_html?


Wordpress hooks – some don't work I noticed that some hooks are not firing… I have the following three hooks

<?php

add_filter('civicrm_permission', 'civicrm_permission', 10, 1);
function civicrm_permission(&$permissions) {
  PC::debug( $permissions, '$permissions' );
}

add_filter('civicrm_aclGroup', 'civicrm_aclGroup', 10, 5);
function civicrm_aclGroup( $type, $contactID, $tableName, &$allGroups, &$currentGroups ) {
  PC::debug( $type, '$type' );
  PC::debug( $contactID, '$contactID' );
  PC::debug( $tableName, '$tableName' );
  PC::debug( $allGroups, '&$allGroups' );
  PC::debug( $currentGroups, '$currentGroups' );
}

add_filter('civicrm_alterAPIPermissions', 'civicrm_alterAPIPermissions', 10, 1);
function civicrm_alterAPIPermissions(&$permissions) {
  PC::debug( $permissions, '$currentGroups' );
}

?>

the middle one (civicrm_aclGroup) fires, the other two do not. PC::debug is just a logging class. as far as I understood the docs this would be the correct way to target the hooks.

Depends what you do in (or with) CiviCRM as to which hooks fire. So, for example, when I go to "Manage Events", I see the following in my logs:

[02-Feb-2018 17:05:56 Europe/London] Array
(
    [method] => civicrm_alterAPIPermissions
    [permissions] => event
    [backtrace] => #0 /path/to/wp-includes/class-wp-hook.php(288): civicrm_alterAPIPermissions('event')
    ... lots of backtrace ...
)

If I go to "Configure Event - Rain-forest Cup Youth Soccer Tournament" (I've got a test install with the sample data) then I also see:

[02-Feb-2018 17:09:46 Europe/London] Array
(
    [method] => civicrm_aclGroup
    [type] => 4
    [contactID] => 202
    [tableName] => civicrm_uf_group
    [allGroups] => Array
        (
            [10] => Contribution Bulk Entry
            [13] => Honoree Individual
            [11] => Membership Bulk Entry
            [1] => Name and Address
            [6] => New Household
            [4] => New Individual
            [5] => New Organization
            [9] => On Behalf Of Organization
            [3] => Participant Status
            [8] => Shared Address
            [7] => Summary Overlay
            [2] => Supporter Profile
            [12] => Your Registration Info
        )

    [currentGroups] =>
    [backtrace] => #0 /path/to/wp-includes/class-wp-hook.php(286): civicrm_aclGroup(4, '202', 'civicrm_uf_grou...', Array, NULL)
    ... lots of backtrace ...
)

If I visit "WordPress Access Control" under Administer -> Users & Permissions, I get:

[02-Feb-2018 17:19:26 Europe/London] Array
(
    [method] => civicrm_permission
    [permissions] => Array
        (
        )

    [backtrace] => #0 /path/to/wp-includes/class-wp-hook.php(286): civicrm_permission(Array)
        ... lots of backtrace ...
)

So, in summary: those hooks do fire -  but only when needed.


Credit Card Icons Missing after Upgrade I upgraded CiviCRM from 5.6.1 to 5.9.0 and later tried 5.10.4.  Both time the credit card icons on our contribution and registration pages were missing after the upgrade (see image).  I had to revert back to 5.6.1 (edit: icons are the same as the security code icon).

I was able to successfully upgrade our test site.  I also copied the production database to the test site (CiviCRM 5.10.4) and ran the database upgrade.  The credit card icons were present.  This tells me that the production database is OK.  What could be wrong?  What should I try next?

We use Wordpress and PayPal Standard.

Added 3/6/2019

I duplicated the problem on a new test site that is a near copy of our production site (copied all the website files and the CiviCRM database).  I noticed that the HTML code for the credit card icons on the malfunctioning contribution page doesn't match that of a good page (see code below).

Bad HTML Code

[object Object]

Good HTML Code

Visa

I played around with the test site and the Credit Card Icon are now present.  I can't say why.  I upgraded the production site again to 5.10.4 and the icons were present.  I was to make a test-drive contribution on both sites.

There's one remnant of this problem.  When I hover over the credit card icon it says [object Object] instead of Visa, Master Card, etc.


Are custom Dedupe General rules working for anyone? On CiviCRM 4.7.8/Joomla 3.5.1, I've experimented with variety and can't seem to get this to work. The preset reserved rules, import, inclusive in contact record and main dedupe rules are all working. If I create a new General Rule with just Email set for 10 characters with a weight of 10 and a Threshold of 10 on a group of 10, 50 and 100 contacts in a group with both known and no dupes. Running this rule just runs and runs without any results whether or not the frontend times out to 500 error.

The default Reserved Rules run lickety-split.
Please advise.

It sounds like you might be running the dedupe on a large database with slow MySQL performance; I've certainly seen this before.  The database doesn't even have to be that big; I've seen this on databases with as few as 20,000 contacts.

The pre-set dedupes that can't be edited use a fundamentally different approach to deduping that runs MUCH faster, but it must be hard-coded.

There's an unpublished extension from Veda (see item 1 here; most subsequent items are part of Civi 4.7) that adds a framework for more hard-coded dedupes, along with a large number of extra pre-built dedupes.  That may be better for your situation.  I'm not sure it's tested on Civi 4.7 though, so try it on a copy of your database first!


Testing a module which uses CiviCRM php api I have written a drupal module that uses the CiviCRM api. I want to build tests for my module. Drupal 7 includes the simpletest module in core, so I'm using that. I have created the following test:

class ExampleCiviCRMTestCase extends DrupalWebTestCase {

public static function getInfo(){
    return array(
        'name' => 'Example CiviCRM Test',
        'description' => 'Check that CiviCRM API can be used in tests',
        'group' => "CiviCRM",
    );
}

public function setUp() {
    parent::setUp(array('civicrm'));
}

public function testCivicrmWorks(){
    civicrm_initialize();
    try {
        $result = civicrm_api3('Contact', 'get', array(
            'sequential' => 1,
        ));
    } catch (CiviCRM_API3_Exception $e) {
        $error = $e->getMessage();
        $this->fail($error);
    }
    $this->assertFalse(empty($result['count']));
}
}

This test fails. The error page states that the civicrm module was successfully enabled, but then this error occured:
Access to undeclared static property: Database::$ignoreTargets. The error occured in database.inc on line 1473. Does anyone have any experience using simpletest with civicrm?

I'm not an expert of testing but i'm pretty sure that SimpleTest creates a new instance of Drupal with a new database each time the testing process is ran.

CiviCRM is not a standard Drupal module and cannot just be enabled. In your SetUp function, You need to install CiviCRM to create the corresponding tables in the database. It could be a rather complex task but it's possible to do so. There is a drush script to do it so it might be a good inspiration.

You might want to check drush_civicrm_install in https://github.com/civicrm/civicrm-drupal/blob/7.x-master/drush/civicrm.drush.inc

Otherwise, you might find easier to use CiviCRM testing way (phpUnit) : https://wiki.civicrm.org/confluence/display/CRMDOC/Testing

And an example : https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ActivityTest.php


What is a line item? And what is a financial item and how are those two linked together? I have created an extension to generate invoices (contributions) based on time spend on activities on a case.

For each activity a line item was created and added to the contribution.
Also the financial type had 21% percent of VAT configured.

In CiviCRM version 4.6 this extension works smoothly. However after upgrading to CiviCRM version 5.9.1 I cannnot edit contributions any more. It fails with the error Expected one FinancialItem but found 0.

After debugging I found out that the line items created with my extension does not have a related financial item (I did not even know they existed and/or where required).

So now I have changed my extension to create two financial items when one line item is added:

One financial item for the amount without VAT
And, one financial item for the VAT amount

Contributions created after this change could be edited. Hurray!

The questions

Now comes my questions:

What are financial items?
How do they differ from line items?
Where do I find documentation about line items and financial items?
What are financial transactions (trxn)? (See answer of Joe)?

Solution

To create all the underlying financial items etc.. One must use the Order API. The order API does create a contribution and line items.

The Line Item table is oriented towards the current state of an order's line item. The Financial Item table is oriented towards keeping track of the history of the financial aspects of line items. The Financial Transaction table is the base table for financial transactions created by CiviCRM every time there is any add, update, cancel, refund, pay grant or other action that has a financial impact.

At a high level, each time there is a change in a line item that produces a financial effect, like a change in the quantity, or the price, or the financial type associated with the line item, a reversal entry of the previous financial impact of the line item is made in the financial item table, and a new entry is inserted representing the current financial impact.

Another difference is that line items are more like business entities while financial items are aspects of financial accounting entries. To hide the complexity of double entry bookkeeping, CiviCRM uses Financial Types to create a bundle of Financial Accounts that will be used through the life cycle of a transaction for things like its Accounts Receivable account, its Revenue account, and potentially other accounts like the Accounts Payable or Contra Revenue account for refunds owing. These financial accounts are the ones that appear in the Chart of Accounts for an organization. Line items have financial types associated with them, while the specific detailed nature of financial items means they have financial accounts associated with them.

The civicrm_financial_trxn and civicrm_financial_item tables hold the main accounting or bookkeeping information in CiviCRM while civicrm_entity_financial_trxn is a related table that connects records in civicrm_financial_trxn to related records in various other tables. There are many types of financial transactions, and they all are stored in these tables, and are exportable via Financial Batch exports to Accounting Packages like QuickBooks, Sage, and Microsoft Dynamics.

Bookkeeping entries have two sides to them: a debit account and a credit account, as well as an amount and a date. Some bookkeeping entries are split, where a single amount on one side is split amongst several amounts and accounts on the other side. For example, a payment for an event registration and a donation would have the total going into the bank on one side, and revenue being recognized for two accounts on the other side.

In the case of contributions which handle the finances for donations, memberships and event registration as well as other sale items, each line item will create a civicrm_financial_item, each payment will create a civicrm_financial_trxn, and civicrm_entity_financial_item records will connect them. In the case of line items with sales tax, which in general goes to a different account in an organization's chart of accounts, there will be an additional entry in the civicrm_financial_item table representing the tax on a line item.

An important principle of accounting is that books should be auditable. One part of that is to retain records about all of the changes that have been made on items. So if a purchase is made with pay later selected, and two partial payments are made, the number of things purchased is changed, a refund is made, etc., then all of these are tracked in the financial tables in CiviCRM. Entries in civicrm_financial_item and civicrm_financial_trxn tables are intended to never be edited or deleted.

We highly discourage developers trying to write directly to the civicrm_financial_trxn, civicrm_financial_item and civicrm_entity_financial_trxn tables which store financial information in CiviCRM since version 4.3. We'd encourage use of the order api and/or payment api, and will enhance and/or fix issues with those APIs.

Documentation that is reasonably accurate on entries for these interlinked tables for various types of accounting transactions can be found at https://wiki.civicrm.org/confluence/display/CRM/CiviAccounts+Data+Flow#CiviAccounts4.3DataFlow-OnlineorofflinecontributionwithFEE.

The Caldera Forms CiviCRM plugin for WordPress was recently trying to integrate its support for various line item operations with Civi core, so their code may provide useful guidance. The Line Item Edit extension might also be a useful developer resource, though I seem to recall that it needs a bit of refactoring.


Civimobile API 4.0 QR code question Can anybody tell me what this means? When creating a new event with the new release of City Mobile API, it gives you the option to turn on QR code generation for that event. However, it has a strange warning note that's really confusing, it reads like this:

When generating QR Code tokens, use this Event
If enabled, the QR Code for this event will be used (you can only have one event enabled at a time, enabling this event will disable all other events).

When I read this, it sounds like if I enable QR code generation for one event all of my other events will also be disabled (is that QR code generation disabled, or the event itself will be disabled and not active).

I guess I'm just really confused by this new feature and there isn't any documentation talking about its behavior. It would seem strange to me that you can only have one event at a time generating QR codes considering most organizations would have multiple events scheduled and open for registration at one time.

Anyone have any thoughts on this?

This option is not related to CiviMobile. Rather becomes available once you install QR code check in extension https://github.com/progressivetech/net.ourpowerbase.qrcodecheckin

And yes, you are reading it correctly, only a single qr can be available at a time. This is limitation of this extension, unless someone codes it in a different way. But please see a discussion why it can’t be done with existing extension
https://github.com/progressivetech/net.ourpowerbase.qrcodecheckin/issues/6


VPN and LAN connections I have

*CiviCRM 4.6.6 on
*Drupal 7.41 running through
*Apache2 on
*Linux Mint 17 in a VirtualBox on Linux Mint 17

If I am on the LAN I can access CiviCRM and everything works:

10.141.229.171/?q=civicrm/dashboard everything works

I also have a VPN that can connect to the drupal server and when I connect I get to log into CiviCRM but then CiviCRM stalls while it tries to connect to the LAN address so the system fails to work.

If, at that point, I stop the browser from continuing to load I can use the CiviCRM dropdown menus and go to almost any other page, including the Drupal menu. As far as I can tell only the dashboard fails to load.

_http://10.12.0.23/?q=civicrm/dashboard -- stalls with the message: "Connecting to _http://10.141.229.171..."

Note: I inserted an underscore just to prevent creating a real link in this message.

I know that the CiviCRM addresses are set to the 10.141.229.171 address but I would like my VPN clients to access the site as well.

The best I can come up with is that I need to set my VPN computer so that:  Any link for 10.141.229.171/page_name gets rewritten to be sent as
10.12.0.23/page_name   -- I tried a few FireFox addons to accomplish this but they failed to work, perhaps because of Java Script?

Again, it seems to fail only with the dashboard.

Unfortunately I am struggling to find out how to fix that. Is it even the right way? Can it be done in any way?

Thank you in advance for any help you can provide. John in Oregon, US

The base URL is set in civicrm.settings.php.

I can imagine you create a conditional statement in there.

You should try if $_SERVER['SERVER_ADDR] or $_SERVER['SERVER_NAME'] is the right variable for you to differentiate between the 2 situations.

More info:
http://php.net/manual/en/reserved.variables.server.php


Organization/Individual Contact relationship I'm using CiviCRM as Joomla component
Joomla users are not connected to CiviCRM contacts
There are Organizations and Individual contacts
Each Individual contact belong to Organization (employer) and has a specific group eg "Representative", "Librarian" etc.

Updating profile info:

Organizations get an email (through mailing functionality) with personalized URL to update their profile fields.

PROBLEM:

What is the best way to enable Organizations admin to update/add/delete Individual contacts which belong to that specific organization?

afaik there is nothing in civicrm that delivers quite what you ask.

The closest 'in the box' is probably the 'contact dashboard' which does let Primary Contact edit the Organisation record, and if you "allow second degree relationship permissions" here the if Primary Contact has permission over the ORganisation and the Organisation has permissioned relationship over the other employees, then Primary contact can edit those people.

Of course the Primary Contact needs a joomla record to login to do this


PayPal IPN Notification Inconsistently Received Random completed PayPal transactions are not being updated in CiviCRM and the contribution records are incorrectly left as "Pending." I have worked with PayPal to confirm that all IPN notifications are being successfully sent from their end. CiviCRM's logs do not show any errors; they simply do not show that they received any notification from PayPal.
To make matters more confusing, when I resend IPN notifications through PayPal, they are then correctly received by CiviCRM the second time around and the contribution record is updated.
Any ideas on how to rectify this situation? I cannot find any pattern as to which notifications go unreceived and which contributions are successfully updated. I am on WordPress 5.5.3 and CiviCRM 5.30.1.

As an update to this thread, the issue was identified as a bug in the PayPal integration (https://lab.civicrm.org/dev/core/-/issues/1931) and was resolved in an update pushed by CiviCRM Admin Utilities 0.8 released on 20 November 2020. Payments have been closing perfectly for us since applying the patch.


What's the right syntax for the API3 "replace" action for the "WordReplacement" entity? I'm trying to call the WordReplacement API v3 with the replace action. The APIv3 Explorer tells me the right PHP syntax is as show below. (I previously called WordReplacement get to get the correct id value.)
$result = civicrm_api3('WordReplacement', 'replace', [
  'id' => 2,
  'find_word' => "Contribute",
  'replace_word' => "Give Now",
  'domain_id' => "my-domain-name-here",
  'match_type' => "exactMatch",
  'is_active' => 1
]);

But executing that in the API Explorer returns the error:
{
    "is_error": 1,
    "error_message": "Mandatory key(s) missing from params array: values"
}

I figured out this is calling the "generic" replace API, and by digging through the API examples (for Email and UFField), it appears the correct syntax is something like:
$result = civicrm_api3('WordReplacement', 'replace', [
  'some_key' => 'some_value',
  'values' => [
    'id' => 2, // maybe this ID isn't needed here?
    'find_word' => "Contribute",
    'replace_word' => "Give Soon",
    'domain_id' => "my-domain-name-here",
    'match_type' => "exactMatch",
    'is_active' => 1
  ]
]);

I tried a few different guesses for some_key and some_value (and also tried omitting those entirely), but always got a new error Type error: Argument 3 passed to civicrm_api() must be of the type array, null given, called in /longpathgoeshere/wordpress/wp-content/plugins/civicrm/civicrm/api/v3/utils.php on line 1813.
I also looked at some of the API definition files like civicrm\civicrm\api\v3\UFField.php, Email.php and WordReplacement.php, as well as the API getfields output, but nothing helped me to infer what the correct syntax should be. So I'd also be interested in hints on how to understand and learn from those as a developer.
I'm running WordPress v.5.4.4 and Civi v.5.35.1.

Updated! based on Coleman's answer, and additional testing.
First of all, for WordReplacement, if you want to update a single record it's best and most appropriate to use the get action to get the record ID (civicrm_word_replacement.id). Then (as Coleman noted) use the create action and include the id parameter to update just that record. (Without the id parameter, create throws an error complaining the record already exists. With it, create performs an update.)
For the replace action, the values parameter must be an array of arrays. But, crucially, in addition to the values array, you must provide "scope" parameters outside of the values array.
So for example, with id as the "scope" parameter, the following will update only the record matching the id (equivalently—but more awkwardly—than create):
$result = civicrm_api3('WordReplacement', 'replace', [
  'values' => [
    'id' => 2, // "scope" parameter
    [
      'find_word' => "Contribute",
      'replace_word' => "Give Now",
      'domain_id' => "my-domain-name-here",
      'match_type' => "exactMatch",
      'is_active' => 1
    ]
  ]
]);

The API also supports, and is in fact intended for, multiple replacements. But in this case the values array must contain all of the records that match the "scope" parameter(s). In other words, it replaces the complete set of records that match the "scope" parameter(s). For WordReplacement, if you provide only the domain_id as the "scope" parameter, the replace action will match all of the records for that domain, so your values array must contain the complete set of WordReplacement records for that domain. If you have 3 replacement words, this might look like the following:
$result = civicrm_api3('WordReplacement', 'replace', [
  'values' => [
    'domain_id' => "my-domain-name-here", // "scope" parameter
    [
      'id' => 2,
      'find_word' => "Contribute",
      'replace_word' => "Give Soon",
      'match_type' => "exactMatch",
      'is_active' => 1
    ],
    [
      'id' => 3,
      'find_word' => "Find this",
      'replace_word' => "Replace with that",
      'match_type' => "exactMatch",
      'is_active' => 1
    ],
    [
      'id' => 7,
      'find_word' => "Find this too",
      'replace_word' => "And replace it with this",
      'match_type' => "wildcardMatch",
      'is_active' => 1
    ],
  ]
]);

If you had four WordReplacement records for "my-domain-name-here", you'll end up with only the three above after calling replace. The fourth record will be deleted. Conversely you can add new records by omitting the id parameter (provided the new records have no "already exists" conflicts).
So the replace API action is powerful but potentially dangerous. Test carefully in a development environment before using.


How to approach fuzzy dates (e.g. contact deceased in month/year)? I was posed this question recently and wonder how others would approach this issue:

  We often are told someone died in (for example) December 2018, but no day. The system won't let me enter it without a day. I don't like to just put 31st or whatever, because we do get queries from people looking up ancestry info. Is there any way to set it so it will take just a month/year combo without the date?

Thinking out loud: I could set up a custom date field that only shows month and year (but then what about the case where they are only told the year, not the month...). I suppose I could do separate fields, a dropdown for month and a text field for year. And then maybe if I use the new contact layout editor extension, I can even move these fields into more logical places than usual?

In this case the organizational needs were indeed for a simple custom text field attached to Individuals.


Enable use of do_shortcode when using CiviCRM and WordPress templates I am trying to add a simple CiviCRM profile shortcode to a template of my theme, but the required CiviCRM files are not being loaded in the wp_head and therefore the shortcode does not render the profile form.

I have traced the issue to CiviCRM only loading these files if the shortcodes are being added to the content of the page or post.

This means that not only does the do_shortcode function not render CiviCRM shortcodes, but also any ACF (Advanced Custom Fields) fields created cannot render the shortcode either.

The php function that handles all of this, is the 'prerender' function in the CiviCRM_For_WordPress_Shortcodes class of civicrm.shortcodes.php.

The shortcode I'm trying to add is as follows...

do_shortcode('[civicrm component="profile" gid="14" mode="create" hijack="0"]')

Does anyone know if this behaviour can be modified, so that the files are enqueued on all WP pages?

Thanks for any help!

Matt

Personally, I don't think loading CiviCRM on all pages regardless of whether there's a shortcode present is a good idea. What you should be able do, however, is something along the lines of:

add_action( 'get_header', 'force_civi_scripts_to_load' );
function force_civi_scripts_to_load() {
  if ( is_page_template( 'your-template.php' ) ) {
    add_action( 'wp_enqueue_scripts', array( civi_wp(), 'front_end_page_load' ), 100 );
  }
}

This should force CiviCRM to load the appropriate scripts when (and only when) the template that your shortcode is located in is loaded. If, however, your shortcode sits in a template part, then you may have to be less specific about when you force CiviCRM's scripts to load.


Import Contacts creating dupes despite dedupe rules We are currently updating a member database with returning and new students/contacts. In the past we have been able to import lists updating the returning students, but now new duplicate records are being created for each of our returning students. I have tried importing using several dedupe rules (including ones that worked in prior years) and also selecting update and skip, but still get duplicates.

What am I missing? Since last year, I have udpated WordPress, CiviCRM and PHP, but I don't know if that could cause this sort of problem. Any suggestions are welcome.

CiviCRM 4.7.31
Wordpress 4.9.6
PHP 7.1

Easiest way is just to use the Contact ID if it is in your file.

Are you importing to the same location type? It does not dedupe a given data point if importing on a different location type.

I've noticed that you must set your desired dedupe rule to be unsupervised. Selecting a rule that is not marked unsupervised hasn't worked lately and is probably a bug.

I believe this is related Import Contacts with dedupe rules


Civisualize - getting data from a report into dataviz I'm seeing in notes on Civizualize that some work has been done in getting reports data into a form where civisualize can deal with it.

Anyone give me a pointer to where that is?

In principle, if you get the data out of report as json or csv, it should work fine.

Let me check with sid if he remembers what was done beside fetching as csv.


MyISAM database but all civicrm_ tables are INNODB... is this a problem? I just upgraded a large site to 4.7 (without any issues in the upgrade process by the way). The new "System Status" admin screen gives a warning as follows:

  "Your database is configured to use the MyISAM database engine.
  CiviCRM requires InnoDB. You will need to convert any MyISAM tables in
  your database to InnoDB. Using MyISAM tables will result in data
  integrity issues."

This is news to me. I took the database over from another person and have upgraded it a number of times already. I looked at the database and it does have some strangeness. For the most part, each civicrm_ table is listed as INNODB, all the log_ tables show up as ARCHIVE, and at the bottom the global setting seems to be MYISAM. The one exception is the civicrm_system_log table, which is listed as MYISAM.

Is this going to cause problems, and is there an easy way to get everything on track?

...

I backed the database up, opened it up in Sequel Pro and went to the civicrm_system_log table. Under "Table Info" I could select "InnoDB" from the dropdown. Then I cleared the caches on the CiviCRM installation and the system status came back green ("System Status: OK").

Per a comment from George Lozier on another thread, the MySQL query to do the same is:

ALTER TABLE civicrm_system_log ENGINE=InnoDB;


Which table is used for hook_civicrm_triggerInfo? I have a rebuild trigger action that is failing.  It is trying to create a trigger on civicrm_contributiion_recur.  Clearly it has 2 i's and shouldn't.  There is or was a trigger on the table without the extra i, so I figure it got stored in the db incorrectly.  I went off in search of just where that stuff is stored but alas haven't found where.

So when you use hook_civicrm_triggerInfo to create a custom trigger where is that info stored?

Or when civi does an index rebuild how does it collect the list of tables and the bodies of the triggers?  It needs to do this so it can combine any triggers civi core has with any custom triggers an extension or customization has added.

Triggers are stored in the information_schema, a virtual database provided by MySQL.  This StackOverflow answer gives a pretty good overview.


Update particular contribute based on contribute id with civicrm_api3 I am working with civi 5.10. How can i update the conribution table row based on contribute id .  I want replace that below  code with civicrm_api3().

        db_update('civicrm_contribution') // Table name no longer needs {}
        ->fields(array(
        'contribution_status_id' => $contribution_status_id,
        ))
        ->condition('id', $contrib_data[0]->id, '=')
        ->execute();

You can use civicrm api to process CRUD on CiviCRM Database.

To update contribution you can use

$result = civicrm_api3('Contribution', 'create', [
  'id' => $contrib_data[0]->id,
  'contribution_status_id' => $contribution_status_id,
]);

Cheers

Pradeep


Search for contacts with documents I am in a process of migrating CiviCRM data to a separate database. I am using the Documenten extension to store some files attached to my contacts and I would like to find the contacts which have documents attached.

The extension page says it should enable this functionality but I cannot find it. Any advice would be greatly appreciated.

It should be at url /civicrm/documents/search.

It looks like you need administer CiviCRM permission to use it.

If for some reason it isn't finding it try rebuilding the menu with /civicrm/menu/rebuild?reset=1

I'm assuming you mean this extension:
https://github.com/CiviCooP/org.civicoop.documents/blob/master/documents.php#L95


Monitor ConfigAndLog .log file in real time I am upgrading the CiviCRM and would like to monitor the current .log file that is in <drupal root>/sites/default/files/civicrm/ConfigAndLog/ as it's being updated, in real time. Currently, I know how to view it using the cat command via command line on demand only. Is there a command that prints the latest entry as they happen?

I know this probably is less of CiviCRM question and more of a linux question, but others debugging and monitoring CiviCRM processes might find it helpful.

tail -f /your/log/file will show you lines as they are added to the file.


How to close a group in CiviSEPA I hope someone here can help me as I´m totally stuck with this problem.
I succesfully created SEPA Mandates, generated a group, downloaded the XML file and transmitted the file to my bank with a banking software today. However, I´m not able to close the group or mark the payments as "recieved". If I click the button "close and submit" ("Schließen und Senden" in German), it allows me to download the XML file, but otherwise says: "This is a test group and therefore can´t be closed". ("Dies ist eine Testgruppe. Sie kann nicht geschlossen werden.").
I´m unable to find out why that is only a test group and how I´m able to mark those payments as "recieved".
Thanks so much for your help!
Angelika

Welcome to Stack Exchange Angelika. The error is most liekly because your SEPA-creditor is marked as a test creditor. You should be able to change that in the creditor's settings.


Custom drupal contact display fields? We have a situation where staff will be filling in a Drupal webform in order to record an activity on a contact within Civi.
We are looking for a way to pull out some data from Civi into the webform by way of typing the contact into the 'Existing Contact' field. We know how to pull out the standard info about an existing contact (eg. Display Name, Address, Postcode etc.) Which gets displayed in this box on the webform.

But we want to be able to pull out a 'custom field' that we added to the contact in Civi which describes how much VAT that contact is paying. In Civi the field is either populated with '20%' or '0%' and we need it displayed on the form so that the staff member filling in the activity knows how much VAT that contact pays without having to go into the Civi contact to see the amount and then back out to finish the form.
So we are thinking we just need to find a way to get the custom fields to show in the following list so that we can select it for view. Is this right? It doesn't need to be editable in anyway, just a view.

We did nothing special, the custom fields showed up for contact in the webform settings? Like so (on the CiviCRM tab in the Webform):

And if you then click 'Yes' you can use the custom fields?


Free membership auto-renewal We have a few membership types that are "semi-automatic".  They are honorary memberships that we don't charge for, but we want them to renew manually because it's an opportunity for them to update their data and donate to the society.  So, officially, it's an annual membership that they have to renew themselves.

However not all of them do, and for those that don't we want to make sure they stay members.  In this sense it's a lifetime membership.

So what I need to do is find a nice way of doing a mass renewal of all those members of these types sometime after our regular renewal period is over. Which is now.

My best idea so far is to do a search for all expired members of each type, export them, and then use that exported data to import new memberships for those people.

It should work, but is there a better way?

If you do a Search for Memberships (eg Find Members, or Adv. Search but set to show results as Memberships) then you should have access to a Batch Update via Profile that I think lets you change Membership characteristics such as Status.

You will also need to create a Profile with the relevant Membership fields in it.


CiviCRM Rules - Condition for contacts created X days ago I am using Civicoops Rules extension. In our boarding process I need to create a rule to create actions for contacts which are still in a certain group after 14 days. My idea was to use the daily trigger for groups and add a condition for the field created_date. How can I do this?

Should I use SQL as the compare value e.g. DATE_ADD(CURRENT_TIMESTAMP, INTERVAL 14 day)
Should I use PHP as the compare value e.g. strtotime('-14 days');
Should I create a custom condition as explained here

You may be able to achieve this already out of the box.

Create a rule like this:

Trigger: Contact added to group.
Condition: Contact is in group "the one you want"
Action: the desired action, with 14 days delay. Then check the box for rechecking of conditions. (You may also want to have an action of removing contact from the original group, so that the condition is no longer met, somewhere down the line...)


Search for duplicate contributions We detected recently some duplicate contributions records. How to make a list of all duplicates? We use the field "source" to indicate the year of the contribution. So we are looking of a list of duplicate contributions for instance for source = "2017"

We found a solution by using this SQL query:

/* === Duplicate contributions === */
/* c contact * b contribution * t temporary */
SELECT b.contact_id ContactID, c.last_name Last name, c.first_name First name,
       b.source Year, b.total_amount Contribution,
       b.receive_date Received,  b.receipt_date Processed
FROM civicrm_contribution b
JOIN (
    select b.contact_id, b.source, count(*)
    from civicrm_contribution b
    group by b.contact_id, b.source
    having count(*) > 1
    )
    t on b.contact_id = t.contact_id and b.source = t.source
INNER JOIN civicrm_contact c ON b.contact_id=c.id


Contact table: managing a new field in my extension I have the need to manage a new contact information (I added a field in civicrm_contact, instead of using a custom field).
Using the buildForm hook, I can show the input element in the contact form, but I don't know how to write the field value in the database.
Is there a specific hook for this operation?

Thanks
Marcello

There is no hook or api specifically for writing to a field added to the civicrm_contact table, as that is a bad unsupported hack to core. I'd suggest changing your code to use the support provided for custom fields. That way you can be more confident that a code review of the extension won't end up preventing it from being published on civicrm.org for auto-distribution. If you still want to proceed with this bad pattern, then you might want to consider writing SQL and submitting it via db_query.


CiviCRM Dashboard endless loading… + Warning: file_exists(): open_basedir restriction in effect Please help me to solve this issue:

CiviCRM Dashboard endless loading… + Warning: file_exists(): open_basedir restriction in effect.

Warning: file_exists(): open_basedir restriction in effect. File(/home/wp-includes/version.php) is not within the allowed path(s): (/home/user:/tmp:/var/tmp:/opt/php-5.5/pear:/usr/local/bin:/etc/pki/tls/certs) in /home/user/public_html/wp/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php on line 471

Above, I changed my real user login for “user”.

I use shared hosting by hostinger.com, where I have no access outside of public_html folder. It is not possible to access Linux system folders like: usr, /opt, /etc. Is it needed to CiviCRM to access that folders?

Apache 2.4, PHP 5.5.35, memory allocated 256 MB, MYSQL 5.6

I installed Wordpress 4.5.3 fast and easy by some graphic installer at the hosting panel. Then, I installed civicrm-4.7.8-wordpress.zip downloading it by the Wordpress plugin installer. CiviCRM installed and activated, I run civiCRM installer. CiviCRM Installer sad “Youŕe ready to install! - Database version and connection settings have been verified and look correct!” All requrements were Ok. Then, I pressed the button “Check Requirements and Install CiviCRM” without sample data. CiviCRM was “successfull” installed, but there was an error: no CiviCRM menus, Dashboard (endless) loading…  … never finished.
At the top, the permanent message: “Warning: file_exists(): open_basedir restriction in effect. File(/home/wp-includes/version.php) is not within the allowed path(s): (/home/user:/tmp:/var/tmp:/opt/php-5.5/pear:/usr/local/bin:/etc/pki/tls/certs) in /home/user/public_html/wp/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php on line 471”

“System Status: Error: Cron Not Running, Configure Default Mailbox, Complete Setup”.

Then, I uninstalled Wordpress, reinstalled it, and did some configurations every time I reinstalled it before install CiviCRM.

I edited the settings, media(miscellaneous), to only “wp-content/uploads” without quotes, or the respective temp folder, at any time a tried a new install, did logof, login again and a new CiviCRM install with other plugins disabled.

In wp-config.php, I edited line 62 by changing “define('WP_TEMP_DIR',dirname(FILE).'/wp-content/uploads');” for “DEFINE('WP_TEMP_DIR','../tmp')” or “define('WP_TEMP_DIR', dirname(FILE) . '/wp-content/temp/');” and simultaneously creating the respective temp or tmp folder. Hostinger accounts have no tmp folder by default.

Don’t matter what I do, CiviCRM installation always fails in Wordpress.

version.php

/**
 * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
 *
 * @global int $wp_db_version
 */
$wp_db_version = 36686;

/**
 * Holds the TinyMCE version
 *
 * @global string $tinymce_version
 */
$tinymce_version = '4310-20160418';

/**
 * Holds the required PHP version
 *
 * @global string $required_php_version
 */
$required_php_version = '5.2.4';

/**
 * Holds the required MySQL version
 *
 * @global string $required_mysql_version
 */
$required_mysql_version = '5.0';

$wp_local_package = 'pt_BR';

As your comment details, WordPress is installed in it's own directory public_html/wp

Currently, CiviCRM has issues with WP in it's own directory as detailed here:  https://wiki.civicrm.org/confluence/display/CRM/WordPress+installed+in+its+own+directory+issues

There are some patches, but at this time a standard install of CiviCRM will not work unless WP is installed in the webroot and not in it's own directory.


How do I debug CiviCRM when I hit a blank page / white screen / fatal error? CiviCRM is showing a blank page (aka white screen of death or WSoD) when I expect to see some output.

How can I debug CiviCRM when there is no error message visible on screen?

This includes when the error message on screen simply says "Error 500" but includes no details about the nature of the problem.

A white screen (WSoD or "white screen of death") indicates that PHP is configured not to display errors, and has hit an error which it can't recover from. The result is an empty page.

Your next step is not to fix the error, but to first give yourself enough information to identify the source of the error. (Diagnose, then treat.)

Viewing errors in logfiles

The webserver can be configured to display errors to screen, but it also logs errors to files on disk. These files vary depending on your hosting environment, so you might consult your webhost's documentation to locate them. You might look for errors in some of these locations depending on webserver/php config -

/var/log/nginx/*err*log       # NginX webserver error logs
/var/log/apache2/*err*log     # Apache webserver & mod_php error logs
/var/log/*php*log             # PHP-FPM & PHP-CGI error logs
/var/log/php5/*log            # PHP-FPM & PHP-CGI error logs
/path/to/site/err*log         # Some hosting environments

And a CiviCRM specific debug log file - location varies depending on hosting environment and CMS, refer to this wiki page for location -

path/to/site/path/to/civicrm/files/ConfigAndLog/CiviCRM*log

(The *s above represent a wildcard, not an actual filename. Eg the last entry might be public_html/error_log on Bluehost.)

Once you've located these files, you can download them to view, or you can use tools like tail or less +F to follow the files. I prefer to follow logfiles because you can watch the error appear each time.

Displaying errors to screen

You may prefer to display errors to screen. This is probably disabled on your site because it's a security risk to some degree - an attacker can see more information when errors are visible, so the default configuration is often to restrict visibility to people with server access (via the logfiles above).

To enable error display, either:

Configure your PHP to display errors for your site via php.ini / .htaccess (see How can I get PHP errors to display), OR

Add PHP code to enable error display (you can add it in civicrm.settings.php or the top of the index.php of your host CMS).

<?php
  error_reporting(E_ALL);
  ini_set('display_errors', TRUE);
  ini_set('display_startup_errors', TRUE);

Making sense of what you see

Once you've taken one of the above approaches, try reproducing the actions which led to a white screen. If all's gone well, you should see an error now (on screen, or in your terminal / SSH session).

This is where you can start debugging meaningfully. There's a good chance you're exhausting server resources (timeouts, memory exhaustion) or hitting some coding error, but once you have the relevant error message at hand you'll be much better equipped to track down the source of the problem affecting your site.

Further reading

Debugging on docs.civicrm.org/dev is probably a better source than this answer now
Stack Overflow: How do I get PHP errors to display?
Where should one look for logs when debugging a new problem?
Drupal.org: Blank pages or White Screen of Death
Joomla SE: What is an efficient way to troubleshoot a White Screen of Death
CiviCRM wiki: Debugging for developers

Notes

If this is the first time you've looked, there may be other errors visible which don't relate to the problem at hand. You may still need to discern what the actual problem is ...

If you're not familiar with UNIX, this may seem like a lot of effort. It's a lot less effort than guessing your way through a problem though!


Unsubscribe confirmation email fails when using Exchange as the mail server If a CiviCRM site is using MS Exchange to handle email, a user attempting to unsubscribe gets an error like:
Mailing Error Failed to send data [SMTP: Invalid response code received from SMTP server while sending email. This is often caused by a misconfiguration in Outbound Email settings. Please verify the settings at Administer CiviCRM >> Global Settings >> Outbound Email (SMTP). (code: 554, response: 5.2.0 STOREDRV.Submission.Exception:SendAsDeniedException.MapiExceptionSendAsDenied; Failed to process message due to a permanent exception with message Cannot submit message. 0.35250:89230000,

I discovered this was because CiviCRM attempts to send the email from do-not-reply@ and the account used to send the email did not have the rights to send on behalf of that email address. You cure it by creating a shared mailbox called do-no-reply@ and give the outbound email account rights to send email from that mailbox.


Styling buttons on CiviCRM public forms I'm looking to improve the look of buttons on CiviCRM public forms.
I am using a bootstrap sub-theme.
Are the button classes documented anywhere?
Any suggestions for addressing this?

Using Drupal 7 & CiviCRM 5.x

If you're using Drupal + CiviCRM you should check out the "Shoreditch" theme for CiviCRM which changes the CiviCRM UI to use bootstrap based styling.

Note: Shoreditch is in Alpha state and undergoing active development, we are using this in production and aside from a few minor issues it's working very well.

If you're not using Drupal you would want to look at overriding the CSS in your CMS/site theme. You can get the button classes etc using the "Web Inspector" in any major web browser - these are not directly documented at present.


Unexpected Error when registering for an Event via Webform Running Civi 4.7.27 / Drupal 7.59

I have developped a rather complex Webform to enable the registration of several participants, with conditionals and associated Contributions, to an Event (I already have had several of this kind without any problem).

But with this one, when I complete the registration, I get an "Unexpected Error".

Then, if I come back to the form (via the browser back arrow), and re-register, everything runs OK.

Of course, I Can't put this webform in production without solving this : any help is welcome.

I think I found the cause : I forgot to fill the "Fee" tab of the Event Form.

Everything is running OK now


CiviMobile: Can't log into CiviCRM using CiviMobile I installed:

CiviMobile extension in CiviCRM;
CiviMobile app on Android.

When I try to login using mobile browser, CiviCRM works. Loging in with same credentials in CiviMobile app does not work, it says: Sorry. We were not able connecting your CiviCRM server.

Logging into the demo server works.

There could be few reasons:
1. Please check the correct extension is installed. You need to install CiviMobileAPI extension (https://civicrm.org/extensions/civimobileapi), not CiviMobile. You can find installation steps here https://civimobile.agiliway.com/#how-to-start.

What CMS do you use?

If you use Drupal or Joomla then there should be no problem. Please check that you specify proper URL paying attention to http/https and www or without www.
if you use WP then there is a bug in core CiviCRM API which prevents API works correctly. Please start reading here for more details https://github.com/civicrm/civicrm-core/pull/12813#issuecomment-428152827
As an immediate solution, we are preparing API fix patch WP clients. It will include our quick fix and instruction how to install in.
Please write us at civicrm@agiliway.com IF you use WP.

If it still does not work then please write us (civicrm@agiliway.com) so we can investigate the problem.

Thank you,
 Sergiy


Why did civicrm_status_pref table not get created during upgrade we had an upgrade (4.4 > 4.7) that resulted in drupal log errors telling us DB Error: no such table ... civicrm_status_pref though there had been no warnings during upgrade itself

We turned logging off and back on, and table was created and several other problems were fixed (eg cron warnings in system status.

Reminder, to self and others, that for upgrading old systems in particular, turning logging off/on can be a help