Support

Account

Home Forums Bug Reports Illegal string offset 'field_group'

Solved

Illegal string offset 'field_group'

  • This is the error I’m getting, something I can fix myself?

    I run the latest version of ACF, ACF repeater and ACF options. Also runs latest version of WordPress and PHP version 5.4.

    Warning: Illegal string offset ‘field_group’ in /smi/web/glossmagazine.se/wp-content/plugins/advanced-custom-fields/core/fields/_functions.php on line 338

    I have already tried to fix the problem by replacing this:

    if( get_post_status( $row['post_id'] ) != "trash" )
    				{
    					$field = $row['meta_value'];
    					$field = maybe_unserialize( $field );
    					$field = maybe_unserialize( $field ); // run again for WPML
    				}
    				
    				
    				// add field_group ID
    				$field['field_group'] = $row['post_id'];

    To this:

    if( get_post_status( $row['post_id'] ) != "trash" )
    				{
    					$field = $row['meta_value'];
    					$field = maybe_unserialize( $field );
    					$field = maybe_unserialize( $field ); // run again for WPML
    					
    					
    					// add field_group ID
    					$field['field_group'] = $row['post_id'];
    				}

    Anyone knows what to do? My site is totally corrupt right now, and I can’t create my old fields to solve it because then this problem comes up.

  • Hi @Henric Åkesson

    Perhaps you will need to debug the contents of $row and $field.

    What is the data for both when you see the error?

    Tip: Use a simple debug snippet like this:

    
    <?php 
    
    echo '<pre>';
    	print_r( $field );
    echo '</pre>';
    echo '<pre>';
    	print_r( $row );
    echo '</pre>';
    
    ?>
    
  • I had exactly same problem. I name he field : field_type and as soon as i renamed it to type by removing field worked.

  • Hi @Vulcu Radu

    Thanks for the follow up. I can’t understand the before / after. Can you please re explain the issue and solution?

    Thanks
    E

  • I solved my problem finally when I checked my php.ini file.

    The extension mbstring.so was loaded and that was no necessary.

    I also deleted a string in the php.ini like this: mbstring.func_overload = 7

    This solved the error coming, and now it works great!

  • I just experienced this issue and I’ve noticed that it will happen if your field name has ‘field_’ string in it.

    @elliot – Do you have a chance to tell us what’s wrong with it?

    Thanks in advanced and really appreciate your time.

  • @elliot Condon – same issue as mentioned above. We had a tab with the same name directly above a repeater. Once i changed the name of the repeater all was well.

    Actually, I spoke too soon. The error is gone, but the data isn’t saving.

Viewing 7 posts - 1 through 7 (of 7 total)

The topic ‘Illegal string offset 'field_group'’ is closed to new replies.