Needs work
Project:
Commerce Core
Version:
7.x-1.x-dev
Component:
Product reference
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
17 Mar 2010 at 19:52 UTC
Updated:
6 Apr 2016 at 16:39 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
pcambraComment #2
pcambraComment #3
pcambraI'm not sure of how to face this as the autocomplete function is highly dependent on the field and instance info:
The product reference field calls the autocomplete path this way:
'#autocomplete_path' => $instance['widget']['settings']['autocomplete_path'] . '/' . $instance['entity_type'] . '/' . $field['field_name'] . '/' . $instance['bundle'],Then, the autocomplete gets the parameters, being the string the last one:
function commerce_product_autocomplete($entity_type, $field_name, $bundle, $string = '') {And finally the products are returned by the match product function that uses both the field and the instance.
commerce_product_match_products($field, $instance, $tag_last, $match, array(), 10);What should be done here?, a base autocomplete function and then depending on the information provided by the caller (field, entity_type, bundle...) fetch the products in one way or another?
Comment #4
vasikehere is a patch inspired by Entity Reference autocomplete.
Comment #5
rszrama commentedWe cannot prepend an argument to this function. It would break any other module depending on the current signature.