Posted by Summit on September 2, 2010 at 3:05pm
| Project: | Node displays contributions |
| Version: | 6.x-2.x-dev |
| Component: | ND Location |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
Hi,
I want all the location fields, which I already checked in the location module, to be visible when choosing full address. Is this correct behaviour?
If so it is a bug, and fields as Phone and Fax Coordinates are not shown.
If not, than it is by design to only show street,city,province right?
greetings,
Martijn
Comments
#1
see #878856: "full address" in location displays incorrectly
#2
Hi,
I've created a patch for this.
Though you can theme theme_nd_location_address in your template.php to fix this, there is no reason why people should be required to do this just to fix this bug. The theme function should respect the location configurations such as field orders and field visibility out of the box.
Or if you are not applying patch, you can add this on your template.php
<?php
/**
* implementation of theme_nd_location_address()
* Rearrange orders of fields to respect location config on content type
* and also respect hide settings.
*/
function phptemplate_nd_location_address($field) {
// Get the location field settings for this node type
$settings = variable_get('location_settings_node_'. $field['object']->type, array());
// Loop through and collect the address fields we want to output in the order specified in node location settings,
// and check that they are not set to be hidden in node location setting
// also ignore arrays (eg. locpick)
$address = array();
foreach ($settings['form']['fields'] as $fieldname => $fieldsettings) {
if (!$settings['display']['hide'][$fieldname] && !empty($field['object']->location[$fieldname]) && !is_array($field['object']->location[$fieldname])) {
// Replace country code with full country name
if ($fieldname == 'country') {
module_load_include('inc', 'location', 'location');
$field['object']->location[$fieldname] = location_country_name($field['object']->location[$fieldname]);
}
// Add this field to our array of fields to output
$address[] = check_plain($field['object']->location[$fieldname]);
}
}
return implode($address, ', ');
}
?>
Hope this helps.
#3
Committed this to both branches, thanks!
#4
Automatically closed -- issue fixed for 2 weeks with no activity.