From c4c4d79c26318f7c15ff25cd86a648145f42452a Mon Sep 17 00:00:00 2001 From: Nick Date: Tue, 11 Aug 2015 14:56:13 +1000 Subject: [PATCH] Fix for Issue #4424 Model Admin : 'Show Specification for' toggle link breaks if Title contains spaces. Uses className for element ID on ImportSpec template. --- admin/code/ModelAdmin.php | 2 +- admin/templates/Includes/ModelAdmin_ImportSpec.ss | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/admin/code/ModelAdmin.php b/admin/code/ModelAdmin.php index dd96e2c8d..2bb77ab5b 100644 --- a/admin/code/ModelAdmin.php +++ b/admin/code/ModelAdmin.php @@ -366,7 +366,7 @@ abstract class ModelAdmin extends LeftAndMain { $specRelations->push(new ArrayData(array('Name' => $name, 'Description' => $desc))); } $specHTML = $this->customise(array( - 'attrModelName' => str_replace(' ', '',$modelName), + 'ClassName' => str_replace('\\', '_', $className), 'ModelName' => Convert::raw2att($modelName), 'Fields' => $specFields, 'Relations' => $specRelations, diff --git a/admin/templates/Includes/ModelAdmin_ImportSpec.ss b/admin/templates/Includes/ModelAdmin_ImportSpec.ss index 08844c2bc..21ebdffce 100644 --- a/admin/templates/Includes/ModelAdmin_ImportSpec.ss +++ b/admin/templates/Includes/ModelAdmin_ImportSpec.ss @@ -1,6 +1,6 @@ -
- <% sprintf(_t('ModelAdmin_ImportSpec_ss.IMPORTSPECLINK', 'Show Specification for %s'),$ModelName) %> -
+
+ <% sprintf(_t('ModelAdmin_ImportSpec_ss.IMPORTSPECLINK', 'Show Specification for %s'),$ModelName) %> +

<% sprintf(_t('ModelAdmin_ImportSpec_ss.IMPORTSPECTITLE', 'Specification for %s'),$ModelName) %>

<% _t('ModelAdmin_ImportSpec_ss.IMPORTSPECFIELDS', 'Database columns') %>
<% loop $Fields %>