Hot answers tagged

13

CiviCRM defines MySQL triggers for certain tasks. When you use phpMyAdmin, mysqldump or similar to export your database to a text file, it exports your triggers as well. The format is something like this: /*!50003 CREATE*/ /*!50017 DEFINER=`newpress`@`localhost`*/ /*!50003 TRIGGER civicrm_address_after_insert after insert ON civicrm_address FOR EACH ROW ...


10

If you have installed civicrm-buildkit and configured civibuild, then you can use the tutorial steps at Daily Coding: Upgrade Tests. If you don't use civibuild, then you can piece-together a similar workflow using civicrm-upgrade-test. For more discussion about writing upgrade logic, see Upgrade Reference on the wiki. For a general, high-level overview of ...


10

You should use the API as the data dictionary. The API explorer (available in every installation) provides a convenient interface to browse the data dictionary. The demo sites each have an API explorer and they are the authoritative public data dictionary for CiviCRM. For example http://dmaster.demo.civicrm.org/civicrm/api/explorer (login first with ...


8

This is doable using the API, and I've accomplished it using Pentaho Kettle. It has a CiviCRM Input and CiviCRM Output step, which use the REST API. You're right to be concerned about the SQL-based approach, since there's been discussion of deprecating that table in favor of a line item-based approach to connecting contributions and memberships. If you ...


7

Saw the same issue here. We noticed that the field appeared twice in the list of fields. We'd selected it as CiviCRM Contact: My Field - but it also appeared as CiviCRM Custom: My Field. When we selected it as CiviCRM Custom: My Field, it worked.


6

It sounds like you imported the first_name and last_name values - but the value at the top of the record is the display_name. You have two options: Use your SQL script to update the display_name accordingly. Export ONLY the contact_id of the affected records (or all records). Reimport the contact ID via the "Import Contacts" functionality. All records ...


5

The easiest would be if you can find it in the CiviCRM custom groups? Using Administer/Customize Data and Screens/Custom Fields. If that does not work, check the table civicrm_custom_group. You will probably see an entry there with the column name 'is_reserved' having the value 1. If that is the case, change the value for 'is_reserved' to 0 and check if you ...


5

Jon G's answer is correct. However, If you're not in the world of shell editors and perl, you can also open the dump file in a text editor (not a word processor) and do a search and replace. You can just search for DEFINER=namename@localhost portion, replace it with nothing, and leave the rest of the line in place.


4

The developer documents on the CiviCRM Wiki are very extensive and cover the codebase and development standards and best practices. There are reference sheets digging into specific areas for the project at hand. There are XML files on GitHub that describe the database structure and fields. Your CiviCRM instance should also have an API explorer and ...


4

I just ran into this issue (on current Drupal, current CiviCRM setup) and confirmed that the way it's set now, a non-admin user needs the permission "access deleted contacts" to run this report. Hope that's helpful - not much of an answer but I lost access to my old account and don't have enough rep to post a comment :)


4

it seems php 7.2 is not compatible with 5.x.x or i do not know how to do the configuration i think downgrade the php would be the best solution but i wonder if there is other answer, and how to do it.... updates: -downgrade php does not help, same error appears -downgrade mysql to 5.5 works!


3

You could use phpmyadmin and look in table 'civicrm_domain' at field 'version' - the version is stored there.


3

Yes, there is such a function; but you shouldn't use it. Make each query separately and check the result. Avoid functions which make multiple SQL queries in one action, as they make it harder for your application logic to handle unexpected cases. CRM_Core_DAO::executeQuery() executes a single query against the DB - use this. CRM_Utils_File::sourceSQLFile()...


3

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


3

You can add this to the top of your .sql file, then try loading it again. SET FOREIGN_KEY_CHECKS = 0; This will permit MySQL to load the data while ignoring the foreign key checks. Since CiviCRM uses foreign key checks, this is a good idea only if the checks throw errors when loading the DB but not when using CiviCRM afterwards. Alternatively, to ensure ...


3

If drupal and civicrm are sharing a database, then this will work without any further configuration. But if you have civicrm in a separate database, there is an extra step: Every time you create a custom field in CiviCRM it adds a new table to the database. You have to tell Views about the new table by adding the new line to your settings.php file. See ...


3

You have to add a map of the civicrm tables to Drupal's settings.php for that to work. See http://wiki.civicrm.org/confluence/display/CRMDOC/Views3+Integration for details.


3

The simplest route I believe is to generate DB dumps which omit these triggers by using mysqldump's --skip-triggers switch mysqldump --skip-triggers NAMEOFDB > NAMEOFDB.sql This outputs a version of the DB dump without triggers, which CiviCRM will regenerate once loaded onto the next site. If you're using another interface to mysqldump, eg phpmyadmin ...


3

You should be able to use the functions in: CRM/Utils/Crypt.php to do symmetric encryption/decryption of the fields. Password related fields in the CiviCRM db are encrypted. As Lesley mentions, there are two aspects to this problem. Encrypting data, and restricting access to the data to a certain class of users


3

I've not used them but have happened on this previously, I believe it's a GUI for the API which allows importing into any entity. Would likely still be a two stage process though, as you'd need the IDs from the first pass https://civicrm.org/blogs/stoob/csv-api-import https://civicrm.org/extensions/api-csv-import-gui


3

Check Drupal permissions at http://site/admin/people/permissions. It might be "CiviReport: save Report Criteria".


2

Carlos Capote for Amnesty International Spain has been doing work to facilitate imports and exports using Pentaho Kettle. See https://civicrm.org/blogs/capo/new-tool-civicrm-data-integration for background and various improvements being done in Fall 2014 (http://wiki.civicrm.org/confluence/display/CRM/Civi+Data+Integration+v1.2). Code is available at https:...


2

We commissioned a developer to implement a fairly complex migration extension for a project a while back. The whole thing is very much coupled to our system however you might be able to glean something from their repo. They didn't handle payments in this migration, we actually added that after the fact. In our case, we were only concerned with importing ...


2

There is no real data dictionary for CiviCRM. The data in core is generated from some xml schema's which you can find on GitHub at: https://github.com/civicrm/civicrm-core/tree/master/xml/schema


2

Do you want just one field encrypted or a group of fields (if you're dealing w/HIPAA data, probably it is more than one, right?) Create custom fields where the 'Type' is, say, 'HIPAA' (you can create this subtype by subtyping your basic object, whether it is Activities, Campaigns, or Contacts). From there, you'd need to add a hook/code to encrypt fields ...


2

We were recently asked to 'Encrypt one CiviCRM custom field' for one of our clients who uses Webform CiviCRM module as a GUI to view/edit/add custom field values to CiviCRM for their clients. I ended up leveraging Drupal Encrypt module to not just encrypt the values stored on the Drupal side (in the Webform Submission) but also to encrypt the values stored ...


2

Agree, the API is decidedly the best way as it does multiple stuff and should continue to function over upgrades when there are database changes. I only use SQL when either the API does not do what I need, with custom data because it is easier most of the times or when doing bulk stuff.


2

This particular error seems to be a recent regression in 4.7.23: https://issues.civicrm.org/jira/browse/CRM-21029 You can wait until the release of 4.7.24 or apply the patch from https://github.com/civicrm/civicrm-core/pull/10819 manually.


2

You might be running the manual query under a different mysql user than the one that owns the function, so you can check who the "definer" is using show create function civicrm_strip_non_numeric;. If it really is "missing", then you can also manually recreate the function - it's defined in CRM_Contact_BAO_Contact: https://raw.githubusercontent.com/civicrm/...


2

General advice is don't use SQL directly - use the API. You don't have to write code if you use cv or API explorer.


Only top voted, non community-wiki answers of a minimum length are eligible