Parse error in class-rwmb-group-field.php

Support MB Group Parse error in class-rwmb-group-field.phpResolved

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #6399
    martinschapiromartinschapiro
    Participant

    I recently updated metabox group to 1.2.9 and the update threw a fatal error.

    Parse error: syntax error, unexpected '[' in /home/lstudio/public_html/wp-content/plugins/meta-box-group/class-rwmb-group-field.php on line 284
    

    I was able to fix this error by replacing the brackets in line 284 to an array.

    Before:

    
                    'attributes' => [
                        'data-current' => $field['default_state'],
                    ],
            
    

    After:

    
                    'attributes' => array(
                        'data-current' => $field['default_state'],
                    ),
            
    

    This site is running php version 5.3.26. I did not see this error on my local install running php version 5.6.10. Is anything I might do in my theme files to guard against this error in future updates? I am also now working on upgrading the version of php.

    I'm happy to provide any more information that you might find helpful.

    #6401
    Anh TranAnh Tran
    Keymaster

    Oops, I used the short array syntax, which is available for PHP >= 5.4. Just fixed it in 1.2.10.

    Thanks a lot for reporting!

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.