Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#1 | update-configuration-calls-2117621-1.patch | 4.46 KB | chris_hall_hu_cheng |
Comments
Comment #1
chris_hall_hu_cheng CreditAttribution: chris_hall_hu_cheng commentedThe 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.
Comment #2
geerlingguy CreditAttribution: geerlingguy commentedI 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.
Comment #3
chris_hall_hu_cheng CreditAttribution: chris_hall_hu_cheng commentedThe 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.
Comment #4
geerlingguy CreditAttribution: geerlingguy commentedI think this was actually fixed in another commit in the past couple months; sorry I missed this patch!
Comment #5
chris_hall_hu_cheng CreditAttribution: chris_hall_hu_cheng commentedNo 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!!
Comment #6
geerlingguy CreditAttribution: geerlingguy commented@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 :-)