silvercommerce / orders-admin

Admin for managing invoices and estimates in the Silverstripe Admin
BSD 3-Clause "New" or "Revised" License
1 stars 2 forks source link

CMS 5 Compatibility #3

Open catharsisjelly opened 1 year ago

catharsisjelly commented 1 year ago

I'd like to use this within SS v5. having had a quick look into what is involved I thought it best to create an issue for this change. For this to work with v5 we are going to have check/update the modules it requires to also work with v5. I've put an initial list of them below to keep track of if that is helpful

Main requirements

Dev requirements

Other Associated modules that need updating

If any of the modules mentioned are updated I suggest we strikethrough them in this post (I'm happy to handle that) and create comments with linked PR's (if applicable)

Suggestions welcome

catharsisjelly commented 1 year ago

Tax-Admin PR - https://github.com/silvercommerce/tax-admin/pull/1

catharsisjelly commented 1 year ago

I have been digging and might have come across an issue. it seems as though we might have a circular reference which is a little strange.

This package uses silvercommerce/stock in dev and that module uses this one. It might be a good idea to figure out why this is (I've not looked yet) and maybe there is a separate component that could be made to resolve this circular reference.

Having had a quick look through the code I can't see anything that is referencing SilverCommerce\Stock so maybe it's not a dev requirement anymore?

mlewis-everley commented 1 year ago

Hi Chris,

I haven’t looked into SS5 in too much detail… After 3 > 4 I have been trying to avoid it!! 😭

The stock dependency is due to a LineItem (and relevant factory) being able to check stock (if support is available) and the LineItem test performs this check.

It may be possible to move this code into the Stock module, but I am not sure the best way to retain the stock check in LineItemFactory if this is the case?

Also, it might be worth you noting there are development versions of this module and catalogue-admin (and probably a few others) that adds proper versioning to products and links line items to products via the version (to get archived pricing, etc).

We are testing this version on a few small sites and it works pretty well (but has a few bugs).

Might be worth you making sure you are working from the most recent development versions?

mlewis-everley commented 1 year ago

Also, I haven’t looked into if there are better versions of Versionhistory field out there. The code SS one is pretty good, but I don’t think we should be able to roll back an order to a previous state (that seems like a bad idea to me)?