Explorar el Código

fixing popsu.theme bug 2

bach hace 2 años
padre
commit
1154485f92
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      web/themes/custom/popsu/popsu.theme

+ 2 - 2
web/themes/custom/popsu/popsu.theme

@@ -68,8 +68,8 @@ function popsu_preprocess_field(&$variables){
     if($element["#field_name"] == "field_programme"){
     if($element["#field_name"] == "field_programme"){
       foreach ($element["#items"]->getIterator() as $id => $item) {
       foreach ($element["#items"]->getIterator() as $id => $item) {
         $nid = $item->getValue()['target_id'];
         $nid = $item->getValue()['target_id'];
-        $variables['items'][$id]['attributes']['class'] = new Attribute();
-        $variables['items'][$id]['attributes']['class']->addClass("programme-".$nid);
+        $variables['items'][$nid]['attributes']['class'] = new Attribute();
+        $variables['items'][$nid]['attributes']->addClass("programme-".$nid);
       }
       }
     }
     }
   }
   }