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

Radio buttons value in repeat field aren't stored on first post save #341

Closed
jedrzejchalubek opened this issue Jun 2, 2015 · 6 comments
Closed

Comments

@jedrzejchalubek
Copy link

Radio buttons values in repeat field aren't stored on first post save. After post save all fields are present but have default value.

Look like it's something wrong on line js -> php. Here field config:

$product_mb_iconography_group = $product_mb_iconography->add_field(array(
            'id'          => 'product_iconography_group',
            'type'        => 'group',
            'description' => __('Iconography list', $this->domain),
            'options'     => array(
                'group_title'   => __('Icon {#}', $this->domain), // {#} gets replaced by row number
                'add_button'    => __('Add Another Icon', $this->domain),
                'remove_button' => __('Remove Icon', $this->domain),
                'sortable'      => true, // beta
            )
));

$product_mb_iconography->add_group_field($product_mb_iconography_group, array(
            'name'    => __('Icon', $this->domain),
            'desc'    => __('Icon type', $this->domain),
            'id'      => 'icon_type',
            'type'    => 'radio_inline',
            'default' => 'ce',
            'options' => array(
                'none' => __('None'),
                'ce' => __( '<img src="' . get_bloginfo('template_url') . '/images/ce-dark.png">', $this->domain),
                'v' => __( '<img src="' . get_bloginfo('template_url') . '/images/v-dark.png">', $this->domain),
                'ground' => __( '<img src="' . get_bloginfo('template_url') . '/images/ground-dark.png">', $this->domain),
                'class-2' => __( '<img src="' . get_bloginfo('template_url') . '/images/class-2-dark.png">', $this->domain),
                'class-3' => __( '<img src="' . get_bloginfo('template_url') . '/images/class-3-dark.png">', $this->domain),
                'f' => __( '<img src="' . get_bloginfo('template_url') . '/images/f-dark.png">', $this->domain),
                'a' => __( '<img src="' . get_bloginfo('template_url') . '/images/a-dark.png">', $this->domain),
                'in' => __( '<img src="' . get_bloginfo('template_url') . '/images/in-dark.png">', $this->domain),
                'out' => __( '<img src="' . get_bloginfo('template_url') . '/images/out-dark.png">', $this->domain),
                'in-out' => __( '<img src="' . get_bloginfo('template_url') . '/images/in-out-dark.png">', $this->domain),
                'op' => __( '<img src="' . get_bloginfo('template_url') . '/images/op-dark.png">', $this->domain),
                'ip' => __( '<img src="' . get_bloginfo('template_url') . '/images/ip-dark.png">', $this->domain),
                // 'box' => __( '<img src="' . get_bloginfo('template_url') . '/images/box-dark.png">', $this->domain)
            ),
        ));

Wordpress 4.2.2
CMB 2.0.8

@austinjreilly
Copy link

I think that this is somewhat related to #257. Specifically, see this comment.

@fredclaymeyer
Copy link

Bumping with video:
https://www.youtube.com/watch?v=3oyPrcLEzQk

As the video shows:

  • The first radio element in the repeater field works just fine.
  • It takes several "tries" to get new elements to save. It seems hard to predict what saves: sometimes neither the element nor its value, sometimes just the element but not its value, and sometimes (after either two or three tries) both.

Also, subsequent elements do seem to take on the previous element's value by default, as #257 seems to describe.

@tnorthcutt
Copy link

+1, experiencing this bug as well.

@austinjreilly are you running into this as well? Any ideas?

@jtsternberg I'm not familiar enough with CMB2 to know where to start debugging this, but if you can point me in the right direction, I'd be delighted to try and put together a PR to fix this.

@austinjreilly
Copy link

@tnorthcutt Last time I checked this was still problematic. I know that #257 was closed, but the problems I outlined in the second bullet of my comment still stand. I don't have time at the moment to work out exactly what's going on, but the errors also included in that comment might be a good place to start.

@kshengelia
Copy link

+1, same bug with me

Here are screenshots, just in case:

radio_step_1
radio_step_2
radio_step_3

@jtsternberg
Copy link
Member

Should be good in the trunk branch. please test.

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

No branches or pull requests

6 participants