Hello
not all enitit references have target_type in value.
So we need to get it from field settings.

Comments

igor.ro’s picture

Status: Active » Needs review
StatusFileSize
new1.96 KB

Here is the patch.

piggito’s picture

Sorry, i don't know if this is the right place to put this but I also got a problem with entityreferences and uuid.
Reading the code it seems that entityreferences uses a field "_target_id" which is an integer (10 digits) but the unique identifier is longer than that so the query results in an error.
Have anyone else got this error?

igor.ro’s picture

@piggito
I have a lot of exp with uuid and entityreferences and uuid_features.
Are you using uuid_features module for this?

piggito’s picture

I was testing uuid_features but had problems and left it.
Do you think that the error could be caused by uuid_features?

igor.ro’s picture

hm... @piggito
please explain your case from functional point of view.
because

Sorry, i don't know if this is the right place to put this but I also got a problem with entityreferences and uuid.
Reading the code it seems that entityreferences uses a field "_target_id" which is an integer (10 digits) but the unique identifier is longer than that so the query results in an error.
Have anyone else got this error?

does not tell us any thing about the error.

igor.ro’s picture

StatusFileSize
new2 KB

Here is the new patch

mgifford’s picture

Patch still applies nicely against the git repository. What's the process to test this so we can mark it RTBC?

timaholt’s picture

I bet the problem @piggito is referencing is this issue: https://drupal.org/node/1541218

I've looked at this patch as a potential fix for that issue, it changes the error but doesn't solve it entirely. I'm not sure these issues are the same, but they do seem somewhat related.

timaholt’s picture

Status: Needs review » Reviewed & tested by the community

Actually after some further testing, this patch does fix the issue at https://drupal.org/node/1541218

I'm marking this RBTC! Thanks igor.ro

skwashd’s picture

Assigned: Unassigned » skwashd

I'll look at committing this in the coming days.

timaholt’s picture

Status: Reviewed & tested by the community » Needs review

I'm marking this back as needs review, as it does fix the errors but the entity reference still isn't deployed using deploy correctly.

skwashd’s picture

Assigned: skwashd » Unassigned

Unassigning from myself as it still needs work.

maciej.zgadzaj’s picture

StatusFileSize
new708 bytes

Well, big part of the previous patch (from #6) code is not really needed, on the contrary, it breaks the functionality. This issue was actually fixed in #1511274: entityreference_field_uuid_load() and entityreference_field_uuid_presave() use wrong target_type source.

The deployment problem on the other hand should be fixed by the last patch in #1545278: Dependencies are not added for entityreference fields (Symptom: "Undefined index: target_type") (Entity Dependency API).

In terms of the patch in #6 here - I've stripped it from the breaking changes, leaving only 2 small updates to entity_uuid_delete(), which still should get committed, even though they are not really related to the issue at hand.

igor.ro’s picture

@maciej.zgadzaj Yes it was my mistake, I now agree with you.

Status: Needs review » Needs work

The last submitted patch, 1: entity_references_fix.patch, failed testing.

dixon_’s picture

Committed. Thanks!

dixon_’s picture

Issue summary: View changes
Status: Needs work » Fixed

And, marking issue accordingly.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.