[interchange] * Allow extra_fields to set and retrieve scratch values.

Mike Heins <[email protected]>
Newsgroups gmane.comp.web.interchange.cvs
Message-ID <[email protected]>
commit df36e3266f14a8c4296b9a20868bb094fa75ac5d
Author: Mike Heins <[email protected]>
Date:   Thu Apr 4 13:49:14 2013 -0400

    * Allow extra_fields to set and retrieve scratch values.

 lib/Vend/UserDB.pm |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/lib/Vend/UserDB.pm b/lib/Vend/UserDB.pm
index 7e6c776..1ab5e69 100644
--- a/lib/Vend/UserDB.pm
+++ b/lib/Vend/UserDB.pm
@@ -883,6 +883,12 @@ sub get_values {
 		my $hash = get_option_hash($row->{$field});
 		if($hash and $hash = $hash->{$loc} and ref($hash) eq 'HASH') {
 			for(@s) {
+				if($scratch{$_} ) {
+					$::Scratch->{$_} = $hash->{$_};
+				}
+				else {
+					$::Values->{$_} = $hash->{$_};
+				}
 				$::Values->{$_} = $hash->{$_};
 			}
 		}
@@ -1008,7 +1014,7 @@ sub set_values {
 
 		my $subhash = $hash->{$loc} ||= {};
 		for(@s) {
-			$subhash->{$_} = $valref->{$_};
+			$subhash->{$_} = $scratch{$_} ? $scratchref->{$_} : $valref->{$_};
 		}
 
 		push @extra, $field;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.