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

Relationship Field with Simple Custom Defined List doesn't save value in Pod item if it contains an apostrophe #5479

Closed TheDude12x closed 4 years ago

TheDude12x commented 5 years ago

Describe the bug Relationship Field with Simple Custom Defined List doesn't save value if it contains an apostrophe.

To Reproduce Steps to reproduce the behavior:

  1. Add Field > Select Field Type 'Relationship'
  2. Select Field Type 'Relationship' related to 'Simple (custom defined list)'
  3. Enter a value that contains an apostrophe (ie - Do's and Don'ts)
  4. When trying to save to Pod item it doesn't save but will display in the drop-down

Expected behavior Expect the value to be saved.

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: true user_registration: 0 default_comment_status: closed multisite: false user_count: 17 dotorg_communication: true ### wp-paths-sizes ### wordpress_path: /nas/content/live/advocatecap wordpress_size: 84.73 MB (88845022 bytes) uploads_path: /nas/content/live/advocatecap/wp-content/uploads uploads_size: 938.67 MB (984271320 bytes) themes_path: /nas/content/live/advocatecap/wp-content/themes themes_size: 4.26 MB (4465628 bytes) plugins_path: /nas/content/live/advocatecap/wp-content/plugins plugins_size: 81.85 MB (85821640 bytes) database_size: 31.50 MB (33027745 bytes) total_size: 1.11 GB (1196431355 bytes) ### wp-dropins (1) ### advanced-cache.php: true ### wp-active-theme ### name: Advocate Capital Inc. version: 1 author: Altrumedia LLC author_website: (undefined) parent_theme: Genesis theme_features: menus, post-thumbnails, title-tag, automatic-feed-links, body-open, genesis-inpost-layouts, genesis-archive-layouts, genesis-admin-menu, genesis-import-export-menu, genesis-readme-menu, genesis-customizer-theme-settings, genesis-customizer-seo-settings, genesis-auto-updates, genesis-breadcrumbs, genesis-menus, genesis-structural-wraps, widgets, html5, genesis-accessibility, genesis-responsive-viewport, custom-header, genesis-after-entry-widget-area, genesis-footer-widgets theme_path: /nas/content/live/advocatecap/wp-content/themes/genesis genesis_recommendations: This theme uses theme supports that are no longer required in Genesis 3.0+: "genesis-responsive-viewport" theme support can be removed ### wp-themes (2) ### Genesis: version: 3.1.2, author: StudioPress Twenty Nineteen: version: 1.4, author: the WordPress team ### wp-mu-plugins (5) ### Force Strong Passwords - WPE Edition: version: 1.6.4, author: Jason Cosper ManageWP - Worker Loader: author: ManageWP, version: (undefined) Stop long comments: version: 0.0.4, author: WPEngine WP Engine Security Auditor: version: 1.0.8, author: wpengine WP Engine System: version: 3.2.1, author: WP Engine ### wp-plugins-active (31) ### .html on PAGES: version: 1.1, author: IntroSites Admin Columns: version: 3.4.6, author: AdminColumns.com Akismet Anti-Spam: version: 4.1.2, author: Automattic Classic Text Widget: version: 1.0.1, author: Victor Font Consulting Group, LLC. Custom Post Type UI: version: 1.6.2, author: WebDevStudios Disable Emojis (GDPR friendly): version: 1.7.2, author: Ryan Hellyer Disable Gutenberg: version: 1.9, author: Jeff Starr Display Widgets: version: 2.7, author: Strategy11 Event Calendar WD Premium: version: 5.1.28, author: 10Web Genesis 404: version: 1.5.0, author: Bill Erickson Genesis Simple Edits: version: 2.3.0, author: StudioPress Genesis Simple Hooks: version: 2.3.0, author: StudioPress Google Tag Manager for Wordpress: version: 1.10.1, author: Thomas Geiger Ivory Search: version: 4.4, author: Ivory Search Leadpages Connector: version: 2.1.6.21, author: Leadpages ManageWP - Worker: version: 4.9.1, author: GoDaddy Overwrite Uploads: version: 1.2, author: Ian Dunn Pods - Custom Content Types and Fields: version: 2.7.15, author: Pods Framework Team Post Types Order: version: 1.9.4.1, author: Nsp Code Regenerate Thumbnails: version: 3.1.1, author: Alex Mills (Viper007Bond) Simple 301 Redirects: version: 1.07, author: Scott Nellé Simple Social Icons: version: 3.0.1, author: StudioPress SlickNav Mobile Menu: version: 1.8.8, author: Neil Gee Smush Pro: version: 3.2.4, author: WPMU DEV Strong Testimonials: version: 2.39.3, author: MachoThemes Super Socializer: version: 7.12.34, author: Team Heateor Widget CSS Classes: version: 1.5.4, author: C.M. Kendrick WP Engine GeoTarget: version: 1.2.5, author: WP Engine WPMU DEV Dashboard: version: 4.7.3.2, author: WPMU DEV WP Sitemap Page: version: 1.6.2, author: Tony Archambeau Yoast SEO: version: 12.1, author: Team Yoast ### wp-plugins-inactive (5) ### 10WEB manager: version: 1.2.48, author: 10WEB Better Search Replace: version: 1.3.3, author: Delicious Brains Gravity Forms: version: 2.2.6, author: rocketgenius IP Geo Block: version: 3.0.17.4, author: tokkonopapa Search Everything: version: 8.1.9, author: Sovrn, zemanta ### wp-media ### image_editor: WP_Image_Editor_Imagick imagick_module_version: 1687 imagemagick_version: ImageMagick 6.9.7-4 Q16 x86_64 20170114 http://www.imagemagick.org imagick_limits: imagick::RESOURCETYPE_AREA: 38 MB imagick::RESOURCETYPE_DISK: 1073741824 imagick::RESOURCETYPE_FILE: 6144 imagick::RESOURCETYPE_MAP: 512 MB imagick::RESOURCETYPE_MEMORY: 256 MB imagick::RESOURCETYPE_THREAD: 4 gd_version: 2.2.5 ghostscript_version: unknown ### wp-server ### server_architecture: Linux 4.15.0-1040-gcp x86_64 httpd_software: Apache php_version: 7.2.20-2+ubuntu18.04.1+deb.sury.org+1 64bit php_sapi: apache2handler max_input_variables: 1000 time_limit: 3600 memory_limit: 512M max_input_time: 3600 upload_max_size: 50M php_post_max_size: 100M curl_version: 7.58.0 OpenSSL/1.1.1c suhosin: false imagick_availability: true htaccess_extra_rules: false ### wp-database ### extension: mysqli server_version: 5.7.26-29-log client_version: mysqlnd 5.0.12-dev - 20150407 - $Id: 3591daad22de08524295e1bd073aceeff11e6579 $ ### wp-constants ### WP_HOME: undefined WP_SITEURL: undefined WP_CONTENT_DIR: /nas/content/live/advocatecap/wp-content WP_PLUGIN_DIR: /nas/content/live/advocatecap/wp-content/plugins WP_MAX_MEMORY_LIMIT: 512M WP_DEBUG: false WP_DEBUG_DISPLAY: true WP_DEBUG_LOG: false SCRIPT_DEBUG: false WP_CACHE: true 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 ### genesis ### theme_version: 3.1.2 db_version: 3101 first_version: 2.0.2 update: 1 site_layout: content-sidebar trackbacks_posts: 1 content_archive: full content_archive_thumbnail: 1 image_size: thumbnail image_alignment: alignleft posts_nav: numeric blog_cat_num: 10 header_scripts: footer_scripts: upgrade: 1 footer_text: Copyright [footer_copyright] Advocate Capital, Inc. & AltruMedia LLC • All Rights Reserved ### pods ### pods-server-software: Apache pods-user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36 pods-session-save-path: /var/lib/php/sessions 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: No 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: Yes pods-memory-current-usage: 12.857M pods-memory-current-usage-real: 6.000M pods-network-wide: No pods-install-location: /nas/content/live/advocatecap/wp-content/plugins/pods/ pods-developer: No pods-tableless-mode: No pods-light-mode: No pods-strict: No pods-allow-deprecated: Yes pods-api-cache: Yes `

Pods Package Export (helpful!)



**Possible Workaround**
I use the value\label and remove the apostrophe from the value but leave it in the label.
issue-label-bot[bot] commented 5 years ago

Issue-Label Bot is automatically applying the label Type: Bug to this issue, with a confidence of 0.95. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

JoryHogeveen commented 5 years ago

I use the value\label and remove the apostrophe from the value but leave it in the label.

This is the correct way. Since key=>value pairs are arrays and array's cannot contain such characters it's not possible to use these as the value.

@sc0ttkclark We could add a value parser if the value|label notation is not used, what are your thoughts?

TheDude12x commented 5 years ago

If you want to display the value with the apostrophes, which is logical, shouldn't it be addressed?

jamesgol commented 5 years ago

Duplicate of #2360. I'll have to do some testing to see where the current status of this is, much has changed since I last worked the issue.