fixed presonne field reference in projet & evenement with special form mode (Nom Prenom)

This commit is contained in:
2026-09-01 11:31:12 +02:00
parent 62058d64bf
commit 1da76aeed4
7 changed files with 142 additions and 23 deletions
+3 -3
View File
@@ -84,13 +84,13 @@ function leshed_preprocess_node(&$variables) {
$variables["attributes"]['class'][] = "view-mode-{$variables['view_mode']}";
// if ($variables['view_mode'] === "teaser") {
if ($node->hasField('field_images')) {
/** @var \Drupal\file\Plugin\\Field\FieldType\FileFieldItemList $field_images */
$field_images = $node->get('field_images');
if (!$field_images->isEmpty()) {
if ($field_images && !$field_images->isEmpty()) {
$variables["attributes"]['class'][] = "has-image";
}
// }
}
}