My log is full of errors when normal users and visitors surf through the website.

Invalid argument supplied for foreach() in /is/htdocs/wp1174846_I80P8A8PQW/www/sites/all/modules/vocabulary_access/vocabulary_access.module in Zeile 677.
array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in /is/htdocs/wp1174846_I80P8A8PQW/www/sites/all/modules/vocabulary_access/vocabulary_access.module in Zeile 677.

What infos do you need?

Comments

sgabe’s picture

Are you using this module on a clean install (so from the beginning) or just installed it on a working site? Could you check the access records with Devel on the referring nodes of these errors? Hhmm...another thing. There are just 465 lines in the module, so I can't tell easily which code part causing the problem.

Wolfgang Reszel’s picture

I've 695 lines and the error is in the inner loop:

  // add per-role grants in addition to per-user grants
  $roles = variable_get('vocabulary_access', array());
  if (count($roles)) {
    foreach (array_keys($user->roles) as $rid) {
      foreach (array_keys($roles[$rid]) as $vid) {
        if ($roles[$rid][$vid]['vocabulary'] >= 1) {
          $vids[] = $vid;
        }
      }
    }
  }