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

Deprecated message registering Jace's block patterns #6

Open
bobbingwide opened this issue Oct 8, 2022 · 3 comments
Open

Deprecated message registering Jace's block patterns #6

bobbingwide opened this issue Oct 8, 2022 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@bobbingwide
Copy link
Owner

While testing the new improved patterns display in blocks.wp.a2z I came across a Doing it wrong message.

Notice: Function _register_theme_block_patterns was called incorrectly. Could not register file "C:\apache\htdocs\wp-a2z/wp-content/themes/jace/patterns/register-block-patterns.php" as a block pattern ("Slug" field missing) Please see Debugging in WordPress for more information. (This message was added in version 6.0.0.) in C:\apache\htdocs\wp-a2z\wp-includes\functions.php on line 5831

The code in gutenberg_register_theme_block_patterns() is trying to process the register-block-patterns.php file as a pattern.

The $pattern_data for this file is

C:\apache\htdocs\wordpress\wp-content\plugins\gutenberg\lib\compat\wordpress-6.1\block-patterns.php(72:0) gutenberg_register_theme_block_patterns(37) 105 4 2022-10-08T16:13:56+00:00 1.285582 0.000946 cf=init 8333 12 0 6291456/6291456 512M F=688 pattern data for C:\apache\htdocs\wp-a2z/wp-content/themes/jace/patterns/register-block-patterns.php Array

    [title] => (string) ""
    [slug] => (string) ""
    [description] => (string) ""
    [viewportWidth] => (string) ""
    [categories] => (string) ""
    [keywords] => (string) ""
    [blockTypes] => (string) ""
    [postTypes] => (string) ""
    [inserter] => (string) ""

hence the message I saw.

C:\apache\htdocs\wordpress\wp-content\plugins\oik-bwtrace\includes\bwtrace-actions.php(198:2) bw_trace_doing_it_wrong_run(1) 106 5 2022-10-08T16:13:56+00:00 1.286035 0.000453 cf=init,doing_it_wrong_run 8336 12 0 6291456/6291456 512M F=688 3 Array

    [0] => (string) "_register_theme_block_patterns"
    [1] => (string) "Could not register file "C:\apache\htdocs\wp-a2z/wp-content/themes/jace/patterns/register-block-patterns.php" as a block pattern ("Slug" field missing)"
    [2] => (string) "6.0.0"
@bobbingwide bobbingwide added the bug Something isn't working label Oct 8, 2022
@bobbingwide bobbingwide self-assigned this Oct 8, 2022
@bobbingwide
Copy link
Owner Author

It looks like this should be passed to Carolina Nymark @carolinan

@carolinan
Copy link

Thank you Herb, I believe this was fixed in 1.0.5 but I will check.

@bobbingwide
Copy link
Owner Author

bobbingwide commented Oct 12, 2022

Thank you Herb, I believe this was fixed in 1.0.5 but I will check.

  • Interesting, I got the problem with 1.0.6.
  • But it would seem that my version of the file register-block-patterns.php is from an earlier version of the theme.
  • Now I've looked at the code in trac I can see the fix was actually in 1.0.4.
  • This indicates that my update routine has failed to remove the file from the patterns folder.
  • Which is a bit of a shame since I use WordPress's Theme_Upgrader class.
  • But I hadn't set $args['overwrite_package'] to true.

The bug's in oik-update

@bobbingwide bobbingwide transferred this issue from bobbingwide/bobbingwide Oct 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants