Define the property type when the field is not stored n the database in order to be selectable in the Search API index fields.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

skipyT’s picture

Status: Active » Needs review
FileSize
2.21 KB

I created a patch which sets the property type even if the field is not stored in the database.

laurentchardin’s picture

I think the main reason we need to do that is because it raises an EntityMetadataWrapperException : Unknown data property... for such fields.
Am i right skipyT ?

Edit: silly me, it was another issue: #1414282: Support for entity_metadata_wrapper()

jsacksick’s picture

Status: Needs review » Needs work

I think you need to replace that line :
$field['settings']['database']['data_type'] by $field_type['property_type'] = $property_types[$field['settings']['database']['data_type']]; + the getter callback should return the value coming from the computed function.

skipyT’s picture

Category: task » feature
Priority: Normal » Critical
Status: Needs work » Needs review
FileSize
2.57 KB

Hi,

I modified the previous patch file after jsacksick review.

New patch file attached.

cmoldovan222’s picture

Status: Needs review » Reviewed & tested by the community

It seems ok for me.

fgm’s picture

This patch contains both an error and a performance issue. Rerolling

fgm’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
20.45 KB
colan’s picture

Version: 7.x-1.0-beta1 » 7.x-1.x-dev
Priority: Critical » Major

New features go into the latest dev branch. This is not critical as the module will still work without it.