contact_flood_control() in ContactFormBlock::build() appears to be totally bogus - I can find no D6, D7 or D8 API reference for this? An attempt is made to include contact.pages.inc, but (in D7) that contains no such function anyway.

I guess we should be retrieving contact module's flood configuration, then doing doing something like:

$flood = \Drupal::flood();
if (!$flood->isAllowed('contact', $time, $interval) {
  // Set a message and throw a Symfony access denied error?
}

But I don't think flood control on the core contact page is working yet anyway.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

John Pitcairn’s picture

John Pitcairn’s picture

Status: Active » Needs work
FileSize
928 bytes

This patch removes the flood control check and adds a todo comment, so the module is at least usable for now.

John Pitcairn’s picture

Title: contact_flood_control() does not exist - how can the flood control check be handled? » Implement D8 flood control
Issue summary: View changes
mikey_p’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.