Closed (fixed)
Project:
Commerce Core
Version:
7.x-1.x-dev
Component:
Developer experience
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Nov 2011 at 16:52 UTC
Updated:
3 Jan 2012 at 14:30 UTC
Jump to comment: Most recent file
Comments
Comment #1
rszrama commentedAhh, was this a recent change or something we've had wrong all along? I'm guessing we'll have the same bug in Customer / Line Item for the customer profile reference and line item reference fields.
Comment #2
fagoNo, there were no change - it just did not pop up as the 'property info' key is usually totally ignored for entity references. The linked patch though used it to detect 'struct' properties for which the 'property info' key is for.
I shortly looked at the definition of the Customer / Line Item references - they look good.
Comment #3
rszrama commentedOk, thanks for the extra info. I'm a little confused then why we're not using the query callback or setter / getter callback for customer profile reference fields:
The same code is used for the line item reference field.
(On a side note, that function is not helpfully named; think I'll update it to make it explicit it's for the reference field.)
Comment #4
pcambra'query callback'is supposed to be deprecated #1345882: Undeprecate 'query callback' when used with a 'computed' property.But I'm wondering why are we unsetting it in each field property callback.
See also #1306106: Can't load nodes via a product reference in a rule
Comment #5
fagoYep, still it's used by the field property info generation code what won't change for backward compatibility.
Good point. Fields unset the callback if it doesn't work - usually as they are using another data structure we cannot query for. This was the case for entity references too, as entity_property_query() did not translate entity objects to ids. It does now so though (already for quite some time). Thus, if the field is a plain entity reference (without any struct) it's working just fine now.
I realized we have the same fault in the entity module's term reference field support, so I've fixed it over at #1357902: allow querying for referenced terms and added tests for it. Thus, you can keep the query callback for your entity references and so enable querying for those properties.
Comment #6
pcambraMarking this one #1306106: Can't load nodes via a product reference in a rule as duplicated, as this change would fix the issue there.
Comment #7
lukusHi
I had a problem with 7.x-1.1 where I couldn't reference product replacement tokens via my display node type.
I was using the tokens for display of custom breadcrumbs and auto urls.
After chatting with pcambra, I was advised to apply this patch - I did so, and now I have replacement tokens.
Thanks all.
Comment #8
summit commentedHi, Could this patch also solve the problem that term references to products are not shown as real terms, and term references to product-displays are shown as real terms?
greetings, Martijn
Comment #9
rszrama commentedLet's see how this patch goes, then. It removes everything from our reference field property info definition except the options list callback. If that isn't necessary, let's remove it, too. Any tips on that, fago?
Comment #10
pcambraActually there's already an issue to remove the line item reference query callback #1358760: Rules "Fetch entity by property" action with line item reference field, marking that one as duplicate.
Comment #11
fagoThe options list callback has to be added manually as of now. I guess it should be possible to auto-detect it somehow though.
Anyway, that's not there yet so #9 looks good to me.
Comment #12
rszrama commentedWonderful, thanks so much guys! Glad to get this fixed - love seeing you in the queue, fago. : )
Commit: http://drupalcode.org/project/commerce.git/commitdiff/7f45495