addressfield_phone 7.x-1.3 的 bug

Notice: Undefined index: fax in addressfield_format_phone_generate() (line 69 of/home/nginx/domains/hi.thatk.com/public/sites/all/modules/addressfield_phone/plugins/format/phone.inc).

 

39     if (!$settings || isset($settings['phone'])) {
40       $format['phone_block']['phone_number']['phone_number'] = array(
41         '#title' => t('Contact Phone'),
42         '#size' => 15,
43         '#attributes' => array('class' => array('phone-number')),
44         '#type' => 'textfield',
45         '#tag' => 'span',
46         '#default_value' => isset($address['phone_number']) ? $address['phone_number'] : '',
47       );
48     }
49     if (!$settings || isset($settings['extension'])) {
50       $format['phone_block']['phone_number']['phone_number_extension'] = array(
51         '#title' => t('Phone Extension'),
52         '#size' => 10,
53         '#attributes' => array('class' => array('phone-extension')),
54         '#type' => 'textfield',
55         '#tag' => 'span',
56         '#default_value' => isset($address['phone_number_extension']) ? $address['phone_number_extension'] : '',
57       );
58     }
59     if (!$settings || isset($settings['mobile'])) {
60       $format['phone_block']['mobile_number'] = array(
61         '#title' => t('Mobile Number'),
62         '#size' => 15,
63         '#attributes' => array('class' => array('phone-number')),
64         '#type' => 'textfield',
65         '#tag' => 'div',
66         '#default_value' => isset($address['mobile_number']) ? $address['mobile_number'] : '',
67       );
68     }
69     if (!$settings || $settings['fax']) {
70       $format['phone_block']['fax_number'] = array(
71         '#title' => t('Fax Number'),
72         '#size' => 15,
73         '#attributes' => array('class' => array('phone-number')),
74         '#type' => 'textfield',
75         '#tag' => 'div',
76         '#default_value' => isset($address['fax_number']) ? $address['fax_number'] : '',
77       );
78     }
79   }

第 69 行 $settings['fax'] 改成 isset($settings['fax']) 即可.