I don't see the fields for the phone/fax fields in views fields selection list.

Comments

matt v.’s picture

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:

An error occurred at http://localhost/mysite/admin/build/views/ajax/add-item/daily_deals/defa...

mattyoung’s picture

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".

z33k3r’s picture

Same here. No idea where/what to select for any type of relationship(ing)...

Buddharide’s picture

Priority: Normal » Critical

Ditto, no phone or fax.

matt v.’s picture

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:

An error occurred at http://localhost//admin/build/views/ajax/add-item/daily_deals/default/field.

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.

matt v.’s picture

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!

mattyoung’s picture

>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?

matt v.’s picture

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.

ajpiano’s picture

Version: 6.x-3.0 » 6.x-3.1-rc1

This is definitely still a big bug. It definitely doesn't work with Views if you just use the locative information.

romand’s picture

I prefer to use CCK field for phone number, Location IMO just for location.

z33k3r’s picture

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?

flexator’s picture

Same Problem here !

yesct’s picture

Issue tags: +views location module phone fax number display worked before
z33k3r’s picture

Still no progress?!

dhartman’s picture

StatusFileSize
new619 bytes

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)

izmeez’s picture

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,

arosemartin’s picture

We are also looking for this, subscribing. Thanks.

kirikintha’s picture

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',
    ),
  );
mattyoung’s picture

beanjammin’s picture

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.

agileware’s picture

Category: support » feature
Priority: Critical » Normal
Status: Active » Needs review
StatusFileSize
new2.79 KB

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.

ecksley’s picture

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

eojthebrave’s picture

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.

agileware’s picture

The patch in #23 only adds help for phone, not fax

stefan81’s picture

Thank you folks.
With your patches and applying the fax help manually (#24), I got it running!:)
would be cool if someone can apply this patch to core.

Benjamin (#20),
if you need more fields, you can do it manually. Lets say you want to add a web address.

Go into the folder modules/location/contrib and duplicate, for example, the "location_phone" folder, then rename the folder and all files with "location_web" and do a search&replace in the files. phone > web. Descriptions you can change manually. Upload the new submodule, activate it and you are done :)
This way I added mobile numbers, web and mail addresses.

By the way: To get the links working just select "Output this field as a link" and fill "Link path:" with http:// (if an external Link) and the appropriate token ( see Replacement patterns further below). For a mail do "mailto:[mailtoken]"
Thats it :)

jax’s picture

Status: Needs review » Reviewed & tested by the community

Patch in #23 works for me and looks sane. It adds phone and fax.

bdragon’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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

lucascaro’s picture

Thank You!