使用自定义前端主题时,我的内容的预览按钮停止工作。它只是重定向到内容概述页面。
我是否在我的主题中遗漏了一些允许我使用“预览”功能的东西?
使用自定义前端主题时,我的内容的预览按钮停止工作。它只是重定向到内容概述页面。
我是否在我的主题中遗漏了一些允许我使用“预览”功能的东西?
Jason Ruyle 的回答是正确的,我遇到了同样的问题并通过将此代码添加到我的模块来解决它:
use Drupal\Core\Entity\EntityInterface;
function my_module_entity_operation_alter(array &$operations, EntityInterface $entity) {
if (isset($operations['edit']['query'])) {
unset($operations['edit']['query']['destination']);
}
return $operations;
}
如果需要,还可以改进代码以针对正确的实体。
您很可能?destination=admin/content
在您的 URL 中有 。这是一个核心错误。当前的讨论可以在以下位置阅读: