diff --git a/README.md b/README.md index 229b76d6..a23e474f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Stanford CAPx -#### Version 2.x +#### Version 2.x RC2 Stanford CAP Extensible module builds on some great work. This module provides an interface for administrators to pull information directly from the CAP API into Drupal. This allows profile owners to continue to manage their profile information on the CAP web service and have that information automatically reflected into a Drupal website. @@ -31,6 +31,12 @@ Collaboration and bug reports are welcome. Please file bug reports on the github Also included in this package is a module called: capx_issue_collector. If you enable this module you will have a 'report feedback' button added to the bottom right hand corner of your website. This will allow you to post feedback directly to our Jira instance. +### Security +#### HTTPS +CAPx uses https for all API calls. Please follow this best practice as you develop with this module. +#### httpoxy mitigation: +In July 2016, the httpoxy security exploit was announced for PHP, including libraries such as Guzzle. CAPx installs were by default protected because of https usage (see above). In addition, **developers are encouraged to seek their own httpoxy mitigation steps at the server level**. Check with your hosting provider to ensure that your implementation is protected from httpoxy. See https://httpoxy.org for details. + ## Credits * Trellon, for the [original CAP module](https://github.com/Stanford/CAP_drupal) and all the problems they solved. A great amount of inspiration and information was used from this module. diff --git a/docs/README.md b/docs/README.md index fe00fe67..a3b69717 100644 --- a/docs/README.md +++ b/docs/README.md @@ -65,7 +65,7 @@ Display Name | $.names.legal.middleName Profile Picture | $.profilePhotos.bigger Type | $.titles.*.type Profile / Bio | $.bio.html -Title and Department | $.longTitle[0] +Title and Department | $.longTitle.title Degrees / Education | $.education.*.label.text File | $.documents.cv Email | $.primaryContact.email diff --git a/includes/CAPx/Drupal/Importer/Orphans/EntityImporterOrphans.php b/includes/CAPx/Drupal/Importer/Orphans/EntityImporterOrphans.php index f453e7a2..4ba7577e 100644 --- a/includes/CAPx/Drupal/Importer/Orphans/EntityImporterOrphans.php +++ b/includes/CAPx/Drupal/Importer/Orphans/EntityImporterOrphans.php @@ -552,14 +552,19 @@ public function processAdoptedMultiple($profiles) { $bundleType = $importer->getBundleType(); $options = $importer->getOptions(); $orphanAction = $options['orphan_action']; + $mapper = $this->getImporter()->getMapper(); if ($orphanAction !== "unpublish") { // Nothing actionable to perform. return; } + // No need to do anything if it is not a multiple query... + if (!$mapper->getConfigSetting('multiple')) { + return; + } + $results = $this->getResults(); - $mapper = $this->getImporter()->getMapper(); $guuidquery = $mapper->getGUUIDQuery(); $parts = explode(".", $guuidquery); $subquery = "$.." . array_pop($parts); diff --git a/includes/CAPx/Drupal/Importer/Orphans/Lookups/LookupMissingMultipleByGUUID.php b/includes/CAPx/Drupal/Importer/Orphans/Lookups/LookupMissingMultipleByGUUID.php index 4cb02883..22fa3be0 100644 --- a/includes/CAPx/Drupal/Importer/Orphans/Lookups/LookupMissingMultipleByGUUID.php +++ b/includes/CAPx/Drupal/Importer/Orphans/Lookups/LookupMissingMultipleByGUUID.php @@ -48,7 +48,7 @@ public function execute($orphaner) { * @param $profileIDs * @param $importerMachineName */ - protected function getLocalGUUIds($profileIDs, $importerMachineName) { + protected function getLocalGUUIDs($profileIDs, $importerMachineName) { $or = db_or()->condition('profile_id', $profileIDs); $results = db_select("capx_profiles", "cxp") ->fields('cxp', array('entity_id', 'guuid')) diff --git a/modules/capx_auto_nodetitle/capx_auto_nodetitle.info b/modules/capx_auto_nodetitle/capx_auto_nodetitle.info index 6256954d..1374c6be 100644 --- a/modules/capx_auto_nodetitle/capx_auto_nodetitle.info +++ b/modules/capx_auto_nodetitle/capx_auto_nodetitle.info @@ -2,7 +2,7 @@ name = CAPX Auto Node Title Support description = Allows support for the auto_nodetitle module core = 7.x package = Stanford -version = 7.x-1.3 +version = 7.x-2.0-rc3 project = capx_auto_nodetitle dependencies[] = auto_nodetitle dependencies[] = stanford_capx diff --git a/modules/capx_issue_collector/capx_issue_collector.info b/modules/capx_issue_collector/capx_issue_collector.info index 61217b9d..b5bac8c0 100644 --- a/modules/capx_issue_collector/capx_issue_collector.info +++ b/modules/capx_issue_collector/capx_issue_collector.info @@ -1,6 +1,6 @@ name = Stanford CAPx Issue Collector description = Provides a feedback link to the CAPx Working Group Jira project. core = 7.x -version = 7.x-1.3 +version = 7.x-2.0-rc3 package = Stanford CAPx ; scripts[] = capx_issue_collector.js diff --git a/stanford_capx.blocks.inc b/stanford_capx.blocks.inc index b758dc5e..ee07267d 100644 --- a/stanford_capx.blocks.inc +++ b/stanford_capx.blocks.inc @@ -199,10 +199,10 @@ function stanford_capx_data_browser_launch_block() { // $rows[] = array('Cohort', '$.maintainers.*.title'); $rows[] = array('Affiliations', '$.affiliations'); $rows[] = array('Job title short', '$.shortTitle.label.text'); - $rows[] = array('Job title long', '$.longTitle[0]'); + $rows[] = array('Job title long', '$.longTitle.title'); // $rows[] = array('Dissertation title', ''); $rows[] = array('Degrees / education', '$.education.*.label.text'); - $rows[] = array('Title and department', '$.longTitle[0]'); + $rows[] = array('Title and department', '$.longTitle.title'); // $rows[] = array('Faculty status', ''); $rows[] = array('Fax', '$.primaryContact.fax'); $rows[] = array('CV - file', '$.documents.cv'); diff --git a/stanford_capx.entity.hooks.inc b/stanford_capx.entity.hooks.inc index 84adaf92..a704c563 100644 --- a/stanford_capx.entity.hooks.inc +++ b/stanford_capx.entity.hooks.inc @@ -297,7 +297,7 @@ function stanford_capx_taxonomy_term_load($terms) { // For each term add the aliases to them if they are a part of the org vocab. foreach($terms as &$term) { if ($term->vocabulary_machine_name == $vocab_name) { - $term->capx = array("aliases" => $aliases[$term->tid]); + $term->capx = array("aliases" => $aliases); } } diff --git a/stanford_capx.forms.inc b/stanford_capx.forms.inc index dd450c6a..b5815119 100644 --- a/stanford_capx.forms.inc +++ b/stanford_capx.forms.inc @@ -689,6 +689,7 @@ function stanford_capx_filter_properties($entity_type, $properties = array()) { $blacklist['node'][] = "comment_count"; $blacklist['node'][] = "comment_count_new"; $blacklist['node'][] = "feed_nid"; + $blacklist['node'][] = "feed_node"; $blacklist['node'][] = "uuid"; $blacklist['node'][] = "vuuid"; $blacklist['node'][] = "log"; diff --git a/stanford_capx.info b/stanford_capx.info index 8e2383fe..fa8b3311 100644 --- a/stanford_capx.info +++ b/stanford_capx.info @@ -3,8 +3,7 @@ description = Provides the ability to import profiles into existing entity types core = 7.x package = Stanford CAPx project = stanford_capx -version = 7.x-2.x-php54 - +version = 7.x-2.0-php54-rc3 dependencies[] = entity dependencies[] = block @@ -26,4 +25,3 @@ files[] = includes/views/views_handler_field_importer_orphan_profiles.inc files[] = includes/views/views_handler_field_capx_profile_id.inc project status url = https://github.com/SU-SWS/stanford_capx - diff --git a/stanford_capx.install b/stanford_capx.install index 4fef21b5..6e65146a 100644 --- a/stanford_capx.install +++ b/stanford_capx.install @@ -3,6 +3,8 @@ * @file */ +use CAPx\Drupal\Util\CAPxMapper; + /** * Implements hook_install(). */ @@ -278,7 +280,7 @@ function stanford_capx_requirements($phase) { /** * Add the guuid field to the capx_profiles table. */ -function stanford_capx_update_7100() { +function stanford_capx_update_7200() { $table = "capx_profiles"; $field = "guuid"; @@ -293,3 +295,25 @@ function stanford_capx_update_7100() { db_add_field($table, $field, $spec); } + +/** + * If auto_nodetitle is enabled we should enable capx_auto_nodetitle. + */ +function stanford_capx_update_7201() { + if (module_exists("auto_nodetitle")) { + module_enable(array("capx_auto_nodetitle")); + } +} + +/** + * Resave each mapper so they get the new default config keys. + */ +function stanford_capx_update_7202() { + $mappers = CAPxMapper::loadAllMappers(); + foreach ($mappers as $mapper) { + $mapper->settings['multiple'] = FALSE; + $mapper->settings['subquery'] = ''; + $mapper->settings['guuidquery'] = ''; + $mapper->save(); + } +} diff --git a/stanford_capx.module b/stanford_capx.module index 2dc87315..0f7022e4 100644 --- a/stanford_capx.module +++ b/stanford_capx.module @@ -327,14 +327,14 @@ function stanford_capx_cron_queue_info() { // A queue process for importing/sync profiles. $queues['stanford_capx_profiles'] = array( 'worker callback' => 'stanford_capx_cron_queue_callback', - 'time' => variable_get('stanford_capx_runtime_limit', 120), + 'time' => variable_get('stanford_capx_runtime_limit', 240), 'skip on cron' => FALSE, ); // A queue process for finding and removing orphans. $queues['stanford_capx_profile_orphans'] = array( 'worker callback' => 'stanford_capx_cron_orphan_queue_callback', - 'time' => variable_get('stanford_capx_runtime_limit', 120), + 'time' => variable_get('stanford_capx_runtime_limit', 240), 'skip on cron' => FALSE, );