After upgrading from Drupal 7.41 to Drupal 7.43, I found that my Views are producing the following notice error when using PHP contextual filter code:

Notice: Undefined index: args in DatabaseLog->findCaller() (line 156 of .../includes/database/log.inc).

By debugging, I know that this is produced by PHP contextual filter in Views. Specifically by line 53 of views/plugins/views_plugin_argument_default_php.inc

Below is my PHP contextual filter code:

$filter = array();
if (module_exists('mymodule')) {
  $url = drupal_get_path_alias(current_path());
  $query = db_query(
  'SELECT cp.contact_person_id
   FROM {mymodule_table} cp
   WHERE cp.website_section_url LIKE :url_to_find', array(':url_to_find' => $url));
  foreach ($query as $row) {
    $filter[] = $row->contact_person_id;
return implode('+',$filter);

The SQL query works correctly.
The view is a Block.
I am using the latest Views 7.x-3.13 version.

What could be happening?

  • you ran update.php right? – No Sssweat Mar 4 '16 at 7:25
  • Yes, I did. I ran update.php when upgrading to Drupal 7.43. – MmMnMr Mar 4 '16 at 7:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.