Hi,
I've created this module for users who may wish to display daily currency rates from TCMB (Turkish Central Bank) for the currency codes set. It can be found at http://drupal.org/sandbox/Kartagis/1186212.
Hi,
I've created this module for users who may wish to display daily currency rates from TCMB (Turkish Central Bank) for the currency codes set. It can be found at http://drupal.org/sandbox/Kartagis/1186212.
Comments
Comment #1
jordojuice commentedHi, thank you for your contribution.
Initial screening cleared:
-
Link to sandbox-
Module duplication-
README.txt file-
No LICENSE filesPlease run your module through the Coder module on minor(most). Don't add CVS tags if it tells you to, though.
Functions should all be documented.
Functions should be separated by a black line.
Remove package = TCMB. Packages are only used for established packages or if your module is a package itself.
Also, I would recommend you update your README.txt file to be a little bit more descriptive in the installation and setup of the module.
The latter notes were just an extra favor, so I won't set the status to needs work. Just fix the issues and push the changes to your sandbox please!
Comment #2
jordojuice commentedComment #3
jordojuice commentedComment #4
heine commentedPlease cleanup before asking for a review. Commented code that is still referenced (see schema) should not be there.
Comment #5
xano- It's not necessary to check for tables' existence during hook_install(). Just call drupal_install_schema() directly.
- Module description should start with a third person singular verb: "Shows exchange rates...."
- Your installation instructions are incomplete. The block cannot be enabled before the module itself has been enabled.
- Do not use t() for schema descriptions.
- Remove commented code.
- You define the permission "administer tcmb", but you never use it.
- Form element titles should describe the input for the element, not what the user has to do. You should use "Currency code" instead of "Input the currency code for...".
- Make a dedicated function that returns currency codes. You have two arrays that list all currency codes. A dedicated function lowers the chance of errors and makes maintenance easier. If you use keys for codes and values for human-readable currency names (and display those in the interface), you can improve usability.
- Always put comments on a separate line.
- In tcmb_settings_form_submit() you use
'%d'as a placeholder. Only%sshould be quoted.%dshouldn't.- Use system_settings_form() for your settings form.
- DON'T USE INTERFACE TEXTS IN ALL CAPS. IT'S BAD FOR READABILITY, MMKAY?
- Instead of using a rather complicated form setup, convert the currency select element to checkboxes. With system_settings_form(), you only need a form builder and no validate or submit handlers.
Comment #6
kartagisFixed the issues you stated.
Comment #7
fabianx commented//***** = reviewer comment
And thats all I could find for now ...
Best Wishes,
Fabian
Comment #8
fabianx commentedPlease also add Caching via cache_set / cache_get as spoken in IRC.
You can add a timestamp, too to re-run this every 24h or something configurable.
Querying a remote server on each page_request is a performance no-go and will lead to agry issues against your module like
"I installed tmcb, because I really liked its functionality, but now my site is sooo slow. Pages take ages to load. I disabled the module and it was fast again ..."
Best Wishes,
Fabian
Comment #9
kartagisI didn't add cache_set / cache_get because the data changes every 24 hours and I didn't want to take the risk of stale data. Other than that, I did some more cleanup.
Comment #10
xanoYou *need* to cache your data. Otherwise your module will execute a HTTP request every. single. page load, which is a VERY BAD idea.
Also, what happens when the HTTP request fails or the received data is invalid? Will your module crash like a 747 on a freshly mowed lawn (it ain't pretty) or will it gracefully degrade/fail, without visitors noticing it?
Comment #11
kartagisAdded caching.
Comment #12
fabianx commentedHi Kartagis,
Unfortunately this still needs more work.
Caching is ineffective as of now.
It needs to be done like:
where tcmb_retrieve_rows does the XML stuff.
Also you did not do all of my suggestions, yet. Please review them again :-).
Thanks and Best Wishes,
Fabian
PS: Edited to seperate theming and data retrieval.
Comment #13
kartagisYou explained a bit on the IRC what a helper function was, but I didn't quite understand. I also did what you said about the menu, but I reverted because my menu under admin/settings disappeared.
Comment #14
kartagisAdded cache and helper function.
Comment #15
fabianx commentedAs spoken in IRC: First read and understand all links and do everything that was asked from you here.
Make a checklist of things that were asked here and explain how you solved them all.
Just then come back.
Comment #16
kartagisOk. I'll read everything I can find,
Comment #17
kartagisSorry again, but could you repost the links? My logs are lost :(
Comment #18
kartagisApplied more doxygen standards.
Comment #19
kartagisAnyone?
Comment #20
heine commentedYou are wasting everyone's time (here and in #drupal*) by refusing to learn basic PHP*.
This, in turn, leads to the current situation where #drupal* is writing a module by providing input to the proverbial infinite monkeys. It may get there in the end, but efficient it is not.
Steps to take in order:
*) I realize you've said you do want to learn PHP, but only after this module is finished. That's the wrong way around.
Comment #21
kartagisCan't you at least tell me what I am doing wrong in the code?
Comment #22
xanoWe tried that for weeks and yet you did not learn. You asked us to review your code that turned out to be pretty much identical to our example code. We pointed you to documentation, which apparently you did not read.
Bottom line: even if this module passes the checks, there is a consensus you are unable to maintain it, as you have told us you cannot program and are not willing to learn.
Comment #23
kartagisI can program and I am willing to learn PHP.
Comment #24
kartagisDid more committing.
Comment #25
gregglesBased on the discussion here, I suggest that this module exist as a sandbox for a bit longer so it can see more real world usage. There are no bugs in the queue, so it appears nobody (other than the author) is actually using this code. Real world usage will help to iron out any performance bugs and also give a chance for Kartagis to experience Drupal community standards a bit more.
It also appears there are some bugs in the module #1249070: Filter data from tcmb.gov.tr prior to printing it and #1249074: Unused variables.
One example of standards where you could benefit is in commit messages and use of the issue queue. I see a lot of commits, but no issues in the queue. I suggest you create issues for work you do prior to doing it and post patches there. Then in your commits, rather than something that conveys little information like "Fixed a function, and removed another function accordingly" (from this commit) you can follow the standard for commit messages.
To raise awareness of the module I suggest you write a longer project page. See this advice for module owners to get a sense of some things you can do.
Comment #26
rfaysubscribe. Hoping you can work your way out of this. You've got some pretty important contributors feeling frustrated with you. greggles gave you some good guidance.
Comment #27
kartagisIssue #1251894: Toggle message fixed.
Comment #28
kartagisIssue #1252936: Implement hook_perm() fixed.
Comment #29
kartagisIssue #1253924: Remove the unused currency codes. fixed.
Comment #30
kartagisIssue #1253912: Justify the toggle message. fixed.
Comment #31
kartagisIssue #1254106: Update README.txt fixed.
Comment #32
kartagisIssue #1273142: Function names should be cleared up. fixed.
Comment #33
kartagisIssue #1262764: Add title for abbreviations fixed.
Comment #34
kartagisIssue #1278148: Create a @_tcmb_date placeholder for translation purposes. fixed.
Comment #35
rfaySeems to me like @Kartagis has been pretty responsive here. @greggles are you willing to let it go forward at this point? I think it might be stalled on your reservations.
Comment #36
tr commentedIt sounds like this module does the same thing as http://drupal.org/project/currency
The Currency module gets its data from Yahoo Finance, but also provides a way to easily add other data providers. The Currency module has actively solicited patches that add other data providers. It seems to me that it would be better to make TCMB a data provider for the Currency module rather than start from scratch and partially re-implement Currency without all of Currency's features*.
*For instance, caching, which is raised as an issue above, has been a part of Currency for a very long time.
Comment #37
rfay@Kartagis has been responsive throughout the cycle here... For the purposes of approving Kartagis for full project privileges, I'd like to stay on track and not offer redundancy objections at this late date. I do understand your point, @TR. Just seems unfair :-)
Comment #38
kartagisThat module provides currency *exchange* rates, as mine does currency rates (not exchange). I've looked into that too, but it lacked the functionality of TCMB.
Comment #39
kartagisOh, and mine shows the rates for the codes set in a block. That's something currency doesn't do.
Comment #40
tr commented@rfay: I understand that it may seem unfair at this late date. However, applicants are explicitly asked to consider and address the duplication issue as part of their application, so this is something that should have been raised by the applicant early on. I think it would benefit the community if the existing Currency module were enhanced, and would allow the applicant to get the benefit of all the other features Currency provides while still being able to use TCMB as a data source. Because of the history of this issue, I didn't change the status of the application and I'm not recommending the application be denied. I think this is a reasonable contribution, but I think it would be much more useful if it were part of the Currency module (3000+ users, D6 and D7 versions available) rather than only serving a few users who need the TCMB data source.
From http://drupal.org/node/1187664:
Comment #41
rfayOK, thanks @TR. It sounds like you're making a reasonable recommendation to @Kartagis for the future, and not blocking this approval process. @Kartagis's responses to this may also have helped.
Comment #42
greggles@rfay, definitely. It's been roughly a month since the last discussions and I do appreciate the effort @Kartagis has put into following Drupal standards and best practices in that time.
Thanks for your contribution, Kartagis! Welcome to the community of project contributors on drupal.org.
I've granted you the git vetted user role which will let you promote this to a full project and also create new projects as either sandbox or "full" projects depending on which you feel is best.
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.
Comment #43
kartagisThanks y'all :)
Comment #44
kartagisI know I should have read the big warning screen that says my project URL can't be changed later, but can you do me a favour and change it to lowercase? What worries me is drush.
Comment #45
gregglesUpper case -> lower case fixed.
Comment #46
kartagisSorry to bother, but Short project name still looks uppercase.
Comment #47
rfay@Kartagis just went through this with another project. It requires Sam's intervention to change the shortname in the repository, sadly.
You can, however, create a new project, move the issues that matter to it, and copy the content of the project page, and push the repo to it (git remote set-url origin you@git.drupal.org:project/newname.git; git push --all)
Otherwise it will take some time to get the repository name changed.
Comment #48
kartagisI tried to do, with the short project name lowercase, and it seems that drupal.org is case insensitive.
Comment #50
avpaderno