Skip Navigation

[Resolved] Creating view in blocks not showing custom fields & update button nonfunctional

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Our next available supporter will start replying to tickets in about 2.87 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 7 replies, has 3 voices.

Last updated by Waqar 12 months ago.

Assisted by: Waqar.

Author
Posts
#2666349
Screenshot 2023-11-19 at 7.14.55 PM.png

I created a CPT. I then created some custom fields in that CPT. I created a page and went into the editor for that page. I added a view block, put in a name for the view to create a new one. I then added the Toolset Header block inside the view. I set the Toolset Header to a dynamic source. I left the post source as current page per the tutorial. I then tried to set the source to one of the custom fields, but none of my custom fields are displaying. I also noticed that the update button in the upper right of the WP editor is non-functional. I am confused as to why these things are occurring. Is there something I missed?

#2666545

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

There is a custom field group assigned to the post type being queried by the View?

It should be appearing in the dropdown, at the top, if that's the case.

Are you able to locate the custom search if you scroll to the bottom of the options?

The Update button uses a WordPress mechanism to detect changes, and becomes inactive after an update until some change is made in the editor. If you make some other change in the editor does the button become active again?

If you open the browser console do you see any errors? (The modern WordPress editor relies heavily on JavaScript, and if something is not working correctly there would typically be clues in the browser console.)

#2667249
Screenshot 2023-11-22 at 9.22.25 AM.png
Screenshot 2023-11-22 at 9.22.05 AM.png
Screenshot 2023-11-22 at 9.21.47 AM.png
Screenshot 2023-11-22 at 9.21.37 AM.png

I see all sorts of console errors. I believe I set up the custom field group correctly since I see it under the CPT in the dashboard. I am attaching some screenshots.

When I expand the error, I see this message...

code: "invalid_json"
message: "The response is not a valid JSON response."

Here is the JSON that is generated...

{
id: "4209",
_locale: "user",
general: {
id: "4209",
preview_id: 4209,
name: "THH Check In",
slug: "thh-check-in",
description: "",
view_template: "",
preview_post_id: null,
error: null,
parent_post_id: null,
parent_post_slug: "",
initial_parent_post_id: null,
custom_search_enabled: false,
sorting_enabled: false,
isWpa: false,
loading: true,
insideTranslatedPost: false,
translatedWithTM: false
},
pagination: {
enable_pagination: true,
pagination_type: "paged",
page_size: 10,
pagination_effect: "fade",
pagination_effect_duration: 500,
browser_history_change: true,
preload_images: true,
cache_pages: true,
preload_prev_next: true,
pages_to_preload: 1,
spinner_type: "builtin",
views_spinner_type: "spinner1",
new_page_interval: 5,
pause_on_hover: false,
js_callback: "",
template: "",
spinner_image_uploaded: ""
},
ordering: {
first: "",
first_dir: "desc",
first_as: "",
second: "",
second_dir: "desc",
taxonomy: "",
taxonomy_dir: "desc",
users: "",
users_dir: "desc"
},
loop: {
inserter_shown: false,
view_template: 0,
view_editor_mode: 2,
loop_type: "toolset-grid",
loop_type_grid: true,
number_of_columns: 2,
add_container: false,
add_row_class: false,
html_structure: "0",
sortable_table: false,
wizard_done: false,
wizardDoneInNewView: false,
wizard_step: 0,
fields: [ ],
list_separator: ",",
filter_template: "",
view_layout: "",
loop_template: "",
custom_css: "",
custom_js: "",
item_template: "",
item_template_style: null,
no_items_text: "[wpml-string context="wpv-views"]No items found[/wpml-string]",
table_columns_widths: [
{
value: 50,
dimensions: "%"
},
{
value: 50,
dimensions: "%"
}
],
table_header_template: "",
disable_table_header: false,
save_loop_item_position: false,
loop_item_on_top: 0,
layout_recreated: false,
excess_output_removed: false,
error: null
},
content_selection: {
query_type: "posts",
wpaLoopsPreview: null,
wpaLoops: [ ],
wpaLoopsOptions: [ ],
post_type: [ ],
postTypeRelationship: null,
allowMultiplePostTypes: false,
taxonomy_type: [ ],
roles_type: [ ],
post_type_dont_include_current_page: 1,
taxonomy_hide_empty: true,
taxonomy_include_non_empty_decendants: true,
taxonomy_pad_counts: true,
users_show_current: false,
relatedPostTypes: [ ],
relatedRFGs: [ ]
},
screen_options: {
purpose: null,
query_show_query_help: true,
query_show_content_selection: true,
query_show_query_options: true,
query_show_ordering: true,
query_show_limit_and_offset: true,
query_show_query_filter: true,
filter_show_filter_help: true,
filter_show_pagination: true,
filter_show_custom_search: true,
filter_show_search_and_pagination: true,
loop_show_loop_help: true,
loop_show_loop_editor: true,
loop_show_output_editor: true
},
limit_offset: {
limit: -1,
offset: 0,
taxonomy_limit: -1,
taxonomy_offset: 0,
users_limit: -1,
users_offset: 0
},
custom_search: {
mode_helper: "",
ajax_results: "disable",
ajax_results_pre_before: "",
ajax_results_before: "",
ajax_results_after: "",
ajax_results_submit: "reload",
enable_dependency: "enable",
enable_history: "enable",
empty_select: "hide",
empty_multi_select: "hide",
empty_radios: "hide",
empty_checkboxes: "hide",
show_single_container_notice: false,
customSearchSpinnerSource: "builtin",
customSearchSpinnerType: "spinner1",
customSearchSpinnerUploaded: "",
customSearchOverlayColor: ""
},
themeIntegration: {
settings: [ ]
},
queryFilters: {
queryFilters: [ ]
},
woocommerceOptions: {
woocommerce_pagination_enabled: false,
woocommerce_sorting_enabled: false
},
viewMarkup: ""
}

When I run it through a validator, I get this...

Error: Parse error on line 1:
{id: "4209",_locale:
-^
Expecting 'STRING', '}', got 'undefined'

I believe the error is due to the keys not having surrounding quotes. I assume this is being generated from within Toolset code. Is this a bug? Is it a setting I need to change? Please advise.

Not sure what you mean by "custom search". If you could clarify, I can try something there.

#2667525
current-source-example.png

Hi,

Thank you for sharing these details.

As shown in the attached example screenshot, the post source should be the post type that is set to be shown by the current view. Then the relevant custom field groups become available.

In case you're not seeing the option to switch to that current view's post type, the script errors will need to be addressed first.

To troubleshoot this, I'll suggest the following steps:

1. Please make sure that WordPress, active theme and plugins are all updated to the latest versions.

2. It would be interesting to test this with all non-Toolset plugins disabled and a default theme like Twenty Twenty-One.

If it's fixed, you can start adding the disabled items, one-by-one, to narrow down to a possible conflicting one.

3. In case the issue still persists, I'll need to see how Toolset and this view are configured in the admin area. You're welcome to share temporary admin login details, in reply to this message.

Note: Your next reply will be private and making a complete backup copy is recommended before sharing the access details.

regards,
Waqar

#2667815

Thanks for writing back.

I tried to login using the provided access details but I'm getting the message that this user is not registered on this site.

Can you please text the username and the password again?

Note: I'm setting your next reply as private again.

#2668483

The access details worked, thank you.

I noticed that your website doesn't seem to have any security plugin active, yet the REST API requests that the blocks-based editor relies on, are being blocked.

This is the response that the server is sending:


<h1>Error 403 - Forbidden access.</h1>
<p>Sorry, you do not have permission to access this resource on the server due to a security restriction.</p>
<p>If you are the site owner, please check your site management tools to verify your WAF settings or contact us if the problem persists.</p>

I'll recommend getting in touch with the hosting support team, to see if they have any security/firewall enabled, which is resulting in these REST API calls getting blocked.

#2668639

There is a WAF on the site. I can disable it, but would rather update the allow list. Just let me know the allowable IPs.

#2668851

I'm not sure exactly which type of WAF is involved here, but, by default, this should be allowed.

The IP should be the same as the server since the REST API calls are from the same server too.

Did you get a chance to raise this with the hosting support team?

#2669325

WAF was giving a false alarm as XSS