• Resolved gnucco123

    (@gnucco123)


    Hi all, I have a question about the new feature “clone empty start”. My site has 1 (custom) field group with some different type custom fields, including some clonable ones. When I start a new post, the first line of clonable custom fields shows, empty. If I compile one of these fields and not the other clonable fields and save, when I edit agin the post the first line of cloneable fields disappear, as clone_empty_start is set to true.
    Is this behaviour done on purpose? I mean, clone_empty_start = false with new posts and clone_empty_start = true with edited posts? Is there an option I can set somewhere to avoid the “disappearing” of the first line of clonable fields?
    Thanks for the information, in the meantime I had to rollback the plugin to the version 5.9.11 prior to the introduction of the “clone empty start” feature.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Tan Nguyen

    (@tanng)

    Dear @gnucco123

    Thanks for using our plugin, I have checked with our case but cannot replicate, could you please share your meta box setup here or via our contact form? I’ll try my best to solve this issue.

    Cheers!

    Thread Starter gnucco123

    (@gnucco123)

    Hi @tanng, thanks for you interest. The code in my functions.php is the following:

    add_filter( 'rwmb_meta_boxes', 'your_prefix_register_meta_boxes' );

    function your_prefix_register_meta_boxes( $meta_boxes ) {
    $prefix = '';

    $meta_boxes[] = [
    'title' => esc_html__( 'Info', 'text-domain' ),
    'id' => 'info',
    'post_types' => ['post'],
    'context' => 'normal',
    'priority' => 'high',
    'fields' => [
    [
    'id' => $prefix . 'regione',
    'name' => esc_html__( 'Regione', 'text-domain' ),
    'type' => 'checkbox_list',
    'options' => [
    'Lombardia' => esc_html__( 'Lombardia', 'text-domain' ),
    'Veneto' => esc_html__( 'Veneto', 'text-domain' ),
    'Emilia Romagna' => esc_html__( 'Emilia Romagna', 'text-domain' ),
    'Trentino Alto Adige' => esc_html__( 'Trentino Alto Adige', 'text-domain' ),
    'Liguria' => esc_html__( 'Liguria', 'text-domain' ),
    'Friuli Venezia Giulia' => esc_html__( 'Friuli Venezia Giulia', 'text-domain' ),
    'Toscana' => esc_html__( 'Toscana', 'text-domain' ),
    'Marche' => esc_html__( 'Marche', 'text-domain' ),
    'Piemonte' => esc_html__( 'Piemonte', 'text-domain' ),
    'Valle d
    Aosta' => esc_html__( 'Valle dAosta', 'text-domain' ),
    'Umbria' => esc_html__( 'Umbria', 'text-domain' ),
    'Abruzzo' => esc_html__( 'Abruzzo', 'text-domain' ),
    'Basilicata' => esc_html__( 'Basilicata', 'text-domain' ),
    'Sicilia' => esc_html__( 'Sicilia', 'text-domain' ),
    'Svizzera' => esc_html__( 'Svizzera', 'text-domain' ),
    'Austria' => esc_html__( 'Austria', 'text-domain' ),
    'Francia' => esc_html__( 'Francia', 'text-domain' ),
    'Belgio' => esc_html__( 'Belgio', 'text-domain' ),
    'Norvegia' => esc_html__( 'Norvegia', 'text-domain' ),
    ],
    'inline' => 1,
    ],
    [
    'id' => $prefix . 'distanza_da_casa',
    'type' => 'text',
    'name' => esc_html__( 'Distanza da casa', 'text-domain' ),
    ],
    [
    'id' => $prefix . 'partenza',
    'type' => 'text',
    'name' => esc_html__( 'Partenza', 'text-domain' ),
    ],
    [
    'id' => $prefix . 'arrivo',
    'type' => 'text',
    'name' => esc_html__( 'Arrivo', 'text-domain' ),
    ],
    [
    'id' => $prefix . 'rientro',
    'name' => esc_html__( 'Rientro', 'text-domain' ),
    'type' => 'checkbox_list',
    'options' => [
    'Bici' => esc_html__( 'Bici', 'text-domain' ),
    'Bici (anello)' => esc_html__( 'Bici (anello)', 'text-domain' ),
    'Auto' => esc_html__( 'Auto', 'text-domain' ),
    'Treno' => esc_html__( 'Treno', 'text-domain' ),
    'Bus' => esc_html__( 'Bus', 'text-domain' ),
    'Bus con portabici' => esc_html__( 'Bus con portabici', 'text-domain' ),
    ],
    'inline' => 1,
    ],
    [
    'id' => $prefix . 'orario_treni_sabato',
    'name' => esc_html__( 'Orario treni (Sabato)', 'text-domain' ),
    'type' => 'time',
    'js_options' => [
    'stepMinute' => 1,
    ],
    'clone' => 1,
    'clone_as_multiple' => true,
    ],
    [
    'id' => $prefix . 'orario_treni_domenica',
    'name' => esc_html__( 'Orario treni (Domenica)', 'text-domain' ),
    'type' => 'time',
    'js_options' => [
    'stepMinute' => 1,
    ],
    'clone' => 1,
    'clone_as_multiple' => true,
    ],
    [
    'id' => $prefix . 'ex_ferrovia',
    'type' => 'text',
    'name' => esc_html__( 'Ex ferrovia?', 'text-domain' ),
    ],
    [
    'id' => $prefix . 'link',
    'type' => 'text',
    'name' => esc_html__( 'Link', 'text-domain' ),
    'clone' => 1,
    'clone_as_multiple' => true,
    ],
    [
    'id' => $prefix . 'fiume',
    'type' => 'text',
    'name' => esc_html__( 'Fiume', 'text-domain' ),
    'clone' => 1,
    'clone_as_multiple' => true,
    ],
    [
    'id' => $prefix . 'tipo_ciclabile',
    'name' => esc_html__( 'Tipo ciclabile', 'text-domain' ),
    'type' => 'checkbox_list',
    'options' => [
    'Strada' => esc_html__( 'Strada', 'text-domain' ),
    'Asfalto' => esc_html__( 'Asfalto', 'text-domain' ),
    'Sterrato' => esc_html__( 'Sterrato', 'text-domain' ),
    'Sentiero MTB' => esc_html__( 'Sentiero MTB', 'text-domain' ),
    ],
    'inline' => 1,
    ],
    [
    'id' => $prefix . 'note_html',
    'name' => esc_html__( 'Note_html', 'text-domain' ),
    'type' => 'wysiwyg',
    ],
    [
    'id' => $prefix . 'note_importanti',
    'type' => 'textarea',
    'name' => esc_html__( 'NOTE IMPORTANTI!', 'text-domain' ),
    ],
    [
    'id' => $prefix . 'file_upload',
    'type' => 'file_upload',
    'name' => esc_html__( 'File Upload', 'text-domain' ),
    'max_status' => false,
    ],
    [
    'id' => $prefix . 'distanza_gpx',
    'type' => 'number',
    'name' => esc_html__( 'Distanza gpx [km]', 'text-domain' ),
    ],
    [
    'id' => $prefix . 'related_posts',
    'type' => 'post',
    'name' => esc_html__( 'Related Posts', 'text-domain' ),
    'post_type' => 'post',
    'field_type' => 'select_advanced',
    'multiple' => true,
    ],
    [
    'id' => $prefix . 'nazione_temp',
    'name' => esc_html__( 'Nazione4temp', 'text-domain' ),
    'type' => 'checkbox_list',
    'options' => [
    'Italia' => esc_html__( 'Italia', 'text-domain' ),
    'Francia' => esc_html__( 'Francia', 'text-domain' ),
    'Germania' => esc_html__( 'Germania', 'text-domain' ),
    'Spagna' => esc_html__( 'Spagna', 'text-domain' ),
    'Danimarca' => esc_html__( 'Danimarca', 'text-domain' ),
    'Irlanda' => esc_html__( 'Irlanda', 'text-domain' ),
    'Scozia' => esc_html__( 'Scozia', 'text-domain' ),
    'Austria' => esc_html__( 'Austria', 'text-domain' ),
    'Slovenia' => esc_html__( 'Slovenia', 'text-domain' ),
    'Olanda' => esc_html__( 'Olanda', 'text-domain' ),
    'Svizzera' => esc_html__( 'Svizzera', 'text-domain' ),
    ],
    'inline' => 1,
    ],
    ],
    ];

    return $meta_boxes;

    }

    If I start a new post, I see the box as the image here

    Then if I add a custom field in a repeatable field (“Fiumi” for example, see here)

    and then hit “Publish”, the result with the latest 5.10.2 version is this

    but I prefer the 5.9.11 behaviour, which is this

    Thanks again for your help, I’ve searched in support forums but I didn’t find anything about it.

    Bye

    Plugin Contributor Tan Nguyen

    (@tanng)

    Hi @gnucco123,

    Thanks for your time and a very detailed explanation, I was able to replicate it now, I confirmed it a bug and will fix it and get back to you as soon as I can.

    Have a good day,

    Tan

    Plugin Author Anh Tran

    (@rilwis)

    Hi @gnucco123 ,

    @tanng fixed it in version 5.10.3. Can you please try again?

    Thread Starter gnucco123

    (@gnucco123)

    Hi, yes, it’s perfect now. Thank you very much for your time and effort.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.