[ic] [interchange] Fix for restrict_allow which was being clobbered by default values.
Mike Heins
mikeh at endpoint.com
Fri May 6 21:23:20 UTC 2016
Quoting Jon Jensen (jon at endpoint.com):
> On Fri, 6 May 2016, Mike Heins wrote:
>
> >Quoting Sam Batschelet (interchange-cvs at icdevgroup.org):
> >>commit 8ba9a07d0f0098b5cae6cb4400bf8ead5f4aa91b
> >>Author: Sam Batschelet <samb at endpoint.com>
> >>Date: Thu May 5 11:09:09 2016 -0400
> >>
> >> Fix for restrict_allow which was being clobbered by default values.
> >>
> >> lib/Vend/Table/Editor.pm | 6 +++++-
> >> 1 files changed, 5 insertions(+), 1 deletions(-)
> >>---
> >>diff --git a/lib/Vend/Table/Editor.pm b/lib/Vend/Table/Editor.pm
> >>index 141eed3..de9eb7a 100644
> >>--- a/lib/Vend/Table/Editor.pm
> >>+++ b/lib/Vend/Table/Editor.pm
> >>@@ -916,7 +916,11 @@ sub display {
> >> last METAMAKE;
> >> }
> >>
> >>- $opt->{restrict_allow} ||= $record->{restrict_allow};
> >>+ if ($record->{restrict_allow}) {
> >>+ my %restrict_allow;
> >>+ @restrict_allow{grep /\S/, split / /, $opt->{restrict_allow} . ' ' . $record->{restrict_allow}} = ();
> >>+ $opt->{restrict_allow} = join ' ', sort keys %restrict_allow;
> >>+ }
> >> #::logDebug("formatting prepend/append/lookup_query name=$opt->{name} restrict_allow=$opt->{restrict_allow}");
> >> for(qw/append prepend lookup_query/) {
> >> next unless $record->{$_};
> >>
> >
> >Doesn't this prevent you from passing a restrict_allow option?
>
> It merges the two sets of restrict_allow values together.
Hmm. I don't understand the comment then, "was being clobbered by
default values". This more looks like a fix for the default values
getting clobbered by the $opt, which I would think is the intention
of the code.
In other words, if you set it in $opt it should blow away what's in
$record, as presumably your setting of the option should indicate that
you know what's best. .
--
Mike Heins
End Point -- Expert Internet Consulting http://www.endpoint.com/
phone +1.765.253.4194 <mikeh at endpoint.com>
"All you need in this life is ignorance and confidence, and
then success is sure." -- Mark Twain
More information about the interchange-users
mailing list