I used hook_entity_property_info_alter to add two properties to an existing entity [crm_core_contact]. I find that I can see these two new properties in the "Fields" section of views, and that my views will display the values of those properties, but I cannot see these new properties in either the Sort or the Filter section of Views? Any ideas on documentation that might tell me what is going on?

Here is the code for one of the properties:

$properties = &$info['crm_core_contact']['properties'];
$properties['notes'] = array(
                'setter callback' => 'entity_property_verbatim_set',
                'setter_permission' => 'Administer wcgopindividualinfo content',
                'label' => 'NotesText',
                'type' => 'text',
                'schema field' => 'notes',
                'getter callback' => 'entity_property_verbatim_get',
                'entity views field' => TRUE,
                'getter_permission' => 'Administer wcgopindividualinfo content',

Although the Trellon documentation does not say this, I'm wondering if I need to add a hook_views_data_alter function to specify the filter and sort handlers for the properties that I added.


1 Answer 1


I have now done some experimentation and find that yes, what I needed to do was use hook_views_data_alter to tell views how to handle the properties I had added above. Here is the code inside my hook_views_data_alter function:

$data['crm_core_contact']['notes'] = array(
            'title' => t('Notes'),
            'help' => t('The notes for the contact'),
         // Information for displaying the notes field
                'field' => array(
            'handler' => 'views_handler_field',
            'click sortable' => TRUE,

    // Information for accepting a note as a filter
        'filter' => array(
        'handler' => 'views_handler_filter_string',
    // Information for sorting on a note.
        'sort' => array(
        'handler' => 'views_handler_sort',

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.