silverstripe / silverstripe-dms

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

Deprecation Notice in SS3.6.6 #213

Closed mspacemedia closed 5 years ago

mspacemedia commented 6 years ago

I'm sure you all know, but the current version produces this error when viewing a page in the sitetree under 3.6.6 under dev conditions.

[User Deprecated] DMSSiteTreeExtension->getDocumentSets is deprecated. Use DocumentSets() instead. Called from call_user_func_array.


DMSSiteTreeExtension.php:64
DMSSiteTreeExtension->getDocumentSets() 
call_user_func_array(Array,Array) 
Object.php:749
Object->__call(getDocumentSets,Array) 
ViewableData.php:120
Page->getDocumentSets() 
ViewableData.php:120
ViewableData->__get(DocumentSets) 
Form.php:1433```
robbieaverill commented 6 years ago

Deprecating APIs is fine, but if we are still using them then we need to fix it

mspacemedia commented 6 years ago

Well, that's true but it gets called by the framework in 3.6.6 here: ViewableData->__get(DocumentSets)

Not quite sure how one would go about fixing this issue to be honest.

dhensby commented 6 years ago

That's not really where it gets called. it's either called like this: $obj->DocumentSets or in a template as $DocumentSets. Do you have the full stacktrace?

NightJar commented 6 years ago

Error:

Don't use getDocumentSets Do use DocumentSets

Stacktrace: does reference DocumentSets (sans 'get' prefix) ViewableData->__get(DocumentSets)

Problem: get{$thatThing} is the first check to call https://github.com/silverstripe/silverstripe-framework/blob/3.6.6/view/ViewableData.php#L119

Relevant: deprecation added as resolution of 500 server error. https://github.com/silverstripe/silverstripe-dms/pull/206#discussion_r179969551

robbieaverill commented 6 years ago

To be honest, this was a mistake on our part in using the getter originally, then being asked to stop using so deprecating it for the sake of not breaking semantic versioning by removing it completely. I guess we need to just remove it altogether and break it for sake of it.

NightJar commented 6 years ago

There is no version 3 at current, so besides the reasonably trivial nature of the change, I don't see the cause for resistance to a new major version.

ScopeyNZ commented 5 years ago

Unfortunately, SilverStripe 3 has entered limited support in June 2018. This means we'll only be fixing critical bugs and security issues for SilverStripe 3 going forward.

You can read the SilverStripe Roadmap for more information on our support commitments.