Skip to content
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

Closed
wants to merge 1 commit into from
Closed

add richtext handler #11

wants to merge 1 commit into from

Conversation

jbcr
Copy link

@jbcr jbcr commented Aug 6, 2019

The richtext handler extends the xml handler.

Copy link
Member

@emodric emodric left a 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;
Copy link
Member

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).

Copy link
Author

@jbcr jbcr Aug 6, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use eZ\Publish\Core\FieldType\RichText\Value;
use Netgen\Bundle\OpenGraphBundle\Exception\FieldEmptyException;

class RichText extends XmlText
Copy link
Member

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 :)

Copy link
Author

@jbcr jbcr Aug 6, 2019

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.

Copy link
Member

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.

@jbcr jbcr changed the base branch from master to 1.3 August 6, 2019 09:06
@jbcr jbcr changed the base branch from 1.3 to master August 6, 2019 09:07
@jbcr
Copy link
Author

jbcr commented Aug 6, 2019

Ok, I close this PR

@jbcr jbcr closed this Aug 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants