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,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')){