My PHPStorm code analysis reported that there is an undefined variable used in the function views_content_views_content_type_content_type() in the file ctools/views_content/plugins/content_types/views.inc.

As you see below, there is no $name variable defined in the function, so the $view variable will always be empty, so this function will always return without doing anything.

/**
 * Return a single content type.
 */
function views_content_views_content_type_content_type($subtype, $plugin) {
  $view = views_get_view($name);
  if (empty($view)) {
    return;
  }

  return _views_content_views_content_type($view);
}

Comments

ey’s picture

Issue summary: View changes
torgospizza’s picture

I noticed this too. It almost looks like it's an alias of _views_content_views_content_type(), which gets called in a few places, unlike this function which I don't see any references to (at least, currently).

maximpodorov’s picture

$subtype must be used instead of $name.

  • japerry committed 83e3468 on 7.x-1.x
    Issue #2380253 by japerry, pc-wurm: Remove deprecated...
japerry’s picture

Title: undefined variable in views_content_views_content_type_content_type() function » Remove deprecated views_content_views_content_type_content_type() function
Priority: Normal » Minor
Status: Active » Fixed

This is an old deprecated function from 2009 and drupal 6. It is not used anywhere (nor is it used in views), and as the reporter said -- this function will never work.

Removed the code entirely. Yay cleanup!

Status: Fixed » Closed (fixed)

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