From 9949dd18dc285caa814fbeb55ae99b978ba0df14 Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Thu, 13 Jun 2019 11:20:29 +0200 Subject: [PATCH] Fixed issue #2604 - Broken Edit-button in public KB interface for KB editors. --- app/helpers/knowledge_base_helper.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/helpers/knowledge_base_helper.rb b/app/helpers/knowledge_base_helper.rb index 3ac3e137f..0e9bf8a1c 100644 --- a/app/helpers/knowledge_base_helper.rb +++ b/app/helpers/knowledge_base_helper.rb @@ -155,13 +155,15 @@ module KnowledgeBaseHelper end def build_kb_link(object) + locale = params.fetch(:locale, object.translation.kb_locale) + path = case object when KnowledgeBase::Answer - "knowledge_base/#{object.category.knowledge_base.id}/answer/#{object.id}" + "knowledge_base/#{object.category.knowledge_base.id}/locale/#{locale}/answer/#{object.id}/edit" when KnowledgeBase::Category - "knowledge_base/#{object.knowledge_base.id}/category/#{object.id}" + "knowledge_base/#{object.knowledge_base.id}/locale/#{locale}/category/#{object.id}/edit" when KnowledgeBase - "knowledge_base/#{object.id}" + "knowledge_base/#{object.id}/locale/#{locale}/edit" end build_zammad_link path