]> git.imager.perl.org - bse.git/commitdiff
improve compatibility between template method I/F and data_only
authorTony Cook <tony@develop-help.com>
Tue, 21 Apr 2020 09:44:40 +0000 (19:44 +1000)
committerTony Cook <tony@develop-help.com>
Tue, 21 Apr 2020 09:44:40 +0000 (19:44 +1000)
site/cgi-bin/modules/BSE/TB/Product.pm
site/cgi-bin/modules/BSE/TB/ProductOption.pm
site/cgi-bin/modules/BSE/TB/ProductOptionValue.pm

index 9a47e980bc14490ce3e47240e0393baa8db4f362..12be7475dbdb09ff840f4c2d04b02f61376c55c8 100644 (file)
@@ -5,7 +5,7 @@ use BSE::TB::Articles;
 use vars qw/@ISA/;
 @ISA = qw/BSE::TB::Article/;
 
-our $VERSION = "1.006";
+our $VERSION = "1.007";
 
 # subscription_usage values
 use constant SUBUSAGE_START_ONLY => 1;
@@ -295,4 +295,6 @@ sub value { $_[0]{value} }
 
 sub get_custom { undef }
 
+sub get_custom_all { +{} }
+
 1;
index ba8345bfc25f7b465651c820060c950feaabb24d..dfcf51d515496730b04577eef57978e95640c2bc 100644 (file)
@@ -2,7 +2,7 @@ package BSE::TB::ProductOption;
 use strict;
 use parent 'Squirrel::Row', 'BSE::CustomData';
 
-our $VERSION = "1.002";
+our $VERSION = "1.003";
 
 sub columns {
   return qw/id product_id name type global_ref display_order enabled default_value custom_data/;
@@ -52,6 +52,7 @@ sub data_only {
 
   my $result = $self->SUPER::data_only;
   $result->{values} = [ map $_->data_only, $self->values ];
+  $result->{get_custom_all} = $self->get_custom_all || {};
 
   return $result;
 }
index 6c068020101d8cb07daf77e26baf0434b81e3738..f83009563ce3a76737c1c8789acc333f2d93f901 100644 (file)
@@ -2,7 +2,7 @@ package BSE::TB::ProductOptionValue;
 use strict;
 use parent "Squirrel::Row", "BSE::CustomData";
 
-our $VERSION = "1.001";
+our $VERSION = "1.002";
 
 sub columns {
   return qw/id product_option_id value display_order custom_data/;
@@ -26,4 +26,13 @@ sub option {
   return BSE::TB::ProductOptions->getByPkey($self->{product_option_id});
 }
 
+sub data_only {
+  my ($self) = @_;
+
+  my $result = $self->SUPER::data_only;
+  $result->{get_custom_all} = $self->get_custom_all;
+
+  $result;
+}
+
 1;