public function getSelectTypes() {
$values = [];
// This is only called from the MapField form in isolation now,
- // so we need to set the metadata.
- $this->init();
- foreach ($this->_fields as $name => $field) {
- if (isset($field->_hasLocationType)) {
- $values[$name] = $field->_hasLocationType;
+ foreach ($this->getFieldsMetadata() as $name => $field) {
+ if (isset($field['hasLocationType'])) {
+ $values[$name] = TRUE;
}
}
return $values;
$this->setFieldMetadata();
}
+ /**
+ * Get metadata for all importable fields.
+ *
+ * @return array
+ */
+ protected function getFieldsMetadata() : array {
+ if (empty($this->importableFieldsMetadata)) {
+ unset($this->userJob);
+ $this->setFieldMetadata();
+ }
+ return $this->importableFieldsMetadata;
+ }
+
/**
* @param array $mappedField
* Field detail as would be saved in field_mapping table