For example I have 2 commerce_order bundles:
And I need have order numbers like [date:custom:Y]-{id} (like 2014-1) for both of them. And {id} not order_id, it's real id of invoice or of order.
And in this case I can have order_number 2014-1 for both. And in this case I see:
DatabaseTransactionOutOfOrderException: in DatabaseConnection->rollback() (line 1059 of /var/www/erpal3/www/includes/database/database.inc).
So added logic for order_number which can be unique only for commerce_order type.
This not change default logic of commerce but gives possibility to works with different commerce order bundles.
Comments
Comment #1
rszrama commentedThis looks like it'd work fine for you given your use case, but I'm going to hold off on any schema level changes like this until 2.x. In 1.x we decided to support the possibility of multiple order types without developing the concept any further in core, and changes to this would affect sites with potentially hundreds of thousands / millions of order rows that could fail on update. Best not to rock that boat. : )
Comment #2
alexshipilov commentedrerolled the patch
Comment #3
alexshipilov commentedfixed some mistakes in rerolled patch
Comment #4
alexshipilov commentedrerolled
Comment #5
alexshipilov commentedwrong extention
Comment #6
andrewsizz commentedThis patch doesn't works on MyISAM, because on installation we have error:
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes.
In Next patch this error fixed.
Comment #7
ugintl commentedWhich patch is working?
Comment #8
ugintl commentedTesting
Comment #9
ugintl commentedComment #10
ugintl commentedComment #11
ugintl commentedComment #12
ugintl commentedComment #13
bojanz commented2.x supports order types properly, it's too late to change this API in 1.x.