silverstripe / silverstripe-redirectedurls

Silverstripe module to let users to configure arbitrary redirections in the CMS
BSD 3-Clause "New" or "Revised" License
32 stars 48 forks source link

Add support for Silverstripe 5. Update property/return types #88

Closed chrispenny closed 1 year ago

chrispenny commented 1 year ago

New major

This will need to be tagged as version ^3. I have created a new 2 branch, which we can use for ongoing support for Silverstripe 4.

Removal of setter methods

Removed the following methods from RedirectedURL:

Replaced them with a more explicit onBeforeWrite(). For me, this removes some of the "magic" that is not obvious to anyone (including me) who is not familiar with the setter/getter magic method paradigm.

There is also a regression in Silverstripe 5: https://github.com/silverstripe/silverstripe-framework/issues/10707

The removal of these methods means that we are not going to be affected by this.

Methods removed

RedirectedURLHandler had two classes that were not being directly used, and can instead be directly accessed through the new Support classes.

Updated API

Updated property and return types wherever possible.

Trailing slashes

Trailing slashes for URLs is now configurable in Silverstripe 5, and the default is that they are disabled. Updated unit tests accordingly.