Support

Account

Home Forums Backend Issues (wp-admin) Uninitialized string offset: 0

Solving

Uninitialized string offset: 0

  • WordPress 3.4.2 and ACF v3.5.8.2 being used.

    After working for over a year without any problems the site is now having problems with one of the Field Groups. We use the repeater field on the site.

    It only renders the first of the fields within the field group and then shows several “Uninitialized string offset: 0” messages (when I have debugging on).

    The site was previously running ACF v3.5 but I have upgraded it to try to solve the problem. Is “Uninitialized string offset: 0” usually caused by a data issue and is there any pointers on how to resolve this.

    Thanks for any help in advance.

  • Just to supply more information on this,

    I’m receiving the following before the first field in the field group is displayed.

    Notice: Uninitialized string offset: 0 in /wp-content/plugins/advanced-custom-fields/acf.php on line 532 Notice: Uninitialized string offset: 0 in /wp-content/plugins/advanced-custom-fields/acf.php on line 532

    I’m receiving the following errors on the following lines. I can see fully the first field that renders completely fine and the the 2nd doesn’t. Theres a total of 6 fields in the field group.

    The 2nd field should be a repeater which includes a wysiwyg and 2 text fields.

    Notice: Uninitialized string offset: 0 in /wp-content/plugins/advanced-custom-fields/core/views/meta_box_fields.php on line 98
    
    field-
    
    Notice: Uninitialized string offset: 0 in /wp-content/plugins/advanced-custom-fields/core/views/meta_box_fields.php on line 98
    
    " data-type="
    
    Notice: Uninitialized string offset: 0 in /wp-content/plugins/advanced-custom-fields/core/views/meta_box_fields.php on line 98
    
    " data-id="
    
    Notice: Uninitialized string offset: 0 in /wp-content/plugins/advanced-custom-fields/core/views/meta_box_fields.php on line 98
    
    ">
    
    <div class="field_meta">
    
    <table class="acf widefat">
    
    <tr>
    
    <td class="field_order"><span class="circle">
    
    Notice: Uninitialized string offset: 0 in /wp-content/plugins/advanced-custom-fields/core/views/meta_box_fields.php on line 102
    
    1</span></td>
    
    <td class="field_label">
    
    <strong>
    
    <a class="acf_edit_field row-title" title="Edit this Field" href="javascript:;">
    
    Notice: Uninitialized string offset: 0 in /wp-content/plugins/advanced-custom-fields/core/views/meta_box_fields.php on line 105
    
    </a>
    
    </strong>
    
    <div class="row_options">
    
    <span><a class="acf_edit_field" title="Edit this Field" href="javascript:;">Edit</a> | </span>
    
    <span><a title="Read documentation for this field" href="http://www.advancedcustomfields.com/docs/field-types/" target="_blank">Docs</a> | </span>
    
    <span><a class="acf_duplicate_field" title="Duplicate this Field" href="javascript:;">Duplicate</a> | </span>
    
    <span><a class="acf_delete_field" title="Delete this Field" href="javascript:;">Delete</a></span>
    
    </div>
    
    </td>
    
    <td class="field_name">
    
    Notice: Uninitialized string offset: 0 in /wp-content/plugins/advanced-custom-fields/core/views/meta_box_fields.php on line 114
    
    </td>
    
    <td class="field_type">
    
    Notice: Uninitialized string offset: 0 in /wp-content/plugins/advanced-custom-fields/core/views/meta_box_fields.php on line 115
    
    Notice: Undefined index: in /wp-content/plugins/advanced-custom-fields/core/views/meta_box_fields.php on line 115
    
    </td>
    
    <td class="field_key">
    
    Notice: Uninitialized string offset: 0 in /wp-content/plugins/advanced-custom-fields/core/views/meta_box_fields.php on line 116
    

    Any advice greatly appreciated.

  • Hi @knade,

    Thanks for the post.

    The errors indicate that there might be some syntax errors on the code above these lines. Your functions could be expecting some array values but currently the variables are passing empty strings.

    To solve this, it is highly recommended to debug your code line by line to identify the culprit:

    <?php 
    
    $value = get_field('field_name');
    
    echo '<pre>';
    	var_dump( $value );
    echo '</pre>';
    
    ?>
    
Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Uninitialized string offset: 0’ is closed to new replies.