From ee271ab4d8b4f434dbe1e2fd93f269ad5e4dad22 Mon Sep 17 00:00:00 2001 From: bach Date: Tue, 20 Aug 2024 19:47:47 +0200 Subject: [PATCH] upgraded all cutom modules, themes & profile following upgrade-status --- .../custom/materio_expo/src/Controller/QRController.php | 1 + web/modules/custom/materio_home/materio_home.module | 1 + .../custom/materio_home/src/Controller/AjaxHomeController.php | 3 ++- .../src/Plugin/Field/FieldType/ComputedArticlesReferences.php | 1 + .../src/Plugin/Field/FieldType/ComputedMaterialsReferences.php | 1 + .../src/Plugin/Field/FieldType/ComputedShowroomsReferences.php | 1 + web/modules/custom/materio_id/materio_id.module | 1 + .../src/Plugin/Field/FieldWidget/SamplesDefaultWidget.php | 1 + .../custom/materio_sapi/src/Controller/AjaxSearchForm.php | 3 ++- .../custom/materio_sapi/src/Form/MaterioSapiSearchForm.php | 1 + .../custom/materio_simplenews/materio_simplenews.module | 2 +- .../custom/materio_user/src/Controller/AjaxLoginForm.php | 3 ++- .../custom/materio_user/src/Controller/AjaxRegisterForm.php | 3 ++- .../src/Plugin/Field/FieldFormatter/VueImageFormatter.php | 2 +- web/profiles/d8-starterkit-profile | 2 +- web/themes/custom/materiotheme/materiotheme.info.yml | 2 +- web/themes/custom/matminimal/matminimal.info.yml | 2 +- 17 files changed, 21 insertions(+), 9 deletions(-) diff --git a/web/modules/custom/materio_expo/src/Controller/QRController.php b/web/modules/custom/materio_expo/src/Controller/QRController.php index f34e52f7..ec0ef827 100644 --- a/web/modules/custom/materio_expo/src/Controller/QRController.php +++ b/web/modules/custom/materio_expo/src/Controller/QRController.php @@ -41,6 +41,7 @@ class QRController extends ControllerBase { $query = $entity_storage->getQuery() ->condition('type', 'materiau') ->condition('status', '1') + ->accessCheck() ->condition('field_reference', $ref); $results = $query->execute(); $nid = array_pop($results); diff --git a/web/modules/custom/materio_home/materio_home.module b/web/modules/custom/materio_home/materio_home.module index 2ca7982c..32c1cbcc 100644 --- a/web/modules/custom/materio_home/materio_home.module +++ b/web/modules/custom/materio_home/materio_home.module @@ -193,6 +193,7 @@ function materio_home_cron(){ // Short-running operation example, not using a queue $query = \Drupal::entityQuery('node') ->condition('status', 1) + ->accessCheck(FALSE) ->condition('type', 'frontpage'); $nids = $query->execute(); $nodes = entity_load_multiple('node', $nids); diff --git a/web/modules/custom/materio_home/src/Controller/AjaxHomeController.php b/web/modules/custom/materio_home/src/Controller/AjaxHomeController.php index 907e9441..957599de 100644 --- a/web/modules/custom/materio_home/src/Controller/AjaxHomeController.php +++ b/web/modules/custom/materio_home/src/Controller/AjaxHomeController.php @@ -78,7 +78,8 @@ class AjaxHomeController extends ControllerBase { $view_builder = $this->entityTypeManager()->getViewBuilder('node'); $renderable = $view_builder->view($node, 'home_full'); $rendered = $this->renderer->executeInRenderContext(new RenderContext(), function () use ($renderable) { - return render($renderable); + // return render($renderable); + return \Drupal::service('renderer')->render($renderable); }); $data['rendered'] = $rendered; diff --git a/web/modules/custom/materio_home/src/Plugin/Field/FieldType/ComputedArticlesReferences.php b/web/modules/custom/materio_home/src/Plugin/Field/FieldType/ComputedArticlesReferences.php index 4eb61cf8..8c88829a 100644 --- a/web/modules/custom/materio_home/src/Plugin/Field/FieldType/ComputedArticlesReferences.php +++ b/web/modules/custom/materio_home/src/Plugin/Field/FieldType/ComputedArticlesReferences.php @@ -41,6 +41,7 @@ class ComputedArticlesReferences extends EntityReferenceFieldItemList ->sort('created', 'DESC') ->exists('field_visuel') ->range(0,12) + ->accessCheck() ->condition('type', 'article'); $nids = $query->execute(); $i = 0; diff --git a/web/modules/custom/materio_home/src/Plugin/Field/FieldType/ComputedMaterialsReferences.php b/web/modules/custom/materio_home/src/Plugin/Field/FieldType/ComputedMaterialsReferences.php index faccb715..e0fbd9f8 100644 --- a/web/modules/custom/materio_home/src/Plugin/Field/FieldType/ComputedMaterialsReferences.php +++ b/web/modules/custom/materio_home/src/Plugin/Field/FieldType/ComputedMaterialsReferences.php @@ -45,6 +45,7 @@ class ComputedMaterialsReferences extends EntityReferenceFieldItemList ->condition('field_materiau_images.%delta', 3, '>') ->exists('field_materiau_images') ->sort('created', 'DESC') + ->accessCheck() ->range(0,200); $results = $query->execute(); if ($results) { diff --git a/web/modules/custom/materio_home/src/Plugin/Field/FieldType/ComputedShowroomsReferences.php b/web/modules/custom/materio_home/src/Plugin/Field/FieldType/ComputedShowroomsReferences.php index b29b513d..9e42dfdb 100644 --- a/web/modules/custom/materio_home/src/Plugin/Field/FieldType/ComputedShowroomsReferences.php +++ b/web/modules/custom/materio_home/src/Plugin/Field/FieldType/ComputedShowroomsReferences.php @@ -39,6 +39,7 @@ class ComputedShowroomsReferences extends EntityReferenceFieldItemList protected function computeValue() { $query = \Drupal::entityQuery('taxonomy_term') ->condition('status', 1) + ->accessCheck(FALSE) ->condition('vid', 'showroom'); // remove masqué diff --git a/web/modules/custom/materio_id/materio_id.module b/web/modules/custom/materio_id/materio_id.module index 3cd12c4d..0b53b318 100644 --- a/web/modules/custom/materio_id/materio_id.module +++ b/web/modules/custom/materio_id/materio_id.module @@ -22,6 +22,7 @@ function computed_field_field_index_compute($entity_type_manager, $entity, $fiel ->condition('type', $entity->bundle()) ->condition('field_famille', $famille) ->sort('field_index', 'DESC') + ->accessCheck(FALSE) ->range(0,1); $nids = $query->execute(); diff --git a/web/modules/custom/materio_samples/src/Plugin/Field/FieldWidget/SamplesDefaultWidget.php b/web/modules/custom/materio_samples/src/Plugin/Field/FieldWidget/SamplesDefaultWidget.php index 64aad999..9d81f3c6 100644 --- a/web/modules/custom/materio_samples/src/Plugin/Field/FieldWidget/SamplesDefaultWidget.php +++ b/web/modules/custom/materio_samples/src/Plugin/Field/FieldWidget/SamplesDefaultWidget.php @@ -31,6 +31,7 @@ class SamplesDefaultWidget extends WidgetBase { $query = \Drupal::entityQuery('taxonomy_term') ->sort('weight', 'DESC') // ->sort('tid', 'DESC') + ->accessCheck() ->condition('vid', $vid); $tids = $query->execute(); $terms = Term::loadMultiple($tids); diff --git a/web/modules/custom/materio_sapi/src/Controller/AjaxSearchForm.php b/web/modules/custom/materio_sapi/src/Controller/AjaxSearchForm.php index 8615b4b3..7a5e5d03 100644 --- a/web/modules/custom/materio_sapi/src/Controller/AjaxSearchForm.php +++ b/web/modules/custom/materio_sapi/src/Controller/AjaxSearchForm.php @@ -58,7 +58,8 @@ class AjaxSearchForm extends ControllerBase { $this->getFormDefinition(); - $rendered = render($this->form_builded); + // $rendered = render($this->form_builded); + $rendered = \Drupal::service('renderer')->render($this->form_builded); // $form_builded = $this->form_builded; // $rendered = \Drupal::service('renderer')->executeInRenderContext(new RenderContext(), function () use ($form_builded) { // return render($form_builded); diff --git a/web/modules/custom/materio_sapi/src/Form/MaterioSapiSearchForm.php b/web/modules/custom/materio_sapi/src/Form/MaterioSapiSearchForm.php index fd4fb04a..66a65c65 100644 --- a/web/modules/custom/materio_sapi/src/Form/MaterioSapiSearchForm.php +++ b/web/modules/custom/materio_sapi/src/Form/MaterioSapiSearchForm.php @@ -84,6 +84,7 @@ class MaterioSapiSearchForm extends FormBase { // ] $query = \Drupal::entityQuery('taxonomy_term'); $query->condition('vid', "assisted_research") + ->accessCheck(TRUE) ->sort('field_weight', 'ASC'); $tids = $query->execute(); $terms = \Drupal\taxonomy\Entity\Term::loadMultiple($tids); diff --git a/web/modules/custom/materio_simplenews/materio_simplenews.module b/web/modules/custom/materio_simplenews/materio_simplenews.module index e211de99..261268f1 100644 --- a/web/modules/custom/materio_simplenews/materio_simplenews.module +++ b/web/modules/custom/materio_simplenews/materio_simplenews.module @@ -31,7 +31,7 @@ function materio_simplenews_form_node_simplenews_issue_form_alter(&$form, &$form } function materio_simplenews_getSimplenewsNodeBodyTemplate($news_id){ - return file_get_contents(drupal_get_path('module', 'materio_simplenews').'/templates/simplenews_'.$news_id.'_node.html'); + return file_get_contents(\Drupal::service('extension.list.module')->getPath('materio_simplenews').'/templates/simplenews_'.$news_id.'_node.html'); } function materio_simplenews_form_node_simplenews_issue_edit_form_alter(&$form, &$form_state, $form_id) { diff --git a/web/modules/custom/materio_user/src/Controller/AjaxLoginForm.php b/web/modules/custom/materio_user/src/Controller/AjaxLoginForm.php index d7cdee7b..131757a0 100644 --- a/web/modules/custom/materio_user/src/Controller/AjaxLoginForm.php +++ b/web/modules/custom/materio_user/src/Controller/AjaxLoginForm.php @@ -55,7 +55,8 @@ class AjaxLoginForm extends ControllerBase { $this->getFormDefinition(); - $rendered = render($this->form_builded); + // $rendered = render($this->form_builded); + $rendered = \Drupal::service('renderer')->render($this->form_builded); // $form_builded = $this->form_builded; // $rendered = \Drupal::service('renderer')->executeInRenderContext(new RenderContext(), function () use ($form_builded) { // return render($form_builded); diff --git a/web/modules/custom/materio_user/src/Controller/AjaxRegisterForm.php b/web/modules/custom/materio_user/src/Controller/AjaxRegisterForm.php index 635e0461..d080222f 100644 --- a/web/modules/custom/materio_user/src/Controller/AjaxRegisterForm.php +++ b/web/modules/custom/materio_user/src/Controller/AjaxRegisterForm.php @@ -62,7 +62,8 @@ class AjaxRegisterForm extends ControllerBase { $this->getFormDefinition(); - $rendered = render($this->form_builded); + // $rendered = render($this->form_builded); + $rendered = \Drupal::service('renderer')->render($this->form_builded); // $form_builded = $this->form_builded; // $rendered = \Drupal::service('renderer')->executeInRenderContext(new RenderContext(), function () use ($form_builded) { // return render($form_builded); diff --git a/web/modules/custom/vue_link_formatter/src/Plugin/Field/FieldFormatter/VueImageFormatter.php b/web/modules/custom/vue_link_formatter/src/Plugin/Field/FieldFormatter/VueImageFormatter.php index ef9ac4f3..db3fce9f 100644 --- a/web/modules/custom/vue_link_formatter/src/Plugin/Field/FieldFormatter/VueImageFormatter.php +++ b/web/modules/custom/vue_link_formatter/src/Plugin/Field/FieldFormatter/VueImageFormatter.php @@ -80,7 +80,7 @@ class VueImageFormatter extends ImageFormatter { // context to ensure different file URLs are generated for different // sites in a multisite setup, including HTTP and HTTPS versions of the // same site. Fix in https://www.drupal.org/node/2646744. - $url = Url::fromUri(file_create_url($image_uri)); + $url = Url::fromUri(\Drupal::service('file_url_generator')->generateAbsoluteString($image_uri)); $cache_contexts[] = 'url.site'; } $cache_tags = Cache::mergeTags($base_cache_tags, $file->getCacheTags()); diff --git a/web/profiles/d8-starterkit-profile b/web/profiles/d8-starterkit-profile index 3a8a1dac..ac69727b 160000 --- a/web/profiles/d8-starterkit-profile +++ b/web/profiles/d8-starterkit-profile @@ -1 +1 @@ -Subproject commit 3a8a1dac5e52deb8f4059f7ae8af7d5d993d1d84 +Subproject commit ac69727be76c5956d90003ea4fcc95dd26f83b7d diff --git a/web/themes/custom/materiotheme/materiotheme.info.yml b/web/themes/custom/materiotheme/materiotheme.info.yml index 249ef9d6..fd361ddf 100644 --- a/web/themes/custom/materiotheme/materiotheme.info.yml +++ b/web/themes/custom/materiotheme/materiotheme.info.yml @@ -2,7 +2,7 @@ name: Materio description: 'Materio Drupal 8 theme with gulp' type: theme base theme: classy -core_version_requirement: ^8.8 || ^9.2 +core_version_requirement: ^8.8 || ^9.2 || ^10 libraries: - core/normalize - materiotheme/global-css diff --git a/web/themes/custom/matminimal/matminimal.info.yml b/web/themes/custom/matminimal/matminimal.info.yml index f39c6e0f..3a6843a8 100644 --- a/web/themes/custom/matminimal/matminimal.info.yml +++ b/web/themes/custom/matminimal/matminimal.info.yml @@ -1,7 +1,7 @@ name: Matminimal type: theme description: 'Adminimal based drupal administration theme with material design.' -core_version_requirement: ^8.8 || ^9.2 +core_version_requirement: ^8.8 || ^9.2 || ^10 base theme: adminimal_theme libraries: