Commit 1debea15 authored by Rahul Maurya's avatar Rahul Maurya 💬 Committed by Patrick Scheffer
Browse files

Issue #3301295 by urvashi_vora, mauryarahul11, Rakhi Soni: Drupal Coding Standard Issue

parent f536d716
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@
  box-sizing: border-box;
  content: '';
  position: absolute;
  border: 0px solid #CCCCCC;
  border: 0px solid #cccccc;
}

.orgchart li:not(:only-child)::before {
+1 −1
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ function hook_organigrams_taxonomy_term_tree_alter(array &$items) {
 *
 * @param string $markup
 *   Contains rendered html.
 * @param object $object
 * @param object $term
 *   Contains a taxonomy term.
 */
function hook_organigrams_taxonomy_term_markup_alter(string &$markup, object $term) {
+1 −0
Original line number Diff line number Diff line
<?php

/**
 * @file
 * Installation hooks for Organigrams module.
+1 −1
Original line number Diff line number Diff line
services:
  organigrams.taxonomy_term_tree:
    class: Drupal\organigrams\TaxonomyTermTree
    arguments: ['@entity_type.manager', '@entity_field.manager']
    arguments: ['@entity_type.manager', '@entity_field.manager', '@module_handler', '@renderer']
+31 −1
Original line number Diff line number Diff line
@@ -8,12 +8,40 @@ use Drupal\taxonomy\Entity\Vocabulary;
use Drupal\taxonomy\Entity\Term;
use Drupal\Core\Link;
use Drupal\Core\Url;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;

/**
 * Provides the settings form for this module.
 */
class OrganigramsImportD7Form extends FormBase {

  /**
   * The entity type manager.
   *
   * @var \Drupal\Core\Entity\EntityTypeManagerInterface
   */
  protected $entityTypeManager;

  /**
   * Constructs a new object.
   *
   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
   *   The entity type manager service.
   */
  public function __construct(EntityTypeManagerInterface $entity_type_manager) {
    $this->entityTypeManager = $entity_type_manager;
  }

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container) {
    return new static(
      $container->get('entity_type.manager')
    );
  }

  /**
   * Returns a unique string identifying the form.
   *
@@ -76,7 +104,9 @@ class OrganigramsImportD7Form extends FormBase {
      $form_state->setErrorByName('organigrams_d7_json', $this->t('No organigram found in the JSON.'));
    }
    else {
      $vocabularies = \Drupal::entityQuery('taxonomy_vocabulary')->execute();
      $vocabularies = $this->entityTypeManager->getStorage('taxonomy_term')->getQuery()
        ->accessCheck(TRUE)
        ->execute();

      if (isset($vocabularies[$organigram->organigram->machine_name])) {
        $form_state->setErrorByName('organigrams_d7_json', $this->t('An organigram with the machine name "@machine_name" already exists. Change the machine name or remove the existing one to import this organigram.', [
Loading