From fb3d887ca7d6b329cafe7a9cc832b8b2dbd39dbe Mon Sep 17 00:00:00 2001
From: Jaap Jansma <jaap.jansma@civicoop.org>
Date: Fri, 11 Oct 2019 15:34:45 +0200
Subject: [PATCH] Fixed issue with title generations

---
 Civi/DataProcessor/Output/UIOutputHelper.php | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Civi/DataProcessor/Output/UIOutputHelper.php b/Civi/DataProcessor/Output/UIOutputHelper.php
index 7afed355..f42d17a2 100644
--- a/Civi/DataProcessor/Output/UIOutputHelper.php
+++ b/Civi/DataProcessor/Output/UIOutputHelper.php
@@ -45,7 +45,7 @@ class UIOutputHelper {
         $url = $outputClass->getUrlToUi($output, $dataprocessor);
 
         $configuration = json_decode($dao->configuration, TRUE);
-        $title = $dao->title;
+        $title = $outputClass->getTitleForUiLink($output, $dataprocessor);
         $item = [
           'title' => $title,
           'page_callback' => $outputClass->getCallbackForUi(),
@@ -182,8 +182,10 @@ class UIOutputHelper {
     $outputClass = $factory->getOutputByName($output['type']);
     $configuration = $output['configuration'];
 
+    $title = $dataProcessor['title'];
     if ($outputClass && $outputClass instanceof \Civi\DataProcessor\Output\UIOutputInterface) {
       $url = $outputClass->getUrlToUi($output, $dataProcessor);
+      $title = $outputClass->getTitleForUiLink($output, $dataProcessor);
     }
 
     $navigation = \CRM_Dataprocessor_Utils_Navigation::singleton();
@@ -203,7 +205,7 @@ class UIOutputHelper {
 
     $navigationParams['domain_id'] = \CRM_Core_Config::domainID();
     $navigationParams['permission'] = array();
-    $navigationParams['label'] = isset($configuration['title']) ? $configuration['title'] : $dataProcessor['title'];
+    $navigationParams['label'] = $title;
     $navigationParams['name'] = $dataProcessor['name'];
 
     if (isset($configuration['navigation_parent_path'])) {
-- 
GitLab