CVS edit link for asanchez75

I have implemented a module called Agrovoc Field (agrovocfield).
The Agrovoc Field module is a module for manually indexing nodes using Agrovoc concepts.

This module creates a new CCK field (called Agrovoc and derived from the Content Taxonomy field) that allows to select Agrovoc terms through an autocomplete textbox connecting to the Agrovoc web services 2.0.

Being a CCK field synchronized with a taxonomy, it allows to exploit both CCK and taxonomy features in Drupal.

The module has very good and very well integrated multi-lingual support: when indexing a node, the module lists Agrovoc terms in the website currently active language, but then stores the selected terms in all the languages enabled in the website. When switching to a different language, the corresponding Agrovoc terms in that language will be displayed and when translating a node that has already been indexed, the translated Agrovoc terms will be displayed and the autocomplete field will only list terms in that language.

I am in contact with the author of another Agrovoc Drupal module (http://drupal.org/project/agrovoc) to coordinate on development.

Both modules derive from the same initial developments and use the same basic functionalities (a common API), but the Agrovoc module only integrates Agrovoc with the Drupal taxonomy, while the Agrovoc Field module integrates it also with CCK.

Note.

AGROVOC is multilingual structured thesaurus for all subject fields in agriculture, forestry, fisheries, food and related domains. It's used all over the world by researchers, librarians, information managers, and others, for indexing, retrieving, and organizing data in agricultural information systems.

Comments

asanchez75’s picture

Title: asanchez75 [asanchez75] » Agrovoc Field module
Component: Miscellaneous » miscellaneous
StatusFileSize
new12.49 KB

Here you can see a short demo

http://www.youtube.com/watch?v=5ovS1var_tE

I am attaching module too.

Thanks

asanchez75’s picture

Status: Postponed (maintainer needs more info) » Needs review
asanchez75’s picture

Here you can sse a small overview of parches I posted. This might help you to see my coding skills and take the decision of giving me cvs access.

http://drupal.org/node/794712

http://drupal.org/node/741960

Besides, I have participed as trainer in several activities of Drupal Perú as you can see here.

http://groups.drupal.org/node/86934

http://drupalperu.org/drupalcamp-primavera-2010

http://lima2011.drupal-latino.org/conferencia/web-semantica-drupal

http://lima2011.drupal-latino.org/conferencia/depuraci-n-debugging-usand...

http://lima2011.drupal-latino.org/conferencia/introducci-n-a-jquery

Finally, I have a blog to promote Drupal solutions

http://cambio.name/personal/

This blog was cited here in a list of spanish blogs, see last one

http://groups.drupal.org/node/84219

Regards,

Adam

asanchez75’s picture

StatusFileSize
new108.99 KB

I am attaching a document about architecture of agrovocfield module.
I hope be useful for my cvs apply.

misseva3105’s picture

thanks for this module

arianek’s picture

Status: Needs review » Postponed

Hi. Please read all the following and the links provided as this is very important information about your CVS Application:

Drupal.org has moved from CVS to Git! This is a very significant change for the Drupal community and for your application. Please read the following documentation on how this affects and benefits you and the application process:
Migrating from CVS Applications to (Git) Full Project Applications

  • The status of this application will be put to "postponed" and by following the instructions in the above link, you will be able to reopen it.
  • Or if your application has been "needs work" for more than 5 weeks, your application will be marked as "closed (won't fix)". You can still reopen it, by reading the instructions above.
asanchez75’s picture

Project: Drupal.org CVS applications » Drupal.org security advisory coverage applications
Status: Postponed » Needs review

I just create a git repository for this module.

http://drupal.org/sandbox/asanchez75/1076836

I am sure that it can become in a full project.

Here you can check its development process

https://github.com/asanchez75/agrovocfield/tree/v0.1

Thanks,

berdir’s picture

Just a short note, since you were already using git, you could have just added the new repo on d.o as a new remote and push it. The advantage would be that the history wouldn't be lost and it would show all your existing commits separate, making it visible that you are continously working on this module and it's not a one-off thing :)

I am not sure if this is still possible because you already pushed now, but maybe next time...

asanchez75’s picture

oh! yes yes, you are right. Next time, I will do it. Don't worry because I will continue send many changes because I am very compromised with this module.

asanchez75’s picture

Just upping this... If someone can check it... Thanks

sreynen’s picture

Component: miscellaneous » new project application
asanchez75’s picture

Component: new project application » module

Just upping this... If someone can check it... Thanks

ralt’s picture

Hello,

Here is my quick review :

You should remove LICENSE.txt, it will be added automatically by d.o.

All $Id$ lines are not necessary anymore since CVS is not used anymore.

In your agrovocfield.module file :

    case 'validate':
     break;
    case 'sanitize':
      break;

Why do you use this instead of "default" ?

function agrovocfield_get_term_by_name($name) {
  $db_result = db_query("SELECT t.tid, t.* FROM {term_data} t WHERE LOWER(t.name) = LOWER('%s')", trim($name));

Nothing big, but why t.tid AND t.* ? t.* should be enough, should it not?

Also, I'm not sure, but I think it is more performance wise to describe the fields one by one if you know what you want (I'm kinda itchy at this star :p).

Found some trailing whitespaces in your agrovocfield_autocomplete.module file.

Except for these little things, the code looks really great! Havent tested it though.

asanchez75’s picture

asanchez75’s picture

Just upping this... If someone can check it... Thanks

jordojuice’s picture

Status: Needs review » Needs work

Hi,
Thanks for your contribution and sorry about the long wait!

I did a code review on your module, and overall I think it looks well done. The module follows coding standards well, though there were a few indentation issues and that's it. The module has a README file, no LICENSE files, etc. I'm prepared to mark this RTBC once a few issues are resolved. Looking at your code and your recent posts, I think you have demonstrated your abilities as far as I'm concerned. But a few things to note:

Comments and names should use US English spelling (e.g., "color" not "colour").

http://drupal.org/coding-standards
Drupal coding and commenting standards dictate that the standard language is US english. So, all of the

/**
 * Implementation de hook_field().
 */

type comments should be

/**
 * Implementation of hook_field().
 */

Also, if properly formatted, comments should look like this (from line 201 of agrovocfield.module

/**
 * Adapted from taxonomy_get_term_by_name function.
 *
 * @param string $name
 *    The term that was searched.
 * @param integer $vid
 *    A vocabulary ID.
 *
 * @return
 *    An array of objects for each term found.
 */

Additionally, comments should follow sentence structure, starting with a space, capital letter, and end with a period, and inline // comments are generally discouraged (like unset($obj->labels); //reseting container).

These are pretty simple fixes that shouldn't take long. Your code demonstrates an understanding of PHP. the Drupal API, and makes good use of the Content API.

Lastly, you might want to include some instructions on using the module in your README.txt file rather than only describing what it does.

ralt’s picture

Hi,

Actually, "Implementation of..." should be "Implements...".

jordojuice’s picture

Issue tags: +pdx-code-review

Indeed that be the new format, though I've gotten mixed signals on whether D6 modules must use this format. All of Drupal core in D6 still uses Implementation of, as do most D6 modules, and many modules complete this review process with the same. Indeed, I've seen it expressly mentioned in this queue that using this format is okay for D6 modules. But perhaps the safest bet is to use the new format, be bold (while I get clarification from the rest of the review team)!

asanchez75’s picture

Thanks for your suggestions. I just solve it.

http://drupalcode.org/sandbox/asanchez75/1076836.git/commit/b4655a2

I hope this is enough :)

asanchez75’s picture

Just upping this... If someone can check it... Thanks

asanchez75’s picture

Please, I would be very grateful if somebody can review it. I guess that everything is ok after your suggestions.
Thanks

jordojuice’s picture

Status: Needs work » Needs review

Agh. Once you correct any issues the application needs to be set back to needs review. That's why it got lost in the sauce!

asanchez75’s picture

Just upping this... If someone can check it... :(

asanchez75’s picture

I would be grateful if somebody could review it. I just develop a agrovocfield importer plugin for Feeds module but I would like negotiate its inclusion in Feeds module through my own account in Drupal.org.
Please :(

jordojuice’s picture

Priority: Normal » Major

Elevating priority to get this checked out again. I am busy at the moment but will check it out again soon if nobody beats me to it.

asanchez75’s picture

Sure you are very busy because 2 weeks have passed since your last comment :(
I will be patient, I understand. I hope you have time very soon.
Thanks

valeriap’s picture

I hope this module gets reviewed soon and is released as an official module, as we strongly need something like this.

The existing Agrovoc module only uses taxonomy, while this one also stores the URI in the CCK field, which is essential for developing Linked Data-enabled websites. Having been developed in very strict collaboration with the group in the Food and Agriculture Organization of the United Nations (FAO) that manages the Agrovoc thesaurus, this module has the necessary functionalities in order to fully integrate Agrovoc indexing and .linking to the Agrovoc URIs published as Linked Data.

We are already using the module, but it would help our community (http://aims.fao.org/community/group/agridrupal) to have it published on drupal.org so that it can be easily shared and upgrades can be monitored.

develcuy’s picture

Just to add more noise, a committed maintainer that is working six months to get his module pushed is (at least for me) the best prove that this is a project and not just a pastebin. I encourage the approval of this module.

davidhernandez’s picture

Regarding module duplication, why not merge functionality with the agrovoc module? Especially since you say you are in contact with that person to coordinate development.

davidhernandez’s picture

Priority: Major » Critical
asanchez75’s picture

Hi davidhernandez,

My approach is different because is based on CCK API. My module helps users in 3 key areas:
1. Choose the widget to fetch the tags from the Agrovoc Server. For now I have implemented a widget called autocomplete, but could create more.
2. Choose the format to display the information in a full text node. In this aspect, I have implemented a formatter that displays the terms of the taxonomy as URIs, facilitating the indexing as Linked Data.
3. Choose the formatter to display the terms through Views module.
Also, is fully integrated with the i18n module. For example, when you create a node in one language, and storing terms in that language, you do not need refilling terms again for each node of each available language in the site. My module will automatically display the terms that correspond to each available language. Furthemore, the terms can only be changed from the default language of the site to ensure consistency of information.
For example, if I store the words: "Rice, Milk" in a field of type agrovocfield, my module will automatically show "Arroz, Leche" when the module is translated into Spanish. The user does not fill it again.
On the other hand, this approach allows the integration with Feeds module to import Agrovoc terms from XML files. For example, I just developed a plugin for Feeds, which is not part of agrovocfield because its location should be inside Feeds module.
The plugin is available here
https://github.com/asanchez75/agrovocfield_plugin_for_feeds
but it can't be part of suite of plugins that Feeds module has for importing CCK fields because my module is not official yet :(
There's a video here here about this plugin
http://blip.tv/asanchez75/plugin_feeds4agrovoc-5321989
Finally, the only coordination I have to do with the other developer is about improvements for module agrovoc_api that is part of his module. I used its API, but only to fetch Agrovoc terms from Agrovoc server.

Regards,

asanchez75’s picture

Priority: Critical » Major

Please, I would be very grateful if someone could review it.
Thanks

davidhernandez’s picture

Adam, I'm so sorry this is taking so long. We are severely short on volunteers. I'm looking over the code right now, and will post comments tonight or tomorrow. Definitely don't add more comments to bump up the issue. Reviewers can actually skip it over because of that. They see it being commented on, so they think it is being reviewed. Thank you for your patience.

davidhernandez’s picture

Thanks for your README. It is very helpful.

I get a lot of these errors:

Fatal error: Class 'SoapClient' not found in C:\wamp\www\d6\sites\all\modules\agrovoc\agrovoc_api.module on line 30

I know it is not from your module, but it is preventing the autocomplete from working, and the node from saving. It does not show any autocomplete suggestions, but it only fails when typing something that should autocomplete, like "chicken". I am doing this on Windows. I will try Linux tomorrow. Otherwise, I cannot get it to work, so I'll have to review the code only.

Coder does hit on this:

Line 272: Potential problem: "SELECT FROM {node}" statements should probably be wrapped in db_rewrite_sql() and with the alias for {node} table defined (e.g. {node} n)

I'm looking at the code now to see if it necessary in this use case, but I don't immediately see a reason not to use db_rewrite_sql(). http://drupal.org/writing-secure-code

Still looking. Regardless of whether I can get it working, I just want to make sure there are no obvious security issues. I should be finished reading it all by tomorrow.

asanchez75’s picture

I just fix the bug. You can check a diff here

http://tinyurl.com/3umzjsl

It is very odd bug because I had reviewed my module months ago with the coder module and had not errors. Maybe, the coder module have updated its database of error detections. Anyway, it is better because I can learn more :)

Later, I will share you a short screencast (7 min) to demonstrate how working my module. Now, I am uploading it.

You are very kind, thanks a lot.

Adam

asanchez75’s picture

My short screencast (7 min) to demonstrate you how working my module

http://tinyurl.com/3tna6mg

I hope help you to understand it.

Regards,

davidhernandez’s picture

Thanks for the information. I set this up on Ubuntu this evening and it is working without any errors. I will try to finish the review very soon.

davidhernandez’s picture

Use t() for the label and description in hook_field_info(). The agrovocfield_autocomplete_widgets_settings() function seems to have no purpose. Other than that, nothing jumps out at me. Add the t() function and I'll mark it reviewed, as long as no one else has any comments.

asanchez75’s picture

OK. I just fix it.
See http://tinyurl.com/3pzf2yd
Thanks

davidhernandez’s picture

Priority: Major » Normal
Status: Needs review » Reviewed & tested by the community
greggles’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +PAreview: security

Congratulations and thanks for your patience. Based on davidhernandez' review I've granted you the git vetted user role.

Indeed the db_rewrite_sql was necessary for security reasons. Adding a tag to track that.

Status: Fixed » Closed (fixed)
Issue tags: -pdx-code-review, -PAreview: security

Automatically closed -- issue fixed for 2 weeks with no activity.

avpaderno’s picture

Title: Agrovoc Field module » [D6] Agrovocfield
Issue summary: View changes
Status: Closed (fixed) » Fixed
Issue tags: -

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.