The attached patch converts order statuses from a database table into configuration entities.

There are still some legacy calls to uc_order_status_list() which need to be cleaned up before it can be removed, and the reports still refer to the now-removed table, but they don't work at the moment anyway.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

longwave’s picture

Issue summary: View changes

Status: Needs review » Needs work

The last submitted patch, order-status-config-entity.patch, failed testing.

longwave’s picture

Status: Needs work » Needs review
FileSize
39.17 KB
longwave’s picture

FileSize
41.53 KB

Added some more tests.

TR’s picture

I like the idea.

longwave’s picture

FileSize
42.73 KB
4.59 KB

This patch converts the remaining calls and removes uc_order_status_list().

longwave’s picture

FileSize
48.02 KB
8.76 KB

This patch converts uc_order_state_list() to uc_order_state_options_list() and removes the concept of "order state scopes", which were used to identify "active" order statuses in a non-intuitive way; they were never previously documented. Active orders are now identified by order status weight instead, this is documented in hook_help.

longwave’s picture

FileSize
48.28 KB
1.49 KB

This patch converts UcOrder's order_status property to be an entity reference instead of a string.

longwave’s picture

There are some followups to this, like removing uc_order_update_status(), converting the uc_state_*_default variables to CMI and possibly converting hook_uc_order_state() to YAML, but I think they are out of scope here and should be dealt with separately. Otherwise I think this is ready to commit? As this is our first real entity conversion for D8 any comments or questions welcome.

longwave’s picture

FileSize
10.94 KB
2.18 KB

Committed #8.

Two further patches attached, to remove uc_order_update_status() and convert uc_state_* to CMI.

The last submitted patch, 10: remove-uc_order_update_status.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 10: uc_order-state-default-cmi.patch, failed testing.

longwave’s picture

longwave’s picture

Status: Needs work » Needs review

The last submitted patch, 10: remove-uc_order_update_status.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 10: uc_order-state-default-cmi.patch, failed testing.

longwave’s picture

Status: Needs work » Needs review
FileSize
10.93 KB
longwave’s picture

The last submitted patch, 10: uc_order-state-default-cmi.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 17: remove-uc_order_update_status.patch, failed testing.

longwave’s picture

Status: Needs work » Needs review
FileSize
2.11 KB
longwave’s picture

FileSize
10.92 KB
longwave’s picture

Status: Needs review » Fixed

All patches have been committed, this work is complete.

Status: Fixed » Closed (fixed)

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