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.

Channel Field Issues

May 16, 2013 6:06pm

Subscribe [1]
  • #1 / May 16, 2013 6:06pm

    jtkendall

    59 posts

    I’m running a site on EE 2.6.0 and I’m randomly getting the following errors when I go to modify an existing channel field.

    A PHP Error was encountered
    Severity: Notice
    Message: Undefined index: field_fmt_options
    Filename: fieldtypes/EE_Fieldtype.php
    Line Number: 269

    A PHP Error was encountered
    Severity: Warning
    Message: Invalid argument supplied for foreach()
    Filename: helpers/form_helper.php
    Line Number: 324

    These kind of errors were happening specifically with textarea’s and that was because they suddenly started missing text formatting options (0 options in the select field), but now the errors are occurring on every field type.

    I fixed the textarea formatting options issue before, but it keeps coming back and I can’t figure out what’s going on with these fields.

  • #2 / May 17, 2013 9:59am

    jtkendall

    59 posts

    Apparently this is an issue with the field not having Formatting options available (I’m guessing someone on my team didn’t pay attention and overwrote the formatting table with a old DB export). I found that the easiest way to fix this was to figure out the ID of the latest field, truncate the formatting table, run the code below and then run the output in MySQL to make sure they all have the formatting options required.

    <?php
    
        $i = 1;
        $val = array('none', 'br', 'xhtml');
    
        while($i < 68){
            foreach($val as $key=>$value) {
                echo 'insert into `exp_field_formatting` (`field_id`, `field_fmt`) VALUES (' . $i . ', "' . $value . '");' . "\r\n";
            }
            $i++;
        }
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases