Forum Replies Created

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • in reply to: [Bug] Hidden field 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

    in reply to: Post status remains “draft” in submitbox #7625
    Tonny Keuken
    Member
    This reply has been marked as private.
    in reply to: Add custom post type php error touch_time #7583
    Tonny Keuken
    Member

    Hi Steve,

    I have tried this out, and it will work.

    touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 );

    It works for every post whatever it’s type as long $for_post value will be 1 or true.

    @line 699 in wp_root/wp-admin/includes/template.php this value will be checked with:

    $post_date = ($for_post) ? $post->post_date : get_comment()->comment_date;

    if the item to check is not a “comment” then the notice (error) will be thrown because a post is not a comment
    and get_comment()->comment_date does not exist

    Self I choose to change line 218 in piklist/parts/meta-boxes/submitdiv.php with the following:

    touch_time(($action == ‘edit’), false === isset( get_comment()->comment_date ), 4);

    I hope this info helps

    Kind regards,
    Tonny

    in reply to: PHP Notice #7371
    Tonny Keuken
    Member
    This reply has been marked as private.
    in reply to: PHP Notice #7370
    Tonny Keuken
    Member

    Hi everyone,

    I am using version 0.9.9.9 at this moment and the above notice came up in the log files.

    I figured it out, is was another query_var that was causing this.

    I also use WooCommerce, and their plugin using also the query_vars, but without setting query_vars[‘order’]

    So I changed the pre_get_posts(&$query) function in class-piklist-wordpress.php, and it solved my problem.

    Just added the && isset($query->query_vars[‘order’]) to the statement

    it’s about the lines 178 to 202

    function now looks like:

      /**
       * pre_get_posts
       * Get the order parameter if it has to do with meta
       *
       * @param object $query The current query object.
       *
       * @access public
       * @static
       * @since 1.0
       */
      public static function pre_get_posts(&$query)
      {
        if (isset($query->query_vars['orderby']))
        {
          if (in_array($query->query_vars['orderby'], array('meta_value', 'meta_value_num')) && isset($query->query_vars['order']) && !is_null($query->query_vars['order']))
          {
            self::$meta_order = $query->query_vars['order'];        
          }
    
          if ( isset($query->query_vars['meta_key']) && !is_null($query->query_vars['meta_key']))
          {              
            self::$meta_key = $query->query_vars['meta_key'];
          }
        }
      }
    

    Hope it helps

    Tonny

    in reply to: conditional field troubles #7017
    Tonny Keuken
    Member

    Hi morganrt,

    Did you try to compare with the code below, already?

    piklist('field', array(
    	'type' => 'html',
    	'field' => 'recorder',
    	'label' => 'A label...',
    	'help' => 'This is help text.',
    	'scope' => 'comment_meta',
    	'reset' => 'false',
    	'value' => '<div>Some HTML goes here</div>',
     'conditions' => array(
     		array(
             	'field' => 'response_structured',
             	'scope' => 'comment_meta',
             	'value' => array( '', null ), //This will compare against an empty string and no value at all
             	'compare' => '!='
           		))
    )); 
    

    Kind regards,
    Tonny

    in reply to: hidden field error #6947
    Tonny Keuken
    Member
    This reply has been marked as private.
    in reply to: hidden field error #6946
    Tonny Keuken
    Member
    This reply has been marked as private.
Viewing 8 posts - 1 through 8 (of 8 total)