I'm getting

Fatal error: Declaration of EntityReference_SelectionHandler_Views::getInstance() must be compatible with that of EntityReference_SelectionHandler::getInstance() 

I'm not sure whether this might be related to PHP 5.3 or something else in our configuration but when i update the method signature from

public static function getInstance($field, $instance)

to

public static function getInstance($field, $instance = NULL, $entity_type = NULL, $entity = NULL)

The error goes away. I don't know how bad an idea it is to make the $instance optional, so please advise. Patch follows.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

thimothoeye’s picture

Status: Active » Needs review
FileSize
952 bytes

Status: Needs review » Needs work

The last submitted patch, 1570524-entityreference-getinstance_signature-1.patch, failed testing.

thimothoeye’s picture

Sorry, faulty patch. Working with git submodules can be a real PITA :)

thimothoeye’s picture

Status: Needs work » Needs review
tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me.

amitaibu’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, committed.

Status: Fixed » Closed (fixed)

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