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

Add "taxonomy_select_hierarchical" in CMB2_Sanitize->default_sanitization() #1307

Merged
merged 1 commit into from Oct 3, 2019

Conversation

latheva
Copy link
Contributor

@latheva latheva commented Oct 2, 2019

The new field type "taxonomy_select_hierarchical" did not save the data to the right table.

Description

I have added a line of code into CMB2_Sanitize->default_sanitization() in order to save the taxonomy_* in to right table.

Motivation and Context

When I tried to work on this new field type, it did not save the data into the right table, it suppose to update the table _term_relationships instead it save the data into _postmeta

Testing procedure

I have tested this code directly in my project. I have a list of custom_type taxonomies for a custom post_type. and with this modification it works as expected in my local, and prod environments.

NOTE: I have dowloaded the project from CMB2:develop branch.

…o database

The new field type "taxonomy_select_hierarchical" did not save the data to the right table.
this upadte to CMB2_Sanitize->default_sanitization(), this is get resolved.
@tw2113
Copy link
Contributor

tw2113 commented Oct 3, 2019

I'm not managing to recreate this postmeta table saving. It keeps saving to the wp_term_relationships table like logically expected.

Do you have other customizations in place that may be contributing to what issues you're seeing?

@latheva
Copy link
Contributor Author

latheva commented Oct 3, 2019

I have re-tested right now and without this modification, the table wp_term_relationships doesn't got updated on my side. I have even tested for the ordinary taxonomy 'category' as well, it seems doesn't work.

@jtsternberg jtsternberg merged commit 972c082 into CMB2:develop Oct 3, 2019
@jtsternberg
Copy link
Member

👍 good catch, thank you!

jtsternberg added a commit that referenced this pull request Oct 7, 2019
lipemat added a commit to lipemat/CMB2 that referenced this pull request Apr 28, 2020
* upstream/develop: (93 commits)
  Ensure to enqueue wp-color-picker
  Add props for CMB2#1331
  Update "develop" bootstrap classname
  Proposal of CODE OF CONDUCT File
  Update version/copyright in scripts/stylesheets
  Fix issues with some tests to get them all passing
  `CMB2::is_box_type()` now also checks for taxonomies if box is registered to "term" object type.
  Prepare for 2.7.0 release
  Add all missing props/udpates to changelog
  bump tested-to value
  Rename CMB2_hookup to CMB2_Hookup Fixes CMB2#1328
  Validate composer.json
  Tested Up To confirmations.
  Update issue templates
  Add license file to meet Community standards
  Add changelog for the register_rest_field_cb param
  Abstract some aspects of the getting/setting of box rest fields to make custom handling easier
  Add ability to short-circuit the register_rest_field with a callback. Allows registering callback with a different rest slug
  Oops, send the fallback value to the box_types method
  Add props for CMB2#1238
  Fixes CMB2#1238 by merging with changes, and add CMB2::is_box_type method for checking. Fixes CMB2#1158
  Add props for CMB2#1314
  minify
  minify
  Re-add padding to textareas for readability
  Fix alpha color picker sample color styling
  clarify coment
  limit to 5.3 branch
  update block editor radio fix
  initial 5.3 prep work
  Add new "cmb2_display_class_{$fieldtype}" filter and field "display_class" parameter to allow specifying the class to use to display the field (in admin columns, etc)
  Fix another place where taxonomy_select_hierarchical was missed
  Add props for CMB2#1296 & CMB2#1297
  Add props for CMB2#1300
  Add props for CMB2#1307
  Update npm dependencis. Fixes CMB2#1308
  Remove grunt-contrib-compress and grunt-combine-media-queries to cut down on npm dependencies
  taxonomy_select_hierarchical is added in order to save correctly in to database
  Fix tests broke by introduction of character counter field property
  Fix issue introduced in 7cb3e00 where field was updated not not returned, breaking things
  If field has supporting data (e.g. file), add supporting data to field data (i.e supporting field id/value)
  Add changelog and props for CMB2#1300
  Update .min file for CMB2#1300
  Add comments to document changes in CMB2#1300
  Include .CodeMirror class in sortable exclusions
  Run the field-specific actions for all fields (including fields in groups). Fixes CMB2#1157
  Escaping Improvements to File Base
  Escaping improvements to File Fields
  Add changelog and props for CMB2#1276
  Refactor character-counter integration
  ...
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

Successfully merging this pull request may close these issues.

None yet

3 participants