如何调试 Gutenberg – 导入内容后编辑器显示空白页面

huangapple go评论51阅读模式
英文:

How to debug Gutenberg - the editor is showing a blank page after importing content

问题

当我编辑一个使用 Gutenberg 的帖子时,只有在导入内容时,我才会看到一个空白页面,导入之前正常运行,导入后内容在前端显示正常,只是无法加载管理员编辑器。

我已经检查了所有错误日志,并尝试打开错误报告,但我看不到任何错误(还检查了控制台日志)- 我应该如何进行调试?我认为这是因为一些不良内容被导入或其他原因,但不太可行来查找数据库中的内容。

英文:

When I edit a post that's using Gutenberg I am seeing a blank page only when I import content, it works fine before I import and the content after import is showing fine on the front end I just can't load the admin editor.

I've checked all the error logs, and have tried turning error reporting on but I can't see any errors (have also checked the console log) - how would I go about debugging this? I assume it's because some rouge content was imported or something but it's not really feasible to trawl through the database to find it?

答案1

得分: 1

以下是翻译好的部分:

"A white page is a common symptom of the Editor encountering an issue in parsing the block markup from the post_content.

For some blocks, if the theme or plugin that created them is not installed, they provide HTML support so the content can still render on the front end, but is not editable in the Editor. Alternatively, something required to edit the post content (plugin/theme/template part) is missing or the wrong version.

To debug this, I would try:

  1. Check the log of the source site the content was exported from incase the error actually occured during the content export/the export was incomplete.

  2. Confirm the plugins installed & activated match the plugins from where source content was exported.

  3. Ensure the plugin versions are not being auto-upgraded before you import the content by adding add_filter( 'auto_update_plugin', '__return_false' ); to wp-config.php

  4. In the database, view the post_content of an issue post/page to identify the blocks used with select post_content from database_name.wp_posts where id = <post_id>; (pick a page from the front end with minimal content and start from there to narrow down potential issues faster).

  5. Potentially the post_content contains reusable blocks and or template parts that have not been exported from the source site, if so, export/import them from source site.

  6. If the above steps haven't helped resolve the issue, re-export the content in smaller batches, or by post type (if there are multiple/custom post types) then import a smaller amount of content to help narrow down if the issue is isolated to a particular post type or a common block.

If you find anything during these steps but aren't able to fully debug it, add any new information you discover to your question."

英文:

A white page is a common symptom of the Editor encountering an issue in parsing the block markup from the post_content.

For some blocks, if the theme or plugin that created them is not installed, they provide HTML support so the content can still render on the front end, but is not editable in the Editor. Alternatively, something required to edit the post content (plugin/theme/template part) is missing or the wrong version.

To debug this, I would try:

  1. Check the log of the source site the content was exported from incase the error actually occured during the content export/the export was incomplete.

  2. Confirm the plugins installed & activated match the plugins from where source content was exported.

  3. Ensure the plugin versions are not being auto-upgraded before you import the content by adding add_filter( 'auto_update_plugin', '__return_false' ); to wp-config.php

  4. In the database, view the post_content of an issue post/page to identify the blocks used with select post_content from database_name.wp_posts where id = <post_id>; (pick a page from the front end with minimal content and start from there to narrow down potential issues faster).

  5. Potentially the post_content contains reusable blocks and or template parts that have not been exported from the source site, if so, export/import them from source site.

  6. If the above steps haven't helped resolve the issue, re-export the content in smaller batches, or by post type (if there are multiple/custom post types) then import a smaller amount of content to help narrow down if the issue is isolated to a particular post type or a common block.

If you find anything during these steps but aren't able to fully debug it, add any new information you discover to your question.

huangapple
  • 本文由 发表于 2023年2月14日 08:09:58
  • 转载请务必保留本文链接:https://go.coder-hub.com/75442326.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定