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 checkbox_fields

September 12, 2012 9:34am

Subscribe [6]
  • #1 / Sep 12, 2012 9:34am

    leeaston

    634 posts

    Updated to 2.5.3 and now get these errors when submitting a safecracker form - it worked in the previous version.

    A PHP Error was encountered
    
    Severity: Notice
    
    Message: Undefined index: checkbox_fields
    
    Filename: libraries/safecracker_lib.php
    
    Line Number: 1210
    
    A PHP Error was encountered
    
    Severity: Notice
    
    Message: Undefined index: checkbox_fields
    
    Filename: api/Api_sc_channel_entries.php
    
    Line Number: 66
  • #2 / Sep 12, 2012 6:13pm

    webster10

    9 posts

    I get similar errors for multi-select

    A PHP Error was encountered

    Severity: Notice

    Message: Undefined index: field_ft_68

    Filename: multi_select/ft.multi_select.php

    Line Number: 155
    A PHP Error was encountered

    Severity: Notice

    Message: Undefined index: channel_html_formatting

    Filename: multi_select/ft.multi_select.php

    Line Number: 156
    A PHP Error was encountered

    Severity: Notice

    Message: Undefined index: channel_auto_link_urls

    Filename: multi_select/ft.multi_select.php

    Line Number: 157
    A PHP Error was encountered

    Severity: Notice

    Message: Undefined index: channel_allow_img_urls

    Filename: multi_select/ft.multi_select.php

    Line Number: 158

     

  • #3 / Sep 12, 2012 7:12pm

    webster10

    9 posts

    Any info on this possibly being a bug introduced in 2.5.3?...or maybe just two of us having a very similar case of operator error

    Thanks,
    Glen

  • #4 / Sep 12, 2012 7:40pm

    webster10

    9 posts

    Was able to track my issue down to operator error.  As Emily Littella would say… Nevermind

    Thanks,
    Glen

  • #5 / Sep 13, 2012 3:02am

    sm9

    352 posts

    I’m getting a very similar error to what’s in the original post:

    A PHP Error was encountered
    Severity: Notice
    Message: Undefined index: checkbox_fields
    Filename: libraries/safecracker_lib.php
    Line Number: 1210

    A PHP Error was encountered
    Severity: Warning
    Message: Cannot modify header information - headers already sent by (output started at /system/codeigniter/system/core/Exceptions.php:170)
    Filename: libraries/Functions.php
    Line Number: 402

    The code for my Safecracker form was working fine in EE 2.5.0, but I’m now get the above error in 2.5.3.

    I didn’t even have any checkbox fieldtypes installed. I tried installing the checkbox fieldtype, but still got the error. I also tried adding a checkbox onto my form (in case this issue is caused by one not being there), but that didn’t help either. I also stripped my form down to just a title, but still got the error. So I guess Safecracker is not usable unless I’m missing something here.

    I’ve just tried commenting out lines 1210-1216 in libraries/safecracker_lib.php (this code appear to be new in 2.5.3) and that stops the errors from appearing when submitting a form:

    foreach (explode('|', $_POST['checkbox_fields']) as $checkbox)
      {
       if ( ! isset($_POST[$checkbox]))
       {
        $_POST[$checkbox] = '';
       }
      }

    However, I’ve got no idea what the above code does or the consequences of taking it out so would appreciate some advice on this.

    Thanks,

    Ste

  • #6 / Sep 13, 2012 3:23am

    sm9

    352 posts

    Just a quick update - I’ve noticed that I’m only seeing and getting stuck on this error when logged in as a Super Admin. I tried a form submission as a Guest user and it worked fine.

  • #7 / Sep 14, 2012 12:51pm

    sm9

    352 posts

    I’ve filed a bug in the bug tracker about this: https://support.ellislab.com/bugs/detail/18233

  • #8 / Sep 14, 2012 1:22pm

    Shane Eckert

    7174 posts

    Hello leeaston and other fellow community members,

    This has been reported as a bug. The patch has also been added to the bug.

    Can you please try the patch and let me know how it goes? It fixed the issue for me.

    Thank you,

  • #9 / Sep 14, 2012 10:55pm

    sm9

    352 posts

    I can confirm that the patch resolved the issue for me.

  • #10 / Sep 15, 2012 10:18am

    leeaston

    634 posts

    Still seems to be a problem. Getting this error when updating an entry using safecracker, but no error when creating a new entry:

    A PHP Error was encountered
    Severity: Notice
    Message: Undefined index: checkbox_fields
    Filename: api/Api_sc_channel_entries.php
    Line Number: 66
  • #11 / Sep 17, 2012 10:12am

    Kevin Smith

    4784 posts

    Hey Lee,

    Looks like that’s a different albeit similar bug, so I reported that for you here. I see you’ve posted a comment to that bug report, so you’ll be notified of any updates to it!

  • #12 / Sep 18, 2012 12:37pm

    design132

    101 posts

    I’m getting it too. I will wait patiently for a fix.  Thanks guys

  • #13 / Sep 18, 2012 12:47pm

    leeaston

    634 posts

  • #14 / Sep 18, 2012 1:34pm

    Kevin Smith

    4784 posts

    Yep, looks like we’ve got a solid solution there. Any more trouble with this or is everyone all set after applying the fix?

  • #15 / Sep 18, 2012 1:35pm

    leeaston

    634 posts

    Working for me.

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

ExpressionEngine News!

#eecms, #events, #releases