Whenever a form with a honeypot is loaded, I get an error page, and the following exception is logged:
Uncaught PHP Exception LogicException: "You are not allowed to use css in #attached" at /var/www/drupal/core/includes/common.inc line 1719
The offending code inside honeypot.module (in honeypot_add_form_protection() is:
// Hide honeypot.
'#attached' => [
'css' => [
'.' . $honeypot_class . ' { display: none !important; }' => ['type' => 'inline'],
],
],
Since there was a recent commit that removed the ability to attach dynamically-generated CSS and JS using #attached, we might have to architect a new solution or go back to the D6 method of having a static (and more easily bot-defeatable) class for the honeypot form. See my comments in #2391025: Add support for inline JS/CSS with #attached.
Until then, Honeypot is broken on D8 HEAD.
Comments
Comment #1
geerlingguy commentedComment #2
geerlingguy commentedThe following code may work... testing:
Comment #3
geerlingguy commentedComment #4
geerlingguy commentedComment #6
geerlingguy commentedFixed.
Comment #9
geerlingguy commentedSilly testbot.