Tested against the alpha-4 release of code various configuration settings problems.

For example setting the option to log to watchdog had not effect, setting to work on article comment forms had no effect.

Patch to fix most issues to follow, shortly.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

chris_hall_hu_cheng’s picture

Status: Active » Needs review
FileSize
4.46 KB

The patch makes a few changes in honeypot.module ..
I have updated config() calls (deprecated) to use \Drupal::config
I have updated variable_gets where present to use \Drupal::config
'expiry' does not seem to get set anywhere in configuration, I have defaulted both instances to 300.

Not sure of best practice (anywhere in D8 to be honest ;) as core is not consistent) but if \Drupal::config('honeypot.settings') called more than once in a function, I have set it to a $config variable.

There is still an issue with individual form settings, but that seems to be due to form ids changing, for example the comment form ids I saw were no longer type specific and were 'node__comment_comment_form' maybe they only become type specific if you add fields to them now or maybe a D8 bug.

geerlingguy’s picture

I think I'll need to try to create more tests to make sure these things don't break again! Thanks for the help; I'll try to review these changes ASAP, and maybe create an 8.x-1.15 alpha release.

chris_hall_hu_cheng’s picture

The form_id for comments could be a pain going forward, on my alpha-4 test installation they all report that generic 'node__comment_comment_form'

I am finding it quite a chore keeping up with D8 at the moment, when I get the blog module working with alpha 4 (and my site ;() going to look at the PHPUnit testing, I suspect it may be simpler and more appropriate in the long run for full coverage, but currently have no idea what the official approach is or whether that can be automated also.

geerlingguy’s picture

Issue summary: View changes
Status: Needs review » Closed (fixed)

I think this was actually fixed in another commit in the past couple months; sorry I missed this patch!

chris_hall_hu_cheng’s picture

No worries, seem to remember it was partial and tentative at the time, probably just based on me getting one of the settings (logging) to work on my D8 site in early alpha and I doubt it would work now.

BTW that version of Honeypot is still happily blocking 4 or 5 comment spam attempts for me every minute of the day :)

I will be migrating/upgrading when beta comes out, will try the latest version out then, a very useful addition to D8!!

geerlingguy’s picture

@chris_hall_hu_cheng - nice! I'm guessing you're one of the two current users of Honeypot for D8, according to the project usage stats :-)