Skip Navigation

[Resolved] Remove field group from custom post type

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

Problem:
A custom field group shows on posts types where it is not supposed to.

Solution:
There was a bug in Types 3.2.5 that broke the conditional display of field groups but the fix did not work in this case, the specifics of which were that there was an empty condition in the data-dependent tab of the field group display conditions that broke this. A solution for that will be included in another Types update.

See https://toolset.com/forums/topic/remove-field-group-from-custom-post-type/#post-1204571

This support ticket is created 5 years, 9 months 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 12 replies, has 2 voices.

Last updated by ChuckGregory 5 years, 9 months ago.

Assisted by: Nigel.

Author
Posts
#1202165

I am trying to: disconnect field group from post type

Link to a page where the issue can be seen: hidden link

I expected to see: custom post 'unit' with field group 'unit'

Instead, I got: custom post 'unit' with field groups 'unit' and 'building'

NOTES:
'building' field group had previously been attached to unit post type but that is not appropriate so I edited the field group so it only is attached to 'building' post type. But it won't go away.

#1202448

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Screenshot 2019-02-19 at 14.59.48.png

Hi Chuck

You have a unit post type and a building post type.

You have a unit custom field group, and a building custom field group.

You want the unit field group linked only to unit posts, and the building field group linked only to building posts.

You had building field group assigned to unit posts, and now you cannot 'unassign' it.

That's the issue, yes?

When you go to Toolset > Custom Fields and edit the building field group, in the settings are you able to edit the "Appears on..." settings at all?

(In my test site I can't because I have an RFG in the field group, for example, see screenshot.)

Or are there any JS errors in the browser console that prevent the page being saved when you try?

Does it look like you can save the page with the updated settings, but when you check the settings are the same?

#1202462

Yes, Nigel, you understand the basic issue. However, I was able to change the settings without trouble; the problem is that the buildings field group still shows up on the units post type even though it is no longer in the list of post types for that field group.

#1202515

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

OK, I have a report of something similar, which I cannot reproduce, and which I couldn't even see on the client's site that I had access to (what I saw didn't match their screenshots).

If you have a browser that you wouldn't have visited the site backend with before it would be helpful to log in with that browser and see if you see the same.

If it works as expected that would confirm that it's a caching issue, in which case can you try to clear your browser cache and perform a hard reload?

#1202581

I have tried this with multiple browsers from multiple devices. It always acts the same.

#1203056

Any luck, Nigel? Do you need access to the site?

#1203062

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Chuck

I've just escalated the issue for another user.

Can you check if the circumstances are the same on your site?

In their case, they have a custom field group which is not assigned to any post type but it is assigned to a template.

The expected behaviour in that case is that the field group should only show up on the post edit screens for posts which are using that template.

Since Types 3.2.5 this is broken (I confirmed on my own test site), and such field groups will appear everywhere.

Do you have such a field group?

To save time, let me set up a private reply in case I do need access to your site.

#1203329

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Chuck

We've had other issues relating to custom field groups, but I cannot reproduce this one, nor identify exactly why it is occurring on your site. I thought perhaps it was to do with the relationship between units and buildings, but seemingly not, as I can't reproduce the issue with a similar set up.

I've taken a copy of your site and if I can't spot the problem when I install it locally, I'll pass it on to my colleagues.

I'll let you know.

#1203382

Thank you, Nigel. I really appreciate your diligence on this and in fact every time I interact with you. Hope you figure it out!

#1203925

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Chuck

The developers have been working on a solution for the related issues where field groups are appearing where they should not, and I've tested their solution on my copy of your site, but it still doesn't work.

I have passed the copy of your site to them so they can identify what is specific to your site that is causing this, so that they can include a fix for it at the same time.

I'm escalating this thread and will keep you posted.

#1203933

Thanks Nigel!

#1204571

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Screenshot 2019-02-22 at 14.08.26.png

Hi Chuck

For that field group, in the where-to-display settings, there is an empty condition in the data-dependent tab (screenshot).

We don't know how it got there, but the devs will add something to the UI to make it clear that there is a condition being applied so that it won't be such a puzzle in the future.

We'll be releasing a Types hotfix update probably on Monday. This is unlikely to be added in time for that, but you can get this working again on your site by simply deleting that condition.

#1204691

WOW! I never saw that screen before.
Thank you for finding this issue.