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

Update for Gutenberg 11.0.0 #34

Open
bobbingwide opened this issue Jul 8, 2021 · 7 comments
Open

Update for Gutenberg 11.0.0 #34

bobbingwide opened this issue Jul 8, 2021 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@bobbingwide
Copy link
Owner

bobbingwide commented Jul 8, 2021

Gutenberg 11.0.0 has been delivered. There may be a need to update the code.
I got these messages opening the Site Editor .
https://s.b/wp55/thisis/wp-admin/admin.php?page=gutenberg-edit-site&postId=781&postType=page
and also visiting https://s.b/wp55/thisis/2021/06/13/post-edit-block/

Warning: Undefined array key 0 in C:\apache\htdocs\wp55\wp-content\plugins\gutenberg\lib\block-supports\elements.php on line 47

Warning: Trying to access array offset on value of type null in C:\apache\htdocs\wp55\wp-content\plugins\gutenberg\lib\block-supports\elements.php on line 47

Warning: Undefined array key 0 in C:\apache\htdocs\wp55\wp-content\plugins\gutenberg\lib\block-supports\elements.php on line 59

Warning: Trying to access array offset on value of type null in C:\apache\htdocs\wp55\wp-content\plugins\gutenberg\lib\block-supports\elements.php on line 59

Warning: Undefined array key 0 in C:\apache\htdocs\wp55\wp-content\plugins\gutenberg\lib\block-supports\elements.php on line 47

Warning: Trying to access array offset on value of type null in C:\apache\htdocs\wp55\wp-content\plugins\gutenberg\lib\block-supports\elements.php on line 47

Warning: Undefined array key 0 in C:\apache\htdocs\wp55\wp-content\plugins\gutenberg\lib\block-supports\elements.php on line 59

Warning: Trying to access array offset on value of type null in C:\apache\htdocs\wp55\wp-content\plugins\gutenberg\lib\block-supports\elements.php on line 59

@bobbingwide
Copy link
Owner Author

I tracked this down to an unexplained change to the sb-post-edit plugin's block.json having an extra , just before the last closing curly brace. I have no idea how it got there.

	"style": "file:./build/style-index.css",
}

It's a pretty basic mistake.

@bobbingwide bobbingwide self-assigned this Jul 8, 2021
@bobbingwide bobbingwide added the enhancement New feature or request label Jul 8, 2021
@bobbingwide
Copy link
Owner Author

bobbingwide commented Jul 12, 2021

Now I've got the same problem in s.b/wp55/written but not s.b/hm
There isn't a problem with the sb-post-edit-block's block.json any more.
So what is it?

@bobbingwide
Copy link
Owner Author

The problem now occurs in the live site ( herbmiller.me ), where the messages aren't seen, but the output is affected.

This was for the /written post.

image

<span class="post_modified">July 13, 2021</span>
 class=”wp-elements-60ed79a850906″
<style>.wp-elements-60ed79a850906 a{color: var(--wp--preset--color--dark-grey) !important;}</style>

It appears to occur when the user is not logged in.
The behaviour of the sb-post-edit-block is that it should not display anything when the user is not logged in.
I still haven't been able to confirm that the problem is directly related to the block.

@bobbingwide
Copy link
Owner Author

It appears to occur when the user is not logged in.

Even more mysterious, it occurs when the plugin isn't activated!

@bobbingwide
Copy link
Owner Author

bobbingwide commented Jul 13, 2021

The block is defined in the metadates template part.

<!-- wp:oik-sb/sb-post-edit-block {"textColor":"blue","fontSize":"extra-small","style":{"elements":{"link":{"color":{"text":"var:preset|color|dark-grey"}}}}} /-->

Let's see if we can use an almost empty template to reproduce the problem.

@bobbingwide
Copy link
Owner Author

Here's the result of testing with a simple scenario.
The post content is:

<!-- wp:paragraph --><p>Apart from this paragraph the only content in the post is another block with a style attribute. The template only displays the post-content. What could possibly go wrong?</p><!-- /wp:paragraph -->
<!-- wp:reproduce/issue34 {"style":{"elements":{"link":{"color":{"text":"var:preset|color|dark-grey"}}}}} /-->

The template only displays the post content.

image

@bobbingwide
Copy link
Owner Author

The workaround for the sb-post-edit-block is to return an empty <span></span> when the user isn't logged in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant