20

Some thoughts Anonymizing data is hard work. Eg: Would it be OK if your developer could de-anonymize your contacts by identifying from geolocated data? What about identifying by "metadata", if suburb data is left in? Does your developer need a DB with activities from inbound email left in? Has the situation improved in the decade since WIRED Why 'Anonymous'...


16

To return more than 25 results you need to add options.limit to your api call: $params = array( 'version' => 3, 'sequential' => 1, 'membership_type' => 1, 'options' => array( 'limit' => 100, ), ); $result = civicrm_api('Membership', 'get', $params); For the second part, we want to be able to retrieve say 5,000 records. We ...


15

As Kurund pointed out, the general instructions are at https://github.com/civicrm/civicrm-buildkit . Follow those instructions to download the all the tools. There are a few details that may not be well represented yet in the documentation: As the main developer behind buildkit, I use it mostly in MAMP (and a bit in Debian and Ubuntu). Buildkit runs ...


14

For the first example, you need to 1. clear the compiled Smarty templates cache. In the second case you need to 2. rebuild the menu system using your xml file. 3. There are some db cache tables you sometimes need to clear out using mysql or a link in the UI. 4. Caching in the CMS can also affect CiviCRM pages. a) One way to do this is to go to Admin > ...


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 ...


9

+1 for Joe's comment which is pretty thorough. Re: drush cc all -- this command can be pretty important in the workflow for Drupal dev. In Civi-Drupal, the analogous command is drush cvapi system.flush In Civi-Wordpress, it's wp civicrm api system.flush . (Or, if you're more into Firebug's CLI, CRM.api3('system','flush')) Note: Despite the anachronistic ...


9

PTP has been experimenting with docker for a few months and is planning to use it in production soon (to replace our aegir provisioning system). I've just been working today on finishing a Docker file for setting up a civicrm-buildkit instance.. Feedback welcome!


9

Go to configure it in your settings /civicrm/admin/setting/misc?reset=1


9

Xdebug configuration is a somewhat temperamental issue -- the details depend on the IDE, the PHP build, host OS, target application, test suite, etc. Providing a good answer to this is tricky -- e.g. I could describe my configuration (Mac OS X, PHPStorm 2016.2, MAMP 3.4, PHP 5.4, buildkit/dmaster), but the odds are that most people reading it will need ...


8

(Update) As of v4.7.0, the approaches below still work, but there's a better way to write to the log file using a PSR-3 logger, e.g.: Civi::log()->info('Hello, log!'); Civi::log()->error('I'm sorry, {name}. I'm afraid I can't do that.', array( 'name' => 'Stanley Kubrick', )); See also: https://civicrm.org/blog/totten/the-static-is-dead-long-live-...


8

Approaches There are a few different patterns one could follow in connecting Civi extensions with composer: (Broad scope) Site build via composer: The entire web site is defined with a custom composer.json file. It doesn't matter what kind of dependency you need to pull in (CMS, CMS module, CMS theme, CRM, CRM extension, PHP library, CSS library, etc), it'...


8

You will need to create extension to have Eventbrite sync with CiviEvents. Here is some guideline on how to approach this Create extension. Add page using civix In run() use CiviCRM api to create entries in civicrm table. Reference : Mandrill extension uses same approach i.e to create entries in various civicrm table upon webhook call. This might find ...


8

As of CiviCRM v5.12.1 the menubar color is a configurable setting. On your main site you can change the color via the UI by visiting Administer -> Customize Data & Screens -> Display Preferences. Since this preference is stored in a system setting, you can override it on your various dev/staging sites by adding a line like this to civicrm.settings.php: ...


7

No one on the core team is actively using docker, although a few of us experiment with it. Several of us do use the civibuild command from https://buildkit.civicrm.org/ . It defines the reference/demo builds used by http://d46.demo.civicrm.org , http://wp46.demo.civicrm.org , etal. Civibuild tackles a slightly different part of the stack than Docker or ...


7

Well here's an alternate way to try which returns the total result if you have no idea how much entries does the returned result will contain : $count = civicrm_api('Membership', 'getcount', $params); $params = array( 'version' => 3, 'sequential' => 1, 'membership_type' => 1, 'options' => array( 'limit' => $count, ), ); $...


7

I'd use System.get API call. (source) In the return values, there's a value for version which corresponds to the value in civicrm-version.php $ cv api System.get name=version { "is_error": 0, "version": 3, "count": 1, "id": 0, "values": [ { "version": "4.6.20.0", "uf": "Drupal", "php": { ...


7

Agree with Chris that System.get is a great API for inspecting the system -- with a trade-off of breadth vs speed. If you need something more performant, use CRM_Utils_System::version(), e.g. $ cv ev 'return CRM_Utils_System::version();' "4.7.16"


7

I will answer your questions #1 and #2. (I'm not sure what you mean by #3. If #3 is sufficiently unrelated to #1 and #2, I would suggest creating a separate question for it) Why an ER (Entity Relationship) diagram might not be helpful As a visual learner, I too looked for an ER diagram when first trying to understand the CiviCRM database schema. I was ...


6

Using the Drupal standards in your IDE ought to get you most of the way. For fine-tuning you can see https://wiki.civicrm.org/confluence/display/CRMDOC/PHP+Code+and+Inline+Documentation and also try out the civilint cli tool which is shipped with buildkit.


6

LExIM is the new overall release and extension strategy: LEAP BY EXTENSION. ITERATE BY MONTH. It basically means that: CiviCRM development will now happen mostly through extensions, enabling the users to individually turn these new features on or off by enabling these new extensions Releases are going to be published on a predictable monthly ...


6

All thanks to the code example link in Eric's answer here's a simplified example of how to offer up a hook (my_new_hook) which takes one argument, $the_argument: CRM_Utils_Hook::singleton()->invoke( 1, $the_argument, $dummy, $dummy, $dummy, $dummy, $dummy, 'my_new_hook'); Then ...


5

You may want to have a look at CiviCRM's Partners and contributors page. For special requirements, it would be helpful if you specify a bit more in detail, what you are looking for. Also, this CiviCRM forum may be of interest: Professional CiviCRM Services Regards Fabian


5

Adding options.limit to 0 returns the total result for the api which I feel is the best way to get more than 25 contacts :) $params = array( 'version' => 3, 'sequential' => 1, 'membership_type' => 1, 'options' => array( 'limit' => 0, ), ); $result = civicrm_api('Membership', 'get', $params);


5

I have found why it was not working. I was looking in the user interface whether my tokens showed up in the list with tokens a user can use. But they did not. After digging all the core code I found out that I had to use a combination of hook_tokens and an event listener for evaluate tokens. I also had to put a require once statement to my token listener ...


5

The generate:api subcommand (and a few others) require access to a working copy of CiviCRM. To locate this, it uses a process reminiscent of drush or wp-cli. For example, if the command-line is running inside /var/www/sites/default/files/civicrm/ext/org.example.foo/, then it will perform an upward search to find the CMS root: /var/www/sites/default/files/...


5

For IDE purposes, look at https://github.com/civicrm/coder/ This is a fork of drupal/coder which relaxes a number of conditions. (The coding practices in Civi differed from Drupal in some non-cosmetic ways -- changing them would break functional backward-compatibility.) This is the same rule-set used by civilint, which is the script that runs the civicrm....


5

I'm unsure what's recommended, but there are several patterns (at least) through the codebase: CRM_Utils_HttpClient, used in core functionality like system checks. This has test coverage! PHP curl, common in the payment processors. PEAR HTTP_Request, in older code like geocoders. Occasionally file_get_contents() to switch things up for fun? I like using ...


5

ah-ha! In your test class edit the setUpHeadless() method which might look at first like this: public function setUpHeadless() { // Civi\Test has ...


5

You will need ssh access to the code base (on your server): First: when working on latest code edits you may need to pull in the latest edits (that may not have been released yet) -> for example: karins-macbook-pro-2:webform_civicrm sysadmin$ git pull origin 8.x-5.x remote: Enumerating objects: 9, done. remote: Counting objects: 100% (9/9), done. remote: ...


5

Here is an example of a hook we created for CiviRules: https://lab.civicrm.org/extensions/civirules/blob/master/CRM/Civirules/Utils/HookInvoker.php Hope this helps :-)


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