You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should be able to drag and drop nested complex fields that contain elements with conditional logic.
⚠️
It may be related to #655 but is a separated issue, as #655 has been fixed in 3.1.6
Actual Behavior
When a complex field inside another complex field contains some elements with conditional logic, the whole page can break when you're moving this field.
It seems the error come from the following file (packages/metaboxes/hocs/with-conditional-logic/index.js), and that Carbon Fields is lots in nested complex fields:
/**
* The function that provides the data that needs to be
* evaluated by conditional logic.
*
* @param {Object} props
* @param {Object} fields
* @return {Object}
*/
function output( props, fields ) {
fields = keyBy( fields, 'id' );
const container = select( 'carbon-fields/metaboxes' ).getContainerById( props.containerId );
const isTopLevelField = some( container.fields, [ 'id', props.id ] );
let siblingFields = [];
// …
if ( isNestedComplex ) {
const groupField = find( get( fields, pathPrefix ), [ 'name', chunk ] );
pathPrefix = `${ groupField.id }.value`;
depth--;
}
// …
}
Additional Container definitions that do NOT raise any error
With nested complex fields, but without conditional logic:
@vvasilev- also have the same issue and 3.1.8 update did not help -
vendor.min.js?ver=3.1.8:49 TypeError: Cannot read property 'fields' of undefined
at H (metaboxes.min.js?ver=3.1.8:1)
at metaboxes.min.js?ver=3.1.8:1
at core.min.js?ver=3.1.8:10
at Object.next (vendor.min.js?ver=3.1.8:57)
at vendor.min.js?ver=3.1.8:57
at metaboxes.min.js?ver=3.1.8:1
at metaboxes.min.js?ver=3.1.8:1
at vendor.min.js?ver=3.1.8:57
at core.min.js?ver=3.1.8:10
at vendor.min.js?ver=3.1.8:57
Version
Expected Behavior
We should be able to drag and drop nested complex fields that contain elements with conditional logic.
Actual Behavior
When a complex field inside another complex field contains some elements with conditional logic, the whole page can break when you're moving this field.
Container definition
Steps to Reproduce the Problem
You should now see that:
Comments
It seems the error come from the following file (
packages/metaboxes/hocs/with-conditional-logic/index.js
), and that Carbon Fields is lots in nested complex fields:
Additional Container definitions that do NOT raise any error
With nested complex fields, but without conditional logic:
Without nested complex fields, but with conditional logic:
The text was updated successfully, but these errors were encountered: