Simple setup with entityform submission is made and attached to node. This form has entityreference which will be loaded by views using Entityreference view handler. While searching to make this view receive filters dynamically I came through this method Use tokens for entity selection view arguments. Athough this patch is still not committed patch seems ok to me.
For some reason this workaround is still not working for me where
1. Termreference field is added to node to which entityform is attached and as this field's value is presaved while entityform submission, this can be set as token.

2. Set [node:field_parameter](manually copied as node tokens are not available here too) as token in entityreference view parameter which is available after applying above mentioned patch. But token_replace() is not replacing the token with actual value.

I checked token section of devel tab of the node and it is available. Then I further found out that all node related tokens are not available to entityform fields including ER field,textfield(screenshot #2) and not even on entityform configuration page.
As for the entityrefrence view selection handler EntityReference_SelectionHandler_Views.class.php, dpm($entity) showing that $entity is set to NULL.

protected function __construct($field, $instance, $entity_type, $entity) {
    $this->field = $field;
    $this->instance = $instance;
    $this->entity = $entity;
    dpm($entity); 
    // Get the entity token type of the entity type.
    $entity_info = entity_get_info($entity_type);
    $this->entity_type_token = isset($entity_info['token type']) ? $entity_info['token type'] : $entity_type;
  }

module version
Drupal 7.27
Entity API 7.x-1.5
Entity tokens 7.x-1.5
Entityforms 7.x-2.0-beta3
Token 7.x-1.5

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nithinkolekar’s picture

anyone having this problem or is it just me?
Is additional info required?

I think if this get solved then , it can be helpful for having same entity reference field with dynamic token instead of creating multiple entity reference field with different static parameters(nid,tid etc.) to same view.