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

Read-only date/hour field could be edited #6583

Closed CarlosLongarela closed 2 years ago

CarlosLongarela commented 2 years ago

Description

Read-only date/hour fields could be edited in the backend. This happen in current Pods version, but also in previous version

Version

2.9.0

Testing Instructions

  1. Create a new field, type date/hour
  2. Advances, change visibility to read-only in the UI
  3. Create new CPT and this field is editable and should to be read-only

Screenshots / Screencast

No response

Possible Workaround

No response

Site Health Information

`
### wp-core ###

version: 6.0.1
site_language: es_ES
user_language: es_ES
timezone: Europe/Madrid
permalink: /%postname%/
https_status: true
multisite: false
user_registration: 0
blog_public: 1
default_comment_status: open
environment_type: production
user_count: 3
dotorg_communication: true

### wp-paths-sizes ###

wordpress_path: /var/www/creacv.gueb.pro/htdocs
wordpress_size: 50,90 MB (53373615 bytes)
uploads_path: /var/www/creacv.gueb.pro/htdocs/wp-content/uploads
uploads_size: 4,51 MB (4731326 bytes)
themes_path: /var/www/creacv.gueb.pro/htdocs/wp-content/themes
themes_size: 15,03 MB (15761398 bytes)
plugins_path: /var/www/creacv.gueb.pro/htdocs/wp-content/plugins
plugins_size: 228,23 MB (239313308 bytes)
database_size: 3,13 MB (3276800 bytes)
total_size: 301,80 MB (316456447 bytes)

### wp-dropins (1) ###

db.php: true

### wp-active-theme ###

name: Crea Tu CV (crea-tu-cv)
version: 1.0.0
author: Carlos Longarela
author_website: https://tabernawp.com/
parent_theme: Nexter (nexter)
theme_features: core-block-patterns, nexter_hooks, widgets-block-editor, automatic-feed-links, title-tag, editor-color-palette, post-thumbnails, menus, align-wide, html5, custom-background, customize-selective-refresh-widgets, custom-logo, woocommerce, editor-styles, editor-style, custom-header, widgets
theme_path: /var/www/creacv.gueb.pro/htdocs/wp-content/themes/crea-tu-cv
auto_update: Desactivado

### wp-parent-theme ###

name: Nexter (nexter)
version: 2.0.0
author: POSIMYTH
author_website: https://posimyth.com
theme_path: /var/www/creacv.gueb.pro/htdocs/wp-content/themes/nexter
auto_update: Desactivado

### wp-themes-inactive (3) ###

GeneratePress: version: 3.1.3, author: Tom Usborne, Actualizaciones automáticas desactivadas
Twenty Twenty-One: version: 1.6, author: el equipo WordPress, Actualizaciones automáticas desactivadas
Twenty Twenty-Two: version: 1.2, author: El equipo de WordPress, Actualizaciones automáticas desactivadas

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

WP CLI Login Command Server: version: 1.3, author: Evan Mattson

### wp-plugins-active (11) ###

Analiza CV: version: 1.0.0, author: Carlos Longarela, Actualizaciones automáticas desactivadas
GridPane Redis Object Cache: version: 1.5.6, author: Version Forked by GridPane | Till Krüss, Actualizaciones automáticas desactivadas
Members: version: 3.2.1, author: MemberPress, Actualizaciones automáticas desactivadas
Nexter Extension: version: 2.0.0, author: POSIMYTH, Actualizaciones automáticas desactivadas
Nexter Pro Extensions: version: 2.0.1, author: POSIMYTH, Actualizaciones automáticas desactivadas
Nginx Helper: version: 2.2.2, author: rtCamp, Actualizaciones automáticas desactivadas
Pods - Custom Content Types and Fields: version: 2.9.0, author: Pods Framework Team, Actualizaciones automáticas desactivadas
Query Monitor: version: 3.9.0, author: John Blackbourn, Actualizaciones automáticas desactivadas
Rewrite Rules Inspector: version: 1.3.1, author: Automattic, Daniel Bachhuber, Actualizaciones automáticas desactivadas
The Plus Addons for Block Editor: version: 1.4.1, author: POSIMYTH, Actualizaciones automáticas desactivadas
The Plus Addons for Block Editor Pro: version: 1.4.0, author: POSIMYTH, Actualizaciones automáticas desactivadas

### wp-plugins-inactive (2) ###

GenerateBlocks: version: 1.5.4, author: Tom Usborne, Actualizaciones automáticas desactivadas
GP Premium: version: 2.1.2, author: Tom Usborne, Actualizaciones automáticas desactivadas

### wp-media ###

image_editor: WP_Image_Editor_Imagick
imagick_module_version: 1690
imagemagick_version: ImageMagick 6.9.10-23 Q16 x86_64 20190101 https://imagemagick.org
imagick_version: 3.7.0
file_uploads: File uploads is turned off
post_max_size: 512M
upload_max_filesize: 512M
max_effective_size: 512 MB
max_file_uploads: 20
imagick_limits: 
    imagick::RESOURCETYPE_AREA: 122 MB
    imagick::RESOURCETYPE_DISK: 1073741824
    imagick::RESOURCETYPE_FILE: 768
    imagick::RESOURCETYPE_MAP: 512 MB
    imagick::RESOURCETYPE_MEMORY: 256 MB
    imagick::RESOURCETYPE_THREAD: 1
imagemagick_file_formats: 3FR, 3G2, 3GP, AAI, AI, ART, ARW, AVI, AVS, BGR, BGRA, BGRO, BIE, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CRW, CUR, CUT, DATA, DCM, DCR, DCX, DDS, DFONT, DNG, DPX, DXT1, DXT5, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, FAX, FILE, FITS, FRACTAL, FTP, FTS, G3, G4, GIF, GIF87, GRADIENT, GRAY, GRAYA, GROUP4, H, HALD, HDR, HISTOGRAM, HRZ, HTM, HTML, HTTP, HTTPS, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, ISOBRL6, JBG, JBIG, JNG, JNX, JPE, JPEG, JPG, JPS, JSON, K25, KDC, LABEL, M2V, M4V, MAC, MAGICK, MAP, MASK, MAT, MATTE, MEF, MIFF, MKV, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MRW, MSL, MTV, MVG, NEF, NRW, NULL, ORF, OTB, OTF, PAL, PALM, PAM, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PGX, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, PPM, PREVIEW, PS, PS2, PS3, PSB, PSD, PTIF, PWP, RADIAL-GRADIENT, RAF, RAS, RAW, RGB, RGBA, RGBO, RGF, RLA, RLE, RMF, RW2, SCR, SCT, SFW, SGI, SHTML, SIX, SIXEL, SPARSE-COLOR, SR2, SRF, STEGANO, SUN, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIFF, VIPS, VST, WBMP, WEBP, WMV, WPG, X, X3F, XBM, XC, XCF, XPM, XPS, XV, XWD, YCbCr, YCbCrA, YUV
gd_version: 2.3.0
gd_formats: GIF, JPEG, PNG, WebP, BMP, XPM
ghostscript_version: 9.50

### wp-server ###

server_architecture: Linux 5.4.0-122-generic x86_64
httpd_software: nginx/1.21.6
php_version: 7.4.30 64bit
php_sapi: fpm-fcgi
max_input_variables: 5000
time_limit: 300
memory_limit: 256M
max_input_time: 60
upload_max_filesize: 512M
php_post_max_size: 512M
curl_version: 7.68.0 OpenSSL/1.1.1f
suhosin: false
imagick_availability: true
pretty_permalinks: true

### wp-database ###

extension: mysqli
server_version: 10.5.16-MariaDB-1:10.5.16+maria~focal
client_version: mysqlnd 7.4.30
max_allowed_packet: 16777216
max_connections: 151

### wp-constants ###

WP_HOME: undefined
WP_SITEURL: undefined
WP_CONTENT_DIR: /var/www/creacv.gueb.pro/htdocs/wp-content
WP_PLUGIN_DIR: /var/www/creacv.gueb.pro/htdocs/wp-content/plugins
WP_MEMORY_LIMIT: 40M
WP_MAX_MEMORY_LIMIT: 256M
WP_DEBUG: true
WP_DEBUG_DISPLAY: false
WP_DEBUG_LOG: false
SCRIPT_DEBUG: false
WP_CACHE: false
CONCATENATE_SCRIPTS: undefined
COMPRESS_SCRIPTS: undefined
COMPRESS_CSS: undefined
WP_ENVIRONMENT_TYPE: production
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: nginx/1.21.6
pods-user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.81 Safari/537.36 Edg/104.0.1293.47
pods-session-save-path: /var/lib/php/sessions
pods-session-save-path-exists: Sí
pods-session-save-path-writable: Sí
pods-session-max-lifetime: 1440
pods-opcode-cache-apc: No
pods-opcode-cache-memcached: No
pods-opcode-cache-opcache: Sí
pods-opcode-cache-redis: No
pods-object-cache-apc: No
pods-object-cache-apcu: No
pods-object-cache-memcache: No
pods-object-cache-memcached: Sí
pods-object-cache-redis: Sí
pods-memory-current-usage: 36,345M
pods-memory-current-usage-real: 20,000M
pods-network-wide: No
pods-install-location: /wp-content/plugins/pods/
pods-developer: No
pods-tableless-mode: No
pods-relationship-table-enabled: Sí
pods-light-mode: No
pods-strict: No
pods-allow-deprecated: Sí
pods-api-cache: Sí
pods-shortcode-allow-evaluate-tags: No
pods-sessions: Desactivar sesiones
pods-can-use-sessions: Sí
pods-relationship-table-status: 0

`

Pods Package

{
    "@meta": {
        "version": "2.9.0",
        "build": 1660141208
    },
    "settings": {
        "types_only": "0",
        "watch_changed_fields": "0",
        "metadata_integration": "1",
        "metadata_override_get": "0",
        "session_auto_start": "0",
        "wisdom_opt_out": "1"
    },
    "pods": [
        {
            "name": "cv",
            "id": 17,
            "label": "CV",
            "description": "",
            "type": "post_type",
            "storage": "table",
            "label_singular": "CV",
            "public": "0",
            "show_ui": "1",
            "rest_enable": "1",
            "supports_title": "1",
            "supports_editor": "0",
            "_migrated_28": "1",
            "show_in_nav_menus": "0",
            "capability_type": "post",
            "can_export": "1",
            "show_in_menu": "1",
            "menu_position": "0",
            "show_in_admin_bar": "1",
            "menu_icon": "dashicons-awards",
            "menu_name": "CV enviados",
            "required": "0",
            "unique": "0",
            "publicly_queryable": "0",
            "exclude_from_search": "0",
            "capability_type_custom": "cv",
            "capability_type_extra": "1",
            "has_archive": "0",
            "hierarchical": "0",
            "rewrite": "0",
            "rewrite_with_front": "1",
            "rewrite_feeds": "0",
            "rewrite_pages": "1",
            "query_var": "0",
            "default_status": "private",
            "revisions_to_keep_limit": "0",
            "delete_with_user": "0",
            "label_all_items": "Todos los CV",
            "groups": [
                {
                    "name": "mas_campos",
                    "id": 18,
                    "label": "M\u00e1s campos",
                    "description": "",
                    "weight": 0,
                    "meta_box_context": "normal",
                    "meta_box_priority": "default",
                    "roles_allowed": "administrator",
                    "admin_only": "0",
                    "fields": [
                        {
                            "name": "id_user",
                            "id": 21,
                            "label": "ID Usuario",
                            "description": "Id del usuario",
                            "weight": 0,
                            "type": "number",
                            "sister_id": "-- Selecciona uno --",
                            "required": "1",
                            "unique": "0",
                            "number_format_type": "number",
                            "number_format": "i18n",
                            "number_decimals": "0",
                            "number_format_soft": "0",
                            "number_step": "1",
                            "number_max_length": "6",
                            "number_html5": "0",
                            "roles_allowed": [
                                "administrador_cv"
                            ],
                            "rest_pick_response": "array",
                            "rest_pick_depth": "1",
                            "restrict_role": "0",
                            "admin_only": "0",
                            "read_only": "1"
                        },
                        {
                            "name": "user_name",
                            "id": 22,
                            "label": "Nombre",
                            "description": "Nombre del usuario",
                            "weight": 1,
                            "type": "text",
                            "sister_id": "-- Selecciona uno --",
                            "required": "0",
                            "unique": "0",
                            "text_allowed_html_tags": "strong em a ul ol li b i",
                            "text_max_length": "255",
                            "roles_allowed": "administrator",
                            "rest_pick_response": "array",
                            "rest_pick_depth": "1",
                            "read_only": "1"
                        },
                        {
                            "name": "user_surname",
                            "id": 23,
                            "label": "Apellidos",
                            "description": "Apellidos del usuario",
                            "weight": 2,
                            "type": "text",
                            "sister_id": "-- Selecciona uno --",
                            "required": "0",
                            "unique": "0",
                            "text_allowed_html_tags": "strong em a ul ol li b i",
                            "text_max_length": "255",
                            "roles_allowed": "administrator",
                            "rest_pick_response": "array",
                            "rest_pick_depth": "1",
                            "read_only": "1"
                        },
                        {
                            "name": "user_email",
                            "id": 24,
                            "label": "Correo Electr\u00f3nico",
                            "description": "Correo Electr\u00f3nico del usuario",
                            "weight": 3,
                            "type": "text",
                            "sister_id": "-- Selecciona uno --",
                            "required": "0",
                            "unique": "0",
                            "text_allowed_html_tags": "strong em a ul ol li b i",
                            "text_max_length": "255",
                            "roles_allowed": "administrator",
                            "rest_pick_response": "array",
                            "rest_pick_depth": "1",
                            "read_only": "1"
                        },
                        {
                            "name": "cv_path",
                            "id": 25,
                            "label": "Ruta CV",
                            "description": "Ruta en el servidor del archivo pdf subido",
                            "weight": 4,
                            "type": "text",
                            "sister_id": "-- Selecciona uno --",
                            "required": "0",
                            "unique": "0",
                            "text_allowed_html_tags": "strong em a ul ol li b i",
                            "text_max_length": "255",
                            "roles_allowed": "administrator",
                            "rest_pick_response": "array",
                            "rest_pick_depth": "1",
                            "read_only": "1"
                        },
                        {
                            "name": "cv_upload_date",
                            "id": 27,
                            "label": "Fecha subida CV",
                            "description": "Fecha en la que se ha subido el pdf",
                            "weight": 5,
                            "type": "datetime",
                            "sister_id": "-- Selecciona uno --",
                            "required": "0",
                            "unique": "0",
                            "datetime_type": "format",
                            "datetime_format": "mdy",
                            "datetime_time_type": "24",
                            "datetime_time_format": "h_mma",
                            "datetime_time_format_24": "hh_mm",
                            "datetime_allow_empty": "1",
                            "datetime_html5": "0",
                            "roles_allowed": "administrator",
                            "rest_pick_response": "array",
                            "rest_pick_depth": "1",
                            "read_only": "1"
                        },
                        {
                            "name": "json_api_response",
                            "id": 26,
                            "label": "JSON respuesta API",
                            "description": "Respuesta JSON del API",
                            "weight": 6,
                            "type": "paragraph",
                            "sister_id": "-- Selecciona uno --",
                            "required": "0",
                            "unique": "0",
                            "paragraph_allowed_html_tags": "strong em a ul ol li b i",
                            "paragraph_max_length": "-1",
                            "roles_allowed": "administrator",
                            "rest_pick_response": "array",
                            "rest_pick_depth": "1",
                            "read_only": "1"
                        },
                        {
                            "name": "json_response_api_ok",
                            "id": 29,
                            "label": "JSON API Ok",
                            "description": "",
                            "weight": 7,
                            "type": "boolean",
                            "sister_id": "-- Selecciona uno --",
                            "required": "0",
                            "unique": "0",
                            "boolean_format_type": "checkbox",
                            "boolean_yes_label": "S\u00ed",
                            "boolean_no_label": "No",
                            "roles_allowed": "administrator",
                            "rest_pick_response": "array",
                            "rest_pick_depth": "1",
                            "read_only": "1"
                        },
                        {
                            "name": "json_result_msg",
                            "id": 33,
                            "label": "Mensaje de Error JSON",
                            "description": "",
                            "weight": 8,
                            "type": "text",
                            "sister_id": "-- Selecciona uno --",
                            "required": "0",
                            "unique": "0",
                            "text_allowed_html_tags": "strong em a ul ol li b i",
                            "text_max_length": "255",
                            "roles_allowed": "administrator",
                            "rest_pick_response": "array",
                            "rest_pick_depth": "1",
                            "read_only": "1"
                        }
                    ]
                }
            ]
        }
    ]
}
sc0ttkclark commented 2 years ago

@zrothauser There's a bit of a blind spot for the read_only property on fields in DFV right now.

Screencast going over the current read only capabilities: https://share.skc.dev/QwunPXEZ

Field types that need work:

We also need to make sure read only applies to repeatable fields as well.

sc0ttkclark commented 2 years ago

Read only kitchen sink package is here: https://github.com/pods-framework/pods/blob/main/tests/codeception/_data/kitchen-sink-readonly-package.json