Hi, i am not sure if anyone has ever got the same problems as i am facing now.
As long as you have simple text fieds this module is perfect and works well.
As soon as you add a Entity Reference list box to choose from the module does not copy the batch selection of that entity reference field into the node.
Also if the field is required it wont ever go pass the validation checks. E.g if the entity reference field is Required and you make a selection in the batch section, it does not over write the selection in the left hand side for each node and error always pops of saying you are missing required field. so you will alwasy have to make selection for individual images and wotn accept any selection from the batch part
any solution? i have tried all patches mentioned in the issue section nthing works.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | entity-reference-complete-fix-2278141-1.patch | 9.83 KB | id.tarzanych |
| #1 | entity-reference-2278141.01.patch | 1.4 KB | NaX |
Comments
Comment #1
NaX commentedOk, after some digging I found that our prepare and empty field callback calls was passing the field name instead of the field info array.
I hope it helps. Please note that I had other patches applied that may also affect the success of this patch.
Comment #2
NaX commentedComment #3
tobey_p commentedThe provided patch works fine for my entity reference,
but i still experience problems when i have a taxonomy reference with multiple terms.
It works when i choose the terms for every item, but when i use the bulk area and choose more then one term,
i get an ajax error as follows:
An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: /de/batch?id=56&op=do StatusText: Service unavailable (with message) ResponseText: PDOException: SQLSTATE[21S01]: Insert value list does not match column list: 1136 Column count doesn't match value count at row 1: INSERT INTO {field_data_field_kategorie} (entity_type, entity_id, revision_id, bundle, delta, language, field_kategorie_tid) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6_17, :db_insert_placeholder_6_20); Array ( [:db_insert_placeholder_0] => node [:db_insert_placeholder_1] => 26 [:db_insert_placeholder_2] => 26 [:db_insert_placeholder_3] => produkt_image [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => und [:db_insert_placeholder_6_17] => 17 [:db_insert_placeholder_6_20] => 20 ) in field_sql_storage_field_storage_write() (line 451 of C:\Users\tprinz\Workspace\duesenberg\htdocs\modules\field\modules\field_sql_storage\field_sql_storage.module).
Comment #4
hasecbinusr commentedif (!$empty_function($field_items, $field_info)) never validates true for my single value entity reference field.
Can someone explain the syntax of that line of code? I've never seen parameters passed to a variable.
Comment #5
hasecbinusr commentedI forced the validation to true with
However, when I attempted to save the nodes, I got a PDO error:
An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: /batch?id=129&op=do StatusText: Service unavailable (with message) ResponseText: PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: 'A' for column 'field_entitytest_target_id' at row 1: INSERT INTO {field_data_field_entitytest} (entity_type, entity_id, revision_id, bundle, delta, language, field_entitiytest_target_id) VALUES (:dn_insert_placeholder_0, :dn_insert_placeholder_1, :dn_insert_placeholder_2, :dn_insert_placeholder_3, :dn_insert_placeholder_4, :dn_insert_placeholder_5, :dn_insert_placeholder_6); Array ( [:dn_insert_placeholder_0] => node [:dn_insert_placeholder_1] => 404 [:dn_insert_placeholder_2] => 967 [:dn_insert_placeholder_3] => customcontenttest [:dn_insert_placeholder_4] => 0 [:dn_insert_placeholder_5] => und [:dn_insert_placeholder_6] => A ) in field_sql_storage_field_storage_write() (line 451 of /modules/field/modules/field_sql_storage.module).Based on the value I attempted to enter and the error, I think what it's doing is returning the first letter of the entity name, instead of the entity target id.
Comment #6
id.tarzanych commentedCreated patch fixing entity reference fields workflow
Comment #7
id.tarzanych commentedUpdated patch, fixed empty function argument, missed that
Comment #8
jordanmagnuson commented@id.tarzanych: How is the patch in #7 related to https://www.drupal.org/node/2365497 ? Does this patch supersede that one?
Comment #9
jordanmagnuson commented@id.tarzanych: Since the patch in #7 bulk_photo_nodes_taxonomy_validate() is now acting on entity reference fields, and NOT taxonomy reference fields (because you changed
$element['#value_key'] == 'tid'to$element['#value_key'] == 'target_id'. Was this change intentional?We need to figure out what kind of validation should happen on taxonomy reference fields, and if nothing else, bulk_photo_nodes_taxonomy_validate() should be renamed...
Comment #11
jordanmagnuson commented#7 was just pushed to dev release. Thanks id.tarzanych!
Though we still need to determine what needs to by done regarding taxonomy reference fields, and whether bulk_photo_nodes_taxonomy_validate() should be renamed.