- Issue created by @ankithashetty
- Merge request !4Issue #3422842: Handled empty check for 'mappings'. → (Open) created by ankithashetty
- Status changed to Needs review
9 months ago 5:42am 21 February 2024
After security updates to the site (core version - 9.5.11) and updating the PHP version to 8.1, been seeing this PHP error in logs during saml_login.
"PHP message: TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in
/web/modules/contrib/saml_attributes_mapping/src/Controller/SamlAttributesMappingController.php on line 66 #0
/web/modules/contrib/saml_attributes_mapping/src/Controller/SamlAttributesMappingController.php(66): count()
#1 /web/modules/contrib/saml_attributes_mapping/saml_attributes_mapping.module(53): Drupal\saml_attributes_mapping\Controller\SamlAttributesMappingController->getSamlAttributes()
#2 [internal function]: saml_attributes_mapping_simplesamlphp_auth_user_attributes()
#3 /web/core/lib/Drupal/Core/Extension/ModuleHandler.php(417): call_user_func_array()
#4 /web/modules/contrib/simplesamlphp_auth/src/EventSubscriber/SimplesamlExternalauthSubscriber.php(102): Drupal\Core\Extension\ModuleHandler->invoke()
#5 [internal function]: Drupal\simplesamlphp_auth\Event"
Add a check in https://git.drupalcode.org/project/saml_attributes_mapping/-/blob/1.0.x/src/Controller/SamlAttributesMappingController.php?ref_type=heads#L66 to handle when $mappings is null
.
NA
NA
NA
NA
Needs review
1.1
Code