hi guys, 

attached is a patch for #487572. please jump over and read up on that
bug as I need some input as to how to deal with the missing
functionality that it reveals. 

thanks

A
Index: src/report/report-system/commodity-utilities.scm
===================================================================
--- src/report/report-system/commodity-utilities.scm	(revision 16580)
+++ src/report/report-system/commodity-utilities.scm	(working copy)
@@ -828,8 +828,17 @@
     ((pricedb-nearest) (lambda (foreign domestic)
 			(gnc:exchange-by-pricedb-nearest
 			 foreign domestic to-date-tp)))
-    (else (gnc:warn "gnc:case-exchange-fn: bad price-source value: " 
-                    source-option))))
+    (else (begin
+	    (gnc:warn "gnc:case-exchange-fn: bad price-source value: " 
+                    source-option)
+	    ;; return a sane, though possibly incorrect function. This
+	    ;; prevents reprot-crashing bugs in reports that implement
+	    ;; additional source-options that have not been coded up
+	    ;; here yet. 
+	    ;;
+	    ;; Known to be missing: pricedb-latest-before.
+	    gnc:exchange-by-pricedb-latest)
+	  )))
 
 ;; Return a ready-to-use function. Which one to use is determined by
 ;; the value of 'source-option', whose possible values are set in
@@ -858,6 +867,9 @@
     ((pricedb-latest) (lambda (foreign domestic date)
 		       (gnc:exchange-by-pricedb-latest foreign domestic)))
     ((pricedb-nearest) gnc:exchange-by-pricedb-nearest)
+    ;; warning!! this (else ) block will not return a function and
+    ;; will cause crashes in reports that implement new source-options
+    ;; without adding them to this function!!!
     (else (gnc:warn "gnc:case-exchange-time-fn: bad price-source value: " 
                     source-option))))
 

Attachment: signature.asc
Description: Digital signature

_______________________________________________
gnucash-devel mailing list
[email protected]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel

Reply via email to