acf-extended / ACF-Extended

🚀 All-in-one enhancement suite that improves WordPress & Advanced Custom Fields
https://www.acf-extended.com
238 stars 27 forks source link

Still having issues with Bi-Directional Relationship #91

Closed ThinkDevStudios closed 2 years ago

ThinkDevStudios commented 2 years ago

Describe the bug Hi! I am really having a hard time figuring this out. still does not work. I have 3 post types mainly subjects, documents and steps Subject can have multiple documents and steps is connected to both documents and subject

if( function_exists('acf_add_local_field_group') ):

acf_add_local_field_group(array(
    'key' => 'group_615c1fcf604d7',
    'title' => 'Document Fields',
    'fields' => array(
        array(
            'key' => 'field_615c1fd647eac',
            'label' => 'Steps',
            'name' => 'steps',
            'type' => 'relationship',
            'instructions' => '',
            'required' => 0,
            'conditional_logic' => 0,
            'wrapper' => array(
                'width' => '',
                'class' => '',
                'id' => '',
            ),
            'post_type' => array(
                0 => 'steps',
            ),
            'taxonomy' => '',
            'filters' => array(
                0 => 'search',
            ),
            'elements' => '',
            'min' => '',
            'max' => '',
            'return_format' => 'id',
            'acfe_bidirectional' => array(
                'acfe_bidirectional_enabled' => true,
                'acfe_bidirectional_related' => array(
                    0 => 'field_615bf826c20f3',
                ),
            ),
        ),
        array(
            'key' => 'field_615c270d7c879',
            'label' => 'Subject',
            'name' => 'subject',
            'type' => 'relationship',
            'instructions' => '',
            'required' => 0,
            'conditional_logic' => 0,
            'wrapper' => array(
                'width' => '',
                'class' => '',
                'id' => '',
            ),
            'post_type' => array(
                0 => 'subjects',
            ),
            'taxonomy' => '',
            'filters' => array(
                0 => 'search',
            ),
            'elements' => '',
            'min' => '',
            'max' => '',
            'return_format' => 'id',
            'acfe_bidirectional' => array(
                'acfe_bidirectional_enabled' => '1',
                'acfe_bidirectional_related' => array(
                    0 => 'field_615c26a518adb',
                ),
            ),
        ),
    ),
    'location' => array(
        array(
            array(
                'param' => 'post_type',
                'operator' => '==',
                'value' => 'documents',
            ),
        ),
    ),
    'menu_order' => 0,
    'position' => 'normal',
    'style' => 'default',
    'label_placement' => 'left',
    'instruction_placement' => 'label',
    'hide_on_screen' => '',
    'active' => true,
    'description' => '',
    'acfe_display_title' => '',
    'acfe_autosync' => '',
    'acfe_form' => 0,
    'acfe_meta' => '',
    'acfe_note' => '',
));

acf_add_local_field_group(array(
    'key' => 'group_615bf7f0788d9',
    'title' => 'Steps Fields',
    'fields' => array(
        array(
            'key' => 'field_615bf800c20f2',
            'label' => 'Subject',
            'name' => 'subject',
            'type' => 'relationship',
            'instructions' => '',
            'required' => 1,
            'conditional_logic' => 0,
            'wrapper' => array(
                'width' => '',
                'class' => '',
                'id' => '',
            ),
            'post_type' => array(
                0 => 'subjects',
            ),
            'taxonomy' => '',
            'filters' => array(
                0 => 'search',
            ),
            'elements' => '',
            'min' => '',
            'max' => '',
            'return_format' => 'id',
            'acfe_bidirectional' => array(
                'acfe_bidirectional_enabled' => '1',
                'acfe_bidirectional_related' => array(
                    0 => 'field_618b46a59971c',
                ),
            ),
        ),
        array(
            'key' => 'field_615bf826c20f3',
            'label' => 'Document',
            'name' => 'document',
            'type' => 'relationship',
            'instructions' => '',
            'required' => 1,
            'conditional_logic' => 0,
            'wrapper' => array(
                'width' => '',
                'class' => '',
                'id' => '',
            ),
            'post_type' => array(
                0 => 'documents',
            ),
            'taxonomy' => '',
            'filters' => array(
                0 => 'search',
            ),
            'elements' => '',
            'min' => '',
            'max' => '',
            'return_format' => 'id',
            'acfe_bidirectional' => array(
                'acfe_bidirectional_enabled' => '1',
                'acfe_bidirectional_related' => array(
                    0 => 'field_615c1fd647eac',
                ),
            ),
        ),
    ),
    'location' => array(
        array(
            array(
                'param' => 'post_type',
                'operator' => '==',
                'value' => 'steps',
            ),
        ),
    ),
    'menu_order' => 0,
    'position' => 'normal',
    'style' => 'default',
    'label_placement' => 'left',
    'instruction_placement' => 'label',
    'hide_on_screen' => '',
    'active' => true,
    'description' => '',
    'acfe_display_title' => '',
    'acfe_autosync' => '',
    'acfe_form' => 0,
    'acfe_meta' => '',
    'acfe_note' => '',
));

acf_add_local_field_group(array(
    'key' => 'group_615c2698d8d63',
    'title' => 'Subject Fields',
    'fields' => array(
        array(
            'key' => 'field_615c26a518adb',
            'label' => 'Documents',
            'name' => 'documents',
            'type' => 'relationship',
            'instructions' => '',
            'required' => 0,
            'conditional_logic' => 0,
            'wrapper' => array(
                'width' => '',
                'class' => '',
                'id' => '',
            ),
            'post_type' => array(
                0 => 'documents',
            ),
            'taxonomy' => '',
            'filters' => array(
                0 => 'search',
            ),
            'elements' => '',
            'min' => '',
            'max' => '',
            'return_format' => 'id',
            'acfe_bidirectional' => array(
                'acfe_bidirectional_enabled' => true,
                'acfe_bidirectional_related' => array(
                    0 => 'field_615c270d7c879',
                ),
            ),
        ),
        array(
            'key' => 'field_618b46a59971c',
            'label' => 'Steps',
            'name' => 'steps',
            'type' => 'relationship',
            'instructions' => '',
            'required' => 0,
            'conditional_logic' => 0,
            'wrapper' => array(
                'width' => '',
                'class' => '',
                'id' => '',
            ),
            'post_type' => array(
                0 => 'steps',
            ),
            'taxonomy' => '',
            'filters' => array(
                0 => 'search',
            ),
            'elements' => '',
            'min' => '',
            'max' => '',
            'return_format' => 'id',
            'acfe_bidirectional' => array(
                'acfe_bidirectional_enabled' => true,
                'acfe_bidirectional_related' => array(
                    0 => 'field_615bf800c20f2',
                ),
            ),
        ),
    ),
    'location' => array(
        array(
            array(
                'param' => 'post_type',
                'operator' => '==',
                'value' => 'subjects',
            ),
        ),
    ),
    'menu_order' => 0,
    'position' => 'normal',
    'style' => 'default',
    'label_placement' => 'left',
    'instruction_placement' => 'label',
    'hide_on_screen' => '',
    'active' => true,
    'description' => '',
    'acfe_display_title' => '',
    'acfe_autosync' => '',
    'acfe_form' => 0,
    'acfe_meta' => '',
    'acfe_note' => '',
));
endif;

Expected behavior when creating a step, I should be able to select the document and subject relationship and step will already connected on both subject and document using bi-directional relationship

Screenshots If applicable, add screenshots to help explain your problem.

WordPress & ACF WordPress version: 5.8.1 ACF Pro version: 5.9.5 ACF add-ons: ACF Extended 0.8.8.6

Add any other context about the problem here.

acf-extended commented 2 years ago

Hello,

This is a duplicate of the other ticket #85. I'm closing this one to avoid confusion.