From 19702927c6314bcbbd75434947bc63818a477210 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Mudra?= Date: Wed, 24 Jan 2024 17:42:51 +0100 Subject: [PATCH] Fixes #37231 - Handle incorrect domain setting display --- app/helpers/fact_values_helper.rb | 2 +- app/models/host/base.rb | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/app/helpers/fact_values_helper.rb b/app/helpers/fact_values_helper.rb index fb174b9ddc5..a4560ae09af 100644 --- a/app/helpers/fact_values_helper.rb +++ b/app/helpers/fact_values_helper.rb @@ -60,7 +60,7 @@ def fact_breadcrumbs url: (fact_values_path if authorized_for(hash_for_fact_values_path)), }, { - caption: params[:host_id], + caption: Setting[:display_fqdn_for_hosts] ? params[:host_id].split('.')[0] : params[:host_id], }, ], resource_url: api_hosts_path(thin: true), diff --git a/app/models/host/base.rb b/app/models/host/base.rb index bf9ac1d75a1..16834e432b3 100644 --- a/app/models/host/base.rb +++ b/app/models/host/base.rb @@ -370,11 +370,8 @@ def render_template(template:, **params) end def to_label - if Setting[:display_fqdn_for_hosts] - name - else - name.split('.')[0] - end + return name if Setting[:display_fqdn_for_hosts] + name.split('.')[0] end private