Merge pull request #1176 from creative-commoners/pulls/5/depr-messages

API Update deprecations
This commit is contained in:
Guy Sartorelli 2022-11-21 09:58:42 +13:00 committed by GitHub
commit f3f23351a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -2,6 +2,7 @@
namespace SilverStripe\UserForms\Model; namespace SilverStripe\UserForms\Model;
use SilverStripe\Dev\Deprecation;
use SilverStripe\CMS\Controllers\CMSMain; use SilverStripe\CMS\Controllers\CMSMain;
use SilverStripe\CMS\Controllers\CMSPageEditController; use SilverStripe\CMS\Controllers\CMSPageEditController;
use SilverStripe\Control\Controller; use SilverStripe\Control\Controller;
@ -650,12 +651,13 @@ class EditableFormField extends DataObject
/** /**
* Returns the Title for rendering in the front-end (with XML values escaped) * Returns the Title for rendering in the front-end (with XML values escaped)
* *
* @deprecated 5.0..6.0 XML is automatically escaped in templates from SS 4 onwards. Please use $Title directly. * @deprecated 4.12.0 Use $Title directly instead
* *
* @return string * @return string
*/ */
public function getEscapedTitle() public function getEscapedTitle()
{ {
Deprecation::notice('4.12.0', 'Use $Title directly instead');
return Convert::raw2xml($this->Title); return Convert::raw2xml($this->Title);
} }
@ -945,10 +947,11 @@ class EditableFormField extends DataObject
* Determine effective display rules for this field. * Determine effective display rules for this field.
* *
* @return SS_List * @return SS_List
* @deprecated 5.6 No longer needed because of support for conditional required field. * @deprecated 5.6.0 Will be removed without equivalent functionality to replace it
*/ */
public function EffectiveDisplayRules() public function EffectiveDisplayRules()
{ {
Deprecation::notice('5.6.0', 'Will be removed without equivalent functionality to replace it');
if ($this->Required) { if ($this->Required) {
return ArrayList::create(); return ArrayList::create();
} }

View File

@ -2,6 +2,7 @@
namespace SilverStripe\UserForms\Model\EditableFormField; namespace SilverStripe\UserForms\Model\EditableFormField;
use SilverStripe\Dev\Deprecation;
use SilverStripe\Core\Convert; use SilverStripe\Core\Convert;
use SilverStripe\ORM\DataObject; use SilverStripe\ORM\DataObject;
use SilverStripe\Security\Member; use SilverStripe\Security\Member;
@ -70,11 +71,12 @@ class EditableOption extends DataObject
} }
/** /**
* @deprecated 5.0..6.0 Use "$Title" in templates instead * @deprecated 5.0.0 Use $Title in templates instead
* @return string * @return string
*/ */
public function getEscapedTitle() public function getEscapedTitle()
{ {
Deprecation::notice('5.0.0', 'Use $Title in templates instead');
return Convert::raw2xml($this->Title); return Convert::raw2xml($this->Title);
} }