humanmade / Custom-Meta-Boxes

Lets you easily create metaboxes with custom fields that will blow your mind.
522 stars 124 forks source link

Bug with Grouped WYSIWYG Fields Outputting HTML in Post Edit Screen #432

Closed wpmark closed 6 years ago

wpmark commented 7 years ago

I have a group field with a title (text field type), image (image field type) and content (wysiwyg field type). The code which outputs there is below:

'features' => array(
    'id'                  => $prefix . 'product_features',
    'name'                => __( 'Product Features', 'hd-utility' ),
    'type'                => 'group',
    'repeatable'          => true,
    'sortable'            => true,
    'string-repeat-field' => __( 'Add New Feature', 'hd-utility' ),
    'string-delete-field' => __( 'Remove Features', 'hd-utility' ),
    'cols'                => 12,
    'fields'              => array(
        'title'   => array(
            'id'     => 'title',
            'name'   => __( 'Feature Title', 'hd-utility' ),
            'type'   => 'text',
            'cols'   => 6,
        ),
        'image'   => array(
            'id'      => 'image',
            'name'    => __( 'Feature Image', 'hd-utility' ),
            'type'    => 'image',
            'cols'    => 6,
        ),
        'content' => array(
            'id'      => 'content',
            'name'    => __( 'Feature Content', 'hd-utility' ),
            'type'    => 'wysiwyg',
            'cols'    => 12,
            'options' => array(
                'textarea_rows' => 4,
            ),
        ),
    ),
),

This code works well in WordPress 4.7.4 and produces the correct output on the post edit screen. In WordPress 4.7.5 it would appear broken in that it is outputting the following on the post edit screen when clicking to add a new group field.

screen shot 2017-05-27 at 21 15 42

Is this a bug or me doing something wrong? I have checked this with same code on a site running WordPress 4.7.4 and a site running WordPress 4.7.5 and it breaks on the latter only.

Many thanks and advance.

alihassanansari commented 7 years ago

Thanks.

mikeselander commented 6 years ago

@wpmark which branch of HMCMB are you testing this on?

wpmark commented 6 years ago

This was using the 1.0.3 release.

mikeselander commented 6 years ago

@wpmark could you try out the develop branch/1.1 version and let me know if this is fixed for you there?

pdewouters commented 6 years ago

@mikeselander yes the issue is fixed on the develop branch - is it stable enough to use on a client project? Or what is the offending code so that I may do a hotfix directly on the repo

mikeselander commented 6 years ago

@pdewouters I believe one of our larger A-Pac clients is using this branch on production, but I'm not personally willing to mark it as production-ready.

It's possible to track down the code that fixed it, but it would take a while as we've made some pretty large moves on this branch. Best case would be to give this the time to mark a release - hopefully I'll have some time this week but can't guarantee it.

How high a priority is this for you?

pdewouters commented 6 years ago

the bug is affecting a live client site, so I'd say high.

mikeselander commented 6 years ago

Since this has been verified as fixed on the develop branch I'm going to close this ticket out. We should be pushing a release with the fix shortly.