Skip to content

Commit

Permalink
Merged in 2.0-rc3 work
Browse files Browse the repository at this point in the history
  • Loading branch information
sherakama committed Aug 30, 2016
2 parents ac43e22 + adcfd83 commit ee95018
Show file tree
Hide file tree
Showing 12 changed files with 49 additions and 15 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down
2 changes: 1 addition & 1 deletion modules/capx_auto_nodetitle/capx_auto_nodetitle.info
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion modules/capx_issue_collector/capx_issue_collector.info
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions stanford_capx.blocks.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion stanford_capx.entity.hooks.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
1 change: 1 addition & 0 deletions stanford_capx.forms.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
4 changes: 1 addition & 3 deletions stanford_capx.info
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

26 changes: 25 additions & 1 deletion stanford_capx.install
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* @file
*/

use CAPx\Drupal\Util\CAPxMapper;

/**
* Implements hook_install().
*/
Expand Down Expand Up @@ -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";
Expand All @@ -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();
}
}
4 changes: 2 additions & 2 deletions stanford_capx.module
Original file line number Diff line number Diff line change
Expand Up @@ -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,
);

Expand Down

0 comments on commit ee95018

Please sign in to comment.