Skip to content

Commit

Permalink
ideas from #376 (comment)
Browse files Browse the repository at this point in the history
  • Loading branch information
kzoltan committed Mar 18, 2015
1 parent 29ed7bc commit 19064ea
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions plugins/restful/RestfulEntityBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,9 @@ protected function getTargetTypeFromEntityReference(\EntityMetadataWrapper $wrap
elseif ($field['type'] == 'taxonomy_term_reference') {
return 'taxonomy_term';
}
elseif ($field['type'] == 'field_collection') {
return 'field_collection_item';
}

throw new \RestfulException(format_string('Field @property is not an entity reference or taxonomy reference field.', $params));
}
Expand Down Expand Up @@ -715,6 +718,7 @@ public function propertyValuesPreprocess($property_name, $value, $public_field_n
switch ($field_info['type']) {
case 'entityreference':
case 'taxonomy_term_reference':
case 'field_collection':
return $this->propertyValuesPreprocessReference($property_name, $value, $field_info, $public_field_name);

case 'text':
Expand Down Expand Up @@ -1384,6 +1388,7 @@ protected function formSchemaHasAllowedValues($field, $instance) {
$field_types = array(
'entityreference',
'taxonomy_term_reference',
'field_collection',
);

$widget_types = array(
Expand Down

0 comments on commit 19064ea

Please sign in to comment.