Many folks don't think to edit their location in the "edit" tab. There is other related functionality, like supplying a default ZIP (eg the User's) in the locationsearch module. Or a "near me" checkbox as discussed here:
http://drupal.org/node/47384

I need this feature and am willing to put out $.

CommentFileSizeAuthor
#4 location_module.patch990 bytesaskike

Comments

akaney’s picture

I think this would be a feature that many people could use. I have just started a new drupal site, and have found this to be a feature of great interest. I have created a few other sites with drupal, but am not familiar enough with the code to be of much help. I would be interested in testing this feature though.

askike’s picture

You can request user location information at registration by inserting the following code:

if ($op == 'register' && $user_setting == LOCATION_USER_COLLECT) {
    $form = array(1 => array());
    $form[0]['location'] = location_form(array('street', 'city', 'province', 'postal_code', 'country'), (isset($user->location) && !_location_is_empty($user->location)) ? location_api2form($user->location) : array('country' => variable_get('location_default_country', 'us')));
    $form[0]['location']['#type'] = 'fieldset';
    $form[0]['location']['#title'] = t('Location');
    $form[0]['location']['#tree'] = TRUE;
    $form[0]['location']['#collapsible'] = TRUE;
    $form[0]['location']['#description'] = t('Please enter at least your ZIP/postal code.');
    return $form;
  }
 

after

  if ($op == 'form' && $category == 'account' && $user_setting == LOCATION_USER_COLLECT) {
    $form = array(1 => array());
    $form[0]['location'] = location_form(array('street', 'city', 'province', 'postal_code', 'country'), (isset($user->location) && !_location_is_empty($user->location)) ? location_api2form($user->location) : array('country' => variable_get('location_default_country', 'us')));
    $form[0]['location']['#type'] = 'fieldset';
    $form[0]['location']['#title'] = t('Location');
    $form[0]['location']['#tree'] = TRUE;
    $form[0]['location']['#description'] = t('Enter as much of your address as you are comfortable with. Your address will only be viewable by those who have the appropriate permissions. The site will be able to automatically link you to driving directions and other features if it already knows your address.');
    return $form;
  }

in location.module

greggles’s picture

Can you provide that as a patch file?

Here are instructions to make a patch: http://drupal.org/diffandpatch

This could be handy if controlled via a setting on the location settings page.

askike’s picture

Version: 4.7.x-1.x-dev » 5.x-1.x-dev
Priority: Critical » Normal
Status: Active » Needs review
StatusFileSize
new990 bytes

I cleaned up the code I offered earlier and created a patch against version 5. It would be nice if this could be controlled as a setting, but that's outside my critical path at the moment.
This is my first patch for public consumption... caveat emptor!

bdragon’s picture

http://drupal.org/node/157798 marked duplicate (patch in issue).

bdragon’s picture

http://drupal.org/node/120858 marked duplicate (patch in issue).

alimosavi’s picture

Version: 5.x-1.x-dev » 6.x-3.0-rc1

in drupal 6 ?

capellic’s picture

I am wondering the same thing. If people don't fill this out upon registration, they have a habit of never getting to it.

THANKS!

bdragon’s picture

Status: Needs review » Fixed

This was fixed post-rc2.

capellic’s picture

Version: 6.x-3.0-rc1 » 6.x-3.x-dev
Status: Fixed » Active

I just installed the dev version of October 20, but I don't see anything about displaying the Location form fields on the registration form. Can you please give directions on how to do this? Thanks!

mandclu’s picture

I just installed rc2, and didn't see anything in there either. If this is possible, please let me know, as I desperately need this.

mandclu’s picture

If the only way to get this working at the moment is to use the dev version instead, what is the current state of the dev version? Is it relatively stable, or is there anything in transition that isn't working properly at the moment? Conversely, is there any chance another beta release might be coming shortly?

benovic’s picture

anyone tested the dev version yet? i might have to use it in a production site which makes me a bit nervous ;)

capellic’s picture

I wouldn't recommend it for Dev. It seems very buggy to me. It could be operator error or maybe a conflict with another module, but it simply isn't working out for me. It's a fairly scope - trying to handle location information worldwide. I'm going to come back to it with the maintainers have had some more time to sort things out.

yesct’s picture

Status: Active » Fixed

Since the last mention that this was fixed in the dev version, there have been new 3.1-rc1 versions. You could try those first before trying the dev version. Marking this one fixed.

Status: Fixed » Closed (fixed)

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

clashar’s picture

for latest stable 6.x-3.1 (2010-Jul-06), I didn't find solution to put requirement to fill in location for user registration.

Actually there is an option when I edit content profile node type to put "Minimum number of locations: " in "Locative information" tab, but even if I put there "1",anyway location tab/fields are not displayed on user registration form.

clashar’s picture

Version: 6.x-3.x-dev » 6.x-3.1
Status: Closed (fixed) » Active
clashar’s picture

Status: Active » Closed (fixed)

Actually #286450: Location on registration?) with comment #12 helped me