massive custom modules and themes D11 compatibility

This commit is contained in:
2026-09-23 14:16:41 +02:00
parent 21092ae992
commit c38d01ee2b
34 changed files with 132 additions and 34 deletions
@@ -1,5 +1,5 @@
name: 'Editors Menus'
type: module
description: 'create editors admin menus through module as they will be exportable as config'
core_version_requirement: ^8.8 || ^9.2 || ^10.2
core_version_requirement: ^8.8 || ^9.2 || ^10.2 || ^11
package: 'Custom'
@@ -1,7 +1,7 @@
name: 'images_styles_cron_gen'
type: module
description: 'helpers for progressive decoupling'
core_version_requirement: ^8.8 || ^9.2 || ^10.2
core_version_requirement: ^8.8 || ^9.2 || ^10.2 || ^11
package: 'custom'
# https://www.flocondetoile.fr/blog/generate-programmatically-image-styles-drupal-8
# https://www.flocondetoile.fr/blog/using-drupal-8-cron-api-generate-image-styles
@@ -34,6 +34,6 @@ class CreateImagesStyles {
else {
$message = t('Finished with an error.');
}
drupal_set_message($message);
\Drupal::messenger()->addStatus($message);
}
}
@@ -3,7 +3,7 @@ description: Materio commerce custom module
package: Materio
type: module
core_version_requirement: ^8.8 || ^9.2 || ^10.2
core_version_requirement: ^8.8 || ^9.2 || ^10.2 || ^11
dependencies:
- drupal:commerce
@@ -1,5 +1,5 @@
name: 'materio_decoupled'
type: module
description: 'helpers for progressive decoupling'
core_version_requirement: ^8.8 || ^9.2 || ^10.2
core_version_requirement: ^8.8 || ^9.2 || ^10.2 || ^11
package: 'Materio'
@@ -16,6 +16,27 @@ use Symfony\Component\HttpFoundation\JsonResponse;
*/
class AjaxHeaderMenuBlock extends ControllerBase {
/**
* The block ID.
*
* @var string
*/
protected $bid;
/**
* The block entity.
*
* @var \Drupal\block\Entity\Block|null
*/
protected $block;
/**
* The rendered block build array.
*
* @var array
*/
protected $block_builded;
private function getBlockDefinition(){
// $language = \Drupal::languageManager()->getCurrentLanguage()->getId();
// \Drupal::logger('materio_user')->notice($language);
@@ -1,5 +1,5 @@
name: 'materio_expo'
type: module
description: 'My Awesome Module'
core_version_requirement: ^8.8 || ^9.2 || ^10.2
core_version_requirement: ^8.8 || ^9.2 || ^10.2 || ^11
package: 'Materio'
@@ -1,7 +1,7 @@
name: Materio FLAG
type: module
description: Defines api behaviours for flaglist.
core_version_requirement: ^8.8 || ^9.2 || ^10.2
core_version_requirement: ^8.8 || ^9.2 || ^10.2 || ^11
package: Materio
dependencies:
- drupal:flag_lists
@@ -2,7 +2,7 @@ name: Materio GraphQL
type: module
description: 'Materio GraphQL schema.'
package: Materio
core_version_requirement: ^8.8 || ^9.2 || ^10.2
core_version_requirement: ^8.8 || ^9.2 || ^10.2 || ^11
dependencies:
- graphql:graphql
- node:node
@@ -6,7 +6,6 @@ use Drupal\graphql\GraphQL\ResolverBuilder;
use Drupal\graphql\GraphQL\ResolverRegistryInterface;
use Drupal\graphql\GraphQL\Response\ResponseInterface;
use Drupal\graphql\Plugin\GraphQL\SchemaExtension\SdlSchemaExtensionPluginBase;
use Drupal\materio_graphql\GraphQL\Response\MaterioResponse;
use Drupal\Core\Url;
// use CommerceGuys\Addressing\Country\CountryRepository;
use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -1,6 +1,6 @@
name: Materio Home
type: module
description: Defines home contents for materiO.
core_version_requirement: ^8.8 || ^9.2 || ^10.2
core_version_requirement: ^8.8 || ^9.2 || ^10.2 || ^11
package: Materio
dependencies:
@@ -123,6 +123,7 @@ function materio_home_entity_bundle_field_info(EntityTypeInterface $entity_type,
return $fields;
}
return [];
}
/**
* Implement hook_entity_base_field_info_alter().
@@ -196,7 +197,7 @@ function materio_home_cron(){
->accessCheck(FALSE)
->condition('type', 'frontpage');
$nids = $query->execute();
$nodes = entity_load_multiple('node', $nids);
$nodes = \Drupal::entityTypeManager()->getStorage('node')->loadMultiple($nids);
foreach ($nodes as $nid => $node) {
$logger->notice('cron | regenerating computed fields for '.$nid);
$node->save();
@@ -11,7 +11,7 @@ use Symfony\Component\HttpFoundation\JsonResponse;
use Drupal\Core\Cache\CacheableJsonResponse;
use Drupal\Core\Cache\CacheableMetadata;
use Drupal\Core\Url;
use Drupal\core\render\RenderContext;
use Drupal\Core\Render\RenderContext;
/**
* Class AjaxHomeController.
@@ -8,7 +8,6 @@ use Drupal\Core\Field\FieldItemList;
use Drupal\Core\TypedData\TypedDataInterface;
use Drupal\Core\Field\BaseFieldDefinition;
use Drupal\Core\TypedData\ComputedItemListTrait;
use Drupal\workflow\Entity\WorkflowManager;
// https://www.drupal.org/node/2112677
@@ -49,7 +48,7 @@ class ComputedShowroomsReferences extends EntityReferenceFieldItemList
$i=0;
foreach ($tids as $tid) {
$term = \Drupal::entityTypeManager()->getStorage('taxonomy_term')->load($tid);
$sid = WorkflowManager::getCurrentStateId($term, 'field_workflow');
$sid = workflow_node_current_state($term, 'field_workflow');
if($sid != 'workflow_visible') continue;
$this->list[$i] = $this->createItem($i, $tid);
$i++;
@@ -1,7 +1,7 @@
name: Materio Id
type: module
description: "Compute automaticly materials references : <family>-<index>, eg. W-0459."
core_version_requirement: ^8.8 || ^9.2 || ^10.2
core_version_requirement: ^8.8 || ^9.2 || ^10.2 || ^11
package: Materio
dependencies:
- computed_field
@@ -1,7 +1,7 @@
name: Materio JsonAPI
type: module
description: Defines custom behaviours to jsonapi.
core_version_requirement: ^8.8 || ^9.2 || ^10.2
core_version_requirement: ^8.8 || ^9.2 || ^10.2 || ^11
package: Materio
dependencies:
- drupal:jsonapi
@@ -9,7 +9,7 @@ use Drupal\Core\Field\FieldItemListInterface;
/**
* Implements hook_entity_field_access().
*/
function materio_jsonapi_entity_field_access($operation, FieldDefinitionInterface $field_definition, AccountInterface $account, FieldItemListInterface $items = NULL) {
function materio_jsonapi_entity_field_access($operation, FieldDefinitionInterface $field_definition, AccountInterface $account, ?FieldItemListInterface $items = NULL) {
if ($field_definition->getName() == 'roles' && $operation == 'view') {
$user = $items->getEntity();
if($account->id() == $user->id() && !$user->hasPermission('materio_jsonapi roles')){
@@ -2,7 +2,7 @@ name: Materio Mailjet
description: Add support for MailJet Webhooks.
package: Materio
type: module
core_version_requirement: ^8.8 || ^9 || ^10.2
core_version_requirement: ^8.8 || ^9 || ^10.2 || ^11
dependencies:
- mailjet:mailjet
@@ -1,7 +1,7 @@
name: Materio Samples
type: module
description: "Provide a sample field, each showroom (taxonomy term) can fill it's own sample reference, and only it's own"
core_version_requirement: ^8.8 || ^9.2 || ^10.2
core_version_requirement: ^8.8 || ^9.2 || ^10.2 || ^11
package: Materio
dependencies:
- taxonomy
@@ -6,7 +6,6 @@ use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Field\WidgetBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\user\Entity\User;
use Drupal\workflow\Entity\WorkflowManager;
/**
* Plugin implementation of the 'materio_samples_default_widget' widget.
@@ -85,7 +84,7 @@ class SamplesDefaultWidget extends WidgetBase {
$delta = 0;
foreach ($this->getShowroomTerms() as $term) {
$tid = $term->id();
$is_hidden = WorkflowManager::getCurrentStateId($term, 'field_workflow') === 'workflow_hidden';
$is_hidden = workflow_node_current_state($term, 'field_workflow') === 'workflow_hidden';
$location = $locations[$tid] ?? '';
// Preserve values of workflow-hidden showrooms so a save never drops
@@ -1,7 +1,7 @@
name: Materio Serach API
type: module
description: 'Search Api Materio module'
core_version_requirement: ^8.8 || ^9.2 || ^10.2
core_version_requirement: ^8.8 || ^9.2 || ^10.2 || ^11
package: 'Materio'
dependencies:
- search_api
@@ -20,6 +20,13 @@ use Drupal\core\render\RenderContext;
*/
class AjaxSearchForm extends ControllerBase {
/**
* The built form array.
*
* @var array
*/
protected $form_builded;
/**
* The form builder.
*
@@ -17,7 +17,47 @@ use Drupal\search_api\Entity\Index;
*/
class Base extends ControllerBase {
/**
* The search index.
*
* @var \Drupal\search_api\IndexInterface|null
*/
protected $index;
/**
* The request parameters.
*
* @var array
*/
protected $allparams;
/**
* The search keys.
*
* @var string
*/
protected $keys;
/**
* The search results.
*
* @var array
*/
protected $results;
/**
* The search queries and counters.
*
* @var mixed
*/
protected $phrase_query, $and_query, $or_query, $query, $count_query, $count, $exactematch_count;
/**
* Filter and term values.
*
* @var mixed
*/
protected $filters, $terms, $items;
private $limit = 15;
private $offset = 0;
@@ -19,9 +19,6 @@ class CountryNameComputed extends FieldItemList {
$country_name = $full_country_list[$country_code];
$lang = \Drupal::languageManager()->getCurrentLanguage()->getId();
$translated_markup = $country_name->render();
if($parent->id() == 5719){
$t="t";
}
$this->list[0] = $this->createItem(0, $translated_markup);
}
}
@@ -82,8 +82,8 @@ class MaterioSapiSearchForm extends FormBase {
// '#type' => "label",
//
// ]
$query = \Drupal::entityQuery('taxonomy_term');
$query->condition('vid', "assisted_research")
$query = \Drupal::entityQuery('taxonomy_term')
->condition('vid', "assisted_research")
->accessCheck(TRUE)
->sort('field_weight', 'ASC');
$tids = $query->execute();
@@ -143,7 +143,7 @@ class MaterioSapiSearchForm extends FormBase {
public function submitForm(array &$form, FormStateInterface $form_state) {
// Display result.
foreach ($form_state->getValues() as $key => $value) {
drupal_set_message($key . ': ' . $value);
\Drupal::messenger()->addStatus($key . ': ' . $value);
}
}
@@ -1,7 +1,7 @@
name: Materio Simple News
type: module
description: 'Simple News extensions Materio module'
core_version_requirement: ^8.8 || ^9.2 || ^10.2
core_version_requirement: ^8.8 || ^9.2 || ^10.2 || ^11
package: 'Materio'
dependencies:
- simplenews
@@ -1,5 +1,5 @@
name: 'materio_user'
type: module
description: ''
core_version_requirement: ^8.8 || ^9.2 || ^10.2
core_version_requirement: ^8.8 || ^9.2 || ^10.2 || ^11
package: 'Materio'
@@ -16,6 +16,27 @@ use Symfony\Component\HttpFoundation\JsonResponse;
*/
class AjaxLoginBlock extends ControllerBase {
/**
* The block ID.
*
* @var string
*/
protected $bid;
/**
* The block entity.
*
* @var \Drupal\block\Entity\Block|null
*/
protected $block;
/**
* The rendered block build array.
*
* @var array
*/
protected $block_builded;
private function getBlockDefinition(){
// $language = \Drupal::languageManager()->getCurrentLanguage()->getId();
// \Drupal::logger('materio_user')->notice($language);
@@ -20,6 +20,13 @@ use Drupal\core\render\RenderContext;
*/
class AjaxLoginForm extends ControllerBase {
/**
* The built form array.
*
* @var array
*/
protected $form_builded;
/**
* The form builder.
*
@@ -20,6 +20,13 @@ use Drupal\core\render\RenderContext;
*/
class AjaxRegisterForm extends ControllerBase {
/**
* The built form array.
*
* @var array
*/
protected $form_builded;
/**
* The form builder.
*
@@ -1,7 +1,7 @@
name: Vue Link Formatter
type: module
description: 'Provides a simple vue link field formatter with vue attributes as @click.'
core_version_requirement: ^8 || ^9 || ^10.2
core_version_requirement: ^8 || ^9 || ^10.2 || ^11
package: Fields
# version: VERSION
dependencies: