Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object Replacement Character in post title crashes Gutenberg 11.4.0/11.4.1 #34602

Closed
mdrovdahl opened this issue Sep 6, 2021 · 33 comments · Fixed by #34851
Closed

Object Replacement Character in post title crashes Gutenberg 11.4.0/11.4.1 #34602

mdrovdahl opened this issue Sep 6, 2021 · 33 comments · Fixed by #34851
Assignees
Labels
[Feature] Rich Text Related to the Rich Text component that allows developers to render a contenteditable Needs Technical Feedback Needs testing from a developer perspective. [Package] Rich text /packages/rich-text [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@mdrovdahl
Copy link

mdrovdahl commented Sep 6, 2021

Description

I am able to create a new post with a post title containing the OBJ character, after saving or publishing it and exiting the editor, the editor crashes when trying to re-open the post for editing. I was unable to replicate the issue using Gutenberg 11.3.0

Sample post title: "This post title crashes Gutenberg "

Step-by-step reproduction instructions

  1. Create a new post
  2. Use a post title with the OBJ character
  3. Save or publish the post
  4. Exit the editor
  5. Re-open the post for editing
  6. Editor crashes

Screenshots, screen recording, code snippet

Screen Shot 2021-09-06 at 2 34 34 PM

Screen Shot 2021-09-06 at 2 34 25 PM

Error text from Gutenberg

pe@https://ephemeral-mdrovdahl-20210901.atomicsites.blog/wp-content/plugins/gutenberg/build/rich-text/index.min.js?ver=8f70a366b9cae91a6f5753db0674024a:1:18233
fe@https://ephemeral-mdrovdahl-20210901.atomicsites.blog/wp-content/plugins/gutenberg/build/rich-text/index.min.js?ver=8f70a366b9cae91a6f5753db0674024a:1:17172
Ee@https://ephemeral-mdrovdahl-20210901.atomicsites.blog/wp-content/plugins/gutenberg/build/rich-text/index.min.js?ver=8f70a366b9cae91a6f5753db0674024a:1:18650
xe@https://ephemeral-mdrovdahl-20210901.atomicsites.blog/wp-content/plugins/gutenberg/build/rich-text/index.min.js?ver=8f70a366b9cae91a6f5753db0674024a:1:19083
b@https://ephemeral-mdrovdahl-20210901.atomicsites.blog/wp-content/plugins/gutenberg/build/rich-text/index.min.js?ver=8f70a366b9cae91a6f5753db0674024a:1:30090
C@https://ephemeral-mdrovdahl-20210901.atomicsites.blog/wp-content/plugins/gutenberg/build/rich-text/index.min.js?ver=8f70a366b9cae91a6f5753db0674024a:1:30848
nt/L<@https://ephemeral-mdrovdahl-20210901.atomicsites.blog/wp-content/plugins/gutenberg/build/rich-text/index.min.js?ver=8f70a366b9cae91a6f5753db0674024a:1:32170
x/<@https://ephemeral-mdrovdahl-20210901.atomicsites.blog/wp-content/plugins/gutenberg/build/compose/index.min.js?ver=0f1f9e9ebb624d4dfb57670a95cb1653:1:22833
A@https://ephemeral-mdrovdahl-20210901.atomicsites.blog/wp-content/plugins/gutenberg/build/compose/index.min.js?ver=0f1f9e9ebb624d4dfb57670a95cb1653:1:24939
P/<@https://ephemeral-mdrovdahl-20210901.atomicsites.blog/wp-content/plugins/gutenberg/build/compose/index.min.js?ver=0f1f9e9ebb624d4dfb57670a95cb1653:1:25375
A@https://ephemeral-mdrovdahl-20210901.atomicsites.blog/wp-content/plugins/gutenberg/build/compose/index.min.js?ver=0f1f9e9ebb624d4dfb57670a95cb1653:1:24939
P/<@https://ephemeral-mdrovdahl-20210901.atomicsites.blog/wp-content/plugins/gutenberg/build/compose/index.min.js?ver=0f1f9e9ebb624d4dfb57670a95cb1653:1:25375
Qj@https://ephemeral-mdrovdahl-20210901.atomicsites.blog/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:177:1
unstable_runWithPriority@https://ephemeral-mdrovdahl-20210901.atomicsites.blog/wp-content/plugins/gutenberg/vendor/react.min.755b0ae9.js:24:26
Za@https://ephemeral-mdrovdahl-20210901.atomicsites.blog/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:73:8
eb@https://ephemeral-mdrovdahl-20210901.atomicsites.blog/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:170:165
gf@https://ephemeral-mdrovdahl-20210901.atomicsites.blog/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:162:319
$g/<@https://ephemeral-mdrovdahl-20210901.atomicsites.blog/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:73:230
unstable_runWithPriority@https://ephemeral-mdrovdahl-20210901.atomicsites.blog/wp-content/plugins/gutenberg/vendor/react.min.755b0ae9.js:24:26
Za@https://ephemeral-mdrovdahl-20210901.atomicsites.blog/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:73:8
$g@https://ephemeral-mdrovdahl-20210901.atomicsites.blog/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:73:178
ja@https://ephemeral-mdrovdahl-20210901.atomicsites.blog/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:73:111
Pa@https://ephemeral-mdrovdahl-20210901.atomicsites.blog/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:157:212
Me@https://ephemeral-mdrovdahl-20210901.atomicsites.blog/wp-content/plugins/gutenberg/vendor/react-dom.min.edd8b7a6.js:110:252
e@https://ephemeral-mdrovdahl-20210901.atomicsites.blog/wp-content/plugins/gutenberg/build/data/index.min.js?ver=da4272fbc833ab25871c55f89400d555:1:19841
t@https://ephemeral-mdrovdahl-20210901.atomicsites.blog/wp-content/plugins/gutenberg/build/data/index.min.js?ver=da4272fbc833ab25871c55f89400d555:1:19908
c/t.subscribe/o<@https://ephemeral-mdrovdahl-20210901.atomicsites.blog/wp-content/plugins/gutenberg/build/data/index.min.js?ver=da4272fbc833ab25871c55f89400d555:1:14312
instantiate/b</<@https://ephemeral-mdrovdahl-20210901.atomicsites.blog/wp-content/plugins/gutenberg/build/data/index.min.js?ver=da4272fbc833ab25871c55f89400d555:1:13434
y@https://ephemeral-mdrovdahl-20210901.atomicsites.blog/wp-content/plugins/gutenberg/build/data/index.min.js?ver=da4272fbc833ab25871c55f89400d555:1:6847
o/</</<@https://ephemeral-mdrovdahl-20210901.atomicsites.blog/wp-content/plugins/gutenberg/build/redux-routine/index.min.js?ver=7a21a7d0e50a3686a159176880d88a37:1:8566
A/</<@https://ephemeral-mdrovdahl-20210901.atomicsites.blog/wp-content/plugins/gutenberg/build/data/index.min.js?ver=da4272fbc833ab25871c55f89400d555:1:8792
P/</</<@https://ephemeral-mdrovdahl-20210901.atomicsites.blog/wp-content/plugins/gutenberg/build/data/index.min.js?ver=da4272fbc833ab25871c55f89400d555:1:9138
dispatch@https://ephemeral-mdrovdahl-20210901.atomicsites.blog/wp-content/plugins/gutenberg/build/data/index.min.js?ver=da4272fbc833ab25871c55f89400d555:1:7707
o/</o</<@https://ephemeral-mdrovdahl-20210901.atomicsites.blog/wp-content/plugins/gutenberg/build/redux-routine/index.min.js?ver=7a21a7d0e50a3686a159176880d88a37:1:8353
n/<@https://ephemeral-mdrovdahl-20210901.atomicsites.blog/wp-content/plugins/gutenberg/build/redux-routine/index.min.js?ver=7a21a7d0e50a3686a159176880d88a37:1:3781
n@https://ephemeral-mdrovdahl-20210901.atomicsites.blog/wp-content/plugins/gutenberg/build/redux-routine/index.min.js?ver=7a21a7d0e50a3686a159176880d88a37:1:3756
u/<@https://ephemeral-mdrovdahl-20210901.atomicsites.blog/wp-content/plugins/gutenberg/build/redux-routine/index.min.js?ver=7a21a7d0e50a3686a159176880d88a37:1:3710

Environment info

### wp-core ###

version: 5.8
site_language: en_US
user_language: en_US
timezone: +00:00
permalink: /%year%/%monthnum%/%day%/%postname%/
https_status: true
multisite: false
user_registration: 0
blog_public: 1
default_comment_status: open
environment_type: production
user_count: 1
dotorg_communication: true

### wp-paths-sizes ###

wordpress_path: /srv/htdocs/__wp__
wordpress_size: 50.37 MB (52816824 bytes)
uploads_path: /srv/htdocs/wp-content/uploads
uploads_size: 0.00 B (0 bytes)
themes_path: /srv/htdocs/wp-content/themes
themes_size: 3.61 MB (3783307 bytes)
plugins_path: /srv/htdocs/wp-content/plugins
plugins_size: 115.32 MB (120922407 bytes)
database_size: 656.00 KB (671744 bytes)
wpcomsh-disk-space-used: 210.9 MB
wpcomsh-disk-space-quota: 200.0 GB

### wp-dropins (2) ###

advanced-cache.php: true
object-cache.php: true

### wp-active-theme ###

name: Twenty Twenty-One (twentytwentyone)
version: 1.4
author: the WordPress team
author_website: https://wordpress.org/
parent_theme: none
theme_features: core-block-patterns, widgets-block-editor, automatic-feed-links, title-tag, post-formats, post-thumbnails, menus, html5, custom-logo, customize-selective-refresh-widgets, wp-block-styles, align-wide, editor-styles, editor-style, editor-font-sizes, custom-background, editor-color-palette, editor-gradient-presets, responsive-embeds, custom-line-height, experimental-link-color, custom-spacing, custom-units, widgets
theme_path: /srv/htdocs/wp-content/themes/twentytwentyone
auto_update: Disabled

### wp-mu-plugins (1) ###

WP.com Site Helper: author: (undefined), version: (undefined)

### wp-plugins-active (1) ###

Gutenberg: version: 11.4.1, author: Gutenberg Team, Auto-updates enabled

### wp-plugins-inactive (9) ###

Akismet Anti-Spam: version: 4.1.11, author: Automattic (latest version: 4.1.12), Auto-updates disabled
AMP: version: 2.1.4, author: AMP Project Contributors, Auto-updates disabled
CoBlocks: version: 2.16.0, author: GoDaddy, Auto-updates disabled
Crowdsignal Forms: version: 1.5.6, author: Automattic (latest version: 1.5.7), Auto-updates disabled
Crowdsignal Polls & Ratings: version: 3.0.0, author: Automattic, Inc., Auto-updates disabled
Jetpack: version: 10.0, author: Automattic, Auto-updates disabled
Layout Grid: version: 1.7, author: Automattic, Auto-updates disabled
Page Optimize: version: 0.5.1, author: Automattic, Auto-updates disabled
WordPress.com Editing Toolkit: version: 3.13942, author: Automattic (latest version: 3.14278), Auto-updates disabled

### wp-media ###

image_editor: WP_Image_Editor_GD
imagick_module_version: Not available
imagemagick_version: Not available
imagick_version: Not available
file_uploads: File uploads is turned off
post_max_size: 2047M
upload_max_filesize: 2047M
max_effective_size: 2 GB
max_file_uploads: 20
gd_version: bundled (2.1.0 compatible)
gd_formats: GIF, JPEG, PNG, WebP, BMP
ghostscript_version: not available

### wp-server ###

server_architecture: Linux 4.19.0-17-amd64 x86_64
httpd_software: nginx
php_version: 7.4.23 64bit
php_sapi: fpm-fcgi
max_input_variables: 6144
time_limit: 1200
memory_limit: 512M
max_input_time: 1200
upload_max_filesize: 2047M
php_post_max_size: 2047M
curl_version: 7.78.0 OpenSSL/1.1.1d
suhosin: false
imagick_availability: false
pretty_permalinks: true

### wp-database ###

extension: mysqli
server_version: 10.4.20-MariaDB-log
client_version: mysqlnd 7.4.23

### wp-constants ###

WP_HOME: https://ephemeral-mdrovdahl-20210901.atomicsites.blog
WP_SITEURL: https://ephemeral-mdrovdahl-20210901.atomicsites.blog
WP_CONTENT_DIR: /srv/htdocs/wp-content
WP_PLUGIN_DIR: /srv/htdocs/wp-content/plugins
WP_MEMORY_LIMIT: 512M
WP_MAX_MEMORY_LIMIT: 512M
WP_DEBUG: true
WP_DEBUG_DISPLAY: false
WP_DEBUG_LOG: false
SCRIPT_DEBUG: false
WP_CACHE: false
CONCATENATE_SCRIPTS: undefined
COMPRESS_SCRIPTS: undefined
COMPRESS_CSS: undefined
WP_LOCAL_DEV: undefined
DB_CHARSET: latin1
DB_COLLATE: latin1_swedish_ci

### wp-filesystem ###

wordpress: writable
wp-content: writable
uploads: writable
plugins: writable
themes: writable
mu-plugins: writable

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@mdrovdahl
Copy link
Author

mdrovdahl commented Sep 6, 2021

cc: @ellatrix as I think you may have experience in this area of the codebase. [Updated] Also seems possible related to #34020

@glendaviesnz glendaviesnz added the [Type] Bug An existing feature does not function as intended label Sep 7, 2021
@glendaviesnz
Copy link
Contributor

I was able to replicate this on latest trunk.

@xpurichan
Copy link

xpurichan commented Sep 8, 2021

I experienced a customer with thi sissue as well. Their title was USA Ryder Cup Captain’s Picks Revealed  I must admit that I am not familiar with OBJ, but this "character" simply appeared as two empty spaces at the end of the page title.

The "Attempt Recovery" button had no effect. I had to enable the Classic Editor, rewrite the title, save, then I was able to re-open the blog post in Gutenberg.

Error output from Gutenberg:

TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.
    at pe (https://golfnewsri.com/wp-content/plugins/gutenberg/build/rich-text/index.min.js?ver=8f70a366b9cae91a6f5753db0674024a:1:18233)
    at fe (https://golfnewsri.com/wp-content/plugins/gutenberg/build/rich-text/index.min.js?ver=8f70a366b9cae91a6f5753db0674024a:1:17172)
    at Ee (https://golfnewsri.com/wp-content/plugins/gutenberg/build/rich-text/index.min.js?ver=8f70a366b9cae91a6f5753db0674024a:1:18650)
    at xe (https://golfnewsri.com/wp-content/plugins/gutenberg/build/rich-text/index.min.js?ver=8f70a366b9cae91a6f5753db0674024a:1:19081)
    at b (https://golfnewsri.com/wp-content/plugins/gutenberg/build/rich-text/index.min.js?ver=8f70a366b9cae91a6f5753db0674024a:1:30088)
    at C (https://golfnewsri.com/wp-content/plugins/gutenberg/build/rich-text/index.min.js?ver=8f70a366b9cae91a6f5753db0674024a:1:30848)
    at https://golfnewsri.com/wp-content/plugins/gutenberg/build/rich-text/index.min.js?ver=8f70a366b9cae91a6f5753db0674024a:1:32170
    at https://golfnewsri.com/wp-content/plugins/gutenberg/build/compose/index.min.js?ver=0f1f9e9ebb624d4dfb57670a95cb1653:1:22833
    at A (https://golfnewsri.com/wp-content/plugins/gutenberg/build/compose/index.min.js?ver=0f1f9e9ebb624d4dfb57670a95cb1653:1:24939)
    at https://golfnewsri.com/wp-content/plugins/gutenberg/build/compose/index.min.js?ver=0f1f9e9ebb624d4dfb57670a95cb1653:1:25374

@getdave getdave added [Feature] Rich Text Related to the Rich Text component that allows developers to render a contenteditable [Package] Rich text /packages/rich-text Needs Technical Feedback Needs testing from a developer perspective. labels Sep 8, 2021
@getdave
Copy link
Contributor

getdave commented Sep 8, 2021

Also able to replicate.

Screen Shot 2021-09-08 at 19 06 12 (1)

Looks like the code that invokes append utilises a method called fromFormat to get the child argument. Unfortunately it doesn't return a type and thus type is undefined.

pointer = append(
    getParent( pointer ),
    fromFormat( {
        ...replacements[ i ],
        object: true,
        isEditableTree,
    } )
);

If we examine this code we can see that there is an explicit code path for the object replacement character so it's obviously a scenario that we are expecting to handle.

Screen Shot 2021-09-08 at 19 10 07

Also note that ...replacements[ i ], is undefined.

@JoshuaGoode
Copy link

Encountered on 6 separate sites.

@kspilarski
Copy link

kspilarski commented Sep 12, 2021

I had a user case with the same issue.

1 similar comment
@rambogenius
Copy link

I had a user case with the same issue.

@zdenys
Copy link

zdenys commented Sep 14, 2021

I encountered another case on a WordPress.com site.

@jamiepalatnik
Copy link

Experienced this bug on a page with extra spaces in the page title.

@thekingsprojects
Copy link

thekingsprojects commented Sep 14, 2021

Just had a user case with the same issue on WordPress.com. Editing the post titles with Quick Edit seems to have resolved it, so that's a workaround if shuffling between Classic and Gutenberg isn't an option.

@edwinho89
Copy link

Encountered another WordPress.com site having similar issue. Editing post titles with "Quick Edit" is an excellent workaround in removing the additional space behind post titles.

@gwwar
Copy link
Contributor

gwwar commented Sep 15, 2021

I do have a patch for this, but the number of reports here make me suspicious. Is this character appearing in post titles as a side effect of another bug, or are folks actually copying this value over?

@goblinartificer
Copy link

Encountered another WordPress.com case today. This is really weird ⁠— it does make me feel like it's being added by another bug! It was added to the beginning or end of most but not all posts.

@sophiegyo
Copy link

I do have a patch for this, but the number of reports here make me suspicious. Is this character appearing in post titles as a side effect of another bug, or are folks actually copying this value over?

I spoke to someone who experienced this last week (including the inability to edit afterwards), but I haven't experienced it myself. They were copying the post title over from MS Word. I noticed the object replacement character showed as a blank space in the source HTML of their published post and when I mentioned this, they noted that there was also a space at the end of the post title in Word, which leads me to assume it's being copied in accidentally in at least one or two cases.

@jartes
Copy link

jartes commented Sep 16, 2021

I had another case in WordPress.com. The user copied the text from a MS Word doc and they had a blank space at the beginning of the post title.

@getdave
Copy link
Contributor

getdave commented Sep 16, 2021

This is now being worked on in #34851. Essentially we'll not allow the character to be inserted at all.

@macmanx2
Copy link

The issue reported at https://wordpress.com/forums/topic/project-wont-show/ regarding https://elisecutoneportfolio.wordpress.com/portfolio/maui-food-bank/ seems very similar, but I'm not seeing any replacement characters.

@hacchism
Copy link

Encountered another WordPress.com site with the issue. Editing a post title with "Quick Edit" worked like a charm.

@kuropixel
Copy link

Another WordPress.com site experiencing this issue. Editing with "Quick Edit" is the easiest solution.

@rickmgithub
Copy link

rickmgithub commented Sep 20, 2021

Another site experiencing the same issue. I also found editing the title using quick view worked.

@cuemarie
Copy link

Encountered today on a site where the user copied and pasted the title from Microsoft Word. Solved by removing OBJ symbol in Classic View -> Quick Edit.

@cuemarie
Copy link

Another report of this, same cause: copying and pasting the post title over from MS Word. User couldn't see the OBJ symbol in Classic View, using Safari.
I had them clear out the title and retype anyway, and that removed the symbol (however the OBJ was still part of the slug and needed to be removed from there as well).

@renata-franco
Copy link

I have another report like this in chat as well. Tried to guide the user to remove it themselves from Classic View editor.

@getdave
Copy link
Contributor

getdave commented Sep 21, 2021

Issue Has Been Fixed

This issue has now been fixed in #34851.

That will be available when Gutenberg 11.6.0 is released. Update your sites when it's available to get that fix.

@mikeicode
Copy link

Ran into this on a .com Personal plan site

@cuemarie
Copy link

cuemarie commented Sep 21, 2021

Ran into this on another .com Business site with plugins; let them know this will be resolved with the next Gutenberg update, and directed to remove object from Classic View in the meantime.

Thanks for the resolution!

@sajmes
Copy link

sajmes commented Sep 24, 2021

I ran into something that appears to be related this issue on a WordPress.com site. A prior report noted the obj in the title. That was no longer there but the post still crashed the editor. I removed several blank spaces from the end of the post title using quick edit and this resolved the issue with the editor loading.

@mdrovdahl
Copy link
Author

mdrovdahl commented Sep 24, 2021

I removed several blank spaces from the end of the post title using quick edit and this resolved the issue with the editor loading.

To be clear, as is reported elsewhere, by removing those spaces you're (I'm 99% certain of this) actually removing the offending Object Replacement Character, it's just not rendering the "OBJ" in that view (for whatever reason), so it's not visible.

@rambogenius
Copy link

I had a user case with the same issue.

@jp-imagines
Copy link

Another report from a WordPress.com site on a Premium plan. The OBJ character was probably pasted in from another editor (it occurred just after a ® character). "Quick Edit" workaround worked like a charm!

@jromales
Copy link

jromales commented Oct 1, 2021

I had a user on a Premium plan who had a similar case. I went to do a quick edit on the post where the title includes an OBJ character and removed the extra space - that solved the problem.

@arinoch
Copy link

arinoch commented Oct 31, 2021

I just took a report from a WordPress.com business user on this issue using 11.8.0, and this issue still persists. In this iteration of the issue, the OBJ didn't necessarily appear in the editor (there was nothing extra, like empty space as in above comments), but did appear in previews/on public pages. There was no Gutenberg crash, but otherwise it appears to be similar to this WordPress.org report. Strangely, if you re-save the post in the Gutenberg editor, sometimes the issue is filtered out. Otherwise, quick/classic edit to fix is still the workaround.

@seanbelly
Copy link

I encountered this on a Russian site. I copy and pasted into plain text editor, deleted the original title, and pasted it back.

This was originally copied from Microsoft Word as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Rich Text Related to the Rich Text component that allows developers to render a contenteditable Needs Technical Feedback Needs testing from a developer perspective. [Package] Rich text /packages/rich-text [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.