This module provides support for the money.js script from http://josscrowcroft.github.io/money.js/. This script provides easy access to currency conversion rates from https://openexchangerates.org/.
Updates
Added support for Open Exchange Rate subscriptions and made it clear that you can only convert from USD on the free subscription, checkbox for subscribers turns on base currency selection. Checks for valid JSON. User can run cron task from admin screen.
Links:
Project Page: https://drupal.org/sandbox/vwX/2055159
Git clone: git clone --branch 7.x-1.x http://git.drupal.org/sandbox/vwX/2055159.git moneyjs
Reviews of other projects
https://drupal.org/node/2054755#comment-7713015
https://drupal.org/node/2045633#comment-7713219
https://drupal.org/node/2055867#comment-7713297
Comments
Comment #1
bhobbs-chitika commentedHello,
When activating the module I get the following php notifications:
I believe your constants should be like define("MONEYJS_PAGES_NOTLISTED", 0); with the first argument a string(see define).
You may find drupal_http_request useful as an alternative to curl or possibly as a fallback if curl is not installed.
I installed the module and successfully got data after running a cron. One thing I was confused about was whether drupal commerce was a dependency or not, your readme seemed to indicate it was required? If this requires drupal commerce it should be indicated in your .info
Comment #2
bhobbs-chitika commentedComment #3
vwX commentedYea, I probably need to run with Notice turned on...
Commerce is not required and there are still some decisions on how to give it a currency to convert without hardcoding. Since I have a commerce site, I've just set the javascript to grap the displayed commerce price field to convert. Getting this to be a project would maybe help in determining the best way to proceed.
Yes, drupal_http_request is on the list. Wasn't working locally for some reason.
Comment #4
vwX commentedAdded code for drupal_http_request and also verification that valid json data received.
Comment #5
vwX commentedSetting to fixed.
Comment #6
klausiThis is not fixed? See https://drupal.org/node/532400
Comment #7
PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://ventral.org/pareview/httpgitdrupalorgsandboxvwX2055159git
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #8
vwX commentedDear PA Robot,
I've jumped through your automated hoops.
Sincerely,
Not a robot vwX.
Comment #9
vwX commentedCode has been updates.
Comment #10
Krizalys commentedHello vwX, your project cannot be cloned using the Git command mentioned in your post.
Comment #10.0
Krizalys commentedAdded information about updates made.
Comment #11
vwX commentedFixed. Bad typing, replaced : with / before sandbox.
Comment #12
Krizalys commentedHello vwX,
I reviewed your module. Here is my report to help you to improve it:
accounting.jsfile you are talking about in your project page/README.txt? Please give download links too, and, even better, provide them in the online help of your module.Warning: call_user_func_array() expects parameter 1 to be a valid callback, function '_moneyjs_cron_run' not found or invalid function name in menu_execute_active_handler() (line 517 of /XXX/includes/menu.inc)..
However, running cron from the default administration location allowed your module to work and populate the data correctly.
accounting.js?I would be glad to review it again once you went into these issues.
Comment #13
klausiThank you for your reviews. When finishing your review comment also set the issue status either to "needs work" (you found some problems with the project) or "reviewed & tested by the community" (you found no major flaws).
Review of the 7.x-1.x branch:
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.
manual review:
Comment #14
vwX commentedAdded link to accouting.js. Fixed harded coded URL. Fixed missing file='moneyjs.admin.inc' in menu callback, Updated field descriptions.
Thank you Krizalys.
Comment #15
vwX commented1. fixed. Let me know if you think not.
2. Fixed.
3. Fixed.
4. The data is being downloaded from an external source. The _moneyjs_isjson function decodes it and checks the return value to make sure it is ok. I reencode it so that it can be directly used by the javascript and so it doesn't have to be reencoded every time.
5. No, I check if the module exists and use it only if the module exists, therefore it is not required.
Thank you for your review. Klausi. I will review some more when I have some more free time.
Comment #16
Krizalys commentedHello vwX, thanks for the fixes.
I reviewed your module again, here is my report:
accounting.jsis now easy to find.And there's a new issue:
At first, I tried without the libraries module enabled (I placed the 2 javascript files in the folder of your module, as indicated), this did not work. I had to put the javascript files in
libraries/moneyjsand turn on the libraries module to have it working.For simplicity and reusability, maybe you should only support the libraries method, and add the libraries module as a dependency?
I'm not sure if these reports are critical enough to change the status of the review, so I leave the decision to other reviewers.
Comment #17
dman commentedMy call on libraries is that though "Libraries API module" is nice, and preferred, it's not always a hard dependency if the install instructions are clear enough and internal error handling is sufficient.
If placing the files manually is enough and the module detects and validates it (eg hook_requirements()), it's not always necessary to bring in external dependencies.
My review:
In the modules page:
Typo in the name, and the description is undescriptive. I suggest "Provides currency conversion tools"
While installing.
As above, if you are not using libraries API module, you should check for dependencies yourself and use hook_requirements so it registers on admin/reports/status
When visiting "Admin : Configuration" I would expect the configs for this tool to be placed under "Web services", it's not "Development".
There again, the title and description
The description Is mostly just a useless tautology. Use that text to use OTHER keywords that might explain to the user what they may find there.
The install process was OK. I'd like to see a watchdog message about the job that was done in the cron run, to help identify problems, as I'm used to encountering problems with behind-the-scenes network connections (many of our sites are firewalled and mysterious network failures can be hard to trace if not logged).
Although I see that this is just an API base, I think it could be helpful to provide that example block you describe as a quickstart.
I tried following the instructions exactly, but I think you actually need to have an 'unfiltered' text format available and use it.
Once installed, I saw a bunch of extra code insterted into my Drupal.settings, but javascript money.js was throwing "Uncaught ReferenceError: accounting is not defined "
I tried having the downloaded libraries in the module folder, and the block code as given, but it still didn't seem to be working. Your check for _moneyjs_load_library() doesn't seem to be working in the non-libraries-api mode.
Comment #18
vwX commentedThank you for you feedback Krizalys. Library module support is fixed, I cannot disable it on my site without breaking things so I have to change some code to test and sometimes my keyboard and my hands do not agree.
Comment #19
vwX commenteddman,
I have made some of your suggested changes, for which I thank you.
Comment #20
klausiReview of the 7.x-1.x branch:
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.
manual review:
But otherwise looks RTBC to me. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Assigning to sreynen as he might have time to take a final look at this.
Comment #21
sreynen commentedAs openexchangerates.org accounts are rate-limited, I'd suggest allowing users to rate-limit the requests. You could grab code for that from https://drupal.org/sandbox/sreynen/1993994 But that's not at all a blocker, so...
Thanks for your contribution, vwX!
I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
Thanks to the dedicated reviewers as well.
Comment #23
avpaderno