pods-framework / pods

The Pods Framework is a Content Development Framework for WordPress - It lets you create and extend content types that can be used for any project. Add fields of various types we've built in, or add your own with custom inputs, you have total control.
https://pods.io/
GNU General Public License v2.0
1.07k stars 264 forks source link

Issue with limiting user field by Role, deleting that role, and not being able to unselect the role from being limited #1902

Open ckpicker opened 10 years ago

ckpicker commented 10 years ago

I've created a Relationship field named 'user_account' in my 'members' Pod that is related to all WP Users. (http://d.pr/i/HNHj)

I have a Pods UI Plugin that I've created and am using for this site (code: https://gist.github.com/ckpicker/24d11338bcb2ee5738a4 - see 'members_page' function).

The issue is that no users are displaying when I view the dropdown from the Pods UI plugin (http://d.pr/i/BiUX), but I currently have 4 users in my WP instance.

Any ideas on this one?

sc0ttkclark commented 10 years ago

Do you have the user field set to show only users of a specific capability?

ckpicker commented 10 years ago

No, here's what the 'Additional Field Options' tab looks like for that field: http://d.pr/i/Jyoa

ckpicker commented 10 years ago

However, this seems to work in my Pods UI plugin if I use the older 'pods_ui_manage' method instead of 'pods_ui.'

sc0ttkclark commented 10 years ago

Hmm, I'm not seeing anything there in the options or the code that would cause that. Though you don't need edit_fields/add_fields in the options array, that's handled by 'fields' => array( 'add' => $add_fields, 'edit' => $edit_fields )

ckpicker commented 10 years ago

Good catch! I deleted those extra options, but that didn't fix the issue. I also tried using an autocomplete field with no luck either.

ckpicker commented 10 years ago

Any ideas on this one? I still can't figure out what's going on.

sc0ttkclark commented 10 years ago

Yeah, this is on my list for this week, thanks for being patient.

sc0ttkclark commented 10 years ago

Can I get access the project itself to do some testing?

ckpicker commented 10 years ago

No problem! Just sent you a hangout with the info. Thanks!

sc0ttkclark commented 10 years ago

There is indeed an issue here. What happened was you created the user_account field and selected the 'members' role to be limited to for which users would show up. Then at some point, that role was deleted, and a new one of a different name similar to 'members' was added, but they didn't have the same name. What this caused was the inability to unselect the role from the field editor. Even though it appeared that no roles were limited, there was a 'members' value stored in the options array for that field which could not be toggled off.

We'll get this fixed during the field editor revamp of 3.0 for loop fields.

ckpicker commented 10 years ago

If I remember correctly, I renamed the role. Thanks for tracking this one down!

jimtrue commented 9 years ago

Do you have the user field set to show only users of a specific capability?

[--- Linked with ASANA.com using Unito.io

commenter Jim True

---[aa]

jimtrue commented 9 years ago

No, here's what the 'Additional Field Options' tab looks like for that field: http://d.pr/i/Jyoa

[--- Linked with ASANA.com using Unito.io

commenter Jim True

---[aa]

jimtrue commented 9 years ago

However, this seems to work in my Pods UI plugin if I use the older 'pods_ui_manage' method instead of 'pods_ui.'

[--- Linked with ASANA.com using Unito.io

commenter Jim True

---[aa]

jimtrue commented 9 years ago

Hmm, I'm not seeing anything there in the options or the code that would cause that. Though you don't need edit_fields/add_fields in the options array, that's handled by 'fields' => array( 'add' => $add_fields, 'edit' => $edit_fields )

[--- Linked with ASANA.com using Unito.io

commenter Jim True

---[aa]

jimtrue commented 9 years ago

Good catch! I deleted those extra options, but that didn't fix the issue. I also tried using an autocomplete field with no luck either.

[--- Linked with ASANA.com using Unito.io

commenter Jim True

---[aa]

jimtrue commented 9 years ago

Any ideas on this one? I still can't figure out what's going on.

[--- Linked with ASANA.com using Unito.io

commenter Jim True

---[aa]

jimtrue commented 9 years ago

Yeah, this is on my list for this week, thanks for being patient.

[--- Linked with ASANA.com using Unito.io

commenter Jim True

---[aa]

jimtrue commented 9 years ago

Can I get access the project itself to do some testing?

[--- Linked with ASANA.com using Unito.io

commenter Jim True

---[aa]

jimtrue commented 9 years ago

No problem! Just sent you a hangout with the info. Thanks!

[--- Linked with ASANA.com using Unito.io

commenter Jim True

---[aa]

jimtrue commented 9 years ago

There is indeed an issue here. What happened was you created the user_account field and selected the 'members' role to be limited to for which users would show up. Then at some point, that role was deleted, and a new one of a different name similar to 'members' was added, but they didn't have the same name. What this caused was the inability to unselect the role from the field editor. Even though it appeared that no roles were limited, there was a 'members' value stored in the options array for that field which could not be toggled off.

We'll get this fixed during the field editor revamp of 3.0 for loop fields.

[--- Linked with ASANA.com using Unito.io

commenter Jim True

---[aa]

jimtrue commented 9 years ago

If I remember correctly, I renamed the role. Thanks for tracking this one down!

[--- Linked with ASANA.com using Unito.io

commenter Jim True

---[aa]

sc0ttkclark commented 3 years ago

Let's get a retest on this to check if the DFV revamp resolved this issue in Pods 2.8.

sc0ttkclark commented 3 years ago

Ready for QA test

pdclark commented 3 years ago

QA mostly didn't pass:

Screen Shot 2021-09-16 at 3 31 37 PM Screen Shot 2021-09-16 at 3 31 23 PM Screen Shot 2021-09-16 at 3 33 26 PM
sc0ttkclark commented 3 years ago

Something for the backlog but this would be good to sort out from the DFV side of the field.