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

When adding custom groups of fields with pods_group_add(), don't show those fields in other groups (if already in a real group) #6317

Closed
andrepetrini opened this issue Nov 18, 2021 · 8 comments
Assignees
Labels
Component: DFV Issues related to the Pods DFV JS that powers form fields Keywords: Regression Status: Need Reproduction Issue must be reproduced before coding can begin Type: Bug
Milestone

Comments

@andrepetrini
Copy link

Description

Hi,
I already have a lot of PODs, and I used to group them with code:
`function my_metaboxes ( $type, $name ) {
pods_group_add( 'campaign', 'Campanha', 'images,video1' );
pods_group_add( 'campaign', 'Mais Vídeos', 'video2,video3,video4,video5,video6' );
pods_group_add( 'campaign', 'Créditos', 'agency,brand,sector,creatives' );
pods_group_add( 'campaign', 'Produção', 'production_company,film_director,photographer,illustrator' );
pods_group_add( 'campaign', 'Prêmios', 'award_tracking' );
pods_group_add( 'campaign', 'Outros', 'overview,collections,public_awareness,user_playlist' );
pods_group_add( 'campaign', 'Antigo (não usar)', 'campaign_video,download_link' );

}
add_action( 'pods_meta_groups', 'my_metaboxes', 10, 2 );`

But when I updated to the 2.8 version, this code broke the admin view because it introduced the new groups. I deleted the code and the admin is back to normal.
Problem is that I can't manage the groups from my existing pods, since I can't move an existing field to new groups. So, in order to have the groups as I had before, I would need to create all the fields once again. We should have a way to create a new group and move an existing field there.
If there are issues with dragging from a group to another, maybe it could be with a dropdown inside the Edit Field?
Thank you.
Best

Version

2.8.5

Testing Instructions

No response

Screenshots / Screencast

No response

Possible Workaround

No response

Site Health Information

No response

Pods Package

No response

@JoryHogeveen
Copy link
Member

@sc0ttkclark
Another user reported the same issue: https://wordpress.org/support/topic/pods_group_add-is-broken-now/

@sc0ttkclark
Copy link
Member

We'll address moving fields to a different group as part of #6183

I'll look into the issue with using pods_group_add() and having those fields not show through other groups. For now, one workaround solution that seems to work for another person is to edit those fields in Pods to hide them from the UI. Then keep your pods_group_add() code. It should automatically handle show/hide so that your custom group will show the field but the normal group will hide it.

Other pods_group_add() issues known have been addressed in Pods 2.8.6

@sc0ttkclark sc0ttkclark changed the title Moving fields between group fields When adding custom groups of fields with pods_group_add(), don't show those fields in other groups (if already in a real group) Nov 30, 2021
@sc0ttkclark sc0ttkclark modified the milestones: Pods 2.8.6, Pods 2.8.7 Nov 30, 2021
@khill07
Copy link

khill07 commented Dec 2, 2021

I don't know if this introduced a new bug, but right now in 2.8.7, any field added through pods_group_add() is being rendered as a text field despite the field type being set to something total different.

@andrepetrini
Copy link
Author

Hey @khill07 , I had the same problem. Removing the pods_group_add() fixed the issue for now, but obviously removed the groups too. Waiting for the new update here to have groups organized again.

@sc0ttkclark sc0ttkclark modified the milestones: Pods 2.8.9, Pods 2.8.10 Jan 22, 2022
@sc0ttkclark sc0ttkclark modified the milestones: Pods 2.8.10, Pods 2.8.11 Feb 2, 2022
@sc0ttkclark sc0ttkclark modified the milestones: Pods 2.8.11, Pods 2.8.12 Feb 21, 2022
@sc0ttkclark sc0ttkclark modified the milestones: Pods 2.8.12, Pods 2.8.13, Pods 2.8.14, Pods 2.8.15 Apr 8, 2022
@sc0ttkclark sc0ttkclark modified the milestones: Pods 2.8.17, Pods 2.8.19 May 11, 2022
@khill07
Copy link

khill07 commented May 16, 2022

Why in the world does this just keep getting pushed. I haven't been able to upgrade for 5 months now.

@BrookeDot
Copy link

Can this be closed as done in #6456 ?

@sc0ttkclark
Copy link
Member

I'm wondering what the use cases are for adding fields to groups using pods_group_add that couldn't be covered by Pods configs now -- https://docs.pods.io/code/registering-configurations/

I don't know if the group handling is resolved here by manually grouping with this function for a DB-based config, but the file-based configs do work well.

@sc0ttkclark sc0ttkclark modified the milestones: Backlog, Pods 3.0.8 Oct 15, 2023
@sc0ttkclark sc0ttkclark added Status: Need Reproduction Issue must be reproduced before coding can begin Component: DFV Issues related to the Pods DFV JS that powers form fields labels Oct 15, 2023
sc0ttkclark added a commit that referenced this issue Oct 15, 2023
@sc0ttkclark sc0ttkclark modified the milestones: Pods 3.0.8, Pods 3.0.7 Oct 15, 2023
@sc0ttkclark
Copy link
Member

I have a fix that can address this, it helps to avoid duplicate fields in general when using custom non DB-based configs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: DFV Issues related to the Pods DFV JS that powers form fields Keywords: Regression Status: Need Reproduction Issue must be reproduced before coding can begin Type: Bug
Projects
None yet
Development

No branches or pull requests

5 participants