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

Select field values in Repeater does not added correctly to 'row_label' from first Select element. #1892

Closed
dedalx opened this issue May 15, 2018 · 2 comments

Comments

@dedalx
Copy link
Contributor

dedalx commented May 15, 2018

Issue description:

Select field values in Repeater does not added correctly to 'row_label' from first Select element if you change another repeater field.

How to re-present:

  1. Use my code to create repeater.
  2. Go to repeater and add new icon - you will see that repeater block have correct "Facebook" title on it.
  3. Now change "Your profile url" text field value to any value (add text to it) - you will see that repeater block title changed from "Facebook" to "none".
  4. This issue appears only for FIRST element in "Select" values array (for "Facebook"). It does not appears for "Vkontakte" for example.

Screenshot with issue: http://take.ms/gNBqV

Version used:

Latest WP
Latest Kirki

Using theme_mods or options?

theme_mods

Code to reproduce the issue (config + field(s))

Kirki::add_field( 'mgtblog_theme_options', array(
    'type'        => 'repeater',
    'label'       => esc_attr__( 'Social icons', 'mgtblog' ),
    'section'     => 'social',
    'priority'    => 10,
    'row_label' => array(
        'type' => 'field',
        'value' => esc_attr__('Social icon', 'mgtblog' ),
        'field' => 'social_type',
    ),
    'button_label' => esc_attr__('Add social icon', 'mgtblog' ),
    'settings'     => 'social_icons',
    'default'      => '',
    'fields' => array(
        'social_type' => array(
            'type'        => 'select',
            'label'       => esc_attr__( 'Social web', 'mgtblog' ),
            'description' => '',
            'choices'     => array(
				'facebook' => esc_attr__( 'Facebook', 'mgtblog' ),
				'vk' => esc_attr__( 'VKontakte', 'mgtblog' ),
				'google-plus' => esc_attr__( 'Google+', 'mgtblog' ),
				'linkedin' => esc_attr__( 'LinkedIn', 'mgtblog' ),
				'dribbble' => esc_attr__( 'Dribbble', 'mgtblog' ),
				'behance' => esc_attr__( 'Behance', 'mgtblog' ),
				'instagram' => esc_attr__( 'Instagram', 'mgtblog' ),
				'tumblr' => esc_attr__( 'Tumblr', 'mgtblog' ),
				'pinterest' => esc_attr__( 'Pinterest', 'mgtblog' ),
				'vimeo-square' => esc_attr__( 'Vimeo-square', 'mgtblog' ),
				'youtube' => esc_attr__( 'Youtube', 'mgtblog' ),
				'skype' => esc_attr__( 'Skype', 'mgtblog' ),
				'flickr' => esc_attr__( 'Flickr', 'mgtblog' ),
				'deviantart' => esc_attr__( 'Deviantart', 'mgtblog' ),
				'500px' => esc_attr__( '500px', 'mgtblog' ),
				'etsy' => esc_attr__( 'Etsy', 'mgtblog' ),
				'telegram' => esc_attr__( 'Telegram', 'mgtblog' ),
				'odnoklassniki' => esc_attr__( 'Odnoklassniki', 'mgtblog' ),
				'houzz' => esc_attr__( 'Houzz', 'mgtblog' ),
				'slack' => esc_attr__( 'Slack', 'mgtblog' ),
				'qq' => esc_attr__( 'QQ', 'mgtblog' ),
				'rss' => esc_attr__( 'RSS', 'mgtblog' )
			),
            'default'     => 'facebook',
        ),
        'social_url' => array(
            'type'        => 'text',
            'label'       => esc_attr__( 'Your profile url (including https://)', 'mgtblog' ),
            'description' => '',
            'default'     => '',
        ),
    )
) );

@Serpentsoft
Copy link

Serpentsoft commented May 17, 2018

You Saved my time 👍 😆 .. I need to add something to this issue that after saving the repeater's items title will be the first item in the select in your case all repeater titles will be Facebook .. Right??

Example: Screenshot

@dedalx
Copy link
Contributor Author

dedalx commented May 17, 2018

@Serpentsoft After saving values for items that was selected as first item in Select element (Facebook in this example) will be blank (because of "null").

aristath added a commit that referenced this issue May 17, 2018
aristath added a commit that referenced this issue Jun 20, 2018
* develop: (50 commits)
  possible fix for #1925
  Envato theme-check fixes
  Fix error when typography field has no font-family
  v3.0.33
  Folder permissions fix for google-fonts
  fixes #1892, fixes #1888
  3.0.32
  add choice per-control.
  use async as default for 3.0.31
  3.0.31
  3.0.30
  3.0.29
  add caches
  stable = 3.0.28 & use correct license in readme
  readme addition
  v3.0.28
  typo
  readme
  switch webfont loading to local when in the frontend
  add googlefonts @font-face to the footer
  ...
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

2 participants