I can't find the phone fields in order to use it (them) in a view, like a member view for example.
Is it possible to catch them or not ?


Members fund testing for the Drupal project. Drupal Association Learn more


portulaca’s picture


mjcarter’s picture

After applying this recent patch for the addressfield module https://drupal.org/node/991834#comment-7986915 indivdual address components are exposed in views.

Then it's a simple one line addition to addressfield.views.inc to expose the data field the phone info is stored in - add the line

'data' => 'views_handler_field',

to the $implemented array.

But the result is not displayed in a usable format due to the serialization of the data (the addressfield module only defines a singe 'data' field to hold anything not to do with names and addresses, this is what the developers of this module were forced to use to store data).

One viable route from here would be to use computed fields to extract individual components of this field with unserialization functions or regular expressions.

Personally I have decided to not use this module when views integration is necessary and to use separate phone fields. It works great when views integration isn't needed though.

kzsolt’s picture


I installed the addressfield_phone module,
but when I wanted to use phone fileld (addressfield's phone filed) in view,
didn't find it (in view as view field).

I made some modification on addresfield_phone module, attached them.
If somebody want to use phone field can do it.

Apply the patch (and clear cache). In view have to appear addresfields phone field.
If you select it, in settings form appear one select list.
You can select phone type which you want to use in view.

kzsolt’s picture

kzsolt’s picture

Category: Feature request » Support request
Status: Active » Needs review
4.33 KB
kzsolt’s picture

  • Commit 4ce1f3d on 7.x-1.x by jcisio:
    Issue #2092831 by kzsolt | remedact: Use phone fields in views.
jcisio’s picture

Title: use phone fields in views » Use phone fields in views
Version: 7.x-1.1 » 7.x-1.x-dev
Status: Needs review » Fixed

Thanks. Committed with coding standard fixes.

  • Commit 75c6690 on 7.x-1.x authored by kzsolt, committed by jcisio:
    Issue #2092831 by kzsolt | remedact: Use phone fields in views.
jcisio’s picture

Reverted 4ce1f3d (with a conflict fix) then recommitted for proper author attribution.

Status: Fixed » Closed (fixed)

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