From 206a4e943271efcd9f85b653a1f9e3f1f49c6f26 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Wed, 17 Apr 2019 14:55:57 +0200 Subject: [PATCH] EZP-30281: Added deprecation info to Core RichText FT namespace (#2602) * Deprecated eZ\Publish\Core\FieldType namespace * Added E_USER_DEPRECATED warning to log deprecation * [Doc] Marked eZ\Publish\Core\FieldType\RichText as deprecated in FieldType README * [Doc] Added info, to 7.4 changes doc, that eZ\Publish\Core\FieldType\RichText is deprecated --- doc/bc/changes-7.4.md | 6 ++++++ eZ/Publish/Core/FieldType/RichText/Converter.php | 2 ++ .../Core/FieldType/RichText/Converter/Aggregate.php | 2 ++ eZ/Publish/Core/FieldType/RichText/Converter/Link.php | 3 +++ .../FieldType/RichText/Converter/ProgramListing.php | 2 ++ .../Core/FieldType/RichText/Converter/Render.php | 2 ++ .../Core/FieldType/RichText/Converter/Render/Embed.php | 2 ++ .../FieldType/RichText/Converter/Render/Template.php | 2 ++ eZ/Publish/Core/FieldType/RichText/Converter/Xslt.php | 2 ++ .../Core/FieldType/RichText/ConverterDispatcher.php | 2 ++ .../Core/FieldType/RichText/CustomTagsValidator.php | 2 ++ .../Core/FieldType/RichText/InternalLinkValidator.php | 2 ++ eZ/Publish/Core/FieldType/RichText/Normalizer.php | 2 ++ .../Core/FieldType/RichText/Normalizer/Aggregate.php | 2 ++ .../RichText/Normalizer/DocumentTypeDefinition.php | 2 ++ eZ/Publish/Core/FieldType/RichText/README.md | 8 ++++++++ .../Core/FieldType/RichText/RendererInterface.php | 2 ++ .../FieldType/RichText/RichTextStorage/Gateway.php | 2 ++ eZ/Publish/Core/FieldType/RichText/SearchField.php | 2 ++ eZ/Publish/Core/FieldType/RichText/Type.php | 10 ++++++++++ eZ/Publish/Core/FieldType/RichText/Validator.php | 2 ++ .../Core/FieldType/RichText/ValidatorDispatcher.php | 2 ++ eZ/Publish/Core/FieldType/RichText/Value.php | 2 ++ eZ/Publish/Core/FieldType/RichText/XmlBase.php | 2 ++ 24 files changed, 67 insertions(+) diff --git a/doc/bc/changes-7.4.md b/doc/bc/changes-7.4.md index 860bbcaed65..3a4a07100cc 100644 --- a/doc/bc/changes-7.4.md +++ b/doc/bc/changes-7.4.md @@ -12,3 +12,9 @@ Changes affecting version compatibility with former or future versions. Passing translations in all languages is no longer needed, all you have to do is pass language version you wish to modify. * New method `\eZ\Publish\API\Repository\ContentTypeService::removeContentTypeTranslation` is introduced. + +## Deprecations + +* `eZ\Publish\Core\FieldType\RichText` namespace has been deprecated and will be removed in 8.0. + + Enable [eZ Platform RichText Bundle](https://github.com/ezsystems/ezplatform-richtext) instead. diff --git a/eZ/Publish/Core/FieldType/RichText/Converter.php b/eZ/Publish/Core/FieldType/RichText/Converter.php index ee42b3e21f0..8683e942d26 100644 --- a/eZ/Publish/Core/FieldType/RichText/Converter.php +++ b/eZ/Publish/Core/FieldType/RichText/Converter.php @@ -12,6 +12,8 @@ /** * Interface for rich text conversion. + * + * @deprecated since 7.4, use \EzSystems\EzPlatformRichText\eZ\RichText\Converter from EzPlatformRichTextBundle. */ interface Converter { diff --git a/eZ/Publish/Core/FieldType/RichText/Converter/Aggregate.php b/eZ/Publish/Core/FieldType/RichText/Converter/Aggregate.php index 9462de70b3c..15349d788de 100644 --- a/eZ/Publish/Core/FieldType/RichText/Converter/Aggregate.php +++ b/eZ/Publish/Core/FieldType/RichText/Converter/Aggregate.php @@ -13,6 +13,8 @@ /** * Aggregate converter converts using configured converters in prioritized order. + * + * @deprecated since 7.4, use \EzSystems\EzPlatformRichText\eZ\RichText\Converter\Aggregate from EzPlatformRichTextBundle. */ class Aggregate implements Converter { diff --git a/eZ/Publish/Core/FieldType/RichText/Converter/Link.php b/eZ/Publish/Core/FieldType/RichText/Converter/Link.php index e91b4315e65..8133fc43535 100644 --- a/eZ/Publish/Core/FieldType/RichText/Converter/Link.php +++ b/eZ/Publish/Core/FieldType/RichText/Converter/Link.php @@ -19,6 +19,9 @@ use DOMDocument; use DOMXPath; +/** + * @deprecated since 7.4, use \EzSystems\EzPlatformRichText\eZ\RichText\Converter\Link from EzPlatformRichTextBundle. + */ class Link implements Converter { /** diff --git a/eZ/Publish/Core/FieldType/RichText/Converter/ProgramListing.php b/eZ/Publish/Core/FieldType/RichText/Converter/ProgramListing.php index 408a142a866..2c03173d504 100644 --- a/eZ/Publish/Core/FieldType/RichText/Converter/ProgramListing.php +++ b/eZ/Publish/Core/FieldType/RichText/Converter/ProgramListing.php @@ -16,6 +16,8 @@ * Class ProgramListing. * * Processes programlisting DocBook tag. + * + * @deprecated since 7.4, use \EzSystems\EzPlatformRichText\eZ\RichText\Converter\ProgramListing from EzPlatformRichTextBundle. */ class ProgramListing implements Converter { diff --git a/eZ/Publish/Core/FieldType/RichText/Converter/Render.php b/eZ/Publish/Core/FieldType/RichText/Converter/Render.php index 29f4bb8f4f1..b9243476d40 100644 --- a/eZ/Publish/Core/FieldType/RichText/Converter/Render.php +++ b/eZ/Publish/Core/FieldType/RichText/Converter/Render.php @@ -14,6 +14,8 @@ /** * Base class for Render converters. + * + * @deprecated since 7.4, use \EzSystems\EzPlatformRichText\eZ\RichText\Converter\Render from EzPlatformRichTextBundle. */ abstract class Render { diff --git a/eZ/Publish/Core/FieldType/RichText/Converter/Render/Embed.php b/eZ/Publish/Core/FieldType/RichText/Converter/Render/Embed.php index 089df913b9d..9a642866f35 100644 --- a/eZ/Publish/Core/FieldType/RichText/Converter/Render/Embed.php +++ b/eZ/Publish/Core/FieldType/RichText/Converter/Render/Embed.php @@ -17,6 +17,8 @@ /** * RichText Embed converter injects rendered embed payloads into embed elements. + * + * @deprecated since 7.4, use \EzSystems\EzPlatformRichText\eZ\RichText\Converter\Render\Embed from EzPlatformRichTextBundle. */ class Embed extends Render implements Converter { diff --git a/eZ/Publish/Core/FieldType/RichText/Converter/Render/Template.php b/eZ/Publish/Core/FieldType/RichText/Converter/Render/Template.php index 770f5344471..6e8238bd24f 100644 --- a/eZ/Publish/Core/FieldType/RichText/Converter/Render/Template.php +++ b/eZ/Publish/Core/FieldType/RichText/Converter/Render/Template.php @@ -20,6 +20,8 @@ /** * RichText Template converter injects rendered template payloads into template elements. + * + * @deprecated since 7.4, use \EzSystems\EzPlatformRichText\eZ\RichText\Converter\Render\Template from EzPlatformRichTextBundle. */ class Template extends Render implements Converter { diff --git a/eZ/Publish/Core/FieldType/RichText/Converter/Xslt.php b/eZ/Publish/Core/FieldType/RichText/Converter/Xslt.php index 8a87f1c94f3..3ee5c32a1bc 100644 --- a/eZ/Publish/Core/FieldType/RichText/Converter/Xslt.php +++ b/eZ/Publish/Core/FieldType/RichText/Converter/Xslt.php @@ -17,6 +17,8 @@ /** * Converts DOMDocument objects using XSLT stylesheets. + * + * @deprecated since 7.4, use \EzSystems\EzPlatformRichText\eZ\RichText\Converter\Xslt from EzPlatformRichTextBundle. */ class Xslt extends XmlBase implements Converter { diff --git a/eZ/Publish/Core/FieldType/RichText/ConverterDispatcher.php b/eZ/Publish/Core/FieldType/RichText/ConverterDispatcher.php index ca96dff1e3e..84df9d18423 100644 --- a/eZ/Publish/Core/FieldType/RichText/ConverterDispatcher.php +++ b/eZ/Publish/Core/FieldType/RichText/ConverterDispatcher.php @@ -13,6 +13,8 @@ /** * Dispatcher for various converters depending on the XML document namespace. + * + * @deprecated since 7.4, use \EzSystems\EzPlatformRichText\eZ\RichText\ConverterDispatcher from EzPlatformRichTextBundle. */ class ConverterDispatcher { diff --git a/eZ/Publish/Core/FieldType/RichText/CustomTagsValidator.php b/eZ/Publish/Core/FieldType/RichText/CustomTagsValidator.php index 4130ed570e7..7ca3b93be16 100644 --- a/eZ/Publish/Core/FieldType/RichText/CustomTagsValidator.php +++ b/eZ/Publish/Core/FieldType/RichText/CustomTagsValidator.php @@ -16,6 +16,8 @@ * * The Validator checks if the given XML reflects proper Custom Tags configuration, * mostly existence of specific Custom Tag and its required attributes. + * + * @deprecated since 7.4, use \EzSystems\EzPlatformRichText\eZ\RichText\Validator\CustomTagsValidator from EzPlatformRichTextBundle. */ class CustomTagsValidator { diff --git a/eZ/Publish/Core/FieldType/RichText/InternalLinkValidator.php b/eZ/Publish/Core/FieldType/RichText/InternalLinkValidator.php index 6b4d827bcf5..5b84385b380 100644 --- a/eZ/Publish/Core/FieldType/RichText/InternalLinkValidator.php +++ b/eZ/Publish/Core/FieldType/RichText/InternalLinkValidator.php @@ -16,6 +16,8 @@ /** * Validator for RichText internal format links. + * + * @deprecated since 7.4, use \EzSystems\EzPlatformRichText\eZ\RichText\Validator\InternalLinkValidator from EzPlatformRichTextBundle. */ class InternalLinkValidator { diff --git a/eZ/Publish/Core/FieldType/RichText/Normalizer.php b/eZ/Publish/Core/FieldType/RichText/Normalizer.php index 42f3fb72931..2b4e41eb163 100644 --- a/eZ/Publish/Core/FieldType/RichText/Normalizer.php +++ b/eZ/Publish/Core/FieldType/RichText/Normalizer.php @@ -10,6 +10,8 @@ /** * Abstract class for XML normalization of string input. + * + * @deprecated since 7.4, use \EzSystems\EzPlatformRichText\eZ\RichText\Normalizer from EzPlatformRichTextBundle. */ abstract class Normalizer { diff --git a/eZ/Publish/Core/FieldType/RichText/Normalizer/Aggregate.php b/eZ/Publish/Core/FieldType/RichText/Normalizer/Aggregate.php index 6a92ce52c48..11f9894f4e1 100644 --- a/eZ/Publish/Core/FieldType/RichText/Normalizer/Aggregate.php +++ b/eZ/Publish/Core/FieldType/RichText/Normalizer/Aggregate.php @@ -12,6 +12,8 @@ /** * Aggregate normalizer converts using configured normalizers in prioritized order. + * + * @deprecated since 7.4, use \EzSystems\EzPlatformRichText\eZ\RichText\Normalizer\Aggregate from EzPlatformRichTextBundle. */ class Aggregate extends Normalizer { diff --git a/eZ/Publish/Core/FieldType/RichText/Normalizer/DocumentTypeDefinition.php b/eZ/Publish/Core/FieldType/RichText/Normalizer/DocumentTypeDefinition.php index ca5fffc1fea..2dec49603ee 100644 --- a/eZ/Publish/Core/FieldType/RichText/Normalizer/DocumentTypeDefinition.php +++ b/eZ/Publish/Core/FieldType/RichText/Normalizer/DocumentTypeDefinition.php @@ -16,6 +16,8 @@ * namespace. * * Note: if input already contains DTD it won't be accepted for normalization. + * + * @deprecated since 7.4, use \EzSystems\EzPlatformRichText\eZ\RichText\Normalizer\DocumentTypeDefinition from EzPlatformRichTextBundle. */ class DocumentTypeDefinition extends Normalizer { diff --git a/eZ/Publish/Core/FieldType/RichText/README.md b/eZ/Publish/Core/FieldType/RichText/README.md index 94ba74748cd..7ce55f08217 100644 --- a/eZ/Publish/Core/FieldType/RichText/README.md +++ b/eZ/Publish/Core/FieldType/RichText/README.md @@ -1,5 +1,13 @@ # RichText field type for eZ Platform +*** +**NOTE**: As of eZ Platform v2.4 the entire `eZ\Publish\Core\FieldType\RichText` namespace +is deprecated. + +Use `\EzSystems\EzPlatformRichTextBundle\EzPlatformRichTextBundle` provided by the +[`ezsystems/ezplatform-richtext`](https://github.com/ezsystems/ezplatform-richtext) package instead. +*** + This is the RichText field type for eZ Platform, it's a field type for supporting rich formatted text stored in a structured xml format. diff --git a/eZ/Publish/Core/FieldType/RichText/RendererInterface.php b/eZ/Publish/Core/FieldType/RichText/RendererInterface.php index 11808ab7a3f..0481c6ac352 100644 --- a/eZ/Publish/Core/FieldType/RichText/RendererInterface.php +++ b/eZ/Publish/Core/FieldType/RichText/RendererInterface.php @@ -10,6 +10,8 @@ /** * RichText field type renderer interface, to be implemented in MVC layer. + * + * @deprecated since 7.4, use \EzSystems\EzPlatformRichText\eZ\RichText\RendererInterface from EzPlatformRichTextBundle. */ interface RendererInterface { diff --git a/eZ/Publish/Core/FieldType/RichText/RichTextStorage/Gateway.php b/eZ/Publish/Core/FieldType/RichText/RichTextStorage/Gateway.php index 4c4874d4ac4..26228f9d24d 100644 --- a/eZ/Publish/Core/FieldType/RichText/RichTextStorage/Gateway.php +++ b/eZ/Publish/Core/FieldType/RichText/RichTextStorage/Gateway.php @@ -14,6 +14,8 @@ /** * Abstract gateway class for RichText type. * Handles data that is not directly included in raw XML value from the field (i.e. URLs). + * + * @deprecated since 7.4, use \EzSystems\EzPlatformRichText\eZ\FieldType\RichText\RichTextStorage\Gateway from EzPlatformRichTextBundle. */ abstract class Gateway extends StorageGateway { diff --git a/eZ/Publish/Core/FieldType/RichText/SearchField.php b/eZ/Publish/Core/FieldType/RichText/SearchField.php index ec7f57b4126..f4dcdc20d1c 100644 --- a/eZ/Publish/Core/FieldType/RichText/SearchField.php +++ b/eZ/Publish/Core/FieldType/RichText/SearchField.php @@ -17,6 +17,8 @@ /** * Indexable definition for RichText field type. + * + * @deprecated since 7.4, use \EzSystems\EzPlatformRichText\eZ\FieldType\RichText\SearchField from EzPlatformRichTextBundle. */ class SearchField implements Indexable { diff --git a/eZ/Publish/Core/FieldType/RichText/Type.php b/eZ/Publish/Core/FieldType/RichText/Type.php index 03ce548f8f8..1308b20dcd3 100644 --- a/eZ/Publish/Core/FieldType/RichText/Type.php +++ b/eZ/Publish/Core/FieldType/RichText/Type.php @@ -22,6 +22,8 @@ /** * RichText field type. + * + * @deprecated since 7.4, use \EzSystems\EzPlatformRichText\eZ\FieldType\RichText\Type from EzPlatformRichTextBundle. */ class Type extends FieldType { @@ -71,6 +73,14 @@ public function __construct( InternalLinkValidator $internalLinkValidator = null, CustomTagsValidator $customTagsValidator = null ) { + @trigger_error( + sprintf( + '%s is deprecated since eZ Platform v2.4, enable RichTextBundle instead', + __CLASS__ + ), + E_USER_DEPRECATED + ); + $this->internalFormatValidator = $internalFormatValidator; $this->inputConverterDispatcher = $inputConverterDispatcher; $this->inputNormalizer = $inputNormalizer; diff --git a/eZ/Publish/Core/FieldType/RichText/Validator.php b/eZ/Publish/Core/FieldType/RichText/Validator.php index c10c778455c..71d0e6cb80c 100644 --- a/eZ/Publish/Core/FieldType/RichText/Validator.php +++ b/eZ/Publish/Core/FieldType/RichText/Validator.php @@ -16,6 +16,8 @@ /** * Validates XML document using ISO Schematron (as XSLT stylesheet), XSD and RELAX NG schemas. + * + * @deprecated since 7.4, use \EzSystems\EzPlatformRichText\eZ\RichText\Validator\Validator from EzPlatformRichTextBundle. */ class Validator extends XmlBase { diff --git a/eZ/Publish/Core/FieldType/RichText/ValidatorDispatcher.php b/eZ/Publish/Core/FieldType/RichText/ValidatorDispatcher.php index 2d669ecea61..87dce9f21cc 100644 --- a/eZ/Publish/Core/FieldType/RichText/ValidatorDispatcher.php +++ b/eZ/Publish/Core/FieldType/RichText/ValidatorDispatcher.php @@ -13,6 +13,8 @@ /** * Dispatcher for various validators depending on the XML document namespace. + * + * @deprecated since 7.4, use \EzSystems\EzPlatformRichText\eZ\RichText\Validator\ValidatorDispatcher from EzPlatformRichTextBundle. */ class ValidatorDispatcher { diff --git a/eZ/Publish/Core/FieldType/RichText/Value.php b/eZ/Publish/Core/FieldType/RichText/Value.php index 0bd798ed50a..eccee8aa247 100644 --- a/eZ/Publish/Core/FieldType/RichText/Value.php +++ b/eZ/Publish/Core/FieldType/RichText/Value.php @@ -13,6 +13,8 @@ /** * Value for RichText field type. + * + * @deprecated since 7.4, use \EzSystems\EzPlatformRichText\eZ\FieldType\RichText\Value from EzPlatformRichTextBundle. */ class Value extends BaseValue { diff --git a/eZ/Publish/Core/FieldType/RichText/XmlBase.php b/eZ/Publish/Core/FieldType/RichText/XmlBase.php index e72b6bc3f43..5a2542a6744 100644 --- a/eZ/Publish/Core/FieldType/RichText/XmlBase.php +++ b/eZ/Publish/Core/FieldType/RichText/XmlBase.php @@ -14,6 +14,8 @@ /** * A base class for XML document handlers. + * + * @deprecated since 7.4, use \EzSystems\EzPlatformRichText\eZ\RichText\XmlBase from EzPlatformRichTextBundle. */ abstract class XmlBase {