Custom Fields
Re-Envisioned
Support Meta Box Group Parse error in class-rwmb-group-field.php

This topic contains 1 reply, has 2 voices, and was last updated by  Anh Tran 2 years, 2 months ago.

  • Creator
    Topic
  • #6399
    Resolved
    martinschapiro
    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.

Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #6401

    Anh 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 1 replies (of 1 total)

You must be logged in to reply to this topic.