Viewing 3 reply threads
  • Author
    Posts
    • #2337
      cdcorey
      Member

      I have a conditional field in a metabox on a custom post type. It was working fine up to 0.9.3.6, but when I try to upgrade to 0.9.4 or higher, the conditional field will no longer appear.

      Here is the relevant code:

      piklist('field', array(
      	'type' => 'checkbox',
      	'field' => '_is_rescheduled_from',
      	'choices' => array(
      		'1' => 'Makeup Game – This game was rescheduled from another date.',
      	),
      ));
      
      piklist('field', array(
      	'type' => 'select',
      	'field' => '_rescheduled_from',
      	'label' => 'From',
      	'conditions' => array(
      		array(
      			'field' => '_is_rescheduled_from',
      			'value' => '1',
      		),
      	),
      	'choices' => array('' => 'Select a Game...') + clm_games_get_cancelled( get_post_meta( get_the_id(), '_league_id', true) ),
      ));
      

      Any idea what change in 0.9.4 would have caused this to stop working?

    • #2343
      Steve
      Keymaster

      We had to make a change to the way numeric keys were handled. This change came in 0.9.4.

      You will need to remove quotes around the numerical keys.

      This topic should explain.

    • #2346
      cdcorey
      Member

      Thanks for the quick response!

      I tried looking at the change log, but there’s not much information. Is there somewhere I can watch for documentation of non-backwards-compatible changes like this? It would be super helpful to know about them before they break my plugin. 🙂

      Thanks again.

    • #2351
      Steve
      Keymaster

      @cdcorey– Sorry about that. This should have been in the changelog, or blog post and was missed.

Viewing 3 reply threads
  • The topic ‘Conditional field not working in Piklist 0.9.4+’ is closed to new replies.