Skip to content

Commit

Permalink
Importing with CSV into Encrypted Custom [ch86] (#6642)
Browse files Browse the repository at this point in the history
  • Loading branch information
inietov authored and snipe committed Jan 25, 2019
1 parent f8d9301 commit 79b41ee
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/Importer/AssetImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,13 @@ protected function handle($row)
foreach ($this->customFields as $customField) {
$customFieldValue = $this->array_smart_custom_field_fetch($row, $customField);
if ($customFieldValue) {
$this->item['custom_fields'][$customField->db_column_name()] = $customFieldValue;
$this->log('Custom Field '. $customField->name.': '.$customFieldValue);
if($customField->field_encrypted == 1){
$this->item['custom_fields'][$customField->db_column_name()] = \Crypt::encrypt($customFieldValue);
$this->log('Custom Field '. $customField->name.': '.\Crypt::encrypt($customFieldValue));
} else {
$this->item['custom_fields'][$customField->db_column_name()] = $customFieldValue;
$this->log('Custom Field '. $customField->name.': '.$customFieldValue);
}
} else {
// Clear out previous data.
$this->item['custom_fields'][$customField->db_column_name()] = null;
Expand Down

0 comments on commit 79b41ee

Please sign in to comment.