Line 1027 of entityreference.module reads:

  if ($entity_id !== 'NULL') {

I haven't seen any bugs caused by it, but is that really what you meant? Why would you want to check that $entity_id does not contain the string "NULL"? Or should it have been if ($entity_id !== NULL) { instead?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

marcvangend created an issue. See original summary.

marcvangend’s picture

Issue summary: View changes
berdyshev’s picture

Status: Active » Needs review
FileSize
601 bytes

yes, but here is some sort of bug, because in cases (i.e. autocomplete in node form widget) when this $entity_id is taken from url arguments, its value will be in lowercase. Patch is attached

Chris Matthews’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

The 3 year old patch in #3 to entityreference.module does not apply to the latest 7.x-1.x-dev and if still relevant needs a reroll.

Checking patch entityreference.module...
error: while searching for:
  $matches = array();

  $entity = NULL;
  if ($entity_id !== 'NULL') {
    $entity = entity_load_single($entity_type, $entity_id);
    $has_view_access = (entity_access('view', $entity_type, $entity) !== FALSE);
    $has_update_access = (entity_access('update', $entity_type, $entity) !== FALSE);

error: patch failed: entityreference.module:1022
error: entityreference.module: patch does not apply
Snehal Brahmbhatt’s picture

Status: Needs work » Needs review
FileSize
595 bytes

@Chris Matthews, Please review my attached patch, I created it for Entity reference 7.x-1.x-dev version as per requirement mentioned in #4. Hope this will help you!..

Thanks!..