Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Term meta is saved but it doesn't appear in term edit screen later #700

Closed
taunoha opened this issue Aug 2, 2016 · 13 comments
Closed

Term meta is saved but it doesn't appear in term edit screen later #700

taunoha opened this issue Aug 2, 2016 · 13 comments

Comments

@taunoha
Copy link

taunoha commented Aug 2, 2016

I've run into a problem where the metadata is stored but It doesn't appear in term edit screen later.

    $oi_catalog = new_cmb2_box( array(
            'id' => $prefix . 'catalog_metabox',
            'title' => esc_attr__('Catalog settings'),
            'object_types' => array('term'),
            'taxonomies' => array('product_category'),
            'context' => 'normal',
            'priority' => 'high',
            'show_names' => true
        )
    );

    $oi_catalog_group_id = $oi_catalog->add_field( array(
            'id'          => '_cmb_catalog_repeat_group',
            'type'        => 'group',
            'options'     => array(
                'group_title'   => __( 'Banner {#}'),
                'add_button'    => __( 'Add banner'),
                'remove_button' => __( 'Remove banner'),
                'closed'    => false,
                'sortable' => false
            )
        )
    );

    $oi_catalog->add_group_field($oi_catalog_group_id, array(
            'name' => 'URL',
            'id'   => 'url',
            'type' => 'text_url'
        )
    );

Am I missing something? I'm running WP 4.5.3, CMB2 2.2.2.1

@tw2113
Copy link
Contributor

tw2113 commented Aug 2, 2016

Hey @taunoha can you start a thread for this over at https://wordpress.org/support/plugin/cmb2 and we'll get you taken care of there. If we find it is indeed a bug in CMB2 itself, we'll move the new details back here.

Thanks.

@rogercoathup
Copy link

We are seeing the same problem -- group fields don't display in term meta after saving

@jtsternberg
Copy link
Member

As soon as I can duplicate this issue, it's something I can look into. Right now, it would appear to be an environment specific issue. You may want to try the standard "deactivate all other plugins and switch to default theme" to see if that helps narrow down the issue.

@rogercoathup
Copy link

rogercoathup commented Nov 17, 2016

@jtsternberg -- if you'd like; to help you duplicate -- I can send you our plugin that creates the meta fields (CMB2 is added via composer)... you can activate and hopefully see the same problem.

[Edit: I've tested with 2016, and no other plugins activated, and it still fails]

@jtsternberg
Copy link
Member

@tw2113
Copy link
Contributor

tw2113 commented Nov 17, 2016

@rogercoathup for what it's worth, myself, and I believe Justin, aren't sure that it's anything to do with the CMB2 configuration, but some conflict coming from away from CMB2.

Alternative possibility, perhaps a different version of CMB2 bundled with a different plugin getting loaded first? or even the theme could be doing something like this.

@rogercoathup
Copy link

@tw2113 -- I've not had chance to try Justin's PR yet. I'll try to make time later today.

Please see my edit above though -- I've tried with just our plugin that creates the meta, no other plugins active and the 2016 theme (so just the one instance of CMB2), and the repeatable group still fails in that case on a term page (the repeatable group works fine on a post type page, and other types of meta field work on term page ok).

@tw2113
Copy link
Contributor

tw2113 commented Nov 17, 2016

No rush on the PR testing, we understand people have busy schedules.

Noted on the other part, and sounds very much like the setup I was using for https://wordpress.org/support/topic/term-meta-is-saved-but-it-doesnt-appear-in-term-edit-screen-later/page/2/#post-8444411 and the results I outlined there.

To aid in things, I'd be willing to take a copy of the plugin you're using for this, and try to recreate similar to how I was in that wordpress.org reply. If I don't succeed then, would you be willing to do a step by step for what you're doing? For example "upload and set an image", "fill in a value for 2nd field", "hit save", "Click edit term link". Very nitpicky detailed steps to ensure recreateabilty for every step.

@rogercoathup
Copy link

Thanks @tw2113 -- is there an email address I can send it to you on? I don't want to share in public as it has the client name / details in the code

@tw2113
Copy link
Contributor

tw2113 commented Nov 17, 2016

michael @ webdevstudios.com will reach me.

@rogercoathup
Copy link

@jtsternberg -- yes, that PR fixes the problem for me.

@tw2113 tw2113 reopened this Nov 23, 2016
@tw2113
Copy link
Contributor

tw2113 commented Nov 23, 2016

@jtsternberg I'm reopening, and from what I'm understanding, the #763 PR is working with no ill effects thus far, from tester feedback.

@joshuadavidnelson
Copy link

I was having the same issue on a custom taxonomy, the field wouldn't populate (though it appeared to save the data to the database). PR #763 fixed the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants