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.
I installed modal_forms and found the blank field was not hidden. I will not be using modal_forms for now as there are other problems, but it may be a useful feature. Not sure if it qualifies as a bug that it does not already work.
Comment | File | Size | Author |
---|---|---|---|
#19 | hide_blank_field_when-1355374-18.patch | 2.39 KB | annya |
#10 | scc-honeypot-attached-css-missing.png | 134.38 KB | vegantriathlete |
#10 | scc-user-register-honeypot-no-modal.png | 146.83 KB | vegantriathlete |
#8 | scc-modal-form-honeypot-field.png | 80.88 KB | vegantriathlete |
Comments
Comment #1
geerlingguy CreditAttribution: geerlingguy commentedFor some reason, CTools modals don't include the CSS that I inject into forms with Honeypot; I'm not sure why this happens (Honeypot simply uses the Drupal-standard way of attaching CSS to a form), and I can't find any issue in the CTools issue queue having to do with this.
I'm going to mark this as needs more info, as I don't use CTools modals that much, and I haven't encountered this problem; if someone could find out what, specifically, causes the CSS to not be attached to the modal properly, I'll try to fix it. (I'm guessing it's some sort of bug with CTools, but I may write around that if enough people encounter this problem).
Comment #2
John_B CreditAttribution: John_B commentedMaybe this core patch, which I assume will be in 7.10 (as it was committed days after 7.8 was released), will fix it?
http://drupal.org/node/561858
Comment #3
geerlingguy CreditAttribution: geerlingguy commentedIt does look like #561858: [Tests added] Fix drupal_add_js() and drupal_add_css() to work for AJAX requests too by adding lazy-load to AJAX framework could fix it. Please let me know if this is fixed for you once 7.10 is released (should be this week, since it's the end of the month...).
Comment #4
Daedalon CreditAttribution: Daedalon commentedJohn_B: Did this issue get fixed with latest Drupal?
Comment #5
John_B CreditAttribution: John_B commentedI have not tested it, am not using Ajax on any site. I may test it but do not have time to do so straight away.
Comment #7
geerlingguy CreditAttribution: geerlingguy commentedGoing to close this for now; if anyone can find anything that would help with this in the meantime, please re-open. Or, if this issue has fixed itself in the meanwhile, let us know!
Comment #8
vegantriathleteThis issue still exists (in D7 -- I haven't tested in D6). I have attached a screenshot. However, I have also informed one of the site maintainers that she can just add the {display: none !important;} to her CSS. So, you may not see the issue if you happen to visit that site.
Steps to reproduce.
1. Install modal_forms.
2. Navigate to admin/config/development/modal_forms and select Enable for register new account links.
3. Create a menu item to allow people to register for the site (path = user/register)
4. Install Honeypot.
5. Navigate to admin/config/content/honeypot and either select Protect all forms with honeypot or General Forms: User Registration form.
6. Log out of the site.
7. Click the link to register.
Comment #9
geerlingguy CreditAttribution: geerlingguy commentedOkay, thanks for the detailed steps! I'll try to take a look at this soon.
Comment #10
vegantriathleteHere's another screen shot that shows that your #attached CSS is not appearing.
There's also a screenshot to show what it looks like when navigating directly to user/register on the site and you can see that your #attached CSS is there.
Comment #11
John Pitcairn CreditAttribution: John Pitcairn commentedWe have a custom non-iframe modal implementation which loads a drupal path into itself via a jquery $.ajax call. The form in question is a custom form which calls honeypot_add_form_protection().
We can add our own css to hide the honeypot field in the code that sets up the modal on the parent page, but I am thinking that it would be nice if honeypot could break out the code that generates the css rule into a public function, so we could just call that and not have to worry about how the specifics of the selector or the hide rule.
Comment #12
lstirk CreditAttribution: lstirk commentedAny update on this? have the same problem
Comment #13
annya CreditAttribution: annya commentedHi
This is a problem of core Ajax Framework, it didn't include CSS inline properties. Attached pathe solev this proble and replace inline css styles on file. Necessary actions:
1. Apply patch
2. Run update.php
Comment #14
annya CreditAttribution: annya commentedAdd line to the end of file.
Necessary actions:
1. Apply patch
2. Run update.php
Comment #15
annya CreditAttribution: annya commentedFix coding standart and one fatal error.
Comment #16
Arlina CreditAttribution: Arlina commented#15 works for me.
Comment #17
geerlingguy CreditAttribution: geerlingguy commentedFinally had time to review this code, and it looks like a great solution to the problem, especially since it will still work perfectly with CSS aggregation and not cause any extra problems. A few nitpicks before I finally add the patch:
Can you stick this as an inline comment above cache_clear_all, so the documentation isn't lost?
Can you change this to "Honeypot admin form submit callback." instead?
I'd rather have this in a separate function (so it has a cleaner interface, and so it could potentially be called from other settings-related functions).
Remove extra space before honeypot, and capitalize Honeypot/CSS.
Same thing, please capitalize CSS (nitpicky, I know... ;).
Is this line required? The docs are a little sparse on #attached, but I thought you just pass a path to a file, and Form API is happy. I could definitely be wrong, but just wondering :)
Comment #18
annya CreditAttribution: annya commented@Arlina thank you for testing patch and updating issue.
@geerlingguy thank you for review. I fixed all notes and here is patch.
Comment #19
annya CreditAttribution: annya commentedOops, wrong patch. Here is correct.
Comment #20
annya CreditAttribution: annya commentedI think I can set this issue as RBTC, cause it was checked by geerlingguy previously.
Comment #21
geerlingguy CreditAttribution: geerlingguy commentedSorry I've taken so long to get around to this; I will try to commit it to dev branch within the next week or so.
Comment #24
geerlingguy CreditAttribution: geerlingguy commentedI've committed the patch from #20 with a few minor changes (added a 'create css' call to hook_install, so the module would have a CSS file in place if the user doesn't go to the admin form and submit it, and changed a couple comment lines). Thanks so much for the help on this!
I'm going to leave this feature in the -dev branch for a little while, then tag a new version once I've confirmed it works on all the sites on which I use Honeypot (since it changes the way CSS is generated and applied, I want to make sure we're not missing any use case).
Comment #26
dokumori CreditAttribution: dokumori commentedhmm, how is the css file loaded without adding it through drupal_add_css()?
Comment #27
dokumori CreditAttribution: dokumori commentednevermind - my oversight: