- Issue created by @tostinni
- Merge request !1Issue #2588475 by Dom.: Clean-up 8.x-1.x repo branch for initial commit,... → (Open) created by tostinni
- Status changed to Needs review
10 months ago 4:01pm 7 February 2024
After submitting a new node/comment, we can see this notice :
Notice : Trying to access array offset on value of type bool dans anonymous_publishing_cl_node_presave() (/opt/www/drupal/web/modules/contrib/anonymous_publishing/modules/anonymous_publishing_cl/anonymous_publishing_cl.module line571)
This is due to an incorrect verification of the database result :
$result = \Drupal::database()
->select('anonymous_publishing_emails')
->fields('anonymous_publishing_emails', [
'email',
'ipaddress',
'blocked',
])
->condition('email', $node->anonymous_publishing_email)
->execute()
->fetchAssoc();
if ($result['email']) {
$result
can be a boolean so we need to test it correctly as it's been done in other place of this file.
$result = \Drupal::database()
->select('anonymous_publishing')
->fields('anonymous_publishing')
->condition('nid', $node->id())
->execute()
->fetchAssoc();
if (!empty($result) && !empty($result['email'])) {
Needs review
2.0
Code