Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i cant get metaboxees #449

Open
srextasagar32 opened this issue Feb 20, 2018 · 8 comments
Open

i cant get metaboxees #449

srextasagar32 opened this issue Feb 20, 2018 · 8 comments
Labels

Comments

@srextasagar32
Copy link

Fatal error: Uncaught Error: Cannot unset string offsets in D:\xampp\htdocs\seperate\wp-content\plugins\Custom-Meta-Boxes-1.1.0\class-cmb-meta-box.php:78

@mikeselander
Copy link
Contributor

@srextasagar32 can you please provide some context to this?

What are the metaboxes you're using that is causing this?
What data do you have saved to those metaboxes?
What environment (PHP version, WP version, etc) are you using?

@srextasagar32
Copy link
Author

I have used this plugin since last couple of years. but there was an uncaught error.
Metaboxes means the meta values this plugin generates.
I am using php 7.1 and wordpress 4.9.4

@mikeselander
Copy link
Contributor

@srextasagar32 I understand that there was an uncaught error, but I need more information from you to debug this.

  1. What metaboxes are triggering this? By this, I need to see the code creating the metaboxes you are using.
  2. What data is saved to those metaboxes? By this, I need to see what data is coming from the database for the metaboxes triggering this error.

@fishstix81
Copy link

@mikeselander I ran into this issue as well. Just to share, it appears related to the group field.
Here's the code I was using. It could be incorrect, but when I do remove the group field, the meta box renders correctly.

$metaboxes[] = [
            'title'      => 'Edit Team Member',
            'fields'     => [
                'id'     => 'member-fields',
                'name'   => 'Member Data',
                'type'   => 'group',
                'fields' => self::$fields,
            ],
            'pages'      => 'Teams Members',
            'context'    => 'advanced',
            'priority'   => 'high',
        ];

I hope this helps.

@mikeselander
Copy link
Contributor

@squibbleFish that does help!

Could you please also past the source of self::$fields so that I can see what kind of fields are being passed into the group?

@fishstix81
Copy link

@mikeselander no problem. It's just a simple array of fields with the appropriate values.

static $fields = [
  [
    'id' => 'field-id-1',
    'name' => 'Name-1'
    'type' .  => 'text'
  ],
  [
    'id' => 'field-id-2',
    'name' => 'Name-2'
    'type' .  => 'text'
  ],
  [
    'id' => 'field-id-3',
    'name' => 'Name-3'
    'type' .  => 'textarea'
  ],
]

I hope this helps.

@deivibub
Copy link

deivibub commented Mar 30, 2018 via email

@fishstix81
Copy link

@deivibub Thanks for checking in, but that is not the case. It does appear to be related to the group property. Most importantly, the fatal error points to this property being unset. https://github.com/humanmade/Custom-Meta-Boxes/blob/develop/class-cmb-meta-box.php#L78.
With the incorrect page the box won't render in the UI, but a fatal is not thrown. Hope that helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants