Skip Navigation

[Resolved] Creating a CPT view

This support ticket is created 3 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. 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 13 replies, has 2 voices.

Last updated by Waqar 3 years, 9 months ago.

Assisted by: Waqar.

Author
Posts
#1912521

Tell us what you are trying to do?
Create a view for a custom post type

Is there any documentation that you are following?
https://toolset.com/2019/06/visually-create-and-design-views-using-block-editor/

Is there a similar example that we can see?
Not on the front end. The problem starts with adding a view widget to a block. A warning about "no correct JSON format" appears. I have no idea where or what to change.

What is the link to your site?
hidden link

The server meets toolset needs, explicitly checked that with their team.
Please tell me what further information you need?

#1912839

Hi,

Thank you for contacting us and I'd be happy to assist.

The warning suggests that something is interfering with the normal processing of the blocks editor.

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 this View block is being used in the admin area and you can share temporary admin login details in reply to this message.

Note: Your next reply will be private please make a complete backup copy, before sharing the access details.

regards,
Waqar

#1914597

Thank you for sharing the access details, but I keep getting the incorrect password message.

Can you please check the username and password again and make sure that this user has the "administrator" role?

I've set your next reply as private again.

#1917133

The access details worked, thank you.

I can see the issue on your website, while creating a new view, using the blocks based editor.

While troubleshooting earlier, did you also checked with Cloudflare disabled?

If you've already checked that, I'll need your permission to download a clone/snapshot of your website, to investigate this on a different server.
( ref: https://toolset.com/faq/provide-supporters-copy-site/ )

#1917993

Hi Waqar,

yes, I disabled CF with non-toolset plugins off and 2021 theme on. No changes.

So yes, paid version of Updraft is there, just create a site key on your server using Updraft and then log in to my site -> Updraft -> clone/migrate -> send a backup and enter the site key for save transmission.

Regards,

Sven

#1919097

Thank you for the permission and I was able to deploy your website's clone on my server.

I'm currently running some tests on it and will share my findings, as soon as this testing completes.

Thank you for your patience.

#1921299

Hi Sven,

Just wanted to let you know that, I'm still investigating this view creation issue and will be able to share an update, in a couple of hours.

regards,
Waqar

#1921975

Thank you for waiting.

During troubleshooting, I was able to narrow down this issue, to the following line of code in the website's "wp-config.php" file:


define( 'WP_REST_API', true );

The quote characters used around the "WP_REST_API" are not correct and it should be changed to:


define( 'WP_REST_API', true );

This screenshot will make the difference more clear:
hidden link

Once this line is fixed, the error "The response is not a valid JSON response." will be fixed.

#1922565

Wrong quotation marks confirmed and fixed.

But no effect. Started a new template and got same error again.

-> Re-checked the config file, can confirm that changes have been saved to correct quotation marks.
-> plugins off exept for Toolset. Added single field 'Karteikopf' in block editor, no styling, no additional text, just the naked field. On updating I received the same "JSON" error message as before

So from my perspective there must be something else. If you need additional info about server or cloudflare, plz let me know.

#1922743

Thanks for the update.

I'm now seeing a different error on your website, which is not seen on your website's clone on my server.

Screenshot: hidden link

Something on your server is blocking the WordPress REST API endpoint for the user information (and could be blocking other endpoints too) which results in 403 forbidden errors.
( similar report of this error at WordPress forum: https://wordpress.org/support/topic/wp-rest-api-users-endpoint-returns-403-error/ )

I'll recommend testing this with Cloudflare disabled again, to see if it is related to Cloudflare or the server. You can then get in touch with the support team of the Cloudflare or the server, accordingly.

#1924183

Hi Waqar,

that is actually a MiniOrange 2FA plugin feature to prevent 3rd party from requesting user info via the REST API. It has been installed about 6:00 pm GMT+1 today thus it's rather not the cause of the prior issue.
If you watched it earlier than 6:00 pm GMT please leave me feedback.

If that MiniOrange feature generally might be a new issue for Toolset Views I can switch that feature off easily via the plugin settings.

At the moment I still feel it's something different.

#1927269

Earlier, the cause of the error "The response is not a valid JSON response." was different (wrong quotation marks).

Now, it is being shown for a different reason, as suggested in my last reply.

Did you get a chance to test this with the "MiniOrange 2FA" plugin disabled?

#1927335

Actually no, as MiniOrange caused several new issues. I love that with their 198 bucks premium account ... NOT. I suggest you close this ticket and as soon as the urgently needed 2FA works as it should, I'll test Views again and in case, I'll open a new ticket. Thank you so far for your assistance. Greatly appreciated.

#1927339

You're very welcome and I'm going to mark this ticket as resolved.

Please feel free to share your test results with us, in case the issue still persists.
( you can include this ticket's link so that we can connect the background info )