Needs work
Project:
Commerce Core
Version:
8.x-2.x-dev
Component:
Order
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
29 Sep 2016 at 17:08 UTC
Updated:
4 Oct 2016 at 14:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
steveoliver commentedUpdate issue summary.
Comment #3
steveoliver commentedAdded GitHub WIP PR link.
Comment #4
steveoliver commentedAdding patch with passing test (other job failure unrelated).
Comment #5
bojanz commentedThe current implementation has a security hole: it works regardless of whether email confirmation is enabled.
So if email confirmation is disabled, I can register using another person's email address and get access to their orders.
Another problem is that it doesn't use CartAssignment (since it's cart specific), but the implementation in the hook is incomplete (it won't move the customer profile, for example). So I've refactored CartAssignment to allow this code to use it: #2811085: Refactor CartAssignment into an OrderAssignment class.
After discussing this with Ryan and Matt, we agreed that this should be documented as a recipe in our docs.
It's not generic enough to be used on all sites, and sites might want to tweak it based on their own business rules (only convert incomplete orders, only complete orders younger than 6 months, etc).
So, let's add a check for the email confirmation (return early if it's off), I'll then transfer the code from here into the documentation.