rubengc/cmb2-field-ajax-search

Unable to save the new field when I have multiple=true option

Opened this issue · 1 comments

I'm trying to do some as this:


     $cmb->add_field ( array (
      'name'       => __( 'Field title', 'ges' ),
      'desc'       => __( 'Field desc', 'ges' ),
      'id'         => $prefix.'_key',
      'type'       => 'term_ajax_search',
      'multiple'   => false,
      'query_args' =>array (
         'taxonomy'=>'custom_tax',
         'childless'=>true,
         'hide_empty'		=> false
      ),
      'repeatable' => true,
     ));

But I see this error message:
Warning: array_values() expects parameter 1 to be array

I think that when repeteable=true the contents of the field in meta_value in database is serialized. It is said, all the repeteable values are in a unique record. I have an existing declaration that I want to change by this functionallity but I will lose all values if I try to do so.

It is not possible to save the same storage criteria?

Also ran into this.

(Similar to this, Ive had trouble also saving the data when attempting to override the meta value save so a term can be set on the post instead of saving as post_meta..... I will create new Issue for this with additional info to describe. )