Title: admin array and header error
Last modified: September 4, 2020

---

# admin array and header error

 *  Resolved [EliWbbr](https://wordpress.org/support/users/eliwbbr/)
 * (@eliwbbr)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/admin-array-and-header-error/)
 * I’m getting two errors in the wp admin that are relating to the cmb2 lib (which
   i LOVE, by the way). Here are the errors:
 * >  Notice: Array to string conversion in ../themes/patk_nickell/cmb2/includes/
   > CMB2_Hookup.php on line 141
   > Warning: Cannot modify header information – headers already sent by (output
   > started at ../themes/patk_nickell/cmb2/includes/CMB2_Hookup.php:141) in ../
   > staging21.thestudio-patrick.com/public_html/wp-includes/functions.php on line
   > 6270
 * I _think_ it related to the file field type. Because on the page you can see 
   this code above that file upload field input box:
 * >  Notice: Undefined offset: 1 in ../wp-content/themes/patk_nickell/cmb2/includes/
   > types/CMB2_Type_File_Base.php on line 146
   > Notice: A non well formed numeric value encountered in ../wp-includes/media.
   > php on line 445
   > Notice: Undefined offset: 1 in ../wp-content/themes/patk_nickell/cmb2/includes/
   > CMB2_Utils.php on line 145
   > Notice: A non well formed numeric value encountered in ../wp-content/themes/
   > patk_nickell/cmb2/includes/CMB2_Utils.php on line 152
   > Notice: Undefined offset: 1 in ../wp-content/themes/patk_nickell/cmb2/includes/
   > CMB2_Utils.php on line 137
   > Notice: A non well formed numeric value encountered in ../public_html/wp-includes/
   > media.php on line 445
   > Notice: Undefined offset: 1 in ../wp-content/themes/patk_nickell/cmb2/includes/
   > CMB2_Utils.php on line 145
   > Notice: A non well formed numeric value encountered in ../wp-content/themes/
   > patk_nickell/cmb2/includes/CMB2_Utils.php on line 152
   > Notice: Undefined offset: 1 in ../wp-content/themes/patk_nickell/cmb2/includes/
   > CMB2_Utils.php on line 137
   > Notice: A non well formed numeric value encountered in ../public_html/wp-includes/
   > media.php on line 445
   > Notice: Undefined offset: 1 in ../wp-content/themes/patk_nickell/cmb2/includes/
   > CMB2_Utils.php on line 145
   > Notice: A non well formed numeric value encountered in ../wp-content/themes/
   > patk_nickell/cmb2/includes/CMB2_Utils.php on line 152
   > Notice: Undefined offset: 1 in ../wp-content/themes/patk_nickell/cmb2/includes/
   > CMB2_Utils.php on line 137
   > Notice: A non well formed numeric value encountered in ../public_html/wp-includes/
   > media.php on line 445
   > Notice: Undefined offset: 1 in ../wp-content/themes/patk_nickell/cmb2/includes/
   > CMB2_Utils.php on line 145
   > Notice: A non well formed numeric value encountered in ../wp-content/themes/
   > patk_nickell/cmb2/includes/CMB2_Utils.php on line 152
   > Notice: Undefined offset: 1 in ../wp-content/themes/patk_nickell/cmb2/includes/
   > CMB2_Utils.php on line 137
   > Notice: A non well formed numeric value encountered in ../public_html/wp-includes/
   > media.php on line 445
   > Notice: Undefined offset: 1 in ../wp-content/themes/patk_nickell/cmb2/includes/
   > CMB2_Utils.php on line 145
   > Notice: A non well formed numeric value encountered in ../wp-content/themes/
   > patk_nickell/cmb2/includes/CMB2_Utils.php on line 152
   > Notice: Undefined offset: 1 in ../wp-content/themes/patk_nickell/cmb2/includes/
   > CMB2_Utils.php on line 168
 * I searched all over stack overflow and your cmb2 documentation without any real
   success. I downloaded the lateset from github and set up the lib on WP 5.5.1 
   site on an Apache server with PHP 7.3.20 earlier today when i was updating some
   other scripts.
 * Can you offer any advice? I’ll be glad to share my code if you need to see that.
 * Here are images: [Pic 1](https://staging21.thestudio-patrick.com/images/1.png)
   [Pic 2](https://staging21.thestudio-patrick.com/images/2.png)
 * Thanks in advance!
    -  This topic was modified 5 years, 9 months ago by [EliWbbr](https://wordpress.org/support/users/eliwbbr/).
    -  This topic was modified 5 years, 9 months ago by [EliWbbr](https://wordpress.org/support/users/eliwbbr/).
    -  This topic was modified 5 years, 9 months ago by [EliWbbr](https://wordpress.org/support/users/eliwbbr/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fadmin-array-and-header-error%2Fpage%2F2%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 5 replies - 16 through 20 (of 20 total)

[←](https://wordpress.org/support/topic/admin-array-and-header-error/?output_format=md)
[1](https://wordpress.org/support/topic/admin-array-and-header-error/?output_format=md)
2

 *  Thread Starter [EliWbbr](https://wordpress.org/support/users/eliwbbr/)
 * (@eliwbbr)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/admin-array-and-header-error/page/2/#post-13439670)
 * Should it help, here is the code for the front end:
 *     ```
                           $boxcosts = get_post_meta( get_the_ID(), '_cmb2_box_cost_repeat_group', true );
                           echo '<tr>';
                               foreach ( (array) $boxcosts as $key => $boxcost ) {
                                   echo '<td>';
                                       echo $boxcost['_cmb2_box_cost'];
                                   echo '</td>';
                               };
                           echo '</tr>';
       ```
   
 *  Thread Starter [EliWbbr](https://wordpress.org/support/users/eliwbbr/)
 * (@eliwbbr)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/admin-array-and-header-error/page/2/#post-13439692)
 * And here is the Product custom post type:
 * `
    <?php function codex_cpt_init() { // PRODUCTS $labels_product = array( ‘name’
   => _x(‘Products’, ‘post type general name’), ‘singular_name’ => _x(‘Product’,‘
   post type singular name’), ‘add_new’ => _x(‘Add New’, ‘product’), ‘add_new_item’
   => __(‘Add New Product’), ‘edit_item’ => __(‘Edit Product’), ‘new_item’ => __(‘
   New Product’), ‘view_item’ => __(‘View Product’), ‘search_items’ => __(‘Search
   Products’), ‘not_found’ => __(‘No products found’), ‘not_found_in_trash’ => __(‘
   No products found in Trash’), ‘parent_item_colon’ => ”, ‘menu_name’ => ‘Products’);
   $args_product = array( ‘labels’ => $labels_product, ‘public’ => true, ‘publicly_queryable’
   => true, ‘show_ui’ => true, ‘show_in_menu’ => true, ‘query_var’ => true, ‘rewrite’
   => true, ‘capability_type’ => ‘post’, ‘has_archive’ => true, ‘hierarchical’ =
   > false, //’menu_position’ => 25, ‘menu_icon’ => get_bloginfo(‘template_url’).‘/
   img/icon-products.png’, ‘supports’ => array(‘title’,’editor’,’thumbnail’) //,’
   excerpt’ ); register_post_type( ‘product’, $args_product ); } add_action( ‘init’,‘
   codex_cpt_init’ ); ?>
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [5 years, 8 months ago](https://wordpress.org/support/topic/admin-array-and-header-error/page/2/#post-13440030)
 * Not worried about either of those parts, as they’re not a part of the issue.
 * I just don’t want you specifying some object types for your group field to see
   if that gets the error removed and resolved and you back to a working website.
 *  Thread Starter [EliWbbr](https://wordpress.org/support/users/eliwbbr/)
 * (@eliwbbr)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/admin-array-and-header-error/page/2/#post-13443718)
 * **This worked!!** Oh my gosh thank you so so much for your time and patience 
   🙂
 * If I could I’d buy you a coffee (or a pint)
 * Thanks again Mr. Beckwith!
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [5 years, 8 months ago](https://wordpress.org/support/topic/admin-array-and-header-error/page/2/#post-13444392)
 * A rating on the plugin is more than enough here, thanks Eli.

Viewing 5 replies - 16 through 20 (of 20 total)

[←](https://wordpress.org/support/topic/admin-array-and-header-error/?output_format=md)
[1](https://wordpress.org/support/topic/admin-array-and-header-error/?output_format=md)
2

The topic ‘admin array and header error’ is closed to new replies.

 * ![](https://ps.w.org/cmb2/assets/icon.svg?rev=2866672)
 * [CMB2](https://wordpress.org/plugins/cmb2/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cmb2/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cmb2/)
 * [Active Topics](https://wordpress.org/support/plugin/cmb2/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cmb2/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cmb2/reviews/)

 * 20 replies
 * 2 participants
 * Last reply from: [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * Last activity: [5 years, 8 months ago](https://wordpress.org/support/topic/admin-array-and-header-error/page/2/#post-13444392)
 * Status: resolved