CVS edit link for jonathan_hunt
I've been working with Drupal for four years now and wish to contribute back to the community, starting with a module that introduces metadata search via the DigitalNZ API (see
http://digitalnz.org/developer ).
DigitalNZ is a great cultural and educational resource. This module introduces a basic search function, including sorting. Future plans would be to add more data into the search result template, add faceted search and additional API functions. Making this module available may help Drupal in the education and cultural heritage markets in NZ.
Code can be downloaded from
http://huntdesign.co.nz/digitalnz-api-module
I have not located evidence of any other Drupal development for the DigitalNZ API. If approved, I'll seek listing with other code at http://digitalnz.org/developer/code-samples/
Thanks for your consideration.
Comments
Comment #1
jonathan_hunt commentedBTW, to properly test this code, you need a Developer API key
http://digitalnz.org/developer/getting-started/
Comment #2
avpadernoComment #3
avpadernoStatic variables doesn't need to be prefixed with the module name; that is how global variables used by a module should be named.
Comment #4
jonathan_hunt commentedI've added a revised module archive.
Re 1, I'm not sure what you are referring to. Can you please relate your comment to specific lines of my module?
FYI, I discovered hook_search_page() #171317: hook_search_page not appearing on api.drupal.org, so I've used that instead of a phptemplate_search_results() call in the module.
Re 2, I've renamed the static variables per your advice.
Comment #5
avpadernoTogether
t()you should useurl(), as reported in the documentation fort().The code assigns to
$sortthe value it already has; which value would the variable have ifpreg_match()returns 0? I guess it would have the same value, and that mean the IF-statement doesn't do anything.Comment #6
avpadernoI forgot to change status.
Comment #7
jonathan_hunt commented1. Adjusted per your comment.
2. I don't know what you are referring to. What functions do think I should be calling? Coder reports 'No Problems Found' (except for the date processing, but that is a special case).
3. I've removed the sort validation.
Comment #8
avpadernoSee digitalnz_api.module. Between a Drupal function and a PHP function with the same purpose, which function would you use?
coder.module doesn't report anything about that because it doesn't have the code to check that; the only way to know if the code is compliant with that point of the coding standards is to read the coding standards.
Comment #9
avpadernoI keep to forget to change the status.
Comment #10
jonathan_hunt commentedIt would help me a great deal if you could refer to a specific function or a line within the module. Are you referring to digitalnz_api_convert_date()? I need that function because I am not on PHP 5.3, and I expect most people using this module are not on PHP5.3 either.
I've read the coding standards, several times.
Comment #11
avpadernoSee the part of the coding standards that refers to the Unicode string functions.
Comment #12
jonathan_hunt commentedI don't see why the unicode string functions are relevant when the string they are working on is a date string that won't include unicode characters.
I've uploaded a new version with the following changes:
- Added README.txt
- If no API key, don't attempt search and display error.
- Move defines to higher-level module.
- Show link to settings per Embedded documentation style guideline http://drupal.org/node/24566.
- Make URL and API key required on settings form.
Comment #13
avpadernoSee my previous point #5.1.
What is that code supposed to do?
Comment #14
avpadernoComment #15
jonathan_hunt commented#13.1 Oops, old habits. Fixed.
#13.2 There are various apachesolr placeholders around the code because I hope to introduce support for faceted search at a later date, in line with the apachesolr approach.
#13.3 Removed.
Comment #16
avpadernoI should have approved the CVS application before; I am sorry for the delay.
Comment #17
jonathan_hunt commentedThanks for your review.
Comment #18
dman commentedLooking forward to playing with the code. Looks like it may tie in with some stuff I'm doing. Watching the repository :-)
Comment #21
avpaderno