Skip to content

Commit e0b858c

Browse files
committed
Merge pull request #438 from kzoltan/7.x-1.x
Support for field collections
2 parents 29ed7bc + 19064ea commit e0b858c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

plugins/restful/RestfulEntityBase.php

+5
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,9 @@ protected function getTargetTypeFromEntityReference(\EntityMetadataWrapper $wrap
460460
elseif ($field['type'] == 'taxonomy_term_reference') {
461461
return 'taxonomy_term';
462462
}
463+
elseif ($field['type'] == 'field_collection') {
464+
return 'field_collection_item';
465+
}
463466

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

720724
case 'text':
@@ -1384,6 +1388,7 @@ protected function formSchemaHasAllowedValues($field, $instance) {
13841388
$field_types = array(
13851389
'entityreference',
13861390
'taxonomy_term_reference',
1391+
'field_collection',
13871392
);
13881393

13891394
$widget_types = array(

0 commit comments

Comments
 (0)