Commit ce2f9dad authored by Hardik Patel's avatar Hardik Patel Committed by Miguel Guerreiro
Browse files

Issue #3121610 by Hardik_Patel_12, Suresh Prabhu Parkala, siddhant.bhosale: Drupal 9 compatibility

parent 92c11103
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2,3 +2,4 @@ type: module
name : Custom body class
description : Adds custom class/es
core : 8.x
core_version_requirement: ^8 || ^9
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -105,7 +105,7 @@ function custom_body_class_preprocess_html(&$variables) {
    if (!empty($specific_node_class) && ($specific_node_class->getValue() !== NULL) && ($specific_node_class->getValue()['value'] == 1)) {
      $variables['attributes']['class'][] = $node->gettype();
    }
    $type = \Drupal::service('entity.manager')->getStorage('node_type')->load($node->getType());
    $type = \Drupal::entityTypeManager()->getStorage('node_type')->load($node->getType());
    $classes = $type->getThirdPartySetting('node_type_class', 'classes', '');
    $variables['attributes']['class'][] = $classes;
  }