silverstripe / silverstripe-versionfeed

Provides an RSS feed for global site changes
BSD 3-Clause "New" or "Revised" License
4 stars 13 forks source link

FIX Ensure page has extension before calling method #101

Closed emteknetnz closed 8 months ago

emteknetnz commented 8 months ago

Issue https://github.com/silverstripe/.github/issues/199

Fixes https://github.com/silverstripe/recipe-kitchen-sink/actions/runs/8058976456/job/22012645584?pr=55#step:12:73 on https://github.com/silverstripe/recipe-kitchen-sink/pull/55

1) DNADesign\ElementalUserForms\Tests\ElementFormControllerTest::testElementFormRendering BadMethodCallException: Object->__call(): the method 'getSiteRSSLink' does not exist on 'SilverStripe\UserForms\Control\UserDefinedFormController'

Happened because we removed the cwp versionfeed config which disabled versionfeed.

The elemental userforms tests has the controller extension appied by not the page extension appied, so have just added a little defensive programming here to resolve. It's required for a cms 6 build though may as well fix for 4.13