Download & Extend

Add token support for Phone module

Project:Phone
Version:5.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Under the Pattern for the title field is a dropdown named Replacement patterns. CCK fields created with the Phone - CCK module do not show in this list under CCK text tokens.

Comments

#1

Project:Automatic Nodetitles» Phone
Version:5.x-1.0» 5.x-1.x-dev
Component:User interface» Code

then the either the phone module needs support for the token module, or the token module needs to include support for phone cck fields.

#2

Version:5.x-1.x-dev» 5.x-2.9
Category:bug report» feature request

I would be interested in seeing this happen

#3

Version:5.x-2.9» 5.x-1.x-dev
Category:feature request» bug report

Not sure why neuromusic changed this issue? Changing it back.

#4

Title:Phone - CCK content type not available in Replacement Patterns dropdown» Add token support for Phone module
Category:bug report» feature request
Status:active» needs review

I added the following to phone.module. It's based on the token support in email.module. Like that module, it only uses the first phone number, if it is a field that allows multiple entries. Please test this and let me know what you think.

<?php
/**
* Implementation of hook_token_list
*/
function phone_token_list($type = 'all') {
  if (
$type == 'field' || $type == 'all') {
   
$tokens['phone']['phone'] = t("Phone number");
    return
$tokens;
  }
}

/**
* Implementation of hook_token_values
*/
function phone_token_values($type, $object = NULL, $options = array()) {
  if (
$type == 'field') {
   
$item = $object[0];
   
$tokens['phone'] = check_plain($item['view']);
    return
$tokens;
  }
}
?>

#5

Basically, you need to post a patch and it needs to be for D6 for there to be any realistic chance of this getting tested, reviewed or committed.

#6

Status:needs review» fixed

Taken into account in 6.2.16 version

#7

Status:fixed» closed (fixed)

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

nobody click here