• Resolved jane-taubman

    (@jane-taubman)


    {
    "@meta": {
    "version": "3.2.2",
    "build": 1719239376
    },
    "settings": {
    "types_only": "0",
    "watch_changed_fields": "1",
    "metadata_integration": "1",
    "metadata_override_get": "1",
    "session_auto_start": "1",
    "wisdom_opt_out": "1",
    "pods_session_auto_start": "1",
    "register_meta_integration": "0",
    "media_modal_fields": "1",
    "dynamic_features_allow": "1",
    "dynamic_features_enabled": [
    "display",
    "form"
    ],
    "show_access_restricted_messages": "0",
    "show_access_admin_notices": "1",
    "dynamic_features_allow_sql_clauses": "simple",
    "display_callbacks": "restricted",
    "display_callbacks_allowed": "esc_attr,esc_html",
    "active_components": [
    "migrate-packages",
    "roles-and-capabilities",
    "templates"
    ]
    },
    "pods": [
    {
    "name": "language-pack",
    "id": 2288,
    "label": "Language Packs",
    "description": "",
    "label_singular": "Language Pack",
    "public": "1",
    "show_ui": "1",
    "supports_title": "0",
    "supports_editor": "1",
    "type": "post_type",
    "storage": "meta",
    "publicly_queryable": "1",
    "exclude_from_search": "0",
    "capability_type": "post",
    "capability_type_custom": "language_pack",
    "capability_type_extra": "1",
    "has_archive": "0",
    "hierarchical": "0",
    "rewrite": "1",
    "rewrite_with_front": "1",
    "rewrite_feeds": "0",
    "rewrite_pages": "1",
    "query_var": "1",
    "can_export": "1",
    "default_status": "draft",
    "supports_author": "1",
    "supports_thumbnail": "0",
    "supports_excerpt": "0",
    "supports_trackbacks": "0",
    "supports_custom_fields": "0",
    "supports_comments": "1",
    "supports_revisions": "0",
    "supports_page_attributes": "0",
    "supports_post_formats": "0",
    "built_in_taxonomies_category": "0",
    "built_in_taxonomies_link_category": "0",
    "built_in_taxonomies_post_tag": "0",
    "show_in_menu": "1",
    "menu_position": "0",
    "show_in_nav_menus": "1",
    "show_in_admin_bar": "1",
    "pfat_enable": "1",
    "pfat_run_outside_loop": "0",
    "pfat_single": "Language Pack",
    "pfat_append_single": "append",
    "pfat_filter_single": "the_content",
    "pfat_append_archive": "append",
    "pfat_filter_archive": "custom",
    "rest_enable": "1",
    "read_all": "1",
    "write_all": "0",
    "rewrite_custom_slug": "language-pack",
    "menu_icon": "dashicons-translation",
    "pfat_filter_archive_custom": "the_content",
    "_migrated_28": "1",
    "dynamic_features_allow": "1",
    "restrict_dynamic_features": "1",
    "restricted_dynamic_features": [
    "form"
    ],
    "restricted_dynamic_features_forms": [
    "edit"
    ],
    "show_access_restricted_messages": "inherit",
    "show_access_admin_notices": "inherit",
    "rest_api_field_mode": "value_and_render",
    "rest_api_field_location": "object",
    "groups": [
    {
    "name": "more_fields",
    "id": 4973,
    "label": "More Fields",
    "description": "",
    "weight": 0,
    "fields": [
    {
    "name": "pack_file",
    "id": 2289,
    "label": "Language Pack File",
    "description": "",
    "weight": 0,
    "type": "file",
    "required": "1",
    "file_format_type": "single",
    "file_uploader": "attachment",
    "file_attachment_tab": "upload",
    "file_edit_title": "1",
    "file_show_edit_link": "0",
    "file_linked": "0",
    "file_limit": "0",
    "file_restrict_filesize": "10MB",
    "file_type": "any",
    "file_allowed_extensions": "fhlang",
    "file_field_template": "rows",
    "file_add_button": "Add File",
    "file_modal_title": "Attach a file",
    "file_modal_add_button": "Add File",
    "file_wp_gallery_output": "0",
    "file_wp_gallery_link": "post",
    "file_wp_gallery_columns": "1",
    "file_wp_gallery_random_sort": "0",
    "file_wp_gallery_size": "thumbnail",
    "admin_only": "0",
    "restrict_role": "0",
    "restrict_capability": "0",
    "hidden": "0",
    "read_only": "0",
    "roles_allowed": [
    "administrator"
    ],
    "rest_read": "0",
    "rest_write": "0",
    "rest_pick_response": "array",
    "rest_pick_depth": "2",
    "unique": "0"
    },
    {
    "name": "version",
    "id": 2290,
    "label": "Version",
    "description": "Version",
    "weight": 1,
    "type": "text",
    "required": "1",
    "text_allow_shortcode": "0",
    "text_allow_html": "0",
    "text_allowed_html_tags": "strong em a ul ol li b i",
    "text_max_length": "255",
    "admin_only": "0",
    "restrict_role": "0",
    "restrict_capability": "0",
    "hidden": "0",
    "read_only": "0",
    "roles_allowed": [
    "administrator"
    ],
    "rest_read": "0",
    "rest_write": "0",
    "rest_pick_response": "array",
    "rest_pick_depth": "2",
    "unique": "0",
    "text_repeatable": "0"
    },
    {
    "name": "submitter",
    "id": 2590,
    "label": "Submitter",
    "description": "",
    "weight": 2,
    "type": "text",
    "required": "1",
    "text_allow_shortcode": "0",
    "text_allow_html": "0",
    "text_allowed_html_tags": "strong em a ul ol li b i",
    "text_max_length": "255",
    "admin_only": "0",
    "restrict_role": "0",
    "restrict_capability": "0",
    "hidden": "0",
    "read_only": "0",
    "roles_allowed": [
    "administrator"
    ],
    "rest_read": "0",
    "rest_write": "0",
    "rest_pick_response": "array",
    "rest_pick_depth": "2",
    "unique": "0",
    "text_repeatable": "0"
    },
    {
    "name": "language_id",
    "id": 2591,
    "label": "Language ID",
    "description": "",
    "weight": 3,
    "type": "text",
    "required": "1",
    "text_allow_shortcode": "0",
    "text_allow_html": "0",
    "text_allowed_html_tags": "strong em a ul ol li b i",
    "text_max_length": "255",
    "admin_only": "0",
    "restrict_role": "0",
    "restrict_capability": "0",
    "hidden": "0",
    "read_only": "0",
    "roles_allowed": [
    "administrator"
    ],
    "rest_read": "0",
    "rest_write": "0",
    "rest_pick_response": "array",
    "rest_pick_depth": "2",
    "unique": "0",
    "text_repeatable": "0"
    },
    {
    "name": "language_name",
    "id": 2592,
    "label": "Language Name",
    "description": "",
    "weight": 4,
    "type": "text",
    "required": "1",
    "text_allow_shortcode": "0",
    "text_allow_html": "0",
    "text_allowed_html_tags": "strong em a ul ol li b i",
    "text_max_length": "255",
    "admin_only": "0",
    "restrict_role": "0",
    "restrict_capability": "0",
    "hidden": "0",
    "read_only": "0",
    "roles_allowed": [
    "administrator"
    ],
    "rest_read": "0",
    "rest_write": "0",
    "rest_pick_response": "array",
    "rest_pick_depth": "2",
    "unique": "0",
    "text_repeatable": "0"
    },
    {
    "name": "internal_name",
    "id": 2593,
    "label": "Internal Name",
    "description": "",
    "weight": 5,
    "type": "text",
    "required": "1",
    "text_allow_shortcode": "0",
    "text_allow_html": "0",
    "text_allowed_html_tags": "strong em a ul ol li b i",
    "text_max_length": "255",
    "admin_only": "0",
    "restrict_role": "0",
    "restrict_capability": "0",
    "hidden": "0",
    "read_only": "0",
    "roles_allowed": [
    "administrator"
    ],
    "rest_read": "0",
    "rest_write": "0",
    "rest_pick_response": "array",
    "rest_pick_depth": "2",
    "unique": "0",
    "text_repeatable": "0"
    }
    ]
    }
    ]
    }
    ],
    "templates": [
    {
    "name": "Language Pack",
    "code": "<p>\r\n<a href=\"{@pack_file,forcedownload}?title={@post_title,urlencode}\" class=\"button download-button\" data-id=\"{@ID}\" rel=\"noopener noreferrer\">Download {@post_title} V{@version}<\/a>\r\n<\/p>\r\n<ul>\r\n\t<li>Localised Language: {@internal_name}<\/li>\r\n\t<li>Uploaded by: {@post_author,rjt_get_author_name}<\/li>\r\n\t<li><time class=\"entry-date published updated\" datetime=\"{@post_date}\">Updated {@post_modified,rjt_date}<\/time><\/li>\r\n<\/ul>",
    "id": 2286,
    "_edit_lock": "1606390858:1",
    "_edit_last": "1",
    "pod_reference": {
    "pod": "language-pack"
    }
    },
    {
    "name": "Language Pack List",
    "code": "[before]<div class=\"flow-item\" id=\"#ajax-load-more\">[\/before]\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n<div class=\"item post-1 post type-post status-publish format-standard hentry\">\r\n\t<a href=\"{@permalink}\"><img src=\"{@screenshot._src}\" onError=\"this.onerror=null;this.src='\/language-pack.png';\" \/><\/a>\r\n\r\n\t<h2 class=\"itemtitle\"><a href=\"{@permalink}\">{@post_title}<\/a><\/h2>\r\n\r\n\t<div class=\"itemdate\"><a href=\"{@permalink}\"><span class=\"posted-on\"> V{@version} {@internal_name}<\/span><\/a>\r\n\r\n\t<div class=\"itemextract\">\r\n\t{@post_content,rjt_first_paragraph}\r\n\t<\/div>\r\n\t\t<p>\r\n\t\t<time class=\"entry-date published updated\" datetime=\"{@post_date}\">Updated {@post_modified,rjt_date}<\/time><\/div>\r\n\t<\/p>\r\n\r\n<\/div><!--End Post -->\r\n\t\t\t\t\r\n[after]\t<\/div> [\/after]",
    "id": 2308,
    "_edit_lock": "1606390745:1",
    "_edit_last": "1",
    "pod_reference": {
    "pod": "language-pack"
    }
    }
    ]
    }

    The above is the definition for my Language Pack Pod. It can be accessed via the V2 rest API, but none of the custom fields appear, it used to work, but I suspect one of the updates to Pods broke it.

    I am sure it is just a simple setting change, but I have tried quite a few without success. Please can someone more knowledgable point me in the right direction.

    Thank you.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Same problem here, they disappeared from API even if global options (in my case) are enabled. They are all gone.

    Show All Fields (read-only)

    • Yes

    Read All Access

    • Require being logged in to read all field values via REST

    Allow All Fields To Be Updated

    • Yes
    Plugin Support Paul Clark

    (@pdclark)

    A recent change added per-field security checks, found in the REST API tab when editing settings for each individual field. Sounds like it is defaulting to off.

    The setting for the individual field would be the first place to check in addition to global REST API settings.

    The relevant field-specific field settings found in the JSON configuration from the original post are "rest_read": "0", "rest_write": "0", —?where 0 indicates the field is hidden from REST, while 1 would turn it on, corresponding to the checkbox in the field settings (for the specific field) > REST API user interface.

    Hello @pdclark,

    I understand what you are saying but if we have a global setting, it does not make any sense to activate the setting also per-field… Or I’m getting wrong the idea?

    Thank you.

    Thread Starter jane-taubman

    (@jane-taubman)

    To get my site to work, I had to manually edit every field.

    I then had to rebuild the PC program and do a full public release to fix as the file links now return the file url on the file level rather than having [guid] as a child field. So if you are accessing the rest API for file names you will need to watch out for that one.

    buxner

    (@buxner)

    Until this actually gets fixed (since the original bug was not addressed), here is a hacky workaround I’ve found:

    add_filter('pods_whatsit_get_arg', 'use_pod_access_setting_by_default', 10, 2);

    function use_pod_access_setting_by_default($value, $arg) {
    if ($arg === 'rest_read' && !$value) return null;
    return $value;
    }
Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.