Class name must be a valid object or a string in plugins/facetapi/adapter.inc on line 870

Created on 22 September 2016, almost 8 years ago
Updated 30 March 2019, about 5 years ago

I got this fatal error while i was moving an existing multi site to a local dev environment. The site already had these modules - Search API, Search API Solr and Facet API enabled and search index configured.

PHP Fatal error:  Class name must be a valid object or a string in /drupal-doc-root/facetapi/plugins/facetapi/adapter.inc on line 870

When i went through the code,

foreach ($facet['dependency plugins'] as $id) {
        if ($is_new) {
          $this->settings[$name]->settings['dependencies'] = array();
        }
        $class = ctools_plugin_load_class('facetapi', 'dependencies', $id, 'handler');
        $plugin = new $class($id, $this, $facet, $this->settings[$name], array());
        $this->settings[$name]->settings['dependencies'] += $plugin->getDefaultSettings();
      }

The variable $facet['dependency plugins'] array had these values

  array (size=3)
    0 => string 'role' (length=4)
    1 => string 'bundle' (length=6)
    2 => string 'facet' (length=5)

'role' and 'bundle' are returning null from ctools_plugin_load_class and leading to fatal error.
I saw a related issue in the queue - https://www.drupal.org/node/2530658 but in a different line.

🐛 Bug report
Status

Active

Version

1.5

Component

Code

Created by

🇮🇳India zuhair_ak Dubai

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024