pods icon indicating copy to clipboard operation
pods copied to clipboard

Trimmed beginning and end characters

Open vesna-droid opened this issue 2 years ago • 1 comments

Description

Hello,

Regarding this matter: https://wordpress.org/support/topic/bug-trimmed-beginning-and-end-characters/

I have a field for entering ascii art which I later display with fixed width font. I defined this field as simple Paragraph type, also tried per above Pods developer suggestion with Code syntax type instead of Paragraph, and in both tries no checkbox by trim extra white space, no html allowed. But for example when I enter this cat ascii art:

/_/
( o.o )

^ <

The field value is updated with trimmed beginning and end in type of Paragraph field, so no beginning empty space and no < at the end, and in type Code syntax last character is preserved but beginning space is removed.

Beware here on github this cat isn't displayed properly, take a look at below testing instructions in hope the cat is visible?

Hope it can be solved soon or you can give me some quick workaround?

Thank you.

Version

2.8.10.

Testing Instructions

 /\_/\
( o.o )
 > ^ <

Screenshots / Screencast

No response

Possible Workaround

No response

Site Health Information

`
### wp-core ###

version: 5.9.2
site_language: en
user_language: en
timezone: +00:00
permalink: /%category%/%author%/%postname%/
https_status: false
multisite: false
user_registration: 0
blog_public: 1
default_comment_status: undefined
environment_type: production
user_count: 5
dotorg_communication: true

### wp-paths-sizes ###

wordpress_path: /home/moljac/temp.vesnamackovic.com
wordpress_size: loading...
uploads_path: /home/moljac/temp.vesnamackovic.com/wp-content/uploads
uploads_size: loading...
themes_path: /home/moljac/temp.vesnamackovic.com/wp-content/themes
themes_size: loading...
plugins_path: /home/moljac/temp.vesnamackovic.com/wp-content/plugins
plugins_size: loading...
database_size: loading...
total_size: loading...

### wp-active-theme ###

name: Astra (astra)
version: 3.7.9
author: Brainstorm Force
author_website: https://wpastra.com/about/?utm_source=theme_preview&utm_medium=author_link&utm_campaign=astra_theme
parent_theme: none
theme_features: core-block-patterns, astra_hooks, widgets-block-editor, align-wide, automatic-feed-links, title-tag, post-thumbnails, html5, post-formats, custom-logo, customize-selective-refresh-widgets, editor-style, woocommerce, rank-math-breadcrumbs, amp, widgets, menus
theme_path: /home/moljac/temp.vesnamackovic.com/wp-content/themes/astra

### wp-themes-inactive (1) ###

Twenty Twenty-Two: version: 1.1, author: the WordPress team

### wp-mu-plugins (1) ###

WordPress automation by Installatron: author: (undefined), version: (undefined)

### wp-plugins-active (10) ###

Code Snippets: version: 2.14.3, author: Code Snippets Pro
Duplicate Content Addon For Polylang: version: 1.1, author: khushwantsidhu
Limit Login Attempts Reloaded: version: 2.24.0, author: Limit Login Attempts Reloaded
Multi-column Tag Map: version: 17.0.22, author: Alan Jackson
Pods - Custom Content Types and Fields: version: 2.8.10, author: Pods Framework Team
Polylang: version: 3.1.4, author: WP SYNTEX
Polylang - Country Detection: version: 1.2.2, author: Markus Wiesenhofer
Polylang Comments Merger: version: 0.5.8, author: Roberto Bolli
Robo Gallery: version: 3.2.0, author: RoboSoft
To Top: version: 2.4, author: Catch Plugins

### wp-plugins-inactive (12) ###

Always Allow Admin Comments: version: 1.3.2, author: Scott Reilly
Auto Amazon Links: version: 5.1.6, author: Michael Uno (miunosoft)
Cool Timeline: version: 2.3.3, author: Cool Plugins
Display Posts: version: 3.0.2, author: Bill Erickson
Post Timeline: version: 2.1.9, author: AgileLogix
PostX - Gutenberg Post Grid Blocks: version: 2.4.26, author: wpxpo
PublishPress Blocks: version: 2.11.6, author: PublishPress
Rich Event Timeline: version: 1.1.4, author: richteam
Stackable - Gutenberg Blocks: version: 3.2.0, author: Gambit Technologies, Inc
Timeline Block: version: 1.2.1, author: Cool Plugins
Timeline Event History: version: 2.2, author: wpdiscover
Ultimate Addons for Gutenberg: version: 1.25.4, author: Brainstorm Force

### wp-media ###

image_editor: WP_Image_Editor_GD
imagick_module_version: Not available
imagemagick_version: Not available
imagick_version: Not available
file_uploads: File uploads is turned off
post_max_size: 20M
upload_max_filesize: 20M
max_effective_size: 20 MB
max_file_uploads: 20
gd_version: 2.2.5
gd_formats: GIF, JPEG, PNG, WebP, BMP, XPM
ghostscript_version: 9.25

### wp-server ###

server_architecture: Linux 3.10.0-962.3.2.lve1.5.65.el7.x86_64 x86_64
httpd_software: Apache
php_version: 7.4.28 64bit
php_sapi: litespeed
max_input_variables: 5000
time_limit: 30
memory_limit: 128M
admin_memory_limit: 256M
max_input_time: 60
upload_max_filesize: 20M
php_post_max_size: 20M
curl_version: 7.71.0 OpenSSL/1.1.1d
suhosin: false
imagick_availability: false
pretty_permalinks: true
htaccess_extra_rules: false

### wp-database ###

extension: mysqli
server_version: 10.3.34-MariaDB-log-cll-lve
client_version: 10.3.32-MariaDB
max_allowed_packet: 268435456
max_connections: 300

### wp-constants ###

WP_HOME: undefined
WP_SITEURL: undefined
WP_CONTENT_DIR: /home/moljac/temp.vesnamackovic.com/wp-content
WP_PLUGIN_DIR: /home/moljac/temp.vesnamackovic.com/wp-content/plugins
WP_MEMORY_LIMIT: 40M
WP_MAX_MEMORY_LIMIT: 256M
WP_DEBUG: false
WP_DEBUG_DISPLAY: true
WP_DEBUG_LOG: false
SCRIPT_DEBUG: false
WP_CACHE: false
CONCATENATE_SCRIPTS: undefined
COMPRESS_SCRIPTS: undefined
COMPRESS_CSS: undefined
WP_ENVIRONMENT_TYPE: Undefined
DB_CHARSET: utf8
DB_COLLATE: undefined

### wp-filesystem ###

wordpress: writable
wp-content: writable
uploads: writable
plugins: writable
themes: writable
mu-plugins: writable

### pods ###

pods-server-software: Apache
pods-user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.1 Safari/605.1.15
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: 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: No
pods-object-cache-redis: No
pods-memory-current-usage: 49.455M
pods-memory-current-usage-real: 50.500M
pods-network-wide: No
pods-install-location: /wp-content/plugins/pods/
pods-developer: No
pods-tableless-mode: No
pods-relationship-table-enabled: Yes
pods-light-mode: No
pods-strict: No
pods-allow-deprecated: Yes
pods-api-cache: Yes
pods-shortcode-allow-evaluate-tags: No
pods-sessions: Disable sessions
pods-can-use-sessions: Yes
pods-relationship-table-status: 43

### pll_options ###

browser: true
rewrite: 1
hide_default: 1
force_lang: 1
redirect_lang: 0
media_support: true
sync: 0
post_types: post, page, wp_block, attachment, robo_gallery_table, autor, _pods_template
taxonomies: category, post_tag, categories_art, gender_type, sexual_type, diagnosis_type, vegan_type, event_type, video_type
domains: 0
version: 3.1.4
default_lang: hr
primary: hr => 42 | en => 43
secondary_menu: hr => 27 | en => 26
mobile_menu: hr => 0 | en => 0
loggedin_account_menu: hr => 0 | en => 0
footer_menu: hr => 0 | en => 0

### pll_language_hr ###

term_id: 3
name: Hrvatski
slug: hr
term_group: 0
term_taxonomy_id: 3
count: 41
tl_term_id: 4
tl_term_taxonomy_id: 4
tl_count: 31
locale: hr
is_rtl: 0
w3c: hr
facebook: hr_HR
home_url: http://temp.vesnamackovic.com/
search_url: http://temp.vesnamackovic.com/
mo_id: 2345
page_on_front: 12
page_for_posts: 0
flag_code: hr
flag_url: http://temp.vesnamackovic.com/wp-content/plugins/polylang/flags/hr.png
custom_flag_url: 0

### pll_language_en ###

term_id: 5
name: English
slug: en
term_group: 0
term_taxonomy_id: 5
count: 21
tl_term_id: 6
tl_term_taxonomy_id: 6
tl_count: 26
locale: en_GB
is_rtl: 0
w3c: en-GB
facebook: en_GB
home_url: http://temp.vesnamackovic.com/en/workers-homepage/
search_url: http://temp.vesnamackovic.com/en/
mo_id: 2346
page_on_front: 1437
page_for_posts: 0
flag_code: gb
flag_url: http://temp.vesnamackovic.com/wp-content/plugins/polylang/flags/gb.png
custom_flag_url: 0

### pll_warnings ###

term-no-lang: post_tag => 262 , 263 , 264 , 265 , 266

`

Pods Package

No response

vesna-droid avatar Mar 29 '22 13:03 vesna-droid

@sc0ttkclark Debugged this issue and found the problem.

Bug 1: When creating a new field all the checkboxes are unchecked by default (even if the default should be true)

Bug 2: When saving the field, all checkboxes that are unchecked do not get stored as 0. Only if the field was previously saved as true (1) will the field be saved as 0. So on display or input, when the field checks for a setting that is true by default and it isn't stored as unchecked (as the UI showed), it will return the default value through pods_v and enable the feature (trim in this case). https://github.com/pods-framework/pods/blob/2.8.23/classes/PodsField.php#L967

This is definitely a (big) regression since 2.8 and I believe we've encountered a similar issue before.

JoryHogeveen avatar Jul 12 '22 08:07 JoryHogeveen

Fixed and tested via 665c7bd42d39022d7c79c50273a334de8471e796

sc0ttkclark avatar Sep 11 '22 03:09 sc0ttkclark