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 265 forks source link

"Limit List Roles" and autocomplete #5486

Open adleviton opened 5 years ago

adleviton commented 5 years ago

Describe the bug

Expected behavior Limiting user roles should not interfere with autocomplete

Screenshots pods-issue

Pods Version

2.7.15

WordPress Environment

` ### wp-core ### version: 5.2.3 site_language: en_US user_language: en_US permalink: /%postname%/ https_status: false user_registration: 0 default_comment_status: closed multisite: false user_count: 254 dotorg_communication: true ### wp-paths-sizes ### wordpress_path: /srv/www/###/current/web/wp wordpress_size: 45.93 MB (48164975 bytes) uploads_path: /srv/www/###/current/web/app/uploads uploads_size: 779.41 MB (817267484 bytes) themes_path: /srv/www/###/current/web/app/themes themes_size: 268.80 MB (281861248 bytes) plugins_path: /srv/www/###/current/web/app/plugins plugins_size: 128.67 MB (134917328 bytes) database_size: 72.23 MB (75736421 bytes) total_size: 1.26 GB (1357947456 bytes) ### wp-active-theme ### name: ### version: 100.0 author: Adam Leviton author_website: ### parent_theme: none theme_features: undefined theme_path: /srv/www/###/current/web/app/themes/### ### wp-themes (1) ### Twenty Nineteen: version: 1.4, author: the WordPress team ### wp-mu-plugins (3) ### Bedrock Autoloader: version: 1.0.0, author: Roots Disallow Indexing: version: 1.0.0, author: Roots Register Theme Directory: version: 1.0.0, author: Roots ### wp-plugins-active (11) ### Admin Columns: version: 3.4.6, author: AdminColumns.com Admin Menu Editor: version: 1.9.1, author: Janis Elsts Enable Media Replace: version: 3.3.6, author: ShortPixel EWWW Image Optimizer: version: 4.9.3, author: Exactly WWW (latest version: 5.0.0) Mailgun: version: 1.7.1, author: Mailgun Pods - Custom Content Types and Fields: version: 2.7.15, author: Pods Framework Team Redirection: version: 4.4, author: John Godley Widget Disable: version: 1.9.1, author: required WP Offload Media: version: 2.2.1, author: Delicious Brains WP Offload Media Tweaks: version: 0.2.1, author: Delicious Brains WP Sync DB: version: 1.5, author: Sean Lang ### wp-plugins-inactive (4) ### BackWPup: version: 3.6.10, author: Inpsyde GmbH Disable Login: version: 1.1.1, author: Ethan Allen Sucuri Security - Auditing, Malware Scanner and Hardening: version: 1.8.21, author: Sucuri Inc. Wordfence Security: version: 7.4.0, author: Wordfence ### wp-media ### image_editor: EWWWIO_Imagick_Editor imagick_module_version: 1687 imagemagick_version: ImageMagick 6.9.7-4 Q16 x86_64 20170114 http://www.imagemagick.org gd_version: 2.2.5 ghostscript_version: 9.21 ### wp-server ### server_architecture: Linux 4.15.0-29-generic x86_64 httpd_software: nginx/1.17.3 php_version: 7.3.9-1+ubuntu18.04.1+deb.sury.org+1 64bit php_sapi: fpm-fcgi max_input_variables: 1000 time_limit: 300 memory_limit: 512M max_input_time: 300 upload_max_size: 25M php_post_max_size: 25M curl_version: 7.58.0 OpenSSL/1.1.1c suhosin: false imagick_availability: true ### wp-database ### extension: mysqli server_version: 5.5.5-10.2.26-MariaDB-1:10.2.26+maria~bionic client_version: mysqlnd 5.0.12-dev - 20150407 - $Id: 7cc7cc96e675f6d72e5cf0f267f48e167c2abb23 $ ### wp-constants ### WP_HOME: http://www.### WP_SITEURL: http://www.###/wp WP_CONTENT_DIR: /srv/www/###/current/web/app WP_PLUGIN_DIR: /srv/www/###/current/web/app/plugins WP_MAX_MEMORY_LIMIT: 512M WP_DEBUG: true WP_DEBUG_DISPLAY: true WP_DEBUG_LOG: false SCRIPT_DEBUG: true WP_CACHE: false CONCATENATE_SCRIPTS: undefined COMPRESS_SCRIPTS: undefined COMPRESS_CSS: undefined WP_LOCAL_DEV: undefined ### wp-filesystem ### wordpress: writable wp-content: writable uploads: writable plugins: writable themes: writable mu-plugins: writable ### pods ### pods-server-software: nginx/1.17.3 pods-user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36 pods-session-save-path: /tmp pods-session-save-path-exists: Yes pods-session-save-path-writable: Yes pods-session-max-lifetime: 1440 pods-opcode-cache-apc: No pods-opcode-cache-memcached: No pods-opcode-cache-opcache: Yes pods-opcode-cache-redis: No pods-object-cache-apc: No pods-object-cache-apcu: No pods-object-cache-memcache: No pods-object-cache-memcached: Yes pods-object-cache-redis: No pods-memory-current-usage: 57.071M pods-memory-current-usage-real: 10.500M pods-network-wide: No pods-install-location: /srv/www/###/current/web/app/plugins/pods/ pods-developer: No pods-tableless-mode: No pods-light-mode: No pods-strict: Yes pods-allow-deprecated: No pods-api-cache: Yes `

Possible Workaround Only seems to happen with "autocomplete". Checkbox and multi select seem unaffected.

issue-label-bot[bot] commented 5 years ago

Issue Label Bot is not confident enough to auto-label this issue. See dashboard for more details.

JoryHogeveen commented 5 years ago

This is expected behavior. The selected users are probably not part of the roles you've selected so they get filtered out.

If you are trying to control access to this field based on the user role then please go to the "Advanced" tab.

adleviton commented 5 years ago

I think I'm still encountering an issue. For example the user "Nursing Education" has a role of "Office Admin". The Pod Field has "Office Admin" checked, but it does not show up when editing a Pod Item.

users

checked

unchecked

jamesgol commented 5 years ago

I tried to reproduce this as closely as possible and was unable to. At first I thought the issue would be related to the large number of users with that role but I created 250 users and still couldn't reproduce it.

The Autocomplete field behaves differently when there are more than 30 items, it switches to using AJAX instead of having the data preloaded.

What are you typing into the autocomplete in order to match 'Nursing Education'? Can you use your browsers development tool to see the AJAX query that is being sent and what is received? The query generated should go to 'admin-ajax.php?pods_ajax=1'

adleviton commented 4 years ago

Finally got back to this. Thanks for the feedback so far.

The ajax seems to be working fine. I can type a few letters from beginning or end of alphabet, and the users show up. What I'm seeing now is that when I hit "Update", and the page refreshes, then field is blank. If I uncheck all the items in "Limit list to Role(s)" like in the image above, and refresh the page, then the value reappears.