Tagged: ,

Viewing 6 reply threads
  • Author
    Posts
    • #4005
      lvlo
      Participant

      Hi guys!

      I’m having troubles with repeatable group field which contains one “file” field and repeatable textarea:

      • When I add new group – there is no “file” field.
      • After saving the post repetable textareas looks like new group’s sections but not like part of group.

      See attached images for more details.

      How can I resolve this issue?

      The code:

      
      piklist( 'field',
          array(
              'type' => 'group',
              'field' => 'guide_section',
              'add_more' => TRUE,
              'label' => 'Секция',
              'description' => '',
              'template' => 'field',
              'fields' => array(
      
                  array(
                      'type' => 'file',
                      'field' => 'image',
                      'label'=> 'Фотография',
                      'description' => '',
                      'columns' => 4,
                      'options' => array(
                          'modal_title' => 'Добавить фотографию',
                          'button' => 'Добавить фотографию'
                      )
                  ),
      
                  array(
                      'type' => 'textarea',
                      'field' => 'description',
                      'label' => 'Описание шага',
                      'description' => '',
                      'add_more' => TRUE,
                      'columns' => 8                    
                  ),
      
      )   )   );
      

      Thank for your time!

      Sergey

      Attachments:
      You must be logged in to view attached files.
    • #4010
      Steve
      Keymaster

      @lvlo– This is a known bug and on our list of todos. Unfortunately, there is no known fix right now.

    • #4011
      lvlo
      Participant

      Thank you for the reply @Steve.

      Wish you good luck to find fixes for this and other issues!

      Sergey

    • #5517
      r.cespa
      Participant

      @Steve – Good morning and Happy New Year!
      I’m using piklist in a project and I’m trying to set up a setting page using group fields, add_mores and file fields.
      Basically there is a group Sliders containing slides; each slides contains a file field and four text fileds (title, subtitle, CallToAction text, URL).
      I’m facing the same problem as lvlo and I was wondering if the bug has been fixed or if you or any user found a workaround.

      AFAIK the problem seems to be related to data serialization when saving to wp_options table: when saving data it creates an array for every single element but the array containing file information is “wrongly sized”; what I mean is that the first array (background of first slide) has one single element with index 0; the second array (background of second slide) has two (??) elements: the first one (index: 0) is set to undefined while the second one (index: 1) is set to image ID.
      If I manually alter the serialized string and correct the anomaly, the page is displayed correctly until I add a new element. If I modify existing elements it still looks ok.

      Some information about my current setup:
      WP 4.3.2 MultiSite
      Piklist 0.9.4.29

      Correct serialized data:
      a:1:{s:6:"slider";a:1:{s:5:"slide";a:2:{i:0;a:5:{s:10:"background";a:1:{i:0;a:1:{i:0;s:3:"456";}}s:8:"h1_title";a:1:{i:0;s:12:"Test Title 1";}s:8:"h2_title";a:1:{i:0;s:15:"Test Subtitle 1";}s:3:"cta";a:1:{i:0;s:5:"CTA 1";}s:7:"cta_url";a:1:{i:0;s:22:"http://www.example.com";}}i:1;a:5:{s:10:"background";a:1:{i:0;a:1:{i:0;s:3:"156";}}s:8:"h1_title";a:1:{i:0;s:12:"Test Title 2";}s:8:"h2_title";a:1:{i:0;s:15:"Test Subtitle 2";}s:3:"cta";a:1:{i:0;s:5:"CTA 2";}s:7:"cta_url";a:1:{i:0;s:23:"http://www2.example.com";}}}}}

      Wrong serialized data string (I added a third slide):
      a:1:{s:6:"slider";a:1:{s:5:"slide";a:3:{i:0;a:5:{s:10:"background";a:1:{i:0;a:1:{i:0;s:3:"456";}}s:8:"h1_title";a:1:{i:0;s:12:"Test Title 1";}s:8:"h2_title";a:1:{i:0;s:15:"Test Subtitle 1";}s:3:"cta";a:1:{i:0;s:5:"CTA 1";}s:7:"cta_url";a:1:{i:0;s:22:"http://www.example.com";}}i:1;a:5:{s:10:"background";a:1:{i:1;a:1:{i:0;s:3:"156";}}s:8:"h1_title";a:1:{i:0;s:12:"Test Title 2";}s:8:"h2_title";a:1:{i:0;s:15:"Test Subtitle 2";}s:3:"cta";a:1:{i:0;s:5:"CTA 2";}s:7:"cta_url";a:1:{i:0;s:23:"http://www2.example.com";}}i:2;a:5:{<strong>s:10:"background";a:1:{i:2;a:2:{i:0;s:9:"undefined";i:1;s:3:"318";}</strong>}s:8:"h1_title";a:1:{i:0;s:12:"Test Title 3";}s:8:"h2_title";a:1:{i:0;s:15:"Test Subtitle 3";}s:3:"cta";a:1:{i:0;s:5:"CTA 3";}s:7:"cta_url";a:1:{i:0;s:23:"http://www3.example.com";}}}}}

      Ciao,
      Roberto

    • #5518
      r.cespa
      Participant

      One more information: removing the file field solves the problem about wrong visualization but I noticed a new strange behavior.
      I added a couple of slides to my slider group (without images, of course, only text fields). I saved the data and everything was fine.
      I then added a third slide, saved the data and everything was fine.
      I removed the third slide using the ” – ” button, I saved the data and I was presented with three slides with the third with empty fields: this looks partially correct to me because data was removed but I expected to see only two slides.

      Thanks,
      Roberto

    • #5519
      Steve
      Keymaster

      Hi Roberto– This is still an issue and will be addresses in the next version of Piklist.

    • #5977
      tiberiur
      Participant

      +1 here

      Any updates with this issue?

      Thank you.

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