silverstripe / silverstripe-sharedraftcontent

Share draft page content with non-CMS users
BSD 3-Clause "New" or "Revised" License
21 stars 28 forks source link

FIX Handle edge case where controller does not have a url_segment defined #75

Closed raissanorth closed 6 years ago

raissanorth commented 6 years ago

Because the share draft content controller extension is applied to the base Controller class (which doesn't have a url_segment), this can throw errors in other modules particularly when running unit tests.

We can check that it has a url_segment (happy path) to avoid this.

Also replace deprecated code.