Using a Drupal 8 install without the Taxonomy module enabled:

  1. Install the datalayer module
  2. Navigate to /admin/config/search/datalayer
  3. Fatal error:
    Error: Class 'Drupal\taxonomy\Entity\Vocabulary' not found in Drupal\datalayer\Form\DatalayerSettingsForm->buildForm() (line 128 of modules/contrib/datalayer/src/Form/DatalayerSettingsForm.php).



We should check if the Taxonomy module is enabled, I think this can be done using the following:

// Setup vocabs.
$v_options = [];
$moduleHandler = \Drupal::service('module_handler');
if ($moduleHandler->moduleExists('taxonomy')){
  $vocabs = Vocabulary::loadMultiple();
  foreach ($vocabs as $v) {
    $v_options[$v->id()] = $v->label();
  }
}
$datalayer_settings = $this->config('datalayer.settings');

This seemed to work, but I might have missed something.

I'm using 8.x-1.0-beta2, but might also be in other versions.

Issue fork datalayer-3156321

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

azwart created an issue. See original summary.

Balu Ertl made their first commit to this issue’s fork.

Balu Ertl’s picture

Status: Active » Needs review

eojthebrave made their first commit to this issue’s fork.

  • eojthebrave committed 30ee232 on 8.x-1.x authored by Balu Ertl
    Issue #3156321 by Balu Ertl, eojthebrave, azwart: Taxonomy dependency...
eojthebrave’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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