Closed (works as designed)
Project:
Location
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Jan 2012 at 10:01 UTC
Updated:
20 Apr 2012 at 03:15 UTC
I'm using a cck Location Field on different node types.
Setting the "additional Field" to required on the node settings has no effect on
the node creation form.
The field gets no asterix an can be empty.
I also noticed that changing a location setting on a field instance for a node type affects any
node type using this field (which may be working as designed).
Comments
Comment #1
ankur commentedThis is by design for the most common use case. If you have a situation where the additional field is required, my suggestion would be to add some code in an implementation of hook_form_alter() that set's the #required value to TRUE in the form array.
Comment #2
samhassell commentedYou can't use hook_form_alter() to do this as the location fields are not available in $form AFAICT. You can use hook_locationapi() though:
I worked this out by looking at location_locationapi() in location.module. You can do a bunch of other cool stuff with this hook.