Custom Fields
Re-Envisioned
Support Meta Box Group Bug with the ids of the clonable fields.

This topic contains 1 reply, has 2 voices, and was last updated by  Anh Tran 2 years, 3 months ago.

  • Creator
    Topic
  • #4353

    Webbio
    Participant

    Greeting everyone,

    I have found a bug in the plugin that you might want to take a look at. It concerns cloning groups of fields with WYSIWYG sub fields. If you have the id of the wysiwyg field something like “informatie_dropdown_1_clonable_groep_inhoud” when you clone the field, instead of adding “_1”, “_2” and so on at the end of the id of the hidden textarea, it changes the existing “_1” in the id to “_2” and so on.

    In my case I addressed the issue by changing the “_1” to a alpha value and everything was ok but in my opinion it is something worth addressing.

    Here’s a complete code to test and replicate the issue:

    $meta_boxes[] = array(
            'id' => 'informatie_dropdown_groep',
            'title' => __('Informatie Dropdown 1 Groep', ''),
            'pages' => array('page'),
            'context' => 'normal', // Where the meta box appear: normal (default), advanced, side. Optional.
            'priority' => 'high',
            'fields' => array(
                array(
                    'name' => __('Informatie Groep 1 Titel', ''),
                    'desc' => __(''),
                    'id' => "{$oyeprefix}informatie_groep_1_title",
                    'type' => 'text',
                ),
                array(
                    'name' => 'Informatie Dropdown 1', // Optional
                    'id' => 'informatie_dropdown_1_clonable_group',
                    'type' => 'group',
                    'clone' => true,
                    'sort_clone' => true,
                    'fields' => array(
                        array(
                            'name' => __('Informatie Dropdown 1 Groep Titel', ''),
                            'desc' => __(''),
                            'id' => "{$oyeprefix}informatie_dropdown_1_clonable_groep_titel",
                            'type' => 'text',
                        ),
                        array(
                            'name' => __('Informatie Dropdown 1 Groep Inhoud', ''),
                            'desc' => __(''),
                            'id' => "{$oyeprefix}informatie_dropdown_1_clonable_groep_inhoud",
                            'type' => 'wysiwyg',
                        ),
                    )
                ),
                
            )
        );
Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #4365

    Anh Tran
    Keymaster

    Looks like the regex pattern matches the wrong position. I will take a look at that.

    Thanks for letting me know.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.