Hello Everyone,

I just started developing with Drupal last week and I'm on a project where I need to set up heirarchical taxonomy terms in this level (root to base) Country, State/Providince, City (if that tree doesn't exist) whenever a user adds a new special node that we call practitioners to the system.

Now I would like to just plug this into the location.module in the _location_save() helper function and have it call my own helper function within the location.module. That function would basically call some taxonomy functions to do some checking and updating if needed. There might be a better or cleaner way to do this without patching. My boss says he really doesn't like messing with the modules and would rather me create my own module. I told him that I believe that this is probably the most efficient way to do it, but we decided that it would be best to ask all of you.

So should I patch the module or do something else? And if I should do something else, please give me some pointers so I can dig into it and solve this problem as quickly as possible.

btw - This is just goinging into a single site and I don't plan on others using this code, unless you have an interest in it, then I'll post it, but its pretty basic.

Thanks,
Tyler Wright
Creative Fuel Design

Comments

funana’s picture

Hi,

creating a new module is allways better than patching an existing one. Patching is for bugs...
Patching for adding features makes updating of modules more difficult that it has to be.
If you are able to create a new module - do it!

vm’s picture

If you are changing the overall operation (doesn't sound like you are) then by all means create a new module or create an addon to be distributed with the location module. This can than be attached to a feature request issue for the location module where it can then be looked at and considered for distribution with the location module as an add on for those who would like the same type of functionality you are creating.

twright’s picture

Thanks a lot for responding and teaching me the ways. I really appriciate your help!