These three errors showed after updating to version 1.12. Rolling back to 1.11 removed these errors and restored functionality.
Warning: reset() expects parameter 1 to be array, string given in entityreference_autocomplete_value_callback() (line 102 of /mnt/www/html/llnlfeature1/docroot/sites/all/modules/contrib/entityreference_autocomplete/entityreference_autocomplete.module).
Warning: Illegal string offset 'entity_type' in entityreference_autocomplete_value_callback() (line 103 of /mnt/www/html/llnlfeature1/docroot/sites/all/modules/contrib/entityreference_autocomplete/entityreference_autocomplete.module).
Warning: Illegal string offset 'entity_id' in entityreference_autocomplete_value_callback() (line 103 of /mnt/www/html/llnlfeature1/docroot/sites/all/modules/contrib/entityreference_autocomplete/entityreference_autocomplete.module).
These errors caused any page I had used this module to not render anything. The errors would show on the home page.
Drupal 7.53
Comment | File | Size | Author |
---|---|---|---|
#13 | entityreference_autocomplete-default_value_callback_variability-2848476-13.patch | 5.45 KB | BR0kEN |
|
Comments
Comment #2
slv_ CreditAttribution: slv_ commentedHi Shelane,
It seems the latest updates needed some more code review, we'll get this checked asap and see if there's something we can do. Thanks!
Comment #3
Sut3kh CreditAttribution: Sut3kh as a volunteer commentedHaving come across the same issue, here is my understanding of the problem and my fix.
As far as I can tell, #2839087: Allow more formats in the '#default_value' property. reworked the #default_value to accept an assoc array as part of #2645936: Allow to pass full array as element #default_value but broke the old way of working (entity id or array of entity ids).
I am assuming that this is not intentional and should support both styles of #default_value, so my fix has attempted to cater to both as best I can.
Comment #4
Sut3kh CreditAttribution: Sut3kh as a volunteer commentedSorry, fixed a silly mistake.
Comment #5
BR0kENI'm sorry, guys, that I broke module's operability. Excuse me.
Project is not an easy one and we should start having tests for it to be sure that everything is going as expected. Let's start from me.
Comment #7
BR0kENUse SimpleTest API for autoloading.
Comment #9
BR0kENComment #11
BR0kENComment #13
BR0kENComment #15
BR0kENFinally.