This topic contains 2 replies, has 2 voices, and was last updated by  Steve 4 days, 19 hours ago.

  • Author
    Posts
  • #9479

    nnovosad
    Participant

    Hi. I noticed that after the restoration of the revision, data from fields of the type ‘group’ disappear. Data from fields of another type do not disappear.
    WP version 5.2.2; Piklist version 1.0.4; PHP 7.2.21.
    There were 3 fields with type ‘group’ on the page.
    Example one field:

    piklist('field', array(
        'type' => 'group',
        'field' => 'careers_drives_group',
        'label' => __('Drives Items', 'vts'),
        'add_more' => 'true',
        'description' => __('A grouped fields for drives items', 'vts'),
        'sortable' => 'true',
        'fields' => array(
            array(
                'type' => 'text',
                'field' => 'title',
                'label' => __('Title', 'vts'),
                'columns' => '12'
            ),
            array(
                'type' => 'textarea',
                'field' => 'description',
                'label' => __('Description', 'vts'),
                'columns' => 12,
                'attributes' => array(
                    'class' => 'large-text',
                    'rows' => '3'
                )
            ),
            array(
                'type' => 'file',
                'field' => 'img',
                'label' => __('Image', 'vts'),
                'columns' => 12,
                'options' => array(
                    'title' => __('Add File', 'vts'),
                    'button' => __('Add', 'vts')
                ),
                'validate' => array(
                    array(
                        'type' => 'limit',
                        'options' => array(
                            'min' => 1,
                            'max' => 1,
                        )
                    )
                )
            ),
        )
    ));

    It can be fixed?

  • #9480

    nnovosad
    Participant

    I compared the values from the post_meta table in the database before and after the revision.
    Before: a:6:{i:0;a:3:{s:5:”title”;s:25:”Title Value”;…data…}
    After: s:1117: “a:6:{i:0;a:3:{s:5:”title”;s:25:”Title Value”;…data…}”;

  • #9487

    Steve
    Keymaster

    So, you’re saying:

    1) Save group data(BEFORE format)
    2) Save changes again
    3) Restore a revision (AFTER format)

    correct?

You must be logged in to reply to this topic.