Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
This is the only module in my stack that is forcing me to use the phone module which there has been limited development on for more than a year and a new D8 backported module telephone
https://www.drupal.org/project/telephone
Has made some progress and it would be nice if this was supported as well.
Proposed resolution
Remove the phone support and use module_exists() to check for either or.
Remaining tasks
User interface changes
API changes
Comment | File | Size | Author |
---|---|---|---|
#10 | remove_dependency_on-2416155-10.patch | 7.22 KB | joelpittet |
#10 | interdiff.txt | 4.71 KB | joelpittet |
#8 | commerce_beanstream-support-telephone-module-2416155-2.patch | 6.23 KB | spiderman |
#7 | Beanstream-OnlineMart-phone-optional.png | 34.24 KB | spiderman |
#4 | commerce_beanstream-support-telephone-module-2416155.patch | 1.79 KB | spiderman |
Comments
Comment #1
tklawsuc CreditAttribution: tklawsuc commentedjoelpittet did you do anything around this "issue" or did you just keep using the phone module?
Comment #2
joelpittetStill using it because of webform_phone as well.
Comment #3
spidermanIndeed, this is a relatively straightforward patch. I'd like to not depend on any telephone module at all, but the Beanstream side seems to require us to submit a phone number with a customer profile. Patch file forthcoming..
Comment #4
spidermanHere's a patch to add support for the telephone module.
Comment #5
spidermanComment #6
tklawsuc CreditAttribution: tklawsuc commentedspiderman, there is an option in beanstream to turn off phone dependency. In our case it's not required. I ended up creating a custom payment method in the Payment module as we were using the pay later feature as well.
Comment #7
spiderman@tklawsuc, thanks for the tip- I'd never found this setting before, as it's a little bit hidden from the TD OnlineMart interface I see it through (not sure if it's different for native Beanstream customers). Indeed, I tested making the phone field optional on the Payment Profile configuration, and adjusting the module to not send the phone number field, and everything worked fine. See attached screenshot for the exact setting I tweaked (the blue text to the right originally said "required", so I clicked it to "optional").
So this means that my patch is somewhat irrelevant, and we can indeed remove the phone/telephone module requirement entirely. That said, I'd like to retain the *option* of including a phone field, so I think I'll work on patching the module to allow the selection of a phone field if available (from either module), but ignore it if not.
In the meantime, I'm pretty confident my patch above works for either telephone or phone module :)
Comment #8
spidermanOk here's a first pass at a patch to make the phone field entirely optional. It basically consists of adding a few checks on the assumption that there will be a phone field at all, and including the value of the field (or not), as required.
I've only tested this *very* quickly, but I tried cases where there was a phone.module field, a telephone.module field, and no phone field at all. Provided the Beanstream settings match up, everything appears to work ok. Anyone else care to take this new patch for a spin and report back? ;)
Comment #9
joelpittetMay want to remove the phone dependency from the info file.
Maybe do a hook_requirements() if at least one is needed or not if it's optional all together which is cool too:)
This looks great though nice work @spiderman!
Comment #10
joelpittetCoding standard touchups and phone removed from info dependencies.
Comment #11
spidermanI've finally come back around to a thorough test of this patch, and tonight have committed @joelpittet's version- thanks for the cleanup!
Comment #13
spidermanThis is committed and rolled into new 2.0-alpha1 release.