| @@ -76,9 +76,9 @@ | ||
| 76 | 76 | |
| 77 | 77 | // check all groups for a unique value |
| 78 | 78 | $unique_value = $this->find_unique_field_in_data($data, $field); |
| 79 | 79 | |
| 80 | - if (!empty($unique_value)) { | |
| 80 | + if ($this->has_identifier_value($unique_value)) { | |
| 81 | 81 | $has_unique_field = true; |
| 82 | 82 | |
| 83 | 83 | if (in_array($field, $this->_post_fields, true)) { |
| 84 | 84 | |
| @@ -113,10 +113,10 @@ | ||
| 113 | 113 | if (!$has_unique_field) { |
| 114 | 114 | |
| 115 | 115 | // fallback to post_title |
| 116 | 116 | $unique_value = $data->getValue('post_title'); |
| 117 | - if (empty($unique_value) || !$this->importer->has_legacy_unique_identifier()) { | |
| 118 | - throw new MapperException(__("No Unique fields present.", 'jc-importer')); | |
| 117 | + if (!$this->has_identifier_value($unique_value) || !$this->importer->has_legacy_unique_identifier()) { | |
| 118 | + throw new MapperException(__('No unique identifier value present. Check that Permissions has a unique identifier set and this row has a non-empty value. File column references are stored as _iwp_ref_uid.', 'jc-importer')); | |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | $query_args['title'] = $unique_value; |
| 122 | 122 | $this->set_unique_identifier_settings('title', $unique_value); |