Skip to content

Commit

Permalink
Merge pull request #419 from MinnPost/418-ignoring-sf-record-type
Browse files Browse the repository at this point in the history
Fix missing Record Type when pulled from Salesforce. Thanks to @timnolte for the report.
  • Loading branch information
jonathanstegall authored Sep 10, 2021
2 parents 650413e + 019b723 commit ddcf497
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions classes/class-object-sync-sf-mapping.php
Original file line number Diff line number Diff line change
Expand Up @@ -1119,12 +1119,12 @@ private function prepare_fieldmap_data( $mappings, $record_type = '' ) {
$mappings[ $id ]['salesforce_record_types_allowed'] = isset( $mapping['salesforce_record_types_allowed'] ) ? maybe_unserialize( $mapping['salesforce_record_types_allowed'] ) : array();
$mappings[ $id ]['fields'] = isset( $mapping['fields'] ) ? maybe_unserialize( $mapping['fields'] ) : array();
$mappings[ $id ]['sync_triggers'] = isset( $mapping['sync_triggers'] ) ? maybe_unserialize( $mapping['sync_triggers'] ) : array();
if ( '' !== $record_type && ! in_array( $record_type, $mappings[ $id ]['salesforce_record_types_allowed'], true ) ) {
unset( $mappings[ $id ] );
}
// format the sync triggers.
$sync_triggers = $this->maybe_upgrade_sync_triggers( $mappings[ $id ]['sync_triggers'], $mapping['version'], $mapping['id'] );
$mappings[ $id ]['sync_triggers'] = $sync_triggers;
if ( '' !== $record_type && ! in_array( $record_type, $mappings[ $id ]['salesforce_record_types_allowed'], true ) ) {
unset( $mappings[ $id ] );
}
}
return $mappings;
}
Expand Down

0 comments on commit ddcf497

Please # to comment.