Re: [interchange] Correct logic of DisplayErrors

David Christensen <[email protected]> Fri, 8 Sep 2017 19:14:11 -0500
Newsgroups gmane.comp.web.interchange.users
Message-ID <[email protected]>
Sure, glad to open a discussion here; I personally fail to see the usefulness of this division as documented, plus the code itself had been inconsistent when it came to how it applied the DisplayErrors criteria (some call sites checked either/or and some were both/and).  Whatever the decision ends up being should be made consistent, plus there are probably additional things that can/should be made to respect this directive as well.

Best,

David

> On Sep 8, 2017, at 6:00 PM, Jon Jensen <[email protected]> wrote:
> 
> David,
> 
> I don't mind the logic change personally, but the documentation shows clearly that the old behavior was intended.
> 
> Unlike many identical pairs of global & catalog directives, this one was designed so that the global one is a universal switch to allow or deny the *ability* to use DisplayErrors in all catalogs:
> 
> http://www.icdevgroup.org/interchange-doc-5.2.0/frames/icconfig_20.html
> http://www.icdevgroup.org/interchange-doc-5.2.0/frames/icconfig_98.html
> http://docs.icdevgroup.org/cgi-bin/online/confs/DisplayErrors.html
> 
> So this probably needs either wider discussion and buy-in along with documentation updates, or to be reverted to match the docs.
> 
> Jon
> 
> 
> 
> On Fri, 8 Sep 2017, David Christensen wrote:
> 
>> commit 096f9b97470c0106594573dda4114e5adf25e81c
>> Author: David Christensen <[email protected]>
>> Date:   Fri Sep 8 17:30:23 2017 -0500
>> 
>>   Correct logic of DisplayErrors
>> 
>>   Most directives (and other places with this specific directive) use 'or' logic to allow you to
>>   define directives in either `interchange.cfg` or `catalog.cfg` to enable a default-off behavior at
>>   either the Interchange server level or at the level of a specific catalog.
>> 
>>   As originally coded, the DisplayErrors directive would have only worked when *both*
>>   `interchange.cfg` and `catalog.cfg` had this enabled.
>> 
>>   Change this so it shows up when either the current catalog or the global config has this set.
>> 
>>   Since the old default was 'no', someone intended this information to be output, so this is the
>>   correct behavior, considering that I only fixed the output of this message in the previous commit.
>> 
>> lib/Vend/Dispatch.pm |    6 +++---
>> 1 files changed, 3 insertions(+), 3 deletions(-)
>> ---
>> diff --git a/lib/Vend/Dispatch.pm b/lib/Vend/Dispatch.pm
>> index eeb463e..cea6640 100644
>> --- a/lib/Vend/Dispatch.pm
>> +++ b/lib/Vend/Dispatch.pm
>> @@ -690,7 +690,7 @@ Sorry, there was an error in processing this form action. Please
>> report the error or try again later.
>> EOF
>> 		$template .= "\n\nError: %s\n"
>> -				if $Global::DisplayErrors && $Vend::Cfg->{DisplayErrors}
>> +				if $Global::DisplayErrors || $Vend::Cfg->{DisplayErrors}
>> 			;
>> 		$template = get_locale_message(500, $template, $err);
>> 		logError($err);
>> @@ -1680,7 +1680,7 @@ EOF
>> 			and not ($Vend::admin and ! $::Variable->{MV_TRACK_ADMIN});
>> # END TRACK
>> 
>> -	if($Vend::Cfg->{DisplayErrors} and $Global::DisplayErrors) {
>> +	if($Vend::Cfg->{DisplayErrors} or $Global::DisplayErrors) {
>> 		$SIG{"__DIE__"} = sub {
>> 							my $msg = shift;
>> 							put_session() if $Vend::HaveSession;
>> @@ -1889,7 +1889,7 @@ Sorry, there was an error in processing this form action. Please
>> report the error or try again later.
>> EOF
>> 		$template .= "\n\nError: %s\n"
>> -				if $Global::DisplayErrors && $Vend::Cfg->{DisplayErrors}
>> +				if $Global::DisplayErrors || $Vend::Cfg->{DisplayErrors}
>> 			;
>> 		$template = get_locale_message(500, $template, $err);
>> 		logError($err);
> 
> 
> --
> Jon Jensen
> End Point Corporation
> https://www.endpoint.com/
> 
> _______________________________________________
> interchange-users mailing list
> [email protected]
> http://www.icdevgroup.org/mailman/listinfo/interchange-users

--
David Christensen
End Point Corporation
[email protected]
785-727-1171

_______________________________________________
interchange-users mailing list
[email protected]
http://www.icdevgroup.org/mailman/listinfo/interchange-users
signature.asc (application/pgp-signature, 801 B)
-----BEGIN PGP SIGNATURE-----

iQIcBAEBCAAGBQJZszJTAAoJEDdKI8nfm2W4cVUP/1YTi3WrgNyOCjTc29XOcFH3
wcRmmT74TUvU2PHszIrpmyFQW4hUUyDQfmpFmXk1VdC4DcmXhTBVByud1p1spsLy
PKvumjvL0o7beLGJpK8wG5uCMMgZssIs5qWJz/eX7BpzJ2KKKLq/onM+TeOTM64K
nJN3eXp6n6jIoZuum6ZwY+t7DKuAWkJmxygO7xrtSUxUEKTVS0Z/3tUHokveTPNm
gTEBJMix3iAFz6bX4FhltwdV51YE/cOWTDhVt/+bdzuy/Q2Ot6NpcPDiWzG5+vzi
cZEWGpHc1UOWIOXMSUw7b9NFbCvGvM02VnkZOO5y1UHLny1g4zXE2FH3yGtbsf+i
DE6B93IcHVlZx8alEZXtHrM/rB4krhpqH4sz8eqB68ypwVkt/zY8yzkpiGq3TNqP
K90w9QzGIXIjga8HiGEtSzi1Khh9ZFf278lYZkMer8IUaMMGbwfRzfrAvkyHiJoV
DVNJT6zRtIRq3SHVjW1x5ZJ//yI9v27XcDQc9rZy57mFf7UbkOZc0qCjRAOQybtN
5y/7LzSLnYUm/aaTjnge/anygdUYadRpcHbDA6ncodRhDrM95aVCzP5S2GceUpuA
1mUoshH/CwbyQ1AfgRDek1LORqtqlA7TJd7TwWhHb/vhscumH468g0L0KbqcWQ+Z
oTEu1Z8XB9OJ9uzg4lhY
=xgeR
-----END PGP SIGNATURE-----