Skip Navigation

[Resolved] Similar M-to-M relationships in views behave differently

This thread is resolved. Here is a description of the problem and solution.

Problem: I'm unable to use the "Edit" button in the Loop Wizard next to a Types field, so I can't insert a field from a related post easily. I'm also seeing some strangeness in the Form editor screen.

Solution: Both issues can be resolved by removing Google Maps from Privacy Consent settings in Avada Theme options.

This support ticket is created 5 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 10 replies, has 3 voices.

Last updated by nicolaS-3 5 years ago.

Assisted by: Christian Cox.

Author
Posts
#1379253

M-to-M relationships in views

Hi
please help me to understand why I get different behaviours from similar views, it's driving me crazy !
I have created a child-view (view1) to show items from a M-to-M relationship (store-product) and it works perfectly. Then I replicated the same structure in another view2 using another M-to-M relationship (review-product) and it doesn't work the same way !
I have noticed that in view1 in the loop Wizard I have selected standard WP fields and for each one of them I could click on Modify and specify "The parent of the current post in the same post type, set by WordPress hierarchical relationship" while in view1 - where I need to select just Toolset custom fields - clicking on Modify nothing happens and field shortcodes in set the template are different:

View1

[wpv-post-featured-image item="@store-product.parent"] - standard field OK !
[wpv-post-link item="@store-product.parent"] - standard field OK !

View2

[wpv-post-title item="@review-product.parent"] - standard field OK !
[types field="review_type"][/types] - Toolset field, not shown
[types field="review-url"][/types] - Toolset field, not shown

In View2 I was expecting to see:
[wpv-review-type item="@review-product.parent"]
[wpv-review-url item="@review-product.parent"]

but this is not the case, what am I doing wrong ?
thanks
Regards
Nicola

#1379505

I have noticed that in view1 in the loop Wizard I have selected standard WP fields and for each one of them I could click on Modify and specify "The parent of the current post in the same post type, set by WordPress hierarchical relationship"
Hello, let me jump in and clarify something here. Toolset's post relationships and WordPress hierarchical relationships are not the same thing. You would only choose this option if the posts are created using the "hierarchical" post type setting, like native WordPress Pages. This setting allows you to nest one Page under another Page, but it is not appropriate for Toolset's post relationships. For Toolset's post relationships, choose "A post related to the current post, set by a Types relationship" and select the appropriate relationship in the dialog. It seems like you did this correctly in View 1, based on the code you provided. Just wanted to clarify this for your reference.

In View2 I was expecting to see:
[wpv-review-type item="@review-product.parent"]
[wpv-review-url item="@review-product.parent"]

Well first of all there is no wpv-review-type or wpv-review-url shortcode. You can review the Views shortcodes available here:
https://toolset.com/documentation/user-guides/views-shortcodes/

The Types field shortcode can be used to display Types custom fields. When you insert a Types field using the Fields and Views button, you can use the Post Selection tab to select a related post. When you insert a Types field in the Loop Wizard dialog, you can click the "Edit" button next to the field name to display the Post Selection tab. Once the View has already been created, you should delete the existing shortcode and start a new one from scratch by clicking Fields and Views.

If the fields are on the parent Review post, the following code should work:

[types field="review_type" item="@review-product.parent"][/types]
[types field="review-url" item="@review-product.parent"][/types]

If not, I would need to take a closer look.

#1379817

Hi Christian,
thanks for this. I was able to show the CPT fields content, adding item="@review-product.parent" by hand. What happens is that in the loop wizard I can't show the Display options, Post selection window for Toolset fields, it appears only for standard WP fields (post title for example). For Toolset CPT clicking on the Edit button nothing happens. Consequently for Toolset CPTs I just get :
[types field="review_type" ][/types]
[types field="review-url"][/types]
and no field content is shown on the page of course.
Is this an Edit button bug ?
Thanks
Regards
Nicola

#1380329

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Nicola,

Christian is currently on Holiday today but will be back tomorrow to continue this ticket with you.

Thanks,
Shane

#1381071

What happens is that in the loop wizard I can't show the Display options, Post selection window for Toolset fields, it appears only for standard WP fields (post title for example).
That is unusual. This sounds like something we need to investigate in more detail. There could be a compatibility issue with another plugin, or something else we need to look into. Can you try these troubleshooting steps first?
- Temporarily deactivate all plugins except Types and Views, and activate a default theme like Twenty Nineteen.
- Clear your browser cache and test the Edit button in the Loop Wizard again.
- If the problem is resolved, reactivate your theme and other plugins one by one until the problem returns.
- If the problem is not resolved, I need to take a closer look.

Let me know what you find out and we can go from there.

#1381421

Hi Christian,
following your suggestion, the first thing I tried was to deactivate Avada, the most complex object i have. And indeed I found the guilty. In Twenty Nineteen clicking on Edit the window appears as expected. I can temporarily deactivate Avada, create the view and then reactivate Avada, waiting for a solution.
Many thanks.
Kind regards
Nicola

#1381527

Can you tell me the version of Avada you're using, and if your Fusion plugins and patches are up-to-date? I'll try to replicate this locally with my own copy of the theme.

#1381791
before_saving.png
after_saving.png

Hi Christian
I'm on 6.1.1 fully patched (this morning I applied 3 patches).
I'll give you another conflict I found. If you go to Toolset Forms and try to edit one, you got the message "Please select a user role" and the form editor is not available yet. If you select the user role and scroll down to the editor you still got the same message and the form editor is not available. Disabling Avada everything works fine. I attach 2 images of the edit: before and after saving. Notice that after saving the role disappears and the butto is still in Save Form mode (I just did it ...).
From now on every time something doesn't work as expected I deactivate Avada and try again. Or should I stop using Avada and move to Guthemberg ?

#1382355

I'm not able to reproduce these two issues locally with Avada installed. It sounds like there is a JavaScript error of some kind causing the problems you have described. May I log in to your wp-admin area and take a quick look to see the problems? Please provide login credentials in the private reply fields here.

#1382569
Screen Shot 2019-11-13 at 2.12.56 PM.png

Both issues can be resolved by removing Google Maps from Privacy Consent settings as shown in the screenshot here. I made that change for you, please confirm this is working as expected.

#1382615

My issue is resolved now. Thank you!