Coder Social home page Coder Social logo

civicrm_osdi's Introduction

com.example.osdi

This is an extension for importing from and exporting to OSDI endpoints from CiviCRM. We suport syncs for Contact resources between CiviCRM to CiviCRM instances, as well as ActionNetwork to CiviCRM instances. Syncs are updated every day automatically through jobs that take groups of contacts on a remote instance of CiviCRM / ActionNetwork and ensure that these contacts are store and up to date on the host CiviCRM instance. All actions are negotiated through the OSDI implementation, and this extension provides an OSDI API endpoint to access contact instances through an OSDI format.

For a demo video, look here.

For more information on how to use or extend this application, please check the docs folder.

This extension to CiviCRM was built by Andy Gu for Google Summer of Code 2018. This repository's single purpose is to contain Andy Gu's submission to GSoC 2018.

Coverage Status

The extension is licensed under AGPL-3.0.

Requirements

  • PHP v5.4+
  • CiviCRM (FIXME: Version number)

Installation (Web UI)

This extension has not yet been published for installation via the web UI.

Installation (CLI, Zip)

Sysadmins and developers may download the .zip file for this extension and install it with the command-line tool cv.

cd <extension-dir>
cv dl com.example.osdi@https://github.com/4ndygu/civicrm_osdi/archive/master.zip

Make sure to install the dependencies as well, by invoking composer install.

Installation (CLI, Git)

Sysadmins and developers may clone the Git repo for this extension and install it with the command-line tool cv.

git clone https://github.com/FIXME/com.example.osdi.git
cv en osdi

Make sure to install the dependencies as well, by invoking composer install.

Usage

how to set up sync

In order to implement 2-way sync, we have implemented 4 main functions.

  • one time import
  • one time export
  • scheduled job import
  • scheduled job import

setting up "one time" jobs

After installing the extension, the configuration page can be spotted at Contacts -> Import via OSDI. The config page should look like this:

config image

The endpoint and resources can be selected from a dropdown menu. Please offer the APIKey of the appropriate Action Network resource in the API Key field.

In the Rule ID field, users can supply a dedupe rule ID, and the extension will call the supervised rule at the end of the one time import and export. This is deprecated for now - as a design decision, we chose to dedupe on name and email on insert. As a CiviCRM user, you can call dedupe rules yourself after import / export at the Contact -> Find and Merge Duplicate Contacts menu. Please do reach my handle at @everykittysdaydream if you explicitly would like this functionality back.

In the Group ID rule, you can specify the group you want to export from or the group you want to import into. Please specify the group ID number.

In specify required fields, you can specify a space_delimited string. In Import, this will check if specific fields in Action Network are present in the incoming data. In Export, this will check if specific fields in CiviCRM are present in the incoming data.

actually importing

The import job above only adds the job to be imported in a queue that sits in $_SESSION["extractors"]. In order to continue with the job, you have to schedule it.

To continue scheduling the job and getting contacts into CiviCRM, you need to set up two endpoints: Importer.Schedule and OSDIQueue.Run To do this, you can navigate to the /civicrm/admin/job?reset=1 endpoint and press "Add New Scheduled Job". There are two jobs to configure. You can name them whatever you like, but make sure the two jobs use the Importer entity + Schedule action, and the OSDIQueue entity and run action, respectively. There are no parameters to these two tasks.

job image

You can schedule the job by calling out to the Importer.Schedule endpoint. There are no parameters to be made. In order to set up the import pipeline, you must go to /civicrm/admin/job and configure Importer.Schedule as a cron job to be run at an interval of your discretion. This will add all tasks to a queue.

These jobs can be timed in cron, but can also be tested by pressing more -> Execute now.

The Scheduler will return information in the following format:

'email' => [
    'valid' => True or false,
    'new' => True or false,
]

Valid determines if the imported contact was valid, or if it contains a first name, last name, and email plus whatever space_delimited OSDI keys that you deem are necessary. New determines if the imported contact is newer than whatever matching contact sits in CiviCRM already. If there is no matching contact, this automatically returns true. The scheduler loads all contacts as separate jobs in a CiviCRM Queue class.

If the Scheduler returns the information "no variable set", that means that the scheduler is empty. You can import more jobs like above.

After you call schedule, you have to run the tasks in the queue. You can do this by calling out to the OSDIQueue.run endpoint. There are no parameters to be made. In order to set up the import pipeline, you must go to /civicrm/admin/job and configure OSDIQueue.run as a cron job to be run at an interval of your discretion. This will run everybody in the queue.

The OSDIQueue.run job will run everybody in the queue.

Currently, the architecture is constructed this way because I cannot configure the queue to only run a few elements without throwing a failed to obtain next task error. Please do let me know if you have gotten past this!

actually exporting

The first time you press the export button on the configuration page, you are actually just loading up the task by calling the Exporter.bulk endpoint. To actually start exporting via the Person Signup Helper, you must call it more times, preferably in a scheduled job. Every subsequent call of the API with the given key and endpoint will attempt to export 100 contacts.

I realize as I write this that this is not particularly good UI and will make a note to fix this.

setting up update jobs

Update jobs exist so they can be called as a scheduled job, presumably every day, that will update all newly modified contacts into both the external endpoint and the CiviCRM instance.

setting up import updates

I have provided an Updater.update endpoint that does the same thing as the original /config field. This is to be set as a scheduled job that runs daily. Here are the parameters:

key - this is the api key
endpoint - this is the root of the external api, such as https://actionnetwork.org/api/v2/
rule - this functions the same as the RuleID from earlier
group - this is analogous to the groupID from the config page

Like the bulk import, you must call Importer.Schedule and OSDIQueue.run for these jobs to actually end up as CiviCRM contacts. If all jobs are configured via scheduled jobs, the pipeline should work.

setting up export updates

To update your exports, you can call Exporter.bulk again with certain parameters. We provide the following extra parameters:

key - this is the api key
endpoint - this is the root of the api's people endpoint, such as https://actionnetwork.org/api/v2/people/
group - this is analogous to the groupID from the config page
updatejob - set this to 1 if you want to update
updateendpoint - set this to the endpoint of the external party's person signup helper
required - this is the same as the space-delimited Required field 

You can set update as a scheduled job that runs daily.

A generic OSDI-compliant endpoint.

You can find it at /civicrm/osdi/response?object=contact. This is currently still in alpha, but it allows users to page through all users with emails, first, and last names. I suppose everything here is in alpha, but this endpoint is currently in even more alpha than the above task.

Known Issues

(* FIXME *)

civicrm_osdi's People

Contributors

4ndygu avatar joemcl avatar megaphonejon avatar seamuslee001 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

civicrm_osdi's Issues

Error on install

When doing install via zip download to my ~/ext directory,

cv dl com.example.osdi@https://github.com/FIXME/com.example.osdi/archive/master.zip

getting this error:

Error: API Call Failed: Array
(
    [entity] => Extension
    [action] => download
    [params] => Array
        (
            [key] => com.example.osdi
            [url] => https://github.com/FIXME/com.example.osdi/archive/master.zip
            [install] => 1
            [debug] => 1
            [version] => 3
        )

    [result] => Array
        (
            [is_error] => 1
            [error_message] => Download failed - ZIP file is unavailable or malformed
        )

)

Error when attempting one-way import

I tried a one-way import since it seemed like the simplest task. I didn't configure the mapping at all - I thought I didn't need to but maybe I'm misunderstanding the docs? Anyway, I got this in the Scheduled Job log for OSDIQueue.Run:

Entity: OSDIQueue Action: Run
Summary
Finished execution of Call OSDIQueue.Run API with result: Success (a:1:{s:6:"result";a:5:{s:8:"is_error";i:1;s:9:"exception";O:22:"CiviCRM_API3_Exception":8:{s:35:"CiviCRM_API3_ExceptionextraParams";a:6:{s:5:"field";s:4:"name";s:10:" (...)
Details


Parameters parsed (and passed to API method): 
a:1:{s:7:"version";i:3;}

Full message: 
Finished execution of Call OSDIQueue.Run API with result: Success (a:1:{s:6:"result";a:5:{s:8:"is_error";i:1;s:9:"exception";O:22:"CiviCRM_API3_Exception":8:{s:35:"CiviCRM_API3_ExceptionextraParams";a:6:{s:5:"field";s:4:"name";s:10:"error_code";i:2100;s:6:"entity";s:7:"Mapping";s:6:"action";s:3:"get";s:8:"is_error";i:1;s:13:"error_message";s:79:"Value for name is 69 characters  - This field has a maxlength of 64 characters.";}s:10:"*message";s:79:"Value for name is 69 characters  - This field has a maxlength of 64 characters.";s:17:"Exceptionstring";s:0:"";s:7:"*code";i:0;s:7:"*file";s:92:"/var/www/testsite-wp.megaphonetech.com/htdocs/wp-content/plugins/civicrm/civicrm/api/api.php";s:7:"*line";i:45;s:16:"Exceptiontrace";a:22:{i:0;a:4:{s:4:"file";s:113:"/var/www/testsite-wp.megaphonetech.com/htdocs/wp-content/uploads/civicrm/ext/civicrm_osdi/CRM/OSDIQueue/Tasks.php";s:4:"line";i:40;s:8:"function";s:12:"civicrm_api3";s:4:"args";a:3:{i:0;s:7:"Mapping";i:1;s:3:"get";i:2;a:2:{s:4:"name";s:69:"OSDIREMOTE_https://test-drupal.megaphonetech.com/civicrm/osdi/webhook";s:7:"version";i:3;}}}i:1;a:6:{s:4:"file";s:99:"/var/www/testsite-wp.megaphonetech.com/htdocs/wp-content/plugins/civicrm/civicrm/CRM/Queue/Task.php";s:4:"line";i:88;s:8:"function";s:10:"AddContact";s:5:"class";s:19:"CRM_OSDIQueue_Tasks";s:4:"type";s:2:"::";s:4:"args";a:2:{i:0;O:21:"CRM_Queue_TaskContext":2:{s:5:"queue";O:19:"CRM_Queue_Queue_Sql":1:{s:22:"CRM_Queue_Queue_name";s:21:"com.civicrm.osdiqueue";}s:3:"log";O:8:"Log_file":16:{s:9:"_filename";s:122:"/var/www/testsite-wp.megaphonetech.com/htdocs/wp-content/uploads/civicrm/ConfigAndLog/CiviCRM.63c0face60f9ca29c6db1501.log";s:3:"_fp";i:0;s:7:"_append";b:1;s:8:"_locking";b:0;s:5:"_mode";i:420;s:8:"_dirmode";i:493;s:11:"_lineFormat";s:21:"%1$s %2$s [%3$s] %4$s";s:11:"_timeFormat";s:14:"%b %d %H:%M:%S";s:4:"_eol";s:1:"
";s:7:"_opened";b:0;s:3:"_id";s:32:"0fcaa8ac83a85099905e318c7a629e20";s:6:"_ident";s:0:"";s:9:"_priority";i:6;s:5:"_mask";i:255;s:10:"_listeners";a:0:{}s:10:"_formatMap";a:9:{s:12:"%{timestamp}";s:4:"%1$s";s:8:"%{ident}";s:4:"%2$s";s:11:"%{priority}";s:4:"%3$s";s:10:"%{message}";s:4:"%4$s";s:7:"%{file}";s:4:"%5$s";s:7:"%{line}";s:4:"%6$s";s:11:"%{function}";s:4:"%7$s";s:8:"%{class}";s:4:"%8$s";s:3:"%\{";s:3:"%%{";}}}i:1;s:939:"O:12:"PeopleStruct":5:{s:6:"person";a:13:{s:11:"family_name";s:0:"";s:10:"given_name";s:0:"";s:15:"additional_name";s:0:"";s:16:"honorific_prefix";s:0:"";s:16:"honorific_suffix";s:0:"";s:9:"gender_id";s:0:"";s:8:"employer";s:0:"";s:15:"email_addresses";a:1:{i:0;a:2:{s:7:"address";s:17:"[email protected]";s:7:"primary";b:1;}}s:16:"postal_addresses";a:1:{i:0;a:6:{s:7:"primary";b:1;s:13:"address_lines";a:1:{i:0;s:0:"";}s:8:"locality";s:0:"";s:6:"region";s:0:"";s:7:"country";s:0:"";s:11:"postal_code";s:0:"";}}s:13:"phone_numbers";a:1:{i:0;a:3:{s:7:"primary";b:1;s:6:"number";s:0:"";s:11:"do_not_call";s:1:"0";}}s:18:"preferred_language";s:5:"en_US";s:13:"custom_fields";a:1:{s:48:"CIVI_ID_aaebfdccdd9ba0e2efa2697eeea132f61be605ce";i:3;}s:13:"modified_date";s:19:"2018-08-01 12:44:25";}s:4:"rule";i:-1;s:7:"groupid";s:1:"2";s:6:"apikey";s:11:"OSDI_rxcjro";s:8:"endpoint";s:58:"https://test-drupal.megaphonetech.com/civicrm/osdi/webhook";}";}}i:2;a:6:{s:4:"file";s:101:"/var/www/testsite-wp.megaphonetech.com/htdocs/wp-content/plugins/civicrm/civicrm/CRM/Queue/Runner.php";s:4:"line";i:214;s:8:"function";s:3:"run";s:5:"class";s:14:"CRM_Queue_Task";s:4:"type";s:2:"->";s:4:"args";a:1:{i:0;r:35;}}i:3;a:6:{s:4:"file";s:101:"/var/www/testsite-wp.megaphonetech.com/htdocs/wp-content/plugins/civicrm/civicrm/CRM/Queue/Runner.php";s:4:"line";i:168;s:8:"function";s:7:"runNext";s:5:"class";s:16:"CRM_Queue_Runner";s:4:"type";s:2:"->";s:4:"args";a:0:{}}i:4;a:6:{s:4:"file";s:114:"/var/www/testsite-wp.megaphonetech.com/htdocs/wp-content/uploads/civicrm/ext/civicrm_osdi/api/v3/OSDIQueue/Run.php";s:4:"line";i:49;s:8:"function";s:6:"runAll";s:5:"class";s:16:"CRM_Queue_Runner";s:4:"type";s:2:"->";s:4:"args";a:0:{}}i:5;a:4:{s:4:"file";s:124:"/var/www/testsite-wp.megaphonetech.com/htdocs/wp-content/plugins/civicrm/civicrm/Civi/API/Provider/MagicFunctionProvider.php";s:4:"line";i:89;s:8:"function";s:30:"civicrm_api3_o_s_d_i_queue_Run";s:4:"args";a:1:{i:0;a:1:{s:7:"version";i:3;}}}i:6;a:6:{s:4:"file";s:100:"/var/www/testsite-wp.megaphonetech.com/htdocs/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php";s:4:"line";i:169;s:8:"function";s:6:"invoke";s:5:"class";s:39:"Civi\API\Provider\MagicFunctionProvider";s:4:"type";s:2:"->";s:4:"args";a:1:{i:0;a:9:{s:2:"id";i:1;s:7:"version";i:3;s:6:"params";a:1:{s:7:"version";i:3;}s:5:"extra";N;s:6:"fields";a:0:{}s:6:"entity";s:9:"OSDIQueue";s:6:"action";s:3:"run";s:8:"function";s:30:"civicrm_api3_o_s_d_i_queue_run";s:10:"is_generic";b:0;}}}i:7;a:6:{s:4:"file";s:100:"/var/www/testsite-wp.megaphonetech.com/htdocs/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php";s:4:"line";i:100;s:8:"function";s:10:"runRequest";s:5:"class";s:15:"Civi\API\Kernel";s:4:"type";s:2:"->";s:4:"args";a:1:{i:0;a:9:{s:2:"id";i:1;s:7:"version";i:3;s:6:"params";a:1:{s:7:"version";i:3;}s:5:"extra";N;s:6:"fields";a:0:{}s:6:"entity";s:9:"OSDIQueue";s:6:"action";s:3:"run";s:8:"function";s:30:"civicrm_api3_o_s_d_i_queue_run";s:10:"is_generic";b:0;}}}i:8;a:6:{s:4:"file";s:92:"/var/www/testsite-wp.megaphonetech.com/htdocs/wp-content/plugins/civicrm/civicrm/api/api.php";s:4:"line";i:23;s:8:"function";s:7:"runSafe";s:5:"class";s:15:"Civi\API\Kernel";s:4:"type";s:2:"->";s:4:"args";a:4:{i:0;s:9:"OSDIQueue";i:1;s:3:"Run";i:2;a:1:{s:7:"version";i:3;}i:3;N;}}i:9;a:4:{s:4:"file";s:104:"/var/www/testsite-wp.megaphonetech.com/htdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/JobManager.php";s:4:"line";i:145;s:8:"function";s:11:"civicrm_api";s:4:"args";a:3:{i:0;s:9:"OSDIQueue";i:1;s:3:"Run";i:2;a:1:{s:7:"version";i:3;}}}i:10;a:6:{s:4:"file";s:104:"/var/www/testsite-wp.megaphonetech.com/htdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/JobManager.php";s:4:"line";i:113;s:8:"function";s:10:"executeJob";s:5:"class";s:19:"CRM_Core_JobManager";s:4:"type";s:2:"->";s:4:"args";a:1:{i:0;O:21:"CRM_Core_ScheduledJob":11:{s:7:"version";i:3;s:4:"name";s:22:"Call OSDIQueue.Run API";s:9:"apiParams";a:1:{s:7:"version";i:3;}s:7:"remarks";a:0:{}s:2:"id";s:2:"25";s:9:"domain_id";s:1:"1";s:13:"run_frequency";s:6:"Always";s:11:"description";s:22:"Call OSDIQueue.Run API";s:10:"api_entity";s:9:"OSDIQueue";s:10:"api_action";s:3:"Run";s:9:"is_active";s:1:"1";}}}i:11;a:6:{s:4:"file";s:103:"/var/www/testsite-wp.megaphonetech.com/htdocs/wp-content/plugins/civicrm/civicrm/CRM/Admin/Page/Job.php";s:4:"line";i:153;s:8:"function";s:14:"executeJobById";s:5:"class";s:19:"CRM_Core_JobManager";s:4:"type";s:2:"->";s:4:"args";a:1:{i:0;s:2:"25";}}i:12;a:6:{s:4:"file";s:104:"/var/www/testsite-wp.megaphonetech.com/htdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/Page/Basic.php";s:4:"line";i:160;s:8:"function";s:6:"browse";s:5:"class";s:18:"CRM_Admin_Page_Job";s:4:"type";s:2:"->";s:4:"args";a:2:{i:0;N;i:1;N;}}i:13;a:6:{s:4:"file";s:103:"/var/www/testsite-wp.megaphonetech.com/htdocs/wp-content/plugins/civicrm/civicrm/CRM/Admin/Page/Job.php";s:4:"line";i:136;s:8:"function";s:3:"run";s:5:"class";s:19:"CRM_Core_Page_Basic";s:4:"type";s:2:"->";s:4:"args";a:0:{}}i:14;a:6:{s:4:"file";s:100:"/var/www/testsite-wp.megaphonetech.com/htdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php";s:4:"line";i:309;s:8:"function";s:3:"run";s:5:"class";s:18:"CRM_Admin_Page_Job";s:4:"type";s:2:"->";s:4:"args";a:2:{i:0;a:3:{i:0;s:7:"civicrm";i:1;s:5:"admin";i:2;s:3:"job";}i:1;N;}}i:15;a:6:{s:4:"file";s:100:"/var/www/testsite-wp.megaphonetech.com/htdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php";s:4:"line";i:84;s:8:"function";s:7:"runItem";s:5:"class";s:15:"CRM_Core_Invoke";s:4:"type";s:2:"::";s:4:"args";a:1:{i:0;a:16:{s:2:"id";s:3:"173";s:9:"domain_id";s:1:"1";s:4:"path";s:17:"civicrm/admin/job";s:5:"title";s:14:"Scheduled Jobs";s:15:"access_callback";a:2:{i:0;s:19:"CRM_Core_Permission";i:1;s:9:"checkMenu";}s:16:"access_arguments";a:2:{i:0;a:2:{i:0;s:14:"access CiviCRM";i:1;s:18:"administer CiviCRM";}i:1;s:3:"and";}s:13:"page_callback";s:18:"CRM_Admin_Page_Job";s:10:"breadcrumb";a:2:{i:0;a:2:{s:5:"title";s:7:"CiviCRM";s:3:"url";s:58:"/wp-admin/admin.php?page=CiviCRM&q=civicrm&reset=1";}i:1;a:2:{s:5:"title";s:18:"Administer CiviCRM";s:3:"url";s:64:"/wp-admin/admin.php?page=CiviCRM&q=civicrm/admin&reset=1";}}s:6:"is_ssl";s:1:"1";s:6:"weight";s:4:"1370";s:4:"type";s:1:"1";s:9:"page_type";s:1:"0";s:4:"desc";s:35:"Managing periodially running tasks.";s:10:"adminGroup";s:15:"System Settings";s:4:"icon";s:18:"admin/small/13.png";s:14:"page_arguments";b:0;}}}i:16;a:6:{s:4:"file";s:100:"/var/www/testsite-wp.megaphonetech.com/htdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php";s:4:"line";i:52;s:8:"function";s:7:"_invoke";s:5:"class";s:15:"CRM_Core_Invoke";s:4:"type";s:2:"::";s:4:"args";a:1:{i:0;a:3:{i:0;s:7:"civicrm";i:1;s:5:"admin";i:2;s:3:"job";}}}i:17;a:6:{s:4:"file";s:84:"/var/www/testsite-wp.megaphonetech.com/htdocs/wp-content/plugins/civicrm/civicrm.php";s:4:"line";i:1246;s:8:"function";s:6:"invoke";s:5:"class";s:15:"CRM_Core_Invoke";s:4:"type";s:2:"::";s:4:"args";a:1:{i:0;a:3:{i:0;s:7:"civicrm";i:1;s:5:"admin";i:2;s:3:"job";}}}i:18;a:6:{s:4:"file";s:75:"/var/www/testsite-wp.megaphonetech.com/htdocs/wp-includes/class-wp-hook.php";s:4:"line";i:286;s:8:"function";s:6:"invoke";s:5:"class";s:21:"CiviCRM_For_WordPress";s:4:"type";s:2:"->";s:4:"args";a:1:{i:0;s:0:"";}}i:19;a:6:{s:4:"file";s:75:"/var/www/testsite-wp.megaphonetech.com/htdocs/wp-includes/class-wp-hook.php";s:4:"line";i:310;s:8:"function";s:13:"apply_filters";s:5:"class";s:7:"WP_Hook";s:4:"type";s:2:"->";s:4:"args";a:2:{i:0;s:0:"";i:1;a:1:{i:0;s:0:"";}}}i:20;a:6:{s:4:"file";s:68:"/var/www/testsite-wp.megaphonetech.com/htdocs/wp-includes/plugin.php";s:4:"line";i:453;s:8:"function";s:9:"do_action";s:5:"class";s:7:"WP_Hook";s:4:"type";s:2:"->";s:4:"args";a:1:{i:0;a:1:{i:0;s:0:"";}}}i:21;a:4:{s:4:"file";s:64:"/var/www/testsite-wp.megaphonetech.com/htdocs/wp-admin/admin.php";s:4:"line";i:224;s:8:"function";s:9:"do_action";s:4:"args";a:1:{i:0;s:21:"toplevel_page_CiviCRM";}}}s:19:"Exceptionprevious";N;}s:15:"last_task_title";s:0:"";s:13:"numberOfItems";s:1:"3";s:11:"is_continue";i:0;}})

Can't schedule an import when the webhook is a WordPress-based site

The various CMSes that CiviCRM supports all have different methods of indicating to their front page router which page should be loaded. Here are two examples:

Drupal: https://test-drupal.megaphonetech.com/civicrm/osdi/webhook
WordPress: https://testsite-wp.megaphonetech.com/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fosdi%2Fwebhook

Furthermore, this assumes that Drupal "clean URLs" are enabled. Otherwise, the Drupal URLs are constructed similarly:

Drupal (no clean URLs): http://example.org/index.php?q=civicrm/osdi/webhook
Joomla 1.5 sites: http://example.org/administrator/index2.php?option=com_civicrm&task=civicrm/osdi/webhook
Joomla 1.6+ sites: http://example.org/administrator/index.php?option=com_civicrm&task=civicrm/osdi/webhook
WordPress sites: http://example.org/wp-admin/admin.php?page=CiviCRM&q=civicrm/osdi/webhook

If it helps to troubleshoot, I provisioned a WordPress site at https://osdi3.megaphonetech.com on the same server as the other two.

"install_groupid" and "install_matching" issues

Hi Andy,

I know you're done, but you said you'd be available for bugfixes. Let me know if you think this isn't something you'll get to.

In the code I noticed a couple of things about these two functions.

  • They're called by the "enable" and "postInstall" hooks. If I understand them correctly, they should just run once, on hook_civicrm_install.
  • They don't have docblocks, so I'm actually not 100% sure. I see that install groupid creates the custom field group and field; I haven't investigated what install_matching does, but if you could add a docblock, it would help future maintainers of the code.
  • hook_civicrm_uninstall should have functions that reverse these functions (e.g. delete the custom field and group).

Thanks,
Jon

Convert alerts to notifications

I'm happy to do this, or you can Andy. Instead of using alert in JS for notifications, we should instead use CiviCRM notifications. It shouldn't take more than a few minutes to change alert to CRM.alert, plus add a status to differentiate between success/warning/error.

"Remote Time Zone" is local time zone?

Hi Andy,

It looks from your docs like the item labeled "Time Zone of remote server" is actually the "time zone on the server where the civicrm instance is running" - or what I'd consider the local time zone. Am I understanding correctly? If so, could we just update the labels appropriately? If I'm misunderstanding, let's see if we can figure out some language that makes it clearer.

Thanks,
Jon

Expose ~/civicrm/osdi/mapping in the UI

Add a menu item for ~/civicrm/osdi/mapping in the menu; add a button in ~/civicrm/osdi/config to connect to /mapping; add a button in /mapping to connect to /config

Fix composer install differences

A placeholder to note that composer install needs to be adjusted to conform with buildkit composer dependencies requirements, or creating the required sheduled jobs does not work. We followed these steps as a workaround:

find . | grep Schedule.php
cd ./com.example.osdi/api/v3/Importer/Schedule.php
cd ./com.example.osdi/api/v3/Importer/
ls
cd ../../..
ls
md vendor
md /vendor
mk dir vendor
mk dir
mkdir vendor
cd vendor
ls
touch autoload.php
find . | grep composer.json
cd
find . | grep composer.json
find . | grep osdi | grep composer.json
cd ./buildkit/build/drupal-clean/web/sites/default/files/civicrm/ext/com.example.osdi/
ls
composer
composer install
ls 
ls vendor
cat vendor/autoload.php

Error message on install

I get this:

Warning: Declaration of CRM_Osdi_Permission::check($permissions) should be compatible with CRM_Core_Permission::check($permissions, $contactId = NULL) in require_once() (line 218 of /home/jon/local/civicrm-buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Core/ClassLoader.php).

It seems like a function signature mismatch that shouldn't really affect anything, but it's quick enough to clean up, and gives reviewers confidence in the code.

Editing Schedule Job can break loading of Jobs page

We edited one of the scheduled jobs through the scheduled job UI (Admin -> Scheduled Jobs -> Edit) and we managed to add in a carriage return to the groups param. This then borked the API call in the OSDIJob.php page (L50) because it then treated the group id as a string rather than as an Integer. CiviCRM APIv3 on Group.Get verifies that the id column is an int or it throws error

Error creating new Importer.Schedule scheduled job

Trying to create a new scheduled job with Importer.Schedule API call and getting the error below, running CiviCRM v. 5.19.alpha1 and Drupal 7, installed via buildkit on my Ubuntu 19.04 laptop.

Warning: require(/home/joe/buildkit/build/drupal-clean/web/sites/default/files/civicrm/ext/com.example.osdi/api/v3/Importer/../../../vendor/autoload.php): failed to open stream: No such file or directory in require() (line 8 of /home/joe/buildkit/build/drupal-clean/web/sites/default/files/civicrm/ext/com.example.osdi/api/v3/Importer/Schedule.php).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.