-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Saving a block with backslash in RichText wipes out all RichText data within the block #16508
Comments
Able to reproduce this! Thanks for the report @Alexius08 For easier testing, we can also use the Search block instead of creating a new block. Title in the search block is RichText and rendered in PHP.
(Backslashes are a problem). Also ref https://wordpress.slack.com/archives/C02QB2JS7/p1576127699440400 |
Hi, I'm still able to reproduce this as of Gutenberg 13.2.; note that this only occurs if the last character in the saved attributed is a backslash; for example, in the test case above by @ehti ; if you change the title in title block to "search for records and\or data" ; the attribute will be saved ;but if you finish it as ABC\ it will not. |
@Mamaduka @youknowriad to be clear and get it out of the way, this isn't related to the recent |
@dmsnell I don't think so as that change is only applied to some blocks not all RichText blocks and this bug is about a custom block with two rich text elements. |
thanks @youknowriad - I can imagine some plausible ways this could go wrong. Can we get a copy of before/after |
The search button text has a Edit: I can only reproduce the issue when the string attribute is serialized in the block comment. <!-- wp:search {"label":"Search","buttonText":"Search \\u0022} /--> Screenshot |
I believe this regression was introduced in #6619. |
Describe the bug
Inputting backslashes into RichText components inside a PHP-rendered block results into loss of saved data inside all RichText components within the affected block.
To reproduce
Steps to reproduce the behavior:
Expected behavior
Normal behavior is preserving all values of RichText-dependent attributes even when the backspace-filled string is inputted.
Screenshots
PHP-rendered block with two RichText inputs filled with normal values, as seen in the editor.
PHP-rendered block with two RichText inputs filled with normal values, as seen in the preview.
PHP-rendered block with two RichText inputs, one of them filled with only backslashes, as seen in the editor.
PHP-rendered block with two RichText inputs, one of them filled with only backslashes, as rendered in the preview. Saving the post at this state leads to removal of all data in the RichText inputs.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: