silverstripe / silverstripe-dms

Adds a Document Management System to Silverstripe
BSD 3-Clause "New" or "Revised" License
40 stars 52 forks source link

Deprecated getDocumentSets() method called in CMS #208

Closed AndrewHaine closed 6 years ago

AndrewHaine commented 6 years ago

DMS Version 2.2.0

When visiting a page with document sets in the CMS the deprecation notice is shown - looks like this is a result of the way ViewableData automatically prepends 'get' when retrieving properties:

// ViewableData.php line 119
if (strtolower($property) !== 'field' && $this->hasMethod($method = "get$property"))
NightJar commented 6 years ago

Thanks for reporting @AndrewHaine In order for a deprecation notice to be displayed, your site must be configured into dev mode, which is generally unadvisable for production sites.

The method was deprecated recently (in https://github.com/silverstripe/silverstripe-dms/pull/206) to fix a 500 error related to the magic lookup you're referring to in ViewableData (infinite recursion).

If you'd like to disable deprecation notices in your development environment you can choose to either:

You can see from the calltime check at https://github.com/silverstripe/silverstripe-framework/blob/3.6/dev/Deprecation.php#L138