Opened 13 months ago
Last modified 13 months ago
#60952 new defect (bug)
Completely broken out of the box: can't edit "hello world" post, lots of errors in browser console in wp-admin
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | critical | Version: | 6.5 |
Component: | Editor | Keywords: | needs-screenshots |
Focuses: | Cc: |
Description (last modified by )
- download wordpress from the official website
- install it
- go to wp-admin
- go to Posts -> "Hello World" -> edit
Already there are a bunch of errors in the console: (oh come on, I can't paste a screenshot!?!?)
- edit the text and click on the "Update" button
Expected: should work
Observed: this error shows up at the top of the page:
"Updating failed. The response is not a valid JSON response."
and this can be seen in the console:
api-fetch.min.js?ver=4c185334c5ec26e149cc:2 POST https://*******.com/wp/index.php/wp-json/wp/v2/posts/1?_locale=user 404 (Not Found)
I didn't touch any settings, this is a fresh installation installed 10 minutes ago.
Attachments (2)
Change History (12)
#5
@
13 months ago
- Keywords reporter-feedback removed
Can you try this:
Custom structure /index.php/%year%/%postname%/
This reproduces for me (/%postname% alone doesn't).
I'm not sure this was the exact value that was set by default out-of-the-box but it was /index.php/%something%/%something%. Either way, it should work with any valid permalink setting.
#6
@
13 months ago
BTW with the Classic Editor plugin, it works and there are no errors even with the same custom permalink structure.
#7
@
13 months ago
Thanks for the clarification @teo8976 . I have set the permalink structure like yours and it's working fine for me. i can't reproduce the issue.
You can do the following steps to check if the issue got solved or not:
1) Deactivate All Plugins From Your WordPress Website
2) Set Your WordPress Website To Its Default Theme
3) Check If The Visual Editor Is Disabled When Writing (go to Users > Your Profile)
4) Ensure Your Website Is Updated To The Latest PHP
5) Ensure You are using latest WordPress version
6) Check For Technical Errors Such As Broken JavaScript in console (developer debug mode)
7) Verify WordPress URLs: Check the WordPress Address and Site Address in Settings » General to ensure they are identical and same.
8) Adjust the custom Permalink Settings again.
9) Make a new post and try to edit.
10) Make sure that you are not using any emoji to your post. sometimes when setting up database your configuration might not support using emoji and it cause json response error.
#9
@
13 months ago
Did all that, still observing the issue.
Are you sure you included the /index.php/ part in your permalink setting?
Some notes:
3) Check If The Visual Editor Is Disabled When Writing (go to Users > Your Profile)
Still reproduces even with the visual editor disabled
4) Ensure Your Website Is Updated To The Latest PHP
It's 8.2.16
6) Check For Technical Errors Such As Broken JavaScript in console (developer debug mode)
As I said, there are a bunch of errors, all from 404 responses:
api-fetch.min.js?ver…85334c5ec26e149cc:2 GET https://xxxxxxx.com/wp/index.php/wp-json/wp/v2/blocks?context=edit&per_page=100&_locale=user 404 (Not Found) api-fetch.min.js?ver…85334c5ec26e149cc:2 GET https://xxxxxxx.com/wp/index.php/wp-json/?_fields=description%2Cgmt_off…site_icon%2Csite_icon_url%2Csite_logo%2Ctimezone_string%2Curl&_locale=user 404 (Not Found) api-fetch.min.js?ver…85334c5ec26e149cc:2 GET https://xxxxxxx.com/wp/index.php/wp-json/?_fields=description%2Cgmt_off…site_icon%2Csite_icon_url%2Csite_logo%2Ctimezone_string%2Curl&_locale=user 404 (Not Found) api-fetch.min.js?ver…85334c5ec26e149cc:2 GET https://xxxxxxx.com/wp/index.php/wp-json/wp/v2/taxonomies?context=edit&per_page=100&_locale=user 404 (Not Found) api-fetch.min.js?ver…85334c5ec26e149cc:2 GET https://xxxxxxx.com/wp/index.php/wp-json/wp/v2/block-patterns/categories?_locale=user 404 (Not Found) api-fetch.min.js?ver…85334c5ec26e149cc:2 GET https://xxxxxxx.com/wp/index.php/wp-json/wp/v2/users?context=view&who=authors&per_page=50&_fields=id%2Cname&_locale=user 404 (Not Found) api-fetch.min.js?ver…85334c5ec26e149cc:2 OPTIONS https://xxxxxxx.com/wp/index.php/wp-json/wp/v2/posts/10?_locale=user 404 (Not Found) api-fetch.min.js?ver…85334c5ec26e149cc:2 GET https://xxxxxxx.com/wp/index.php/wp-json/wp/v2/templates/lookup?slug=single-post-sdv-lskndvslnkdsl-lsndv&_locale=user 404 (Not Found) api-fetch.min.js?ver…85334c5ec26e149cc:2 GET https://xxxxxxx.com/wp/index.php/wp-json/wp/v2/wp_pattern_category?context=view&per_page=100&_fields=id%2Cname%2Cdescription%2Cslug&_locale=user 404 (Not Found) api-fetch.min.js?ver…85334c5ec26e149cc:2 GET https://xxxxxxx.com/wp/index.php/wp-json/wp/v2/themes?context=edit&status=active&_locale=user 404 (Not Found) api-fetch.min.js?ver…85334c5ec26e149cc:2 GET https://xxxxxxx.com/wp/index.php/wp-json/wp/v2/templates?context=edit&_locale=user 404 (Not Found)
All of these are when I load the page to edit the post, before I attempt to update.
When I do update, I get this:
api-fetch.min.js?ver…85334c5ec26e149cc:2 POST https://xxxxx.com/wp/index.php/wp-json/wp/v2/posts/10?_locale=user 404 (Not Found)
9) Make a new post and try to edit.
I get the error when attempting to save the new post, let alone edit it.
10) Make sure that you are not using any emoji to your post. sometimes when setting up database your configuration might not support using emoji and it cause json response error.
There are no emojis or other strange characters in the post. Also note these are 404 errors, so nothing to do. And my database was created with utf8_mb4
encoding. Also, if there had been something wrong with my database, I should have received a warning when installing, which I didn't.
But this has nothing to do with that, these are 404 errors.
BTW below is the body of the response to the update request. Shouldn't it be a json??
<!DOCTYPE html> <html lang="en-US"> <head> <meta charset="UTF-8"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <meta name='robots' content='max-image-preview:large'/> <title>Page not found –Test WordPress</title> <link rel="alternate" type="application/rss+xml" title="Test WordPress » Feed" href="https://sixty-seven.com/wp/index.php/feed/"/> <link rel="alternate" type="application/rss+xml" title="Test WordPress » Comments Feed" href="https://sixty-seven.com/wp/index.php/comments/feed/"/> <script> window._wpemojiSettings = { "baseUrl": "https:\/\/s.w.org\/images\/core\/emoji\/15.0.3\/72x72\/", "ext": ".png", "svgUrl": "https:\/\/s.w.org\/images\/core\/emoji\/15.0.3\/svg\/", "svgExt": ".svg", "source": { "concatemoji": "https:\/\/sixty-seven.com\/wp\/wp-includes\/js\/wp-emoji-release.min.js?ver=6.6-alpha-57937" } }; /*! This file is auto-generated */ !function(i, n) { var o, s, e; function c(e) { try { var t = { supportTests: e, timestamp: (new Date).valueOf() }; sessionStorage.setItem(o, JSON.stringify(t)) } catch (e) {} } function p(e, t, n) { e.clearRect(0, 0, e.canvas.width, e.canvas.height), e.fillText(t, 0, 0); var t = new Uint32Array(e.getImageData(0, 0, e.canvas.width, e.canvas.height).data) , r = (e.clearRect(0, 0, e.canvas.width, e.canvas.height), e.fillText(n, 0, 0), new Uint32Array(e.getImageData(0, 0, e.canvas.width, e.canvas.height).data)); return t.every(function(e, t) { return e === r[t] }) } function u(e, t, n) { switch (t) { case "flag": return n(e, "\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f", "\ud83c\udff3\ufe0f\u200b\u26a7\ufe0f") ? !1 : !n(e, "\ud83c\uddfa\ud83c\uddf3", "\ud83c\uddfa\u200b\ud83c\uddf3") && !n(e, "\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc65\udb40\udc6e\udb40\udc67\udb40\udc7f", "\ud83c\udff4\u200b\udb40\udc67\u200b\udb40\udc62\u200b\udb40\udc65\u200b\udb40\udc6e\u200b\udb40\udc67\u200b\udb40\udc7f"); case "emoji": return !n(e, "\ud83d\udc26\u200d\u2b1b", "\ud83d\udc26\u200b\u2b1b") } return !1 } function f(e, t, n) { var r = "undefined" != typeof WorkerGlobalScope && self instanceof WorkerGlobalScope ? new OffscreenCanvas(300,150) : i.createElement("canvas") , a = r.getContext("2d", { willReadFrequently: !0 }) , o = (a.textBaseline = "top", a.font = "600 32px Arial", {}); return e.forEach(function(e) { o[e] = t(a, e, n) }), o } function t(e) { var t = i.createElement("script"); t.src = e, t.defer = !0, i.head.appendChild(t) } "undefined" != typeof Promise && (o = "wpEmojiSettingsSupports", s = ["flag", "emoji"], n.supports = { everything: !0, everythingExceptFlag: !0 }, e = new Promise(function(e) { i.addEventListener("DOMContentLoaded", e, { once: !0 }) } ), new Promise(function(t) { var n = function() { try { var e = JSON.parse(sessionStorage.getItem(o)); if ("object" == typeof e && "number" == typeof e.timestamp && (new Date).valueOf() < e.timestamp + 604800 && "object" == typeof e.supportTests) return e.supportTests } catch (e) {} return null }(); if (!n) { if ("undefined" != typeof Worker && "undefined" != typeof OffscreenCanvas && "undefined" != typeof URL && URL.createObjectURL && "undefined" != typeof Blob) try { var e = "postMessage(" + f.toString() + "(" + [JSON.stringify(s), u.toString(), p.toString()].join(",") + "));" , r = new Blob([e],{ type: "text/javascript" }) , a = new Worker(URL.createObjectURL(r),{ name: "wpTestEmojiSupports" }); return void (a.onmessage = function(e) { c(n = e.data), a.terminate(), t(n) } ) } catch (e) {} c(n = f(s, u, p)) } t(n) } ).then(function(e) { for (var t in e) n.supports[t] = e[t], n.supports.everything = n.supports.everything && n.supports[t], "flag" !== t && (n.supports.everythingExceptFlag = n.supports.everythingExceptFlag && n.supports[t]); n.supports.everythingExceptFlag = n.supports.everythingExceptFlag && !n.supports.flag, n.DOMReady = !1, n.readyCallback = function() { n.DOMReady = !0 } }).then(function() { return e }).then(function() { var e; n.supports.everything || (n.readyCallback(), (e = n.source || {}).concatemoji ? t(e.concatemoji) : e.wpemoji && e.twemoji && (t(e.twemoji), t(e.wpemoji))) })) }((window, document), window._wpemojiSettings); </script> <style id='wp-block-site-logo-inline-css'> .wp-block-site-logo { bo WordPress.org: Please note that this content has been truncated for display.
The issue goes away if I change the Permalink setting to "Plain".
By default, it was set to something else. I think it was "Custom Structure", but by changing it to plain, the contents of the input field that defined the custom structure was lost (and it doesn't get recovered if I re-select "Custom Structure"), which is BTW a separate bug by itself.