Closed (fixed)
Project:
Location
Version:
6.x-3.1
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
31 Jan 2009 at 17:07 UTC
Updated:
3 Jan 2014 at 00:07 UTC
Jump to comment: Most recent
Comments
Comment #1
yesct commentedtagging.
Comment #2
rooby commentedNote that this code is created for the 3.1 version, not the 3.0 version.
You can't use hook_form_alter() for this because at that stage the field is only a collections of the location settings used to create the fields that will be displayed.
The location module provides a hook for this, called hook_locationapi(&$obj, $op, $a3 = NULL, $a4 = NULL, $a5 = NULL)
The field_expand $op is where locations fields are created and you can use that to modify the different fields of a location.
Here is an example that sets the default value for and then disables the 'name' field of the locations.
If you want you could add to this code some checks to determine which node type the user is currently adding/editing.