From 46277146c50dfc468d4dd74c4a67d40602427a61 Mon Sep 17 00:00:00 2001 From: Deon George Date: Thu, 3 Jul 2025 13:02:02 +0800 Subject: [PATCH] Fix rendering of Add Value attributes when the attribute is also rendered by a template, resulting in double javascript and blank values --- resources/views/components/attribute-type.blade.php | 2 +- resources/views/components/attribute.blade.php | 2 +- resources/views/components/attribute/layout.blade.php | 2 +- .../components/attribute/widget/options.blade.php | 10 +++++----- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/resources/views/components/attribute-type.blade.php b/resources/views/components/attribute-type.blade.php index 68813d4e..d2355af7 100644 --- a/resources/views/components/attribute-type.blade.php +++ b/resources/views/components/attribute-type.blade.php @@ -46,7 +46,7 @@ @endif - @if((! $o->no_attr_tags) && (! $o->is_rdn)) + @if((! $o->no_attr_tags) && (! $o->is_rdn) && (! $template)) diff --git a/resources/views/components/attribute.blade.php b/resources/views/components/attribute.blade.php index 9df670e0..4a501ed2 100644 --- a/resources/views/components/attribute.blade.php +++ b/resources/views/components/attribute.blade.php @@ -1,5 +1,5 @@ - +
@foreach($o->langtags as $langtag) diff --git a/resources/views/components/attribute/layout.blade.php b/resources/views/components/attribute/layout.blade.php index e7163110..1aa3dc8b 100644 --- a/resources/views/components/attribute/layout.blade.php +++ b/resources/views/components/attribute/layout.blade.php @@ -4,7 +4,7 @@ {{ $slot }} - +
diff --git a/resources/views/components/attribute/widget/options.blade.php b/resources/views/components/attribute/widget/options.blade.php index b5ab7dae..09a07a43 100644 --- a/resources/views/components/attribute/widget/options.blade.php +++ b/resources/views/components/attribute/widget/options.blade.php @@ -255,18 +255,18 @@ @default @if($o->isDynamic()) @break @endif @php($clone=TRUE) - @if($o->values_old->count()) - (! $new)]) data-attribute="{{ $o->name }}" id="{{ $o->name_lc }}-addnew"> @lang('Add Value') + @if($o->values_old->count() && (! $template)) + (! $new)]) data-attribute="{{ $o->name_lc }}" id="{{ $o->name_lc }}-addnew"> @lang('Add Value') @endif @section('page-scripts') - @if($clone && $edit && $o->can_addvalues) + @if((! $template) && $clone && $edit && $o->can_addvalues)