Closed (fixed)
Project:
Honeypot
Version:
2.1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
2 Mar 2018 at 16:55 UTC
Updated:
2 May 2022 at 18:09 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
aaronbaumanAttached patch service-ifies honeypot_add_form_protection
Comment #4
aaronbaumanpatch namespace. derp.
Comment #5
markdorisonPatch no longer applies cleanly.
Comment #6
markdorisonRe-rolled patch.
Comment #7
markdorisonRe-rolled to include change from 090a23353b28b5c30c68dd171d2a03bf12a81d47.
Comment #9
markdorisonComment #10
markdorisonThis is working as expected in my testing.
Comment #11
geerlingguy commentedThis looks good to me in general, but a cursory glance shows a few coding standards issues (comments and spacing, mostly, in the new class). I will try to test a little further then merge soon!
Comment #12
markdorison@geerlingguy Thanks for catching that. Updated patch attached.
Comment #14
markdorisonTroubleshooting test failures.
Comment #15
manuel garcia commentedThis looks perfect to me, RTBC++
Only thing I can think of is that we should communicate this clearly (ie write a change record, or bold letters on the release notes), just in case someone is using it on their custom code.
Comment #16
mpp commentedWe should implement some deprecation items:
- A @deprecated PHPdoc tag;
- A @trigger_error('...', E_USER_DEPRECATED) at runtime
- A unit test proving the deprecation notice will be triggered when the deprecated code is called;
See https://www.drupal.org/core/deprecation
Comment #17
tr commentedI think this is a good idea.
This does represent an API change, so it would have to be deprecated in one version then removed in the next. In principle we could deprecate it in 8.x-1.x then remove it in 2.0.x. because this is a major version change.
Comment #18
tr commentedNew features should go into 2.0.x first at this point in time. That means it would have to be deprecated in 2.0.x and removed probably in 2.1.x or even 3.0.x.
Comment #19
tr commentedThis properly deprecates ALL the Honeypot API functions and moves them into a service. It also adds tests for the deprecations.
This patch is significantly larger and different from the previous patches, and all of those are >3 years old, so I'm essentially starting from scratch. I still want to clean up the code, but posting here to get feedback from the testbot and from any users who want to try this out.
My intention is to create a 2.1.x branch for API changes like this. That's reflected in the deprecation messages.
Comment #20
tr commentedComment #22
tr commentedIt is a never-ending source of frustration for me that code copied from Drupal core contains an excessive number of coding standards violations. Here is a new patch with many of those fixed, and hopefully with the test failure fixed as well.
Comment #24
tr commentedAgain.
Comment #26
tr commentedAgain. Debugging this on DrupalCI ...
Comment #28
tr commentedComment #30
tr commentedProgress, but everything since #20 is simply debugging the test case on the testbot - nothing is being changed in the actual code.
Comment #31
tr commentedTurns out the test actually found a bug in original version of
honeypot_get_protected_forms(), which sometimes improperly returns a NULL instead of an array. Here's a new patch which includes a fix for that.Comment #32
jonathan1055 commentedAs an aside, the deprecation coding standard warnings are incorrect, and are being fixed in #3192093: Deprecation error messages don't allow module:n.n.n versions
Comment #33
jonathan1055 commented#3192093: Deprecation error messages don't allow module:n.n.n versions is fixed, so when Core uses the next version of Coder, which will be 8.3.15 these coding standards messages will be gone.
Comment #34
tr commentedThanks jonathan!
Comment #35
tr commentedRe-roll to account for the fix in #3264627: honeypot_get_protected_forms() doesn't always return an array
Comment #36
tr commentedI forgot I also added an interface for the service.
Comment #37
tr commentedComment #38
tr commentedRe-rolled against current 2.1.x branch.
Comment #39
tr commentedCorrect the arguments to expectDeprecation() in the new test.
Comment #41
tr commentedCommitted #39.