missing fields bug fix

This commit is contained in:
Bachir Soussi Chiadmi 2024-11-05 10:19:31 +01:00
parent cab86fcb11
commit e6271c6624
7 changed files with 59 additions and 83 deletions

View File

@ -11,6 +11,7 @@ dependencies:
- field.field.node.site.field_nom_de_la_commune_nb_d_hab
- field.field.node.site.field_nom_du_qpv_nb_d_hab
- field.field.node.site.field_parties
- field.field.node.site.field_poid
- field.field.node.site.field_porteur_s_de_site
- field.field.node.site.field_programme_de_l_etat
- field.field.node.site.field_region
@ -47,12 +48,10 @@ third_party_settings:
width_breakpoint: 640
group_infos:
children:
- field_numero
- field_region
- field_nom_du_qpv_nb_d_hab
- field_departement_s
- field_programme_de_l_etat
- field_collectivite_s_epci
- field_porteur_s_de_site
- field_nom_de_la_commune_nb_d_hab
label: Infos
@ -87,6 +86,7 @@ third_party_settings:
group_details:
children:
- status
- field_poid
- created
- uid
- simple_sitemap
@ -105,8 +105,7 @@ third_party_settings:
required_fields: true
weight: -1
group_mots_clefs:
children:
- field_mots_clefs
children: { }
label: 'Mots Clefs'
region: content
parent_name: group_tabs
@ -296,6 +295,13 @@ content:
convert: '0'
duplicate: duplicate
third_party_settings: { }
field_poid:
type: number
weight: 3
region: content
settings:
placeholder: ''
third_party_settings: { }
field_porteur_s_de_site:
type: string_textarea
weight: 18

View File

@ -11,6 +11,7 @@ dependencies:
- field.field.node.site.field_nom_de_la_commune_nb_d_hab
- field.field.node.site.field_nom_du_qpv_nb_d_hab
- field.field.node.site.field_parties
- field.field.node.site.field_poid
- field.field.node.site.field_porteur_s_de_site
- field.field.node.site.field_programme_de_l_etat
- field.field.node.site.field_region
@ -35,7 +36,7 @@ content:
settings:
link_to_entity: false
third_party_settings: { }
weight: 106
weight: 5
region: content
field_documents:
type: file_default
@ -43,7 +44,7 @@ content:
settings:
use_description_as_link_text: true
third_party_settings: { }
weight: 111
weight: 9
region: content
field_geofield:
type: geofield_default
@ -52,7 +53,7 @@ content:
output_format: wkt
output_escape: true
third_party_settings: { }
weight: 115
weight: 13
region: content
field_images:
type: image_caption
@ -63,7 +64,7 @@ content:
image_loading:
attribute: lazy
third_party_settings: { }
weight: 0
weight: 1
region: content
field_liens_site:
type: link
@ -75,7 +76,7 @@ content:
rel: ''
target: ''
third_party_settings: { }
weight: 112
weight: 10
region: content
field_nom_de_la_commune_nb_d_hab:
type: string
@ -83,7 +84,7 @@ content:
settings:
link_to_entity: false
third_party_settings: { }
weight: 110
weight: 8
region: content
field_nom_du_qpv_nb_d_hab:
type: string
@ -91,7 +92,7 @@ content:
settings:
link_to_entity: false
third_party_settings: { }
weight: 105
weight: 4
region: content
field_parties:
type: entity_reference_revisions_entity_view
@ -100,14 +101,14 @@ content:
view_mode: default
link: ''
third_party_settings: { }
weight: 113
weight: 11
region: content
field_porteur_s_de_site:
type: basic_string
label: above
settings: { }
third_party_settings: { }
weight: 109
weight: 7
region: content
field_programme_de_l_etat:
type: string
@ -115,7 +116,7 @@ content:
settings:
link_to_entity: false
third_party_settings: { }
weight: 107
weight: 6
region: content
field_region:
type: string
@ -123,7 +124,7 @@ content:
settings:
link_to_entity: false
third_party_settings: { }
weight: 104
weight: 3
region: content
field_sous_titre:
type: string
@ -131,12 +132,12 @@ content:
settings:
link_to_entity: false
third_party_settings: { }
weight: 114
weight: 12
region: content
links:
settings: { }
third_party_settings: { }
weight: 100
weight: 2
region: content
title:
type: title
@ -145,10 +146,11 @@ content:
link_to_entity: true
tag: h2
third_party_settings: { }
weight: -49
weight: 0
region: content
hidden:
created: true
field_poid: true
langcode: true
search_api_excerpt: true
uid: true

View File

@ -12,6 +12,7 @@ dependencies:
- field.field.node.site.field_nom_de_la_commune_nb_d_hab
- field.field.node.site.field_nom_du_qpv_nb_d_hab
- field.field.node.site.field_parties
- field.field.node.site.field_poid
- field.field.node.site.field_porteur_s_de_site
- field.field.node.site.field_programme_de_l_etat
- field.field.node.site.field_region
@ -60,6 +61,7 @@ hidden:
field_nom_de_la_commune_nb_d_hab: true
field_nom_du_qpv_nb_d_hab: true
field_parties: true
field_poid: true
field_porteur_s_de_site: true
field_programme_de_l_etat: true
field_region: true

View File

@ -12,6 +12,7 @@ dependencies:
- field.field.node.site.field_nom_de_la_commune_nb_d_hab
- field.field.node.site.field_nom_du_qpv_nb_d_hab
- field.field.node.site.field_parties
- field.field.node.site.field_poid
- field.field.node.site.field_porteur_s_de_site
- field.field.node.site.field_programme_de_l_etat
- field.field.node.site.field_region
@ -62,6 +63,7 @@ hidden:
field_nom_de_la_commune_nb_d_hab: true
field_nom_du_qpv_nb_d_hab: true
field_parties: true
field_poid: true
field_porteur_s_de_site: true
field_programme_de_l_etat: true
field_region: true

View File

@ -0,0 +1,25 @@
uuid: a074192e-6a9a-4e1c-8726-27497c07ce78
langcode: fr
status: true
dependencies:
config:
- field.storage.node.field_poid
- node.type.site
id: node.site.field_poid
field_name: field_poid
entity_type: node
bundle: site
label: Poid
description: ''
required: false
translatable: false
default_value:
-
value: 0
default_value_callback: ''
settings:
min: -20
max: 20
prefix: ''
suffix: ''
field_type: integer

View File

@ -4,13 +4,11 @@ status: true
dependencies:
config:
- page_manager.page.node_view
- views.view.site
module:
- ctools_block
- node
- panels
- q2d_mod
- views
id: node_view-panels_variant-0
label: Sites
weight: 0
@ -63,28 +61,6 @@ variant_settings:
- ''
html_id: ''
css_styles: ''
4f39a2a9-9180-481e-ac4a-168fcc5fd8e4:
id: 'entity_field:node:field_numero'
label: Numéro
label_display: '0'
provider: ctools_block
context_mapping:
entity: node
formatter:
type: number_integer
weight: 0
label: visually_hidden
settings:
thousand_separator: ''
prefix_suffix: true
third_party_settings: { }
region: second
weight: -3
uuid: 4f39a2a9-9180-481e-ac4a-168fcc5fd8e4
css_classes:
- ''
html_id: ''
css_styles: ''
0f521934-a0b6-49c7-9dd0-b984c8d80ef3:
id: 'entity_field:node:field_documents'
label: Documents
@ -152,43 +128,6 @@ variant_settings:
- ''
html_id: ''
css_styles: ''
06132319-e1c4-45e4-9b9e-2db00c2d5ea2:
id: 'views_block:site-block_1'
label: ''
label_display: '0'
provider: views
context_mapping: { }
views_label: ''
items_per_page: none
exposed: { }
region: second
weight: 0
uuid: 06132319-e1c4-45e4-9b9e-2db00c2d5ea2
css_classes:
- ''
html_id: ''
css_styles: ''
6e59adf8-c9fe-438c-9518-413fa8f77ffb:
id: 'entity_field:node:field_mots_clefs'
label: 'Mots Clefs'
label_display: visible
provider: ctools_block
context_mapping:
entity: node
formatter:
type: entity_reference_label
weight: 0
label: visually_hidden
settings:
link: false
third_party_settings: { }
region: second
weight: 1
uuid: 6e59adf8-c9fe-438c-9518-413fa8f77ffb
css_classes:
- ''
html_id: ''
css_styles: ''
585c2156-c9db-4940-8382-0744350facf6:
id: prevnextsite_block
label: 'PrevNext Site Block'

View File

@ -27,15 +27,15 @@ class PrevNextSite extends BlockBase {
if ($node) {
$nodetype = $node->getType();
if($nodetype === "site"){
$num = $node->get('field_numero')->getString();
$num = $node->get('field_poid')->getString();
$allSites = \Drupal::entityTypeManager()->getStorage('node')
->loadByProperties(['type' => 'site', 'status' => 1]);
usort($allSites, function($a, $b){
$numA = $a->get('field_numero')->getString();
$numB = $b->get('field_numero')->getString();
$numA = $a->get('field_poid')->getString();
$numB = $b->get('field_poid')->getString();
if ($numA == $numB) {
return 0;
}
@ -44,7 +44,7 @@ class PrevNextSite extends BlockBase {
$prevnode = null;
$nextnode = null;
foreach($allSites as $index => $site){
$n = $site->get('field_numero')->getString();
$n = $site->get('field_poid')->getString();
if($n === $num){
$prevnode = $index - 1 >= 0 ? $allSites[$index - 1] : null;
$nextnode = $index + 1 < count($allSites) ? $allSites[$index + 1] : null;