Deprecated function: group_entity_field_access(): Implicitly marking parameter $items as nullable is deprecated

Created on 27 February 2025, about 2 months ago

I am in the process of upgrading to PHP 8.4, and came across this deprecated small issue

For users using the opigno ggroup module, even the latest available version "drupal/ggroup": "^2.0@RC" has:
"require": {
"drupal/group": "^2.0"
},

For me, I am (for now) stuck using "drupal/ggroup": "^1.0@alpha", which seems like group v1.6.0 is the highest I can go for now.

[26-Feb-2025 20:34:46 UTC] Failed to log error: Deprecated function: group_entity_field_access(): Implicitly marking parameter $items as nullable is deprecated, the explicit nullable type must be used instead in include_once() (line 153 of my_drupal_app/core/lib/Drupal/Core/Extension/Extension.php). #0 my_drupal_app/core/includes/bootstrap.inc(166): _drupal_error_handler_real(8192, 'group_entity_fi...', '/Applications/M...', 380)
#1 my_drupal_app/core/lib/Drupal/Core/Extension/Extension.php(153): _drupal_error_handler(8192, 'group_entity_fi...', '/Applications/M...', 380)
#2 my_drupal_app/core/lib/Drupal/Core/Extension/Extension.php(153): include_once('/Applications/M...')
#3 my_drupal_app/core/lib/Drupal/Core/Extension/ModuleHandler.php(128): Drupal\Core\Extension\Extension->load()
#4 my_drupal_app/core/lib/Drupal/Core/Extension/ModuleHandler.php(141): Drupal\Core\Extension\ModuleHandler->load('group')
#5 my_drupal_app/core/lib/Drupal/Core/DrupalKernel.php(615): Drupal\Core\Extension\ModuleHandler->loadAll()
#6 my_drupal_app/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(46): Drupal\Core\DrupalKernel->preHandle(Object(Symfony\Component\HttpFoundation\Request))
#7 my_drupal_app/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#8 my_drupal_app/core/modules/page_cache/src/StackMiddleware/PageCache.php(116): Drupal\Core\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#9 my_drupal_app/core/modules/page_cache/src/StackMiddleware/PageCache.php(90): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#10 my_drupal_app/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#11 my_drupal_app/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#12 my_drupal_app/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#13 my_drupal_app/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#14 my_drupal_app/core/lib/Drupal/Core/DrupalKernel.php(741): Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#15 my_drupal_app/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#16 {main}
function group_entity_field_access($operation, FieldDefinitionInterface $field_definition, AccountInterface $account, FieldItemListInterface $items = NULL) {
  // Can't retrieve an entity from an empty item list.
  if (!isset($items)) {
    return AccessResult::neutral();
  }
🐛 Bug report
Status

Active

Version

1.6

Component

Code

Created by

🇺🇸United States jakegibs617

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @jakegibs617
  • 🇮🇳India divyansh.gupta Jaipur

    Working on it.

  • 🇮🇳India divyansh.gupta Jaipur

    I was able to reproduce this issue and the patch applied successfully and fixed the issue for me.
    Please review.

  • 🇺🇸United States jakegibs617

    that patch applied, but since we are fixing 1.6 group for php 8.4, I found more to update:

    PHP Deprecated:  Drupal\group\GroupMembershipLoader::loadByUser(): Implicitly marking parameter $account as nullable is deprecated, the explicit nullable type must be used instead in /Applications/MAMP/htdocs/my_app/modules/contrib/group/src/GroupMembershipLoader.php on line 104
    
    Deprecated: Drupal\group\GroupMembershipLoader::loadByUser(): Implicitly marking parameter $account as nullable is deprecated, the explicit nullable type must be used instead in /Applications/MAMP/htdocs/my_app/modules/contrib/group/src/GroupMembershipLoader.php on line 104
    
    PHP Deprecated:  Drupal\group\GroupMembershipLoaderInterface::loadByUser(): Implicitly marking parameter $account as nullable is deprecated, the explicit nullable type must be used instead in /Applications/MAMP/htdocs/my_app/modules/contrib/group/src/GroupMembershipLoaderInterface.php on line 53
    
    Deprecated: Drupal\group\GroupMembershipLoaderInterface::loadByUser(): Implicitly marking parameter $account as nullable is deprecated, the explicit nullable type must be used instead in /Applications/MAMP/htdocs/my_app/modules/contrib/group/src/GroupMembershipLoaderInterface.php on line 53
    
    PHP Deprecated:  Drupal\group\Entity\Controller\GroupContentController::editFormTitle(): Implicitly marking parameter $_entity as nullable is deprecated, the explicit nullable type must be used instead in /Applications/MAMP/htdocs/my_app/modules/contrib/group/src/Entity/Controller/GroupContentController.php on line 271
    
    Deprecated: Drupal\group\Entity\Controller\GroupContentController::editFormTitle(): Implicitly marking parameter $_entity as nullable is deprecated, the explicit nullable type must be used instead in /Applications/MAMP/htdocs/my_app/modules/contrib/group/src/Entity/Controller/GroupContentController.php on line 271
    
    PHP Deprecated:  Drupal\group\Form\GroupPermissionsTypeSpecificForm::buildForm(): Implicitly marking parameter $group_type as nullable is deprecated, the explicit nullable type must be used instead in /Applications/MAMP/htdocs/my_app/modules/contrib/group/src/Form/GroupPermissionsTypeSpecificForm.php on line 110
    
    Deprecated: Drupal\group\Form\GroupPermissionsTypeSpecificForm::buildForm(): Implicitly marking parameter $group_type as nullable is deprecated, the explicit nullable type must be used instead in /Applications/MAMP/htdocs/my_app/modules/contrib/group/src/Form/GroupPermissionsTypeSpecificForm.php on line 110
    
    PHP Deprecated:  Drupal\group\Form\GroupPermissionsRoleSpecificForm::buildForm(): Implicitly marking parameter $group_role as nullable is deprecated, the explicit nullable type must be used instead in /Applications/MAMP/htdocs/my_app/modules/contrib/group/src/Form/GroupPermissionsRoleSpecificForm.php on line 47
    
    Deprecated: Drupal\group\Form\GroupPermissionsRoleSpecificForm::buildForm(): Implicitly marking parameter $group_role as nullable is deprecated, the explicit nullable type must be used instead in /Applications/MAMP/htdocs/my_app/modules/contrib/group/src/Form/GroupPermissionsRoleSpecificForm.php on line 47
    
  • 🇺🇸United States jakegibs617

    still more now

    PHP Deprecated:  Drupal\group\Entity\Storage\GroupContentStorage::resetCache(): Implicitly marking parameter $ids as nullable is deprecated, the explicit nullable type must be used instead in /Applications/MAMP/htdocs/my_app/modules/contrib/group/src/Entity/Storage/GroupContentStorage.php on line 145
    
    Deprecated: Drupal\group\Entity\Storage\GroupContentStorage::resetCache(): Implicitly marking parameter $ids as nullable is deprecated, the explicit nullable type must be used instead in /Applications/MAMP/htdocs/my_app/modules/contrib/group/src/Entity/Storage/GroupContentStorage.php on line 145
    
    PHP Deprecated:  Drupal\group\Entity\Storage\GroupRoleStorage::resetUserGroupRoleCache(): Implicitly marking parameter $group as nullable is deprecated, the explicit nullable type must be used instead in /Applications/MAMP/htdocs/my_app/modules/contrib/group/src/Entity/Storage/GroupRoleStorage.php on line 283
    
    Deprecated: Drupal\group\Entity\Storage\GroupRoleStorage::resetUserGroupRoleCache(): Implicitly marking parameter $group as nullable is deprecated, the explicit nullable type must be used instead in /Applications/MAMP/htdocs/my_app/modules/contrib/group/src/Entity/Storage/GroupRoleStorage.php on line 283
    
    PHP Deprecated:  Drupal\group\Entity\Storage\GroupRoleStorageInterface::resetUserGroupRoleCache(): Implicitly marking parameter $group as nullable is deprecated, the explicit nullable type must be used instead in /Applications/MAMP/htdocs/my_app/modules/contrib/group/src/Entity/Storage/GroupRoleStorageInterface.php on line 94
    
    Deprecated: Drupal\group\Entity\Storage\GroupRoleStorageInterface::resetUserGroupRoleCache(): Implicitly marking parameter $group as nullable is deprecated, the explicit nullable type must be used instead in /Applications/MAMP/htdocs/my_app/modules/contrib/group/src/Entity/Storage/GroupRoleStorageInterface.php on line 94
    
    PHP Deprecated:  Drupal\group\Entity\Storage\GroupContentTypeStorage::resetCache(): Implicitly marking parameter $ids as nullable is deprecated, the explicit nullable type must be used instead in /Applications/MAMP/htdocs/my_app/modules/contrib/group/src/Entity/Storage/GroupContentTypeStorage.php on line 141
    
    Deprecated: Drupal\group\Entity\Storage\GroupContentTypeStorage::resetCache(): Implicitly marking parameter $ids as nullable is deprecated, the explicit nullable type must be used instead in /Applications/MAMP/htdocs/my_app/modules/contrib/group/src/Entity/Storage/GroupContentTypeStorage.php on line 141
    
    PHP Deprecated:  Drupal\group\Entity\Access\QueryAccessHandlerBase::getConditions(): Implicitly marking parameter $account as nullable is deprecated, the explicit nullable type must be used instead in /Applications/MAMP/htdocs/my_app/modules/contrib/group/src/Entity/Access/QueryAccessHandlerBase.php on line 83
    
    Deprecated: Drupal\group\Entity\Access\QueryAccessHandlerBase::getConditions(): Implicitly marking parameter $account as nullable is deprecated, the explicit nullable type must be used instead in /Applications/MAMP/htdocs/my_app/modules/contrib/group/src/Entity/Access/QueryAccessHandlerBase.php on line 83
    
  • 🇺🇸United States jakegibs617

    jakegibs617 changed the visibility of the branch 3509416-deprecated-function-groupentityfieldaccess to hidden.

  • 🇮🇳India shivam_tiwari

    This issue was found for me on Drupal 10.3.10 with PHP 8.4
    After installing modules, I am getting 500 error page with a white screen. MR 225 is working fine for me so moving it to RTBC.
    Adding some testing evidence related to it.

Production build 0.71.5 2024