diff --git a/modules/gvocab/gvocab.module b/modules/gvocab/gvocab.module index a5252f5..5aee5d0 100644 --- a/modules/gvocab/gvocab.module +++ b/modules/gvocab/gvocab.module @@ -35,7 +35,7 @@ function gvocab_route_access(Route $route, RouteMatchInterface $match) { $term_id = array_sum(explode('/', $current_path))[3]; if ((!$vocabulary) && is_numeric($term_id)) { // Case: Add/Edit/Delete term ids. - $vocabulary_id = db_select('taxonomy_term_data', 't') + $vocabulary_id = $this->select('taxonomy_term_data', 't') ->fields('t', ['vid']) ->condition('tid', $term_id) ->execute()->fetchField(); @@ -102,11 +102,13 @@ function gvocab_access($op = NULL, $vocabulary_id = NULL) { /** * @param \Drupal\Core\Entity\EntityInterface $entity * - * @return \Drupal\Core\Access\AccessResultAllowed + * @return \Drupal\Core\Access\AccessResultAllowed|\Drupal\Core\Access\AccessResultNeutral * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException */ function gvocab_entity_access(EntityInterface $entity) { if ($entity->getEntityTypeId() == 'taxonomy_vocabulary' && gvocab_access('', $entity->getConfigTarget())) { return AccessResult::allowed(); } + + return AccessResult::neutral(); }