1

I want to add another field, which needs to be accessible by views (for display and ordering), to the entityreference table field_data_field_FIELDNAME. Structure of that table is:

  • entity_type VARCHAR(128)
  • bundle VARCHAR(128)
  • deleted TINYINT(4)
  • entity_id INT(10)
  • revision_id INT(10)
  • language VARCHAR(32)
  • delta INT(10)
  • field_FIELDNAME_target_id INT(10)

I want to have a column storing DateTime information here, so I can attach information about when this reference was added/ updated for that referenced entity. There also needs to be a way to save the newly added field directly in the array structure for that reference such as:

$node->field_reference['und'][] = array(
  'target_id' => 123,
  'my_new_column' => '2014-03-13 15:29:29'
);

I know I could solve this by using field_collections or relation module, but both would cause significant performance issues.

2

Gave an approach here https://www.drupal.org/node/2001822#comment-9165509

Hope that it will work for you

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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