bobbingwide / thisis

ThisIs ... experimental Full Site Editing theme
GNU General Public License v3.0
1 stars 0 forks source link

Update for Gutenberg 11.0.0 #34

Open bobbingwide opened 3 years ago

bobbingwide commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

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

bobbingwide commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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