silvershop / silvershop-core

SilverShop is an e-commerce shopping cart module for the SilverStripe CMS
http://silvershop.github.io
BSD 2-Clause "Simplified" License
113 stars 119 forks source link

Silverstripe 5 support #789

Closed elliot-sawyer closed 1 year ago

elliot-sawyer commented 1 year ago

I've started the work to upgrade this module to Silverstripe 5 and have managed it with very few changes required.

It's not mergeable as-is unless you add my forks to the repositories key to your parent project (composer seems to ignore the upstream ones). The pull requests need to be accepted, so I can update this pull request to use a stable tag, or a specific commit until it is marked stable

    "repositories": {
        "silvershop/core": {
            "type": "vcs",
            "url": "git@github.com:elliot-sawyer/silvershop-core.git"
        },
        "silvershop/silverstripe-listsorter": {
            "type": "vcs",
            "url": "git@github.com:elliot-sawyer/silverstripe-listsorter.git"
        },
        "silvershop/silverstripe-sqlquerylist": {
            "type": "vcs",
            "url": "git@github.com:elliot-sawyer/silverstripe-sqlquerylist.git"
        }
    },

The only coding change required was on sqlquerylist, which changed the method signature on limit to support type hinting and return types. There may be more to be checked inside the tests, but I haven't gone into those.

Once those upstream dependencies are merged in, this should be safe to merge

elliot-sawyer commented 1 year ago

Unrelated to the above, when I tried to install silvershop/silverstripe-hasonefield it results in a 500 error when adding it to a DataObject's CMS fields (I think it was Order). That was in a DataExtension so quite possible I was doing something wrong