使用自定义前端主题时,我的内容的预览按钮停止工作。它只是重定向到内容概述页面。
我是不是在我的主题中遗漏了什么让我可以使用“预览”功能?
发布于 2016-10-11 01:35:32
你最有可能在你的网址中有?destination=admin/content。这是一个核心错误。当前的讨论可以在以下位置阅读:
发布于 2016-10-12 15:15:18
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;
}如果需要,还可以改进代码以针对正确的实体。
https://stackoverflow.com/questions/36013941
复制相似问题