As a follow-up to #400904: List of modules using "Country codes API", I have released a module called Country codes Field that depends on the Country codes API module. I am planning to release a new version soon. Tom, do you think this is an appropriate (temporary) place for this for now?

CommentFileSizeAuthor
#4 countrycodes_field-6.x-0.2.tgz4.23 KBroball

Comments

mrfelton’s picture

Hi Robert. Glad you got it working. One thing I would say is to give some thought to the name of this project, as it serves a very specific purpose - that is, overriding a specifically named custom profile field. Perhaps the modules name should include something to indicate this, as at the moment, it sounds like it is a field that can be used anywhere. How about profilefield_countrycode, profile_countryfield, or profile_countries. Alternatively, could this not also be done by creating a cck widget - which would then be much more flexible and more suited to the name countrycodes_field (or just country_field)? Just a thought...

nancydru’s picture

Indeed, with Fields now being in core in D7, doing it as a CCK widget could position this as a premier solution that is somewhat "future proof." And, just a thought, perhaps it could be worked into the theme_username implementation in the RealName module.

roball’s picture

Thank you for your comments. I want my solution to be independent of the CCK module, thus I prefer to release it as a module on its own for D6. maybe it won't be needed for D7 at all. Nancy, I haven't looked into theme_username of your module so far, thus for me it's easier to release it as a standalone module for now. But thank you for your offer!

Sure, there could be a better name than Country codes Field, but I've already hardcoded in version 0.2 everywhere. It was inspired of your Country codes API naming.

roball’s picture

Title: "Country codes Field" module released » "Country codes Field" 6.x-0.2 module released
StatusFileSize
new4.23 KB

Actually, here is version 0.2. Works fine for me.

roball’s picture

Title: "Country codes Field" 6.x-0.2 module released » "Country codes Field" module 6.x-0.2 released
mrfelton’s picture

Status: Active » Closed (fixed)
summit’s picture

bookmarking, greetings, Martijn

alan d.’s picture

Status: Closed (fixed) » Active

Can you please publish modules rather than letting these get lost in a closed issue, even if it is just getting them into CVS. This helps other developers to see what is already out there, it helps to prevent duplications and allows others to contribute back to existing modules.

Speaking of duplications, I've spent a couple of days creating a simple country module as I needed a country field in Drupal 7 project that I have just started playing with.

It provides the following three things:

  • A base country table, using shameless rip from this module merged with the continent patch (http://drupal.org/node/255215) and Drupal core countries. Schema used is.
    CREATE TABLE `countries_country` (
      `iso2` char(2) NOT NULL COMMENT 'ISO2 country code.',
      `iso3` char(3) default NULL COMMENT 'ISO3 country code.',
      `name` varchar(80) NOT NULL,
      `printable_name` varchar(80) NOT NULL,
      `numcode` smallint(6) default NULL,
      `continent` char(2) NOT NULL COMMENT 'Continent code.',
      `enabled` int(11) NOT NULL default '1' COMMENT 'Whether the country is enabled.',
      PRIMARY KEY  (`iso2`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Maintains a country database.';
    
  • A simple UI to edit / add countries. Countries from core can be disabled but not deleted.
  • A country FAPI element, 'country'. A simple prepopulating select list based on enabled countries. It has a inbuilt filter for all/enabled/disabled countries. It also has a simple continent filter.
  • A country field, called Country, with the same characteristics as the FAPI element.

The code is committed @ http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/countries/

Should I go ahead and publish this? It's really late here so I haven't reviewed the above module to see the overlap.

mrfelton’s picture

@Alan D: I though Roball had published his contribution.

Regarding your own contribution (which I have not yet looked at). Perhaps you should seek to try and get the additional features that you need included in this module, or as a sub module of this one. There are already over 500 people using the countries_api module, and several other modules depend on it too. It seems a little silly to publish yet another project with pretty much the same functionality. My view is that there should only be 1 module with the iso2 iso3 country data (this one). That means only only place to keep these values up to date. I think there are plenty of other projects out there that could already benefit from using countries_api for its iso country needs (ubercart, location etc etc).

Please consider joining forces before you start your own project.

alan d.’s picture

Title: "Country codes Field" module 6.x-0.2 released » Profile "Country codes Field" module 6.x-0.2 released
Status: Active » Closed (fixed)

I’ll let Roball update this thread to let the world know about his progress in this. Updated the title to indicate that this is a Profile feature

I’ll created another issue about the other things. @see http://drupal.org/node/597748

roball’s picture

The reason for creating this module was because I needed a quick solution for user profile data stored at an LDAP server, providing the data to both Drupal and Moodle. I'm not totally happy with the current solution since it only works with exactly one specific field provided by the Profile module, and only in one way (country name to code). Indeed, as suggested by mrfelton and NancyDru, this functionality should be better provided as a CCK based solution. Unfortunately, I had no time to work on this further so far, so I don't think it's worth to publish the module as a project at this stage. If anyone would like to work on a CCK field, that would be very welcome. Thanks.

alan d.’s picture

Thanks for the update.

We had a complex user profile requirement recently so I know the headaches with Drupal profile module. We rewrote the field management of the Profile module to do what we required as the content profile module just didn't cut it. I guess now we have a easily extendable profile module for the future, at least till Drupal 7 comes out!