I am not sure if I should label this as a bug, feature, or support request. Currently it is possible to add a static argument to an Entity Selection - Mode "View Filter" using the Entity Reference module. However, a patch that was created in 2012 and still works allows token based arguments rather than static arguments:

https://drupal.org/comment/6809760#comment-6809760

Multiple Selects seems to be the best widget for my purpose but sadly is incompatible with the above patch. On the edit form, I am able to add the first reference, but as soon as I "add another item", it seems to refresh and forget the token argument. It clears out the initial selected reference and then shows no visible references selectable for either the first or second items.

As soon as I use a static argument it works, so I am fairly certain there is just a problem with the aformentioned patch.

I would appreciate any help and thanks for all the hard work on this module.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

NWOM’s picture

Title: Compatibility Problem with Entity Selection Mode Views Filter with Dynamic Token Argument » Compatibility Problem: Entity Selection Mode Views Filter with Dynamic Token Argument patch
webadpro’s picture

Could you provide some steps to reproduce this issue?

dgautsch’s picture

I believe the issue the OP is experiencing is unrelated to the patch. I have been able to reproduce this issue without utilizing the aforementioned patch.

Steps to Reproduce

  1. Create two content types. Have content type A have an entity reference field that references content type B.
  2. Use a views filter on the entity reference field created in content type A.
  3. Do not define any views arguments for this field in the field configuration area. Let the view do all the work.
  4. Create a node and add multiple select items to your node.
  5. When you click "add another item" the request is made and the previously set items are reset to -none-
dobe’s picture

I am experiencing the same issue.

dobe’s picture

I was able to solve the issue with the following patch. Which seems to be the same way entityreference module handles this.

webadpro’s picture

dobe’s picture

Please check the patch again. The problem I was receiving was because we were just passing NULL to the entity_type and entity. It is not the same patch.

dobe’s picture

Status: Active » Needs review
wla_g’s picture

I've had the same issue and the patch solves it.