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 stripping element style attributes

November 01, 2011 7:10pm

Subscribe [5]
  • #1 / Nov 01, 2011 7:10pm

    NAlbuquerque

    20 posts

    I’m having a strange issue with safecracker where it strips attributes from html elements in a textarea fieldtype. (This was also happening with a WYGWAM fieldtype, so I turned it into a textarea to troubleshoot.)

    For example, the style attribute on an image gets completely stripped when posted via safecracker. However, if I post via CP it’s fine.

    The fieldtype is set to textarea with XHTML formatting. If I manually add the style=“border:1px solid red” to the CP it posts and displays in the template fine.

    If I try the same thing via a safecracker form, the style attribute gets completely removed when I post.

    Any ideas of why this might be happening?

    I should add that I am running the latest version of EE (2.3.1).

  • #2 / Nov 02, 2011 3:59pm

    Sue Crocker

    26054 posts

    Hi, NAlbuquerque.

    I’d like to see if I can re-create the issue on a brand new version of EE 2.3.1. Can you post what you have in your SC form?

  • #3 / Nov 02, 2011 4:22pm

    Maheradmin

    22 posts

    Hi Sue, here is simplified form which I used to troubleshoot on a blank template. My channel only consists of a single WYGWAM fieldtype—although I’ve changed it to a textarea and it does the same thing.

    {exp:safecracker channel="group_posts" entry_id="{segment_4}" return="groups/view/{segment_3}" dynamic="no" include_jquery="yes"}
      
     
      <label for="title">Title</label>
      <input name="title" type="text" value="{title}">
     
         
    
     {field:group_posts_body}
    
       <input type="submit" value="Submit" class="no-padding">
    
    {/exp:safecracker}

     

  • #4 / Nov 04, 2011 2:59pm

    Kevin Smith

    4784 posts

    Hi Maheradmin (and NAlbuquerque?),

    I was able to replicate the problem you posted about. Definitely looks like a bug, so I posted a bug report on your behalf here. I’d recommend adding a comment to that bug report so that you’re updated when a solution is posted.

    Thanks for letting us know about this bug!

  • #5 / Nov 04, 2011 3:14pm

    NAlbuquerque

    20 posts

    Thanks for the follow up!

  • #6 / Nov 07, 2011 4:09pm

    Dan Decker

    7338 posts

    Ji NAlbuquerque,

    Since Kevin has posted the bug report, is there anything else we can assist you with?

    Cheers,

  • #7 / Nov 07, 2011 4:13pm

    NAlbuquerque

    20 posts

    Nope, just need to get this sorted out for a site launch coming up.  I’ve signed up for notifications on the bug report so hopefully this will get fixed soon.

    Thanks!

  • #8 / Nov 09, 2011 10:09pm

    Dan Decker

    7338 posts

    Hi NAlbuquerque,

    Keep an eye out for progress on that bug report. If you need any other help in the meantime, please let is know in a new thread.

    Cheers!

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

ExpressionEngine News!

#eecms, #events, #releases