-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add richtext handler #11
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi!
Thanks for the PR. I've left a couple of comments for you. Let me know what you think!
namespace Netgen\Bundle\OpenGraphBundle\Handler\FieldType; | ||
|
||
use eZ\Publish\API\Repository\Values\Content\Field; | ||
use eZ\Publish\Core\FieldType\RichText\Value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this value deprecated and removed in eZ kernel v8? (master
branch is only for v8).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This field is add in eZ kernel v7 : https://github.com/ezsystems/ezpublish-kernel/tree/7.5/eZ/Publish/Core/FieldType/RichText
use eZ\Publish\Core\FieldType\RichText\Value; | ||
use Netgen\Bundle\OpenGraphBundle\Exception\FieldEmptyException; | ||
|
||
class RichText extends XmlText |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the signature of the value is the same, why not just add the rich text value check in the original supports
method and just tag the original implementation with a new tag in services.yml
?
Also, I plan to mark the all classes final before the next release, so that is one more incentive not to extend :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it's possible. But why close your code ?
EDIT: Nope, it is not possible because XmlText is only with eZ kernel < 7 and RichText is available with eZ kernel >= 7. The XmlText must be converted in RichText when you upgrade your project to Platform 2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what you mean.
In eZ kernel 7 rich text was included in eZ kernel. In v8, it was taken out to a separate package (https://github.com/ezsystems/ezplatform-richtext).
Additionally, there's a separate ezxmltext package which can be used on both v7 and v8.
In any case, if you wish to use old richtext namespace, this PR needs to go to v1 branch of this bundle.
As for final
, its simply because of best practices and less maintenance costs.
Ok, I close this PR |
The richtext handler extends the xml handler.