ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Safecracker Not Displaying Captcha

September 26, 2011 11:48am

Subscribe [4]
  • #1 / Sep 26, 2011 11:48am

    Joelle

    272 posts

    This question may be related to a resolved thread.

    This is my first time working with Safecracker. The aforementioned thread helped—a little—but I’m still not seeing the Captcha.

    The client needs anonymous, non-logged in posts to their ‘guestbook’ (It’s an author).  They need anyone to be able to leave a message and it goes into a pending status.

    I’ve got the status set, I’ve got the member created (I created a faux member called “Guestbook” and it’s part of the “Guestbook” member group.)

    I assigned this member to the form. I gave permissions for this member to post to this channel.

    But shouldn’t I still see the captcha form? We want the captcha for all non-logged-in posters. Here is my form:

    {exp:safecracker id="guestbook_form" channel="guestbook" return="guestbook/thanks" }
     <div class="guestbook_form">
     <label>Message Subject:*</label>
     <input name="title" type="text" /></p> 
     <label>Your Name:*</label>
     {field:guestbook_name}
    
     <label>Your Email:*</label>
     {field:guestbook_email}
    
     <!--<label>Your URL: (optional)</label>
     {field:guestbook_url}-->
    
     <label>Enter Your Message:*</label>
     {field:guestbook_body}
    
    
     {if captcha}
     <label for="captcha">Please enter the word you see in the image below:</label>
     {captcha}
     <input type="text" name="captcha" value="{captcha_word}" maxlength="20" /></p>
     {/if}
    
     * All fields are required.
     <input type="submit" class="submit" value="Submit" /></p>
     </div>
     {/exp:safecracker}

    I’m not sure what I’m missing here. I did all the things mentioned in that previous post—gave access to the channel, etc. Also, the Captcha settings are on, site-wide, and have the correct paths set.

    Help??  Thank you!!

     

  • #2 / Sep 26, 2011 12:00pm

    Joelle

    272 posts

    To be clear, I’m not logged in when I’m looking for the captcha. I have a completely separate browser open that I’m not logged into.  The post goes through, but it says “you need to enter the captcha”, which doesn’t appear in the page or in the source.

  • #3 / Sep 26, 2011 12:37pm

    Joelle

    272 posts

    I noted the logged_out_member_id and added that to my form, as well as triple checking that it’s assigned in Safecracker to that channel. No change.

    If I remove the {if captcha} conditional, it appears just fine, so somewhere there’s a breakdown. I’m not doing something right ... but I don’t know what.

    *banging head*

  • #4 / Sep 26, 2011 12:57pm

    Joelle

    272 posts

    Here’s a revised version of the opening tag, showing all the things I’ve been trying:

    {exp:safecracker id="guestbook_form" logged_out_member_id="4" safecracker_head="no" channel="guestbook" include_jquery="no" return="guestbook/thanks" }

     

  • #5 / Sep 26, 2011 1:35pm

    Adrienne L. Travis

    213 posts

    This is almost certainly related to either not having an images/captcha directory, or having the wrong permissions on it. The failure mode on that is REALLY not graceful, and it has given me fits on more than one project. Check your “images/” directory for a “captcha” subdirectory, and make sure it’s set to 777.

  • #6 / Sep 26, 2011 1:38pm

    Joelle

    272 posts

    :(  Sadly, that didn’t work.  There is an images/captcha directory, the permissions are 777.  The paths are also correct to the captcha directory.

    When I remove {if captcha}, it works just fine, it displays and all is well. When I put the conditional there, it disappears. And I am definitely, positively logged out. I’ve checked in 4 browsers.

    Thank you, though! I really appreciate any help I can get here. 😊

  • #7 / Sep 26, 2011 3:34pm

    Joelle

    272 posts

    SO, the issue was this: the status tags have to be in the form for captcha to display. This seems silly—especially if you want anonymous guests to be able to post. They don’t need to select a status, or even know statuses exists—they’re guests—the admin should decide and the poster should never see that info. We tried passing the status through using a hidden field, but it wouldn’t display the Captcha when we did that. It *must* be showing or captcha won’t display.

    Seems weird to me. Is this a bug? If it’s not a bug, maybe consider updating that in the future? 😊

    (It’s been resolved for now by doing a display: none;)

  • #8 / Sep 26, 2011 5:46pm

    Adrienne L. Travis

    213 posts

    That’s really weird; I’ve certainly had hidden statuses work before with CAPTCHA tags. Sounds like a bug; what version of EE are you running?

  • #9 / Sep 26, 2011 11:13pm

    Dan Decker

    7338 posts

    Hi Joelle,

    I happy to see you got along to a resolution. I agree, having to *display* a status vs. a hidden field for captcha to works sounds like a bug, given the very specific nature of this. When trying to replicate, I couldn’t get captcha to display at all, even using the status tags. Definitely a bug of some sort.

    If you have have any other issues in the future, please feel free to start a new thread.

    Cheers,

  • #10 / Sep 26, 2011 11:13pm

    Dan Decker

    7338 posts

    resolved

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases