Tagged: , ,

Viewing 8 reply threads
  • Author
    Posts
    • #3543
      upside
      Member

      So I’ve created an add-more group with a file upload field and two text fields. When I try to save page the image does not save. If I try to add a second add more field and add the image there the image still does not save. The text fields do save properly. Here is the code that is creating the add more metabox:

      piklist('field', array(
              'type' => 'group'
              ,'columns' => 12
              ,'field' => 'box_repeater'
              ,'add_more' => true
              ,'fields' => array(
                array(
                  'type' => 'file'
          		,'field' => 'upload_basic'
          		,'scope' => 'post_meta'
          		,'label' => __('Add File(s)','piklist')
          		,'description' => __('This is the basic upload field.','piklist')
          		,'options' => array(
            			'basic' => true
          		)
                )
                ,array(
                  'type' => 'text'
                  ,'field' => 'tc_box_title'
                  ,'columns' => 6
                  ,'attributes' => array(
                    'placeholder' => 'box title'
                  )
                )
                ,array(
                  'type' => 'text'
                  ,'field' => 'tc_box_url'
                  ,'columns' => 6
                  ,'attributes' => array(
                    'placeholder' => 'box url'
                  )
                )
              )
      
        ));
      

      Thanks for your help!

    • #3546
      Steve
      Keymaster

      @upside– Welcome to the Piklist community!

      Bug confirmed! Seems to be an issue with the basic file field in an add_more.

      I was able to get it working with the Media Upload field using our latest beta which I emailed to you. Then use this code:

        piklist('field', array(
          'type' => 'group'
          ,'field' => 'box_repeater'
          ,'add_more' => true
          ,'fields' => array(
            array(
              'type' => 'file'
              ,'field' => 'upload_basic'
              ,'columns' => 12
              ,'label' => __('Add File(s)','piklist')
              ,'description' => __('This is the basic upload field.','piklist')
              ,'options' => array(
                  'basic' => false
                  ,'multiple' => false
              )
            )
             ,array(
              'type' => 'text'
              ,'field' => 'tc_box_title'
              ,'columns' => 6
              ,'attributes' => array(
                'placeholder' => 'box title'
              )
            )
            ,array(
              'type' => 'text'
              ,'field' => 'tc_box_url'
              ,'columns' => 6
              ,'attributes' => array(
                'placeholder' => 'box url'
              )
            )
          )
        ));
      
    • #3547
      upside
      Member

      Steve you guys totally rock! I’ve been using Piklist for a while now and this is the first time I’ve used your support forum and it seems like your support is as awesome as Piklist itself! I was able to get this to work properly with your code and the latest beta. Thanks again for the fast response and for making Piklist. It is such an awesome tool.

    • #3548
      Steve
      Keymaster

      @upside– Glad to help!

      We would appreciate it if you could tell the world how awesome Piklist is by leaving us a 5 Star review on WordPress.org. It really helps promote Piklist.

      Thanks!

    • #3615
      upside
      Member

      @steve I went ahead and rated Piklist 5 stars on WordPress.org. I love Piklist its changed how I look at problems and what I think is possible in WordPress.

      I’m having some trouble getting the add-more fields to display. I wound up setting up a test add-more like the basic one in the user guide and I’m getting some weird error messages in the debug log. I’ve got the following code in the page template:

      // Get field data
      			$exercise = get_post_meta($post ->ID, 'exercise', true);
      
      			// Get your custom template part: addmore-workout-template.php
      			piklist(get_stylesheet_directory() . '/addmore-whatdo', array('data' => $exercise, 'loop' => 'data'));

      And there is an addmore-whatdo.php file in the theme folder. It looks like it’s trying to go into another Piklist plugin first to find the template and then going to the correct url after? Any idea why this would be happening?

      PHP Warning:  include(/Users/TC/npsa/WordPress/wp-content/plugins/npsa-quotes/parts/http://hostnpsa:8888/wp-content/themes/NPSA-theme/addmore-whatdo.php): failed to open stream: No such file or directory in /Users/TC/npsa/WordPress/wp-content/plugins/piklist/includes/class-piklist.php on line 374
      
    • #3624
      Steve
      Keymaster

      @upside– This is a bug that will be fixed in the next version of Piklist. If you move addmore-whatdo.php to npsa-quotes/parts/ does it work?

    • #4232
      nate9024
      Member

      A new version just came out today (0.9.4.28) but this has not fixed the issue with file uploads saving.

      Here is my code:

      piklist('field', array(
          'type' => 'group'
          ,'field' => 'downloads'
          ,'label' => __('Files PDF')
          ,'columns' => 12
          ,'add_more' => true
          ,'fields' => array(
              array(
                  'type' => 'file'
                  ,'field' => 'download_image_pdf'
                  ,'multiple' => 'multiple'
                  ,'label' => 'Image/icon and PDF file'
                  ,'description' => __('Upload your image (234x126px) and PDF file')
              ),
              array(
                  'type' => 'text'
                  ,'field' => 'download_title'
                  ,'label' => 'Download text'
                  ,'description' => __('Appears underneath the image')
              )
          )
      ));

      I know this is a little different than the original post because this code allows for multiple file uploads within the addmore. Do you have any suggestions on how to allow for them to save? Currently it does not allow saving of the files, text field, or the positioning/order of the addmore elements.

    • #4233
      nate9024
      Member

      I apologize – this was not an error with Piklist. It was an error with my host’s caching which was causing the save problems. Please disregard my previous post; it is working fine!

    • #4234
      Steve
      Keymaster

      @nate9024– Welcome to the Piklist community!

      Glad all is working for you. Closing this ticket.

Viewing 8 reply threads
  • The topic ‘Add more group with file upload not saving’ is closed to new replies.