Where are views phone/fax fields?
mattyoung - March 16, 2009 - 07:48
| Project: | Location |
| Version: | 6.x-3.1-rc1 |
| Component: | Location_views |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
| Issue tags: | views location module phone fax number display worked before |
Description
I don't see the fields for the phone/fax fields in views fields selection list.

#1
I believe you need to first add a "Relationship" for "Content: Location - (field_location)" because the phone is stored in a separate table. You should then be able to see phone and fax listed under the Fields section. However, I just did the same and when I try to actually add the phone number to the view, I'm getting the following error:
#2
I see they are stored in tables 'location_phone', 'location_fax' and related by 'lid'.
However, how do I add e relationship to these two tables? When I add relationships in views, I only see choice for "Comment: Node", "Comment: Parent comment", "Comment: User", "Node revision: User" and "Taxonomy: Parent term".
#3
Same here. No idea where/what to select for any type of relationship(ing)...
#4
Ditto, no phone or fax.
#5
I just tried uninstalling the Location module on my development site and reinstalling using the latest DEV version of Location instead. When I now try to add a phone number field to my view, I get an error saying:
I tried deleting and recreating the location relationship within Views, but that didn't seem to make a difference. The error message isn't very descriptive, so I'm not sure where to start digging for more info.
#6
I just realized that despite the nondescript error message, the phone field was getting added to the view. And the phone number is now getting displayed. Woohoo!
Thanks for the great module and for all the development and bug fix work that has gone into it!
#7
>the phone field was getting added to the view. And the phone number is now getting displayed. Woohoo!
I just install the dev version and I still cannot see the phone and fax field in view.
I use the Locative Information setting in the node itself. I'm not adding Location as CCK field because I found gmap view only works with the Locative Information in the node.
What did you do to get the phone/fax fields?
#8
mattyoung,
Maybe the difference in what we're seeing is because I'm using Location as a CCK field. That would also explain why I had to set up a "Content: Location - (field_location)" relationship and why you wouldn't see that option.
#9
This is definitely still a big bug. It definitely doesn't work with Views if you just use the locative information.
#10
I prefer to use CCK field for phone number, Location IMO just for location.
#11
My setup is not using the Location CCK field, but rather the Location module to implement the form within the node creation page. If I use the CCK field, I can see the CCK field data available within Views, but that doesn't help with my Location module and the implementation with Gmap.
Any ideas on when this will be getting addressed?
#12
Same Problem here !
#13
marked #387198: No Phone Field in User Accounts as a duplicate of this issue.
#346694: Map Link Doesn't show up - phone problem also fixed might be related too
#14
Still no progress?!
#15
I'm attaching this patch which is similar to the ones others have submitted for the 5.x branch. I'm still torn between this being a location field or using regular CCK fields. Almost seems like it would be better to just use CCK fields.
(whoops. I posted this in the wrong thread--the patch is not related to views)
#16
subscribing.
I am having the same problem with both the fax and phone fields. I have enabled both submodules and it doesn't matter whether I create the location as a cck field or as a location on the node, the fields appear and I can enter a number but it does not display.
Thanks for all the work on this module. It sure does a lot well.
Izzy,
#17
We are also looking for this, subscribing. Thanks.
#18
Hey y'all - I had to do this, to make it show up. I'm sorry, I'm a git and don't know how to commit a real patch. But, this seems to work, I also had to add a 'help' part. If someone could direct me to the right place to make a patch to be reviewed, it would be awesome. I find that daunting for some reason. thanks!
$data['location_phone']['table']['join'] = array(// Location links to node through location_instance via lid.
'node' => array(
'left_table' => 'location_instance',
'left_field' => 'lid',
'field' => 'lid',
),
// Location links to node_revisions through location_instance via lid.
'node_revisions' => array(
'left_table' => 'location_instance',
'left_field' => 'lid',
'field' => 'lid',
),
// Location links to users through location_instance via lid.
'users' => array(
'left_table' => 'location_instance',
'left_field' => 'lid',
'field' => 'lid',
),
);
#19
http://drupal.org/patch
#20
To those wondering why the phone/fax fields are necessary:
When using a CCK phone field you are probably only working with one location per node, however if you are working with multiple locations within a node (ie if a node is a company and it has multiple locations), then it makes sense to have phone & fax (and URL as someone else suggested) included as part of the location as it is relevant and it provides the grouped fields necessary to be able to "add another location" and have all the necessary fields available for that new location.
#21
Thanks for the code kirikintha, seems to work for what I need.
Here is a patch based on your code that does phone and fax joins in their respective views.inc files.
#22
I'm now getting all the data when I select "Address" as my field. But I'm not seeing field options for a number of the individual address elements. For example, I see no state and still no phone.
In my case, I need more granular control of the address data than the standard "Address" output. I'm one of those poor souls that knows some PHP, but not module development... a designer type. Somehow with Views it often comes down to this with me:
1.) Build a tpl.php file
2.) Get the node ID
3.) node_load();
4.) No more missing fields
I would add to the discussion weighing CCK location VS Node location that Node Import only supports the latter. Although I find Node Location less in keeping with the "Drupal way"... What can you do.
Thanks
#23
The patch in #21 seems to be working well. I added a help argument to the phone field description so that views would not complain about missing help.
#24
The patch in #23 only adds help for phone, not fax