Commit f536d716 authored by Jaydev Bhatt's avatar Jaydev Bhatt Committed by Patrick Scheffer
Browse files

Issue #3301253 by Jaydev Bhatt, akshaydalvi212: Update the module for D10 readiness

parent c1ab5c0e
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -79,6 +79,7 @@ function organigrams_form_alter(&$form, FormStateInterface $form_state, $form_id
        // Pick out the terms by checking on tid in the key.
        if (substr($key, 0, 3) == 'tid') {
          // Get the position value.
          if (isset($value['#term']) && !empty($value['#term']->get('field_o_position')->first())) {
            $position = $value['#term']->get('field_o_position')->first()->getValue();
            // If the positions is s, prepend 'Staff' to the term title.
            if ($position['value'] == 's') {
@@ -89,6 +90,7 @@ function organigrams_form_alter(&$form, FormStateInterface $form_state, $form_id
      }
    }
  }
}

/**
 * Custom submit function for the vocabulary add form.
+5 −1
Original line number Diff line number Diff line
@@ -46,7 +46,11 @@ organigrams.view:
  path: '/organigram/{taxonomy_vocabulary}'
  defaults:
    _controller: '\Drupal\organigrams\Controller\OrganigramsController::viewOrganigram'
    _title_callback: '\Drupal\taxonomy\Controller\TaxonomyController::vocabularyTitle'
    _title_callback: '\Drupal\Core\Entity\Controller\EntityController::title'
  requirements:
    _permission: 'view organigrams'
    _custom_access: '\Drupal\organigrams\Controller\OrganigramsController::isOrganigram'
  options:
    parameters:
      taxonomy_vocabulary:
        with_config_overrides: TRUE
+7 −5
Original line number Diff line number Diff line
@@ -161,6 +161,7 @@ class TaxonomyTermTree {
      return;
    }

    if (isset($object) && !empty($object->get('field_o_position')->first())) {
      // Get the position of the child.
      $position = $object->get('field_o_position')->first()->getValue();

@@ -168,6 +169,7 @@ class TaxonomyTermTree {
      if (!in_array($position['value'], $positions)) {
        return;
      }
    }

    // Set default name for the object. Replace | with a linebreak.
    $markup = str_replace('|', '<br />', $object->getName());