@debrup Hey, thanks for checking this out! Apologies, that screenshot is from our production set up, and I only included it to show the "Should not by null" error appearing on all the fields. Please follow the reproduction steps in the original post.
If you still can't reproduce let me know, I will try to reproduce again and create better instructions.
michael.garrido → created an issue.
I can also confirm this issue happens with Flood Control and Drupal Shield module enabled, using Drupal 10.2.6. Doesn't seem to occur in Drupal 10.1.8.
This seems to be due to the isIpWhitelisted function trying to call the flood_control_get_whitelist_ips function that is defined in the flood_control.module file:
<?php
...
protected function isIpWhitelisted(string $ipAddress = ''): bool {
$request = $this->requestStack->getCurrentRequest();
if ($request && !$ipAddress) {
$ipAddress = $request->getClientIp() ?? '';
}
// Gets the values from the config.
$ipsWhiteList = flood_control_get_whitelist_ips();
.....
?>
it seems to be failing to resolve that particular function when called from that location. Oddly enough, in Form/FloodControlSettingsForm.php, the code does a similar call:
<?php
...
public function validateForm(array &$form, FormStateInterface $form_state) {
// Validating whitelisted ip addresses.
$whitelistIps = flood_control_get_whitelist_ips($form_state->getValue('ip_white_list'));
// Checking single ip addresses.
if (!empty($whitelistIps['addresses'])) {
foreach ($whitelistIps['addresses'] as $ipAddress) {
if (!filter_var($ipAddress, FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE)) {
$form_state->setErrorByName('ip_white_list', $this->t('IP address %ip_address is not valid.', ['%ip_address' => $ipAddress]));
}
}
}
.....
?>
But that one does NOT cause an error.
The error seems to partly stem from the namespace causing PHP to look in the wrong spot, IE its looking for Drupal\flood_control\flood_control_get_whitelist_ips(), but since that function isn't in the Drupal/flood_control namespace, it fails. However, I did try doing something like:
<?php
...
protected function isIpWhitelisted(string $ipAddress = ''): bool {
....
$ipsWhiteList = \flood_control_get_whitelist_ips();
....
?>
But it results in essentially the same error (and I'm not sure if that is even that way to go about that anyways).
I'm not sure whether this is an issue with the flood control module itself, or some issue introduced by core that is causing this issue with resolving the function.
michael.garrido → created an issue.