跳转到主要内容
时光倒流 提交于 23 December 2015

我建立了一个tab page (node/nodeID/comments, 用于显示field comment, 也就是说,comment添加和显示将在该tab显示(比如:node/1/comments) 而不显示在node view page (比如: node/1).

问题是,当我在tab page添加comment并按save后,页面跳转到node view page (比如:node/1#comment-1), 而我想要的是按save后,页面留在tab page(如:node/1/comments)因为我是在tab page添加comment的。

我在core/module/comment/src/commentform.php找到function save, 但不知如何修改

$form_state->setRedirectUrl($uri)。

该问题我在http://drupal.stackexchange.com/questions/184529/change-the-page-to-which-users-are-redirected-after-saving-a-comment提交,目前还未找到具体办法。

各位大神请帮忙。

谢!

Drupal 版本