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.

A few post-2.2.1 upgrade problems (safecracker / captcha / javascript)

July 28, 2011 4:07pm

Subscribe [6]
  • #1 / Jul 28, 2011 4:07pm

    dehuszar

    99 posts

    Hi all,

    I just upgraded to EE 2.2.1 from 2.1.3 and got caught by the issues with JavaScript getting parsed when used as a path or embed from templates.  I since set debugging to “1”, and moved my JS out of EE templates, but that’s a serious hassle.  I tried using the patch, but it didn’t make a difference.  I tend to use EE conditionals in my CSS and JS and to have to take them out of the template system definitely hampers how I work.  Is using the templates for JS just not functioning at present?

    Second, I have a Safecracker form which since having upgraded, no longer displays my Captcha code.  Here’s how it’s written in the template:

    {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" />
       {/if}

    Pretty boilerplate.  Worked before the upgrade, but not after.  I have a contact form which uses form logic brought over from the original site (which I’m replacing after I finish what I’m stuck on), and not safecracker or saef to process the form.  But I slipped the {captcha} code over to that form and it works fine, and I’m seeing new Captcha images being written to /images/captchas/ on page refreshes.  ...so I think my Captcha configuration is okay.

    Looking at my Health Check plugin I noticed that while my safecracker module has been upgraded to 2.1, my Safecracker file and Safecracker catchall fields are still displaying as version 1.0.1.  I am using the safecracker_file fieldtype in this form and wonder whether a version mismatch between addons might be contributing to the problem.  Did either safecracker_file and safecracker_catchall get upgraded or deprecated?

    Thanks in advance,
    Sam

  • #2 / Jul 29, 2011 1:12pm

    Kevin Smith

    4784 posts

    Hi dehuszar,

    Using templates for your JS should be working just fine. Do you have the latest download of ExpressionEngine running on your site? I’m not sure I fully understand the issues you’re facing with the JavaScript. Could you go into more detail?

    Also, the safecracker module folder should be located in ./system/expressionengine/modules, while safecracker_file should be located in ./system/expressionengine/third_party. Could you check to make sure those paths are correct?

    SafeCracker File should definitely be at version 2.1, so that’s probably your issue there. Regarding Catchall, that’s still a BarrettNewton add-on, so I’d check here for an upgrade.

  • #3 / Jul 29, 2011 3:13pm

    dehuszar

    99 posts

    Hi Kevin,

    With regards to the JavaScript issues, I’m referring to this issue: http://ellislab.com/forums/viewthread/193583/

    It’s supposed to be resolved, but only to the extent that you keep JavaScript out of templates and set debug=“1” in your config file. But as I want to use conditionals in my templates it’s not really a solution for my needs.

    As for the safecracker issue, I’ll look for upgrades and check back.

    In the meantime, thanks for your help!

  • #4 / Jul 31, 2011 8:35pm

    dehuszar

    99 posts

    So, I’m not finding any downloads for a 2.2.1 compatible version of safecracker_file.  I’m guessing I’ll have to re-upload from the EE 2.2.1 installer package?  I thought I already did this though.  What files should I be copying over to upgrade the fieldtype?

  • #5 / Aug 01, 2011 1:03pm

    Kevin Smith

    4784 posts

    Right, the safecracker_file folder is part of the EE package download, and it’s located at ./system/expressionengine/third_party inside the package. Just look for it there and upload it to the same respective directory on your server.

    I can definitely understand how it would hamper your work to take your JS out of templates, so let me ask around and see what the best practice for that sort of things is now.

  • #6 / Aug 01, 2011 2:09pm

    dehuszar

    99 posts

    The Health Check plugin is still reporting safecracker_file as 1.0.1 after upgrade, but the AddOns->Fieldtypes page reports v2.1.

    The captchas still don’t work.  As mentioned above, the captchas displayed prior to upgrade, but not after.  Paths haven’t changed, the captchas folder has permissions of 777, no captchas.

    I have tried unchecking TrueType usage and the random number generation, but no dice.  I have checked the require logged-in users checkbox as well.

    Here’s the full code in case I’m missing some detail:

    
    
    

    I have a captcha in a form elsewhere which also doesn’t work, so I’m fairly confident that it’s not a template issue.  Regardless, I checked out the Debugging output and didn’t see anything that jumped out.  I also reviewed the Member Group and Channel Preferences to make sure there were no permissions out of place or new relevant permissions to set.  All things point to Captchas working as they did before.  Are there any EE logs for that sort of thing?

    I would really like to get this sorted out quickly.  My work on these forms are ready to launch as soon as I can get those captchas working again.

    Thanks in advance.

  • #7 / Aug 01, 2011 2:18pm

    dehuszar

    99 posts

    Quick clarification and an update…  When I say above, “the captchas folder has permissions of 777, no captchas” I mean there are no captchas displaying. 

    The captchas folder is filled with captchas, and there are image files with today’s date and appear to display fine when loaded in an image browser. 

    The “no captchas” was to indicate that I am unable to see any indication of the captcha tags being processed.  This gave me the idea to try stripping the conditional {if captcha}. 

    Sure enough, removing the conditional caused Captchas to display properly, so it appears there may be an issue with some updated code logic which checks whether or not to load captchas, or perhaps a variety of different tags.

    I’ll comment out the conditional in the meantime, but this might need to be filed with the bug tracker.

  • #8 / Aug 03, 2011 3:12pm

    Brandon Jones

    5500 posts

    Hi dehuszar,

    I’m not able to replicate this, unfortunately. If you turn CAPTCHAs *off* for a member group, does this conditional evaluate correctly?

    {if captcha == FALSE}
       CAPTCHA is disabled
    {/if}
  • #9 / Aug 08, 2011 9:22am

    bgarrant

    356 posts

    I have also verified this issue.  If you remove the conditional, the CAPTCHA display correct in SafeCracker form.  Is this a bug?

  • #10 / Aug 08, 2011 11:57am

    dehuszar

    99 posts

    Hi Brandon,  Thanks for your reply. 

    So, I have tried including your code in the offending templates and even with CAPTCHAs turned ON for the member groups in question your conditional displays.

  • #11 / Aug 08, 2011 12:01pm

    bgarrant

    356 posts

    I can only make mine display by removing the conditional.  Once I do that all works as expected.  I want it to show all the time on this form so it is OK, but can’t figure our why the conditional {if captcha}{/if} causes the CAPTCHA to fail in 2.2.1 with SafeCracker.

  • #12 / Aug 08, 2011 12:21pm

    dehuszar

    99 posts

    Hi bgarrant,

    I am seeing what you are seeing.  I was referring to Brandon’s {if captcha == FALSE} conditional’s contents displaying, even when CAPTCHA wasn’t disabled.  Sort of the same issue as our initial concern but approaching it from a different vector.

    Can you try Brandon’s {if captcha == FALSE}CAPTCHA is disabled{/if}, but leave the CAPTCHA requirement in place for your members?  It “shouldn’t” display, but it is on my end.

  • #13 / Aug 08, 2011 12:25pm

    bgarrant

    356 posts

    Same here.  For some reason the {if captcha}{/if} conditional seems to be ignored in 2.2.1 when using SafeCracker.  Very odd as it works in all other versions I have used.  Seems like it has to be a bug of some kind.

  • #14 / Aug 09, 2011 11:57am

    Mediakitchen

    261 posts

    Removed as resolved my issue - silly missing bracket:)

  • #15 / Aug 09, 2011 12:02pm

    bgarrant

    356 posts

    Take out all conditionals and just try the {captcha} code.  The problem seems to be when the {captcha} tag is surrounded by the conditional like {if captcha}{captcha}{/if}.  If you have a form that you want it to always show on, just remove that conditional and it should work.

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

ExpressionEngine News!

#eecms, #events, #releases