Hi,

I just updated this module from version 1.5 to 1.7 and started getting the validation error:

Multiple entities match this reference; "%multiple". Specify the one you want by appending the id in parentheses, like "@value (@id)"

The ID is specified in each case. It seems like, while I specify a bundle in my code, the bundle is not being taken into account when validating and therefore checks all values for that entity type.

Specifically around line 179 in the main module file, it seems like the bundle condition is not added to the query because $entity_info is not defined for "!empty($entity_info['entity keys']['bundle'])".

I was able to get this working, by adding this line at the top of the function, below line 157, but I am not 100% sure if that's a valid fix:

  $entity_info = entity_get_info($entity_type);

Thanks.

Comments

slv_’s picture

Thanks a lot. I certainly pushed the 7.x-1.7 version too quick. It should have been more time in --dev branch.

I'll check this asap and apply your fix, or a more suitable one, if there's one.

Best,

Salva.

  • slv_ committed 3e55ca3 on 7.x-1.x
    Issue #2360951 by threeg: Fixed Validation not checking Reference ID.
    
slv_’s picture

Title: Validation not checking bundle » Validation not checking Reference ID.
Status: Active » Closed (fixed)

Right. The specific problem of the entity info that you're facing is fixed in 7.x-1.x-dev.

In this particular case, it fixes the error for you, but the underlying issue is another. I forgot to add a check for cases where the actual ID is present on the labels submitted by the user.

I've just pushed a fix for that. It's in --dev branch too, so it'll be available in 7.x-1.8

http://cgit.drupalcode.org/entityreference_autocomplete/commit/?id=3e55ca3

Closing.

threeg’s picture

Thanks for taking care of this.