Viewing 2 reply threads
  • Author
    Posts
    • #3147
      lycidiae
      Member

      Hello!

      Trying to use the Radio field in a repeating group has led to some finicky behavior:

      Even though the radio is given a default value and is required, I have a problem of the a choice from the selection being lost in the GUI on the CPT backend page load. The three choices start out all blank even if a value for that repeater was selected during a different edit, the required field for some reason misses the dropped values, and updating deletes my meta values in the database.

      Please help me out, am I missing some field in the Piklist setup array that persists choices, or is this a bug in the repeating groups (I’m not running into any persistence problems when radio and datepicker fields are top level).

      
      piklist('field',
          array(
              'type' => 'group',
              'scope' => 'post_meta',
              'field' => 'service_relation',
              'label' => __('Relate Post'),
              'description' => __('Link this accountant to his/her respective field(s) of practice.'),
              'add_more' => true,
              'columns' => 12,
              'fields' => array(
                  ...
                  ,array(
                      'type' => 'radio',
                      'scope' => 'post_meta',
                      'field' => 'cpa_incharge',
                      'value' => 'member',
                      'required' => 'true',
                      'label' => 'Practice Area Level',
                      'columns' => 4,
                      'attributes' => array(
                          'class' => 'text'
                      ),
                      'choices' => array(
                          'member' => 'Member',
                          'featured' => 'Featured',
                          'charge' => 'In Charge'
                      )
                  )
              )
          )
      );
      
    • #3149
      Steve
      Keymaster

      @lycidiae– Welcome to the Piklist Community!

      Is there a reason you’re using a group field for this one field? Or is the “…” other fields in the group?

      Try removing scope from both fields, and let Piklist set it for you. See if that helps.

    • #3151
      lycidiae
      Member

      Thanks for the warm welcome, I really appreciate your help!

      Yes, there are a couple of other fields which aren’t having any issues.

      Thanks for the tip, I’ll give it a shot and let you know!

Viewing 2 reply threads
  • The topic ‘Grouped Radio Data Persistence’ is closed to new replies.