From a261c69386e610e9653098d1e6ec2c6aa5a4b6db Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 27 Feb 2014 15:56:04 +0100 Subject: [PATCH] Partpicker: Benutzerdefinierte Variablen mitschicken --- SL/Controller/Part.pm | 1 + SL/DB/CustomVariable.pm | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/SL/Controller/Part.pm b/SL/Controller/Part.pm index e64a774a7..d5a7f2a5f 100644 --- a/SL/Controller/Part.pm +++ b/SL/Controller/Part.pm @@ -52,6 +52,7 @@ sub action_ajax_autocomplete { description => $_->description, type => $_->type, unit => $_->unit, + cvars => { map { ($_->config->name => { value => $_->value_as_text, is_valid => $_->is_valid }) } @{ $_->cvars_by_config } }, } } @{ $self->parts }; # neato: if exact match triggers we don't even need the init_parts diff --git a/SL/DB/CustomVariable.pm b/SL/DB/CustomVariable.pm index 3f894cd01..d9b154c09 100644 --- a/SL/DB/CustomVariable.pm +++ b/SL/DB/CustomVariable.pm @@ -118,7 +118,7 @@ sub is_valid { require SL::DB::CustomVariableValidity; my $query = [config_id => $self->config_id, trans_id => $self->trans_id]; - return SL::DB::Manager::CustomVariableValidity->get_all_count(query => $query) == 0; + return (SL::DB::Manager::CustomVariableValidity->get_all_count(query => $query) == 0) ? 1 : 0; } 1; -- 2.20.1