You are here:  » Rest cannot read


Rest cannot read

Submitted by babrees on Sat, 2022-06-11 12:57 in

Hi David

Sorry to trouble you.

Still setting up my new site. Stand alone PT works perfectly.

Have set up the WP Plugin but am getting the following error. Any ideas?

code "rest_cannot_read"
message "Sorry, you are not allowed to view autosaves of this post."
data
status 401

Cheers
Jill

Submitted by support on Mon, 2022-06-13 08:20

Hi Jill,

Assuming the plugin activates successfully (or does this error happen when you click Activate?) what action e.g. page view or form submission are you taking immediately prior to this being displayed?

I don't recognise the error at all; "REST" indicates some kind of use of the WP internal API for post / comment management...

Cheers,
David.
--
PriceTapestry.com

Submitted by babrees on Mon, 2022-06-13 09:21

Hi David

Thanks.

It was just the shopping page, but I think it must have been a blip with WP. Just tried it again and noticed although 'published' it was still only showing the draft preview url. I made the page a draft again, closed it, opened it and published and it's now ok!!

Thanks again
Jill

Submitted by babrees on Mon, 2022-06-13 10:44

Sorry David. This is very strange as the shopping page just won't work every time.

I deleted the page and created a new one. At first it was fine and I closed the page.

Next time I opened it from the admin side, if I click to view the shopping page, even though the url shows correctly it goes to: {link saved}

If I type in the url on the front end it shows the page correctly: {link saved}

This is the only page that is doing it. Do you have any ideas?

Submitted by support on Mon, 2022-06-13 11:49

Hi Jill,

Does it look like the plugin is causing this for example only after you have added a shortcode to the page?

You mentioned being the only page causing the problem - it's not conflicting with the "Container Permalink" page at all is it? (the page containing just the [pto] shortcode along...)

Regarding your other new post, please could you email me about that and I'll get back to you...

Cheers,
David.
--
PriceTapestry.com

Submitted by babrees on Mon, 2022-06-13 12:20

Hi David

Have just been testing again.

Started a new page, deleting the old one, calling it shopping and changing Page Title in Configuration to Shopping

Just input some testing text to begin with. Everything find and admin side goes to correct page.

Added [pto] shortcode and it stopped working and going to the wp-json again

Submitted by babrees on Mon, 2022-06-13 12:22

Oh, in addition I had added the code on this thread: https://www.pricetapestry.org/node/587

For my last test I had reverted back to default in case it was that.

Submitted by support on Mon, 2022-06-13 12:59

Hi Jill,

The plugin should create the page at activation; could you try deleting the /shopping page then Deactive the plugin and then Activate it again, /shopping should then be present without needing to be created...

Cheers,
David.
--
PriceTapestry.com

Submitted by babrees on Mon, 2022-06-13 14:36

Hi David

Yes it did originally, and I then renamed it, changing it in Configuration too.

So I deleted the page and deactivated the plugin.
On reactivating yes it again made the page.
However, instead of going to wp-json, it's back to the original...
code "rest_cannot_read"
message "Sorry, you are not allowed to view autosaves of this post."
data
status 401

Submitted by babrees on Mon, 2022-06-13 14:39

I also tried deactivating all other plugins, but that didn't help either

Submitted by support on Mon, 2022-06-13 15:40

Hi Jill,

in wp-config.php (line 82) you can enable debug mode by changing as follows;

define( 'WP_DEBUG', true );

With that temporarily in place, is any PHP warning or error message displayed when the problem occurs?

Once any error message captured let me know what is displayed (or if no difference of course) and change debug mode back to disabled as follows;

define( 'WP_DEBUG', false );

Cheers,
David.
--
PriceTapestry.com

Submitted by babrees on Mon, 2022-06-13 17:03

The following is displayed...

{code saved}

Submitted by support on Mon, 2022-06-13 17:16

Hi Jill,

As they are only warnings / notices I'm not sure this will fix the problem but in the first instance please could you apply the modifications described in the following comments;

/node/664#comment-2489

/node/664#comment-2492

Cheers,
David.
--
PriceTapestry.com

Submitted by babrees on Tue, 2022-06-14 09:52

Thanks David

So, I made the updates you gave. No difference.

Although I updated all those files and uploaded them at the same time, and double checked, I am still getting the following error:

{code saved}

So, as it's a new site and I've been messing about with it, I deleted the whole kit and kaboodle and started fresh with a completely new install.

I activated and configured ONLY PTO plugin. Didn't touch anything else. No different. It's really weird.

Everything else works fine and I can get to the page from the front-end, just not the admin. So, I think it's time to say ok, just ignore it.

Although it would be nice to try and get rid of the deprecated warning.

Cheers
Jill

Submitted by support on Tue, 2022-06-14 11:01

Hi Jill,

Ah - there is an additional modification required to pto_atoz.php further to the above, but to document based on the distribution version look for the following code beginning at line 169:

  function pto_atoz_widget()
  {
    parent::WP_Widget(false, $name = "PriceTapestry.org A to Z");
  }

...and REPLACE with:

  function __construct()
  {
    parent::__construct(false, $name = "PriceTapestry.org A to Z");
  }

Cheers,
David.
--
PriceTapestry.com

Submitted by babrees on Tue, 2022-06-14 11:41

Thanks David

That fixed the warning :) Albeit not the problem!

Cheers
Jill