Closed (fixed)
Project:
Address Field Phone
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
20 Dec 2012 at 07:44 UTC
Updated:
3 Dec 2018 at 11:51 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
kvoltz commentedAny progress with this? This would be a great feature to add.
Comment #2
svouthi commentedI am interested in this basic functionality also.
Comment #3
sketman commentedI would welcome this feature too...
Comment #4
svouthi commentedI went ahead and installed Field Group and Commerce Fieldgroup Panes (since my use case is with Commerce), and created fields as mentioned in this comment, making the phone number field required. Granted, this field has no special formatting, but it is adequate for my needs at present.
Comment #5
jcisio commentedFWIW it's quite easy to make phone number required with something like this:
or even better, in some case:
Comment #6
jawi commentedThanks jcisio for your input. Do you place this adjustment in a custom module or in the Address Field Phone module?
Comment #7
jcisio commentedFinally I think it does not worth adding this feature that will make the UI having too many options.
Comment #8
millionleaves commentedThanks to jcisio for the code in #5; this gave me what I wanted. A couple of additional observations for someone looking to use it:
It's a shame this functionality won't be added to the Address Field Phone module, but it's clear the UI would get pretty messy once the scenarios outlined in the 3rd and 4th points are taken into account.
Comment #9
tuchoI attached a patch that add this feature to the module.
It replaces each checkbox for the available fields with a select with 3 states:
I keep the default behavior, so if all the fields are hidden, the four fields are shown in the address form.
I have merged the patch from #2481897: Undefined index in addressfield_format_phone_generate() to avoid some warnings when a field is not selected.
Comment #10
socialnicheguru commentedComment #11
jcisio commentedThe other issue is fixed, patch needs reroll.
Comment #12
damienmckennaRerolled.
Comment #13
damienmckennaFYI the other issue didn't completely fix the problem with missing variables, so this should cover it.
Comment #14
socialnicheguru commentedhttps://www.drupal.org/node/2689889
Comment #15
aporieSo,
None of the solutions above work for me :
1) Patch apply to 7.x-1.3 version and not dev version with the following command (I'm saying it because took me a while to figure it out) :
patch -p1 < thepatch.patchwith the patch in the root folder of addressfield_phone.2) Patch even if patching process worked did nothing .... (didn't see any change, none select list for the checkbox as described in #9)
3)#5 also didn't work with the folowing :
4) Probably all of that come from me because I'm not a php dev, but still, here are my feedbacks.
Comment #16
tuchoPatch re rolled for current 7.x-1.x dev version!
Comment #17
aporieIs there something I have to know, like this patch apply to new fields or whatever ?
Because I'm sorry but still no change ... I'm sorry to annoy you with that.
[edit] So it bother me so much that I directly edited the module files :
In phone.inc, just remove conditionnal directives on the field you want to make required :
'#required' => (!empty($settings['extension']) && $settings['extension'] == 'required'),Into :
Comment #18
mbreden commented#5 didn't work for me, however this did.
Comment #19
stijnbousard commentedPatch #16 is exactly what I need! Thanks!
Comment #20
philsward commented#16 worked beautifully against 1.4. Unless there's a reason to change how the UX works, (I think it's fine for intended purposes) I'd say let's get this committed.
Comment #21
jcisio commentedPatch looks good. The UI is less clumsy than I thought. Thanks all. Committed and pushed.
Comment #24
no sssweat commentedThis still isn't available in the latest stable version.
Time to release a new version? 7.x-1.5 ?