I've downloaded the dev version of efq_views and enabled it with drush. After that, running drush cc all gives (numerous times) the warning mentioned above.

line 188:

  foreach ($field['columns'] as $column => $attributes) {

I also get similar warning regarding line 16, once.

line 16:

      foreach (field_info_instances($entity_type) as $bundle => $field_data) {

Finally, when browsing interactively, I also get:

"Notice: Undefined offset: 1 in _efq_views_get_field_handlers() (line 181 of /home/joe/new_full_planetary/drupal_planetary/sites/all/modules/efq_views/efq_views.views.inc)."

  if (isset($views_data['real field'])) {
    list($field_name, $column) = explode(':', $views_data['real field']);
  }

and

"Notice: Undefined variable: return in _efq_views_copy_data() (line 55 of /home/joe/new_full_planetary/drupal_planetary/sites/all/modules/efq_views/efq_views.views.inc)."

function _efq_views_copy_data(&$data, &$entity_type, $key, $entity_data) {
  if (substr($key, 0, 7) == 'entity_') {
    $return = TRUE;
    $entity_type = substr($key, 7);
  }
  elseif (substr($key, 0, 13) == 'views_entity_') {
    $return = FALSE;
    $entity_type = substr($key, 13);
  }
  if (!isset($data['efq_' . $entity_type])) {
    $data['efq_' . $entity_type] = array();
  }
  $data['efq_' . $entity_type] += $entity_data;
  return $return;
}

I'm using the latest OG and efq_views. Let me know if I can provide any further useful info!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

holtzermann17’s picture

Issue summary: View changes

not a comment line after all

holtzermann17’s picture

Issue summary: View changes

additional notice

holtzermann17’s picture

Issue summary: View changes

context

attekilpela’s picture

This patch should suppress the errors.
It's tested with 7.x-1.x-dev from 2012-Aug-14.

jaydub’s picture

Status: Active » Needs review
marcingy’s picture

Status: Needs review » Needs work

The patch returning false in the first line of the function is simply masking issues not fixing the bug.

holtzermann17’s picture

Status: Needs work » Needs review

Printing out the $key and the $entity_type reveals that the only two keys on my installation that don't have a suitable $entity_type defined after this...

  if (substr($key, 0, 7) == 'entity_') {
    $return = TRUE;
    $entity_type = substr($key, 7);
  }
  elseif (substr($key, 0, 13) == 'views_entity_') {
    $return = FALSE;
    $entity_type = substr($key, 13);
  }

...are og_membership_type and og_membership. That suggests a bug with the OG code. Regarding the patch in #1, it does work to suppress the warnings, and, given the above result, I don't think it merely masks issues. However, I would suggest removing the

$return = FALSE;

from the original code (above), since when you've put that at the beginning of the function, you don't need to do it again.

attekilpela’s picture

$return = FALSE at top of the function is there just to make sure that $return isn't returned as undefined variable in any possible case.

I have used this patch for the last week and had zero problems.

majorrobot’s picture

I can confirm that this seems to have fixed the issue.

Jorrit’s picture

This part of the patch is wrong:

+    if (strpos($views_data['real field'], ":") === TRUE) {
+      list($field_name, $column) = explode(':', $views_data['real field']);
+    }

strpos() never returns boolean TRUE. It returns boolean FALSE or an integer. The change should be:

+    if (strpos($views_data['real field'], ":") !== FALSE) {
+      list($field_name, $column) = explode(':', $views_data['real field']);
+    }
Jorrit’s picture

By the way, I think these bugs no longer exist in 7.x-1.x.

chx’s picture

Status: Needs review » Fixed

Reopen if it reoccurs then. Thanks.

Status: Fixed » Closed (fixed)

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

joekrukosky’s picture

Updated attekilpela's patch with Jorrit's change for simplicity.

chx’s picture

#11, #8 says these bugs are gone. Why do you need a patch?

joekrukosky’s picture

I was still having the issue until I applied the patch to the dev version (7.x-1.0-alpha3+13-dev). Since I modified the patch with #7, I thought I'd post it.

chx’s picture

Status: Closed (fixed) » Active

Oh. OK, I will reinvestigate then.

Andre-B’s picture

Backup and Migrate 7.x-2.7 and Entity API 7.x-1.1 is probably causing this for me (from a look at debug_backtrace())

Andre-B’s picture

Issue summary: View changes

another notice

mihai_brb’s picture

I'm still getting this error, using 7.x-1.0-alpha5
Notice: Undefined offset: 1 in _efq_views_get_field_handlers() (line 194 ...

Not sure what is the status of this ...

Thanks,
Mihai

Stephen Rockwell’s picture

I've got the same issue and curious about status as well.

chx’s picture

Status: Active » Closed (cannot reproduce)

Everyone: file a new issue with the exact error message you are getting. This issue became the dreaded "hey I have an error message let's post it here" issue. Stop doing this. #16 for example posted half an error message which says "Notice: Undefined offset: 1" in an issue titled "Invalid argument supplied". So #17 is now can't be evaluated as to what "same issue" it tries to report. So I am closing this down in hope of better bug reports.