WordPress.org

Make WordPress Core

Opened 6 months ago

Last modified 3 weeks ago

#52779 new defect (bug)

Error with saved blocks

Reported by: lumay Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 5.7
Component: Editor Keywords: dev-feedback reporter-feedback
Focuses: Cc:

Description

After update to WordPress 5.7 there is no possibility to use saved blocks without make changes in original bock. That's mean I would like to use saved block, make some changes when I've added it to the post and didn't make change in saved block – it is not posible now. Could you please give me a tip how to use previous option of using saved blocks?

Attachments (4)

Zrzut ekranu 2021-03-11 o 15.36.55.png (52.3 KB) - added by lumay 6 months ago.
saved block without option to use without changes in source
Zrzut ekranu 2021-03-19 o 07.54.20.png (465.8 KB) - added by lumay 6 months ago.
Screen Shot 2021-06-01 at 12.18.46.png (39.2 KB) - added by paaljoachim 4 months ago.
The "Convert to regular blocks" text button has been switched out with the icon seen in the toolbar.
Capture d’écran 2021-06-14 à 10.24.28.png (37.7 KB) - added by audrasjb 3 months ago.
Convert to regular block in WP 5.7.2

Download all attachments as: .zip

Change History (42)

@lumay
6 months ago

saved block without option to use without changes in source

#1 @peterwilsoncc
6 months ago

  • Component changed from General to Editor
  • Keywords reporter-feedback added

Hi @lumay and welcome back to trac!

I've attempted to reproduce this in a vanilla WordPress install (no plugins running Twenty Twenty One), are you able to provide some additional steps to reproduce?

The steps I took are as follows:

  • Create a new post
  • Add a paragraph block, save as reusable block
  • Publish post
  • Create another new post
  • Insert reusable block
  • Publish the post
  • The shared block was visible.

It would help if you could provide the following:

  • The type of post you created (post, page, custom post type)
  • Whether you had published the original post
  • The type of shared/reusable block you were trying to insert

Thanks for the report.

#2 @lumay
6 months ago

Hi @peterwilsoncc thx for your answer. Please try do this steps:

Create any new reusable block for ex. with text
Insert this reusable block to the post and try to edit it without save changes to origin reusable block – there is no option to do that. If you change something in reusable block it will be applied in every post where it is - and it is ok.
But before we're able to to add reusable block to the post and change it as a comon block without saving changes in original reusable block - we could use it as a tamplate :)

#3 @lumay
6 months ago

When I'm trying to publish post there is option to uncheck "save reusable block", but when I've unchecked it button save is not active - there in no possibilities to publish changed resusable block witjhout to saving it in origin template

#4 @lumay
6 months ago

  • Keywords reporter-feedback removed

#5 @lumay
6 months ago

  • Keywords dev-feedback added

#6 @desrosj
6 months ago

  • Milestone changed from Awaiting Review to 5.7.1

I'm moving this to 5.7.1 to continue investigating. There are some other reports about strange behavior with reusable blocks (#52790), so I'd like to get to the bottom of this.

#7 @peterwilsoncc
6 months ago

Thanks for the further information @lumay, I think I have reproduced it now

The steps I took are as follows:

  • Create a new post
  • Add a paragraph block, save as reusable block
  • Publish post
  • Create another new post
  • Insert reusable block
  • Click 'save'
  • Uncheck 'save reusable block'
  • Click 'publish', this fails

In the console, clicking publish in the final step is showing the error Uncaught TypeError: _this2.props.setEntitiesSavedStatesCallback is not a function in the console twice.

I'd cleared local and session storage prior to starting to make sure there wasn't anything there getting in the way.

This ticket was mentioned in Slack in #core-editor by peterwilsoncc. View the logs.


6 months ago

#9 @lumay
6 months ago

Thanks @peterwilsoncc for additional checking. I've got there also additional Errors in console. If it help you?

[Error] WebSocket connection to 'wss://public-api.wordpress.com/pinghub/wpcom/me/newest-note-data' failed: Unexpected response code: 403
[Error] Error while parsing the 'sandbox' attribute: 'allow-presentation' is an invalid sandbox flag.
	xd (react-dom.min.js:17:421)
	hj (react-dom.min.js:117:334)
	Sh (react-dom.min.js:152:402)
	Th (react-dom.min.js:152:290)
	tj (react-dom.min.js:152:155)
	Te (react-dom.min.js:146:154)
	Te
	(anonimowa funkcja) (react-dom.min.js:61)
	unstable_runWithPriority (react.min.js:25:262)
	Pg (react-dom.min.js:61)
	ha (react-dom.min.js:60:454)
	(anonimowa funkcja) (react-dom.min.js:236)
	Ei (react-dom.min.js:41:91)
	Ei

#10 @paaljoachim
6 months ago

Actually that is somewhat similar to what I am mentioning here where I am comparing and old and new Reusable block methods. https://github.com/WordPress/gutenberg/issues/29178

The problem is if one does not want to save a change to a Reusable block is that it gets stuck in the Save/Publish process and one is not able to move onward.

At the moment we are looking at this for Full Site Editing which should also be transferred over to Reusable blocks. https://github.com/WordPress/gutenberg/issues/29577#issuecomment-801930448

Version 0, edited 6 months ago by paaljoachim (next)

#11 @lumay
6 months ago

So, the solution is delete all old reusable blocks and create them again? - [UPDATE] No it isn't sollution :( Doesn't work.
Before was better option to convert reusable block on common block, when it was added to the post.
When I've converted reusable block on common block I was sure I didn't change source of reusable block.

Last edited 6 months ago by lumay (previous) (diff)

#12 @paaljoachim
6 months ago

@youknowriad and @matveb
Let's get a very simple solution in place. If the user unchecks to save changes to Reusable block then the save change should be ignored but one still needs to be able to go through the process of saving and then clicking to Publish.

@lumay at the moment it is also too easy to accidentally make a change to a Reusable block.
A click through method is being explored. When clicking a reusable block, the first click selects the parent container (Reusable block). The second click would then select one of the inner blocks. https://github.com/WordPress/gutenberg/issues/29337

Both of the above issues (quick fix for saving mechanism) and (click through method) will hopefully be included in WordPress 5.7.1. Making it easier for the many folks struggling with this aspect of the new Reusable block feature.

Last edited 6 months ago by paaljoachim (previous) (diff)

This ticket was mentioned in Slack in #forums by t-p. View the logs.


6 months ago

This ticket was mentioned in Slack in #core by audrasjb. View the logs.


6 months ago

This ticket was mentioned in Slack in #core by audrasjb. View the logs.


6 months ago

This ticket was mentioned in Slack in #core by audrasjb. View the logs.


5 months ago

#17 @audrasjb
5 months ago

  • Milestone changed from 5.7.1 to 5.7.2

Moving to Milestone 5.7.2 as WordPress 5.7.1 Release Candidate 1 is planned for today.

#18 @dd32
4 months ago

  • Milestone changed from 5.7.2 to 5.7.3

WordPress 5.7.2 has been released, moving open tickets to 5.7.3

#19 @peterwilsoncc
4 months ago

@paaljoachim Do you know if this was fixed outside of the issue linked? I'm having trouble finding a merged PR on the Gutenberg repo but could very well be missing something.

#20 @paaljoachim
4 months ago

Hey @peterwilsoncc

There are two aspects in affect. No fixes are yet in place for WP 5.8.

  1. One can not in an easy way discard a save. It has not been worked on. I made a new issue here:

Improving multi-entity saving UI method.
https://github.com/WordPress/gutenberg/issues/31456
Where an discard option is added in the 3 dot/ellipsis drop down menu. The hidden UI that currently exists is that one can uncheck to Save Reusable block, and then save anything else, and leave the post/page and the Reusable block will not be saved.

  1. Making a change to a Reusable block in WP 5.7 is just too easy compared to how it was done in WP 5.6.

At the moment we are trying to get this PR: (linking to a Code review comment from @youknowriad ) https://github.com/WordPress/gutenberg/pull/31109#pullrequestreview-661793222 merged so that it can be included in WP 5.8.
What it does is add a "lid" on top of the Reusable block. So the first click selection of the Reusable block selects the entire block. Current behavior it will select the inner contents. Having a first initial click select the entire block, adds some protection making it just a little more difficult in making an accidental change.

Because of the problems with Reusable blocks in WP 5.7. I have also begun rethinking the UI and UX of how these work today. https://github.com/WordPress/gutenberg/issues/31163

Last edited 4 months ago by paaljoachim (previous) (diff)

#21 @peterwilsoncc
4 months ago

Thanks Paul,

For now I'll leave this out of my plans for 5.7.3 but if you get something that can be backported to resolve some of the issues in 5.7 could you post here so I know to include them?

This ticket was mentioned in Slack in #accessibility by paaljoachim. View the logs.


4 months ago

#23 @paaljoachim
4 months ago

I will let you know Peter!

Last edited 4 months ago by paaljoachim (previous) (diff)

#24 @paaljoachim
4 months ago

Hi @lumay

I re-read what you wrote.
It seems the essence of the problem you mention is adding a Reusable block. Then wanting to make changes to it without it affecting other places where the Reusable block is being used.
You mention a template.

  1. One creates a Reusable block to be used for multiple pages/posts.
  2. One adds the Reusable block to a page. Then converts back to a regular block. (Instead of clicking the Convert text button in the WP 5.6 toolbar one needs to in WP 5.7 click the icon.)

I added this issue:
Reusable block: Add "Convert to regular blocks" in the ellipsis drop down.
https://github.com/WordPress/gutenberg/issues/32217

  1. As it is converted back to regular blocks. One can then use the blocks without it affecting the original Reusable block. (Because it was converted back to a regular block.)

Linking in this Github issue:
Disable direct editing of reusable blocks
https://github.com/WordPress/gutenberg/issues/32353

Last edited 4 months ago by paaljoachim (previous) (diff)

#25 @lumay
4 months ago

Hi @paaljoachim. Yeap indeed. There is still no „convert to a regular block” option avalaible for reusable blocks.
Thank you!

@paaljoachim
4 months ago

The "Convert to regular blocks" text button has been switched out with the icon seen in the toolbar.

#26 @paaljoachim
4 months ago

Hey @lumay

In WordPress 5.7 the text button has been switched out with an icon that looks like a duplicate file icon, but it is actually a "Convert to regular blocks icon".
Because it is so vague I made the Github issue to get a text link into the 3 dot drop down.
https://github.com/WordPress/gutenberg/issues/32217

#27 @lumay
4 months ago

Hi @paaljoachim - Oh it's good place, but I didn't realize it is in this place :) For me it could stay as it is now :)Thanx!

#28 @paaljoachim
4 months ago

You are very welcome!

#29 @paaljoachim
4 months ago

Add Convert to regular Blocks button to ellipsis Dropdown PR has been merged.
https://github.com/WordPress/gutenberg/pull/32310

#30 @paaljoachim
3 months ago

I made this issue:
Reusable block: Add a lock to the parent toolbar to protect the inner content from accidental editing.
https://github.com/WordPress/gutenberg/issues/32461
As there are Gutenberg explorations going on in locking content in various ways, so the above issue fits in with the exploration happening. The issue in a sense brings back the "edit" button used in WP 5.6, but this time it is a lock icon to project the content. It would protect the Reusable block content from accidental changes.

A Gutenberg developer needs to work on the issue. @mikeschroder mentioned he is looking for projects to work on for WP 5.8. I do not know how a Reusable block lock content PR would fit in with WP 5.8.

#31 @psyctc
3 months ago

I have been advised by gizmo2501 to put my comments that are in https://wordpress.org/support/topic/5-7-reusable-blocks-are-a-backwards-step-2/#post-14552579 here ... so I am.

"I am deeply frustrated by reusable blocks. The idea is clearly excellent but my experience, in both 5.7.1 and 5.7.2 is that, at least for what I want to do, that they are fundamentally broken and I suspect that is because the design is fundamentally misconceived. I have a pages that are for chapters of a book and it seemed a brilliant option to create a “navigation block” at the bottom of each that would be table of three columns: previous | book overview | next with small font and different background colour from the rest of the page. I would insert that into the bottom of each page, convert it from reusable to ordinary, add the correct links to “previous” and “next” so that they would jump to the preceding chapter and next chapter. Seemed perfect use for reusable blocks and would save me an hour or two that it would take me to build the table for each page.

What I get is a total mess: generally WP isn’t offering the option to convert to ordinary block, if you want to manage reusable blocks you lose changes in your page. I suspect some of the problems may be corner cases of using a table in a reusable block but surely we need blocks as a full heading on the dashboard menu so we can edit reusable blocks and manage them quite separately from the pages and the saving of pages and of their reusable blocks needs to be rewritten so that it correctly separates the two quite distinct saves. Surely at that point it would be wise to prompt “If you save this block it will update all other uses of it: maybe you want to convert it to an ordinary block?” and offer a Y/N option there. That would have saved me hours of mess."

@audrasjb
3 months ago

Convert to regular block in WP 5.7.2

#32 @audrasjb
3 months ago

Hi @psyctc thank you for your feedback

generally WP isn’t offering the option to convert to ordinary block, if you want to manage reusable blocks you lose changes in your page

There is a button to convert reusables to regular blocks. See the screenshot I shared above (WP 5.7.2).

#33 @paaljoachim
3 months ago

Status update (I am editing this comment based on changes happening):

Merged into the Gutenberg plugin in May:
Add Convert to regular Blocks button to ellipsis Dropdown.
https://github.com/WordPress/gutenberg/pull/32310

Merged into the Gutenberg plugin in February (Will be included in WP 5.8):
Use a modal for the reusable blocks creation flow
https://github.com/WordPress/gutenberg/pull/29040
(I am wondering if this method should change. As the creation flow UI/UX in 5.6 has a better flow than the modal approach.)

Being worked on:
Add Reusable block save button, snackbar on save and Welcome Guide (Not sure if this one should be backported.)
https://github.com/WordPress/gutenberg/pull/32464

Merged into the Gutenberg plugin June 25th.
Template Parts & Reusable Blocks - try overlay element for clickthrough to edit pattern.
https://github.com/WordPress/gutenberg/pull/31109
(Does create some protection for avoiding accidental changes.)

Being worked on:
Add lock feature for Reusable Blocks to protect inner blocks
https://github.com/WordPress/gutenberg/pull/32710
(On hold for now. Click through approach needs to be tested out for a while to understand if the lock feature in this PR is needed.)

Issue:
I have also added this issue to switch the current icon to a more obvious symbolic meaning icon or to instead use a text button:
Reusable block: Replace "Convert to regular blocks" icon
https://github.com/WordPress/gutenberg/issues/32586

Issue:
Reusable block: Making it easier to understand that one is removing the Reusable block from a page.
https://github.com/WordPress/gutenberg/issues/32748

Reusable block fixes will very likely be added to a WP 5.7.3 -> Changed to WP 5.8.1. Based on Jonathans below comment.

Last edited 2 months ago by paaljoachim (previous) (diff)

#34 @desrosj
3 months ago

  • Milestone changed from 5.7.3 to 5.8.1

With 5.8 RC1 due out next week and no 5.7.3 currently planned, I'm going to punt this to the milestone for the next minor release: 5.8.1.

This ticket was mentioned in Slack in #core-editor by paaljoachim. View the logs.


3 months ago

#36 @desrosj
3 weeks ago

  • Keywords reporter-feedback added
  • Milestone changed from 5.8.1 to Future Release

I've read through this again, and I honestly have no idea how to dive in.

It looks like there are different error messages being reported by different testers, the steps to take to reproduce the issue are not clear, and the various issues and pull requests linked all just seem to have reusable blocks in common and don't necessarily reproduce the issue as described.

Would someone that was able to reproduce the issue previously be able to retest this in 5.8 to confirm the problem still exists? And if it still happens in 5.8, some updated instructions for how to test, what the outcome is, and what the expected outcome is would be helpful.

For the time being, I am going to punt this out of 5.8.1 to Future Release as it's not clear what the underlying problem is.

#37 @paaljoachim
3 weeks ago

Thank you @desrosj Jonathan for taking the time to go through this ticket again!

I will suggest adding these two fixes to 5.8.1 which will really help a lot of people!

One problem that multiple people was having over and over again was overlooking the convert from Reusable block back to regular blocks icon in the toolbar. So we got this PR merged:
Add Convert to Regular Blocks button to ellipsis Dropdown
https://github.com/WordPress/gutenberg/pull/32310

The other problem many had/have is accidental changes to a Reusable block. I will suggest adding the overlay feature included in this PR:
Template Parts & Reusable Blocks - try overlay element for clickthrough to edit pattern.
https://github.com/WordPress/gutenberg/pull/31109

Last edited 3 weeks ago by paaljoachim (previous) (diff)

This ticket was mentioned in Slack in #design by paaljoachim. View the logs.


3 weeks ago

Note: See TracTickets for help on using tickets.