Active
Project:
Commerce Core
Version:
7.x-1.4
Component:
Order
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
21 Jan 2013 at 18:23 UTC
Updated:
10 Jun 2016 at 11:02 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
jessepinho commentedHmmm, attachment didn't work. Trying again.
Comment #2
jessepinho commentedI updated this to use a valid e-mail address (using @example.com). Otherwise, orders can't be saved due to an invalid e-mail address.
Comment #3
rszrama commentedWow, I didn't even know this existed. I had the idea for a while that we should consider ways to sanitize sensitive information, including things like card on file references, payment gateway variables, billing addresses, etc. I didn't know there was a method for doing so. What is the recommended usage for this drush function, and is it already sanitizing the e-mail addresses of user profiles, too?
Comment #4
jessepinho commentedI just discovered it recently myself! It's great for setting up test instances of a site.
This hook allows you to register queries that will be executed after the source site's database has been imported to the target site. It is already sanitizing the e-mail addresses of user profiles in the format 'user+UID@localhost', which is the behavior I copied for orders until I realized that using '@localhost' prevents orders from being saved due to e-mail address format validation.
I've written a couple Drupal Commerce payment method modules (which I'll be posting to d.o as soon as my Git application is approved) which also hook into drush to switch to sandbox mode when using --sanitize. I'm thinking that's the best practice for sanitization of sensitive payment information. (You may want to sanitize customer profiles, too! Names/addresses/etc.)
Comment #5
rszrama commentedWhoa, dude - lemme know where your review is happening and I'll do what I can to pitch in on reviews to get you approved. : )
Comment #6
jessepinho commentedOK, one more modificaysh. This version doesn't change the e-mail addresses of orders where the mail field is already set to "" (blank).
Comment #7
nico.knaepen commentedYou could try using the https://www.drupal.org/project/scrambler module. This module scrambles/sanitizes data which you have defined. There is no UI module for commerce yet but it is possible to define which fields for which tables to scramble. Here's a code example of how to use the hooks.