After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 670383 - Finance::Quote fails to return Currency Quotes - Other Quotes OK
Finance::Quote fails to return Currency Quotes - Other Quotes OK
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: General
2.4.x
Other All
: Normal minor
: ---
Assigned To: Christian Stimming
Geert Janssens
Depends on:
Blocks:
 
 
Reported: 2012-02-19 08:22 UTC by Dave Roberts
Modified: 2018-06-29 23:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Replacement Quote.pm (a patched version from 1.17 release of the Finance::Quote module) (38.14 KB, application/x-perl)
2012-02-19 08:22 UTC, Dave Roberts
  Details
a diff file to allow patching of the original Quote.pm (5.59 KB, patch)
2012-02-19 08:24 UTC, Dave Roberts
reviewed Details | Review

Description Dave Roberts 2012-02-19 08:22:11 UTC
Created attachment 207969 [details]
Replacement Quote.pm (a patched version from 1.17 release of the Finance::Quote module)

After installing the Finance::Quote facility it fails to return Currency Quotes, other Quotes are OK. It passes the checks 


Investigating on the web I find this ....
http://gnucash.1415818.n4.nabble.com/Unable-to-receive-quote-for-CURRENCY-EUR-td4354816.html
which suggests that Finance::Quote requires patching (thanks to Mike for being on top of this all). 3 patches are required. It appears that Finance::Quote is not being maintained on CPAN.

Whilst this is not a Gnucash bug it does impact Gnucash users - I've raised this bug report as a means of providing direction to anyone having a similar problem to me.

So here's the fix (which you can deduce from the above URL).

1) make sure you have latest Finance::Quote module. This is written for version 1.17, if you have a later version then this may or may not work....

You can check the module version by using this on the command line (should be good for all os's)
C:\>cpan -D Finance::Quote
CPAN: CPAN::SQLite loaded ok (v0.199)
Database was generated on Sat, 18 Feb 2012 19:53:46 GMT
Finance::Quote
-------------------------------------------------------------------------
        CPAN: Module::CoreList loaded ok (v2.46)
Fetch stock prices over the Internet
        E/EC/ECOCODE/Finance-Quote-1.17.tar.gz
        C:\strawberry\perl\site\lib\Finance\Quote.pm
        Installed: 1.17
        CPAN:      1.17  up to date
        Erik Colson (ECOCODE)
        eco@ecocode.net



2) now two choice. Either replace the Quote.pm file in the perl installation (revised Quote.pm attached) or rebuild the Finance::Quote module.

Replace Quote.pm in perl installation
-------------------------------------
This is a workaround approach, but will get you going.... Find the Quote.pm in the perl installation, and replace it with the one attached below.  My Quote.pm is located here C:\strawberry\perl\site\lib\Finance (will be different for other parl installations)

Rebuild the Finance::Quote module
---------------------------------
This is still a workaround until the module is upgraded at source...

I use patch command from the GNU win32 tools port.

First patch the Quote.pm file in the module build structure (Quote.pm is all that needs changing). Then rebuild and install the module in the standad way...

Finance-Quote-1.17-ttfR36\lib\Finance>
Finance-Quote-1.17-ttfR36\lib\Finance>patch -p0 < Quote.pm.diff
patching file Quote.pm
Finance-Quote-1.17-ttfR36\lib\Finance>del Quote.pm.diff
Finance-Quote-1.17-ttfR36\lib\Finance>cd ..\..\
Finance-Quote-1.17-ttfR36>perl makefile.pl
Writing Makefile for Finance::Quote
Finance-Quote-1.17-ttfR36>dmake

... output removed ...

Finance-Quote-1.17-ttfR36>dmake install
Installing C:\strawberry\perl\site\lib\Finance\Quote.pm
Appending installation info to C:\strawberry\perl\lib/perllocal.pod
dmake:  Warning: -- Target [install] was made but the time stamp has not been updated.

Finance-Quote-1.17-ttfR36>
Comment 1 Dave Roberts 2012-02-19 08:24:51 UTC
Created attachment 207970 [details] [review]
a diff file to allow patching of the original Quote.pm

Note that both Quote.pm and Quote.pm.diff include the three patches included in http://gnucash.1415818.n4.nabble.com/Unable-to-receive-quote-for-CURRENCY-EUR-td4354816.html

I am not responsible for the code changes - folks more astute than I take the credit.
Comment 2 Olivier Allard-Jacquin 2012-02-19 14:18:02 UTC
Hi Dave,

I've same bug on Debian Testing/Wheezy, with Gnucash version 2.4.10-1 (last Debian update)

My Finance::Quote version is "libfinance-quote-perl 1.17+git20110918-1".

Your patch is working fine ! Thanks for it !

Before patch :
$ gnc-fq-dump currency USD EUR
1 USD = <unknown> EUR

After patch:
$ gnc-fq-dump currency USD EUR
1 USD = 0.7606 EUR
Comment 3 Frank H. Ellenberger 2013-04-04 04:15:06 UTC
At 2012-09-30 Eric released Finance::Quote 1.18, which fixed this issue.

Use your packet manager, run gnc-fq-update or cpan [http://wiki.gnucash.org/wiki/CPAN] to update your installation.

Thanks for your cooperation!
Comment 4 John Ralls 2017-09-24 22:49:15 UTC
Reassign version to 2.4.x so that individual 2.4 versions can be retired.
Comment 5 John Ralls 2018-06-29 23:06:43 UTC
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=670383. Please update any external references or bookmarks.