From 488766bf3db5897ef6fc0e0de05bb79ffb9c0fc5 Mon Sep 17 00:00:00 2001 From: bach Date: Wed, 25 Aug 2021 23:07:04 +0200 Subject: [PATCH] =?UTF-8?q?villes=20and=20th=C3=A8me=20of=20active=20progs?= =?UTF-8?q?=20in=20home=20#1435?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/sync/views.view.programmes.yml | 8 ++++---- .../Plugin/views/field/ViewsComputedProjetsReference.php | 2 +- .../Plugin/views/field/ViewsComputedThemesReference.php | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/config/sync/views.view.programmes.yml b/config/sync/views.view.programmes.yml index 5918244c..09ae9ba5 100644 --- a/config/sync/views.view.programmes.yml +++ b/config/sync/views.view.programmes.yml @@ -547,8 +547,8 @@ display: element_wrapper_class: '' element_default_classes: true empty: '' - hide_empty: false - empty_zero: false + hide_empty: true + empty_zero: true hide_alter_empty: true entity_type: node plugin_id: views_computed_projets_reference @@ -597,8 +597,8 @@ display: element_wrapper_class: '' element_default_classes: true empty: '' - hide_empty: false - empty_zero: false + hide_empty: true + empty_zero: true hide_alter_empty: true entity_type: node plugin_id: views_computed_themes_reference diff --git a/web/modules/custom/popsu_programme/src/Plugin/views/field/ViewsComputedProjetsReference.php b/web/modules/custom/popsu_programme/src/Plugin/views/field/ViewsComputedProjetsReference.php index 19edecd5..9a4a396b 100644 --- a/web/modules/custom/popsu_programme/src/Plugin/views/field/ViewsComputedProjetsReference.php +++ b/web/modules/custom/popsu_programme/src/Plugin/views/field/ViewsComputedProjetsReference.php @@ -33,7 +33,7 @@ class ViewsComputedProjetsReference extends FieldPluginBase { $projets = $node->get('computed_projets_references')->getvalue(); } - return count($projets) . ' villes'; + return count($projets) ? count($projets) . ' villes' : null; } /** diff --git a/web/modules/custom/popsu_programme/src/Plugin/views/field/ViewsComputedThemesReference.php b/web/modules/custom/popsu_programme/src/Plugin/views/field/ViewsComputedThemesReference.php index 4cc1aea7..d96b1f53 100644 --- a/web/modules/custom/popsu_programme/src/Plugin/views/field/ViewsComputedThemesReference.php +++ b/web/modules/custom/popsu_programme/src/Plugin/views/field/ViewsComputedThemesReference.php @@ -33,7 +33,7 @@ class ViewsComputedThemesReference extends FieldPluginBase { $themes = $node->get('computed_themes_references')->getvalue(); } - return count($themes) . ' themes'; + return count($themes) ? count($themes) . ' thèmes' : null; } /**