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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

shelane created an issue. See original summary.

slv_’s picture

Hi 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!

Sut3kh’s picture

Status: Active » Needs review
FileSize
4.29 KB

Having 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.

Sut3kh’s picture

FileSize
4.29 KB

Sorry, fixed a silly mistake.

BR0kEN’s picture

Assigned: Unassigned » BR0kEN
FileSize
18.65 KB
21.92 KB

I'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.

  • BR0kEN committed 9213807 on 7.x-1.x
    Issue #2848476 by Sut3kh, BR0kEN: Issues after update to 1.12
    
BR0kEN’s picture

Status: Needs review » Needs work
BR0kEN’s picture

Status: Needs review » Needs work
BR0kEN’s picture

Status: Needs review » Needs work
BR0kEN’s picture

  • BR0kEN committed 3ee1a94 on 7.x-1.x
    Issue #2848476 by BR0kEN, Sut3kh: Issues after update to 1.12
    
BR0kEN’s picture

Status: Needs review » Fixed

Finally.

Status: Fixed » Closed (fixed)

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