Reference Field Option Limit used to be compatible with past versions of the Entity Reference module. After updating the Entity Reference module to version 7.x-1.0-rc1 "User" targets are no longer limitable.
This may have something to do with the fact that after updating the new version of entity reference, you must perform the following pending updates to the database:
entityreference module
• 7001 - Drop "target_type" from the field schema.
And when adding an Entity Reference field, when you select Target Type: User you cannot select "Target Bundle"
This is how you can recreate the problem to check for yourself...
Created a fresh install off drupal 7.12
Downloaded & enabled entityreference-7.x-1.0-rc1 & dependencies
Downloaded & enabled reference_option_limit-7.x-1.0-alpha3
Create Vocabulary: Position
Added several positions
Under Account Settings
Added new field: Entity Reference
Target Type: Taxonomy Term
Target Bundle: Position
Created content-type: Assignment
Added existing field: Entity Reference: field_position (Position)
Added new field: Entity Reference
Field Name: Assignee
Target Type: User
Now, when editing Assignment settings for the Assignee field. the following option is transparent and may not be selected:
[ ] Limit this field's options according to matching field values
This will limit the options presented in this field's widget to only those entities that match the current entity in certain field values. This option is only available when both the current entity bundle and the referred entity bundle(s) have fields in common.
While the User entity and the Assignment content-type both have the position field in common, the Assignee field options are not limitable for the Assignment content-type.
Comments
Comment #1
freddura commentedComment #2
alesr commentedI have this problem too with entityreference-7.x-1.0-rc1 and reference_option_limit-7.x-1.0-dev
Any known solution?
Comment #3
alesr commentedFound out that it is working on entityreference-7.x-1.0-beta3 (on beta4 target_type is dropped).
You have to uninstall rc1 and clean install beta3 to get the "target_type" table back.
Comment #4
joachim commentedThe problem is not with the new version of the module, but rather because the limited field points to users, and those don't have bundles.
I reproduced your setup, and if instead of users I have a new node type called 'person' then everything works fine.
Presumably something has changed in entityref to account for the fact that users don't have bundles. I'm not sure what that is though as I don't see anything in the log for that module that suggests there's been a change.
Comment #5
joachim commentedFixed.
- #1505176 by joachim: Fixed no matching fields found for a limited entity reference field with 'user' target type.
Comment #6
alesr commentedI don't have users as content types, because my users need to login in to this student management system where they are referred after you as admin select a class first (you then see only student from this class). That's why I have to use user entity for this.
Comment #7
joachim commentedThat's fine -- I wasn't suggesting you change, I was just explaining how the bug works.
I've made a new release with the fix.
Comment #9
doxigo commentedI still have the same problem with the latest version of this module