I'm not sure whether this is the right way to go about submitting Drupal module patches (this is my first), so go easy on me!

What I was lacking in GMap was a way in which to associate different API keys with different domains running the site. I know this was possible previously with the keys module, but I see that that has not been ported for D7 yet.

I have written a very basic patch that adds this functionality to GMap and D7.

Let me know what you think!

CommentFileSizeAuthor
gmap-multiple-domains-support.patch5.24 KBalexpls
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexpls’s picture

Status: Reviewed & tested by the community » Needs review
alexpls’s picture

Title: Multiple domain support for Google Maps API keys » Multiple domain support for Google Maps API keys (patch included)
Sutharsan’s picture

Status: Needs review » Needs work

It is not a good idea to change variable 'googlemap_api_key' into 'googlemap_api_keys' without providing an upgrade path. This way, everyone installing the module/patch will lose the API key.

The patch contains lines with trailing while space. Use Coder module to check.

Typo '$key_' in:
foreach($keys as $key_ => $values) {
You can leave '$key_' out.

Personally I'm not a fan of single character variables i.e. $f. $fieldset has much more meaning.
Make the fieldset non collapsible. It's not something that should be hidden.

Don't break translatable strings and don't include <em>:
... Your current hostname is <em>' . $_SERVER['HTTP_HOST'] . '</em>.'
Use the % placeholder as described in t().

drupal a11y’s picture

Any updates on this?

For D6 exists also this add on for the Domain Module: http://drupal.org/project/domain_bonus

Sutharsan’s picture

A port of the Keys module is waiting for review: #1362494: Thorough review of 7.x dev branch. That could be a solution to this problem.
[edit] The patch is not a port but a thorough review.

drupal a11y’s picture

Keys Module is working fine with D7!