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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tklawsuc’s picture

joelpittet did you do anything around this "issue" or did you just keep using the phone module?

joelpittet’s picture

Still using it because of webform_phone as well.

spiderman’s picture

Assigned: Unassigned » spiderman

Indeed, 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..

spiderman’s picture

Here's a patch to add support for the telephone module.

spiderman’s picture

Status: Active » Needs review
tklawsuc’s picture

spiderman, 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.

spiderman’s picture

Status: Needs review » Needs work
FileSize
34.24 KB

@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 :)

spiderman’s picture

Status: Needs work » Needs review
FileSize
6.23 KB

Ok 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? ;)

joelpittet’s picture

May 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!

joelpittet’s picture

Coding standard touchups and phone removed from info dependencies.

spiderman’s picture

Status: Needs review » Reviewed & tested by the community

I've finally come back around to a thorough test of this patch, and tonight have committed @joelpittet's version- thanks for the cleanup!

  • spiderman committed 4867157 on 7.x-2.x authored by joelpittet
    Issue #2416155 by spiderman, joelpittet: Remove dependency on phone...
spiderman’s picture

Status: Reviewed & tested by the community » Fixed

This is committed and rolled into new 2.0-alpha1 release.

Status: Fixed » Closed (fixed)

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