Commit 00a31ecb authored by Valters Sverns's avatar Valters Sverns Committed by Stefan Borchert
Browse files

Issue #3257269 by mr.valters, Summit, stBorchert: Error: Call to a member function bundle() on null

parent 8f84278b
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@
 */

use Drupal\Core\Database\Database;
use Drupal\taxonomy\TermInterface;

/**
 * List all javascript classes used to create models and views in the widget.
@@ -114,6 +115,9 @@ function shs_term_has_children(int $tid): bool {

  /** @var \Drupal\taxonomy\TermInterface $term */
  $term = \Drupal::entityTypeManager()->getStorage('taxonomy_term')->load($tid);
  if (!($term instanceof TermInterface)) {
    return FALSE;
  }
  $access_unpublished = $current_user->hasPermission('administer taxonomy') || $current_user->hasPermission('view unpublished terms in ' . $term->bundle());

  $query = Database::getConnection()->select('taxonomy_term_field_data', 't');