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

Warning: message displayed when navigation item not found. #12

Open
bobbingwide opened this issue Apr 30, 2021 · 1 comment
Open

Warning: message displayed when navigation item not found. #12

bobbingwide opened this issue Apr 30, 2021 · 1 comment
Assignees

Comments

@bobbingwide
Copy link
Owner

When I exported the header template part, which includes a navigation menu I received the following warning for each menu item that was invalid.

Warning: Attempt to read property "post_status" on null in C:\apache\htdocs\wp55\wp-content\plugins\gutenberg\build\block-library\blocks\navigation-link.php on line 114

 <!-- wp:navigation-link {"label":"Home","type":"page","id":2,"url":"https://s.b/wp55/thisis/"} /-->

Actual output

Menu items unusable, except for Home, which links to the original site.

Expected output

  • Menu items should have adjusted the URL to the site's permalink
    image
@bobbingwide bobbingwide self-assigned this Apr 30, 2021
@bobbingwide
Copy link
Owner Author

bobbingwide commented Apr 30, 2021

Possible explanation

  • The message is produced for each Navigation link that has an invalid ID and has "type":"post" or "type":"page"
  • Possibly twice per link.

Workaround

  • Remove the "id" and "page" attribute from the navigation-link blocks.
  • Remove the "URL" attribute as well, otherwise the links will go to the wrong place.

Proposed solution

  • Fix the Gutenberg code in error.

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

No branches or pull requests

1 participant