Viewing 3 reply threads
  • Author
    Posts
    • #7853
      jcrist
      Member

      The hidden field value in 0.9.9 was not updated like the other fields and sometimes returns Array.

      value="<?php echo esc_attr($value); ?>"
      should be
      value="<?php echo is_array($value) ? esc_attr(end($value)) : esc_attr($value); ?>"

    • #7917
      Tonny Keuken
      Member

      here is the patch you can apply to it, please fix it

      diff --git a/piklist/parts/fields/hidden.php b/piklist/parts/fields/hidden.php
      index daffa8d..1b8d39a 100644
      --- a/piklist/parts/fields/hidden.php
      +++ b/piklist/parts/fields/hidden.php
      @@ -1,8 +1,8 @@
       
      -<input 
      +<input
         type="hidden"
      -  id="<?php echo piklist_form::get_field_id($arguments); ?>" 
      +  id="<?php echo piklist_form::get_field_id($arguments); ?>"
         name="<?php echo piklist_form::get_field_name($arguments); ?>"
      -  value="<?php echo esc_attr($value); ?>" 
      +  value="<?php echo is_array($value) ? esc_attr(end($value)) : esc_attr($value); ?>"
         <?php echo piklist_form::attributes_to_string($attributes); ?>
       />
      

      regards,
      Tonny

    • #8324
      poxtron
      Member

      I have the same problem. Thanks for posting the answer.

      I hope they push an update to address this issue.

    • #8327
      Steve
      Keymaster

      This should be fixed in our latest beta >

Viewing 3 reply threads
  • You must be logged in to reply to this topic.