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
EZP-27628: Implement editing support for RichText FieldType #151
Conversation
doc/bc/changes-1.10.md
Outdated
## Changes | ||
- EZP-27628: Implement editing support for RichText FieldType | ||
|
||
What changed: `ezrepoforms.field_type.form_mapper.ezrichtext` requries `ezpublish.api.service.field_type` dependency. |
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.
requires
return ''; | ||
} | ||
|
||
return (string) $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.
If I get that correctly, that means the textarea will be filled with the XML internal format (docbook) which won't be super usable to have a Rich Text editor :)
Instead, the textarea should be filled with xhtml5edit
representation of the field 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.
Oh, you are right. I wasn't aware we are using two different schemas. The fact we are using some processors doing work "behind the scenes" didn't help either. Anyway, fixed it.
return $this->fieldType->getEmptyValue(); | ||
} | ||
|
||
return $this->fieldType->fromHash(['xml' => $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.
and maybe same here, is it enough to accept an xhtml5edit
document ?
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.
Funny fact - This is how it works in PlatformUI. UI is sending JSON object with xml
and xhtml5edit
properties but both contain the same markup (xhtml5edit). Kinda hackish but it is later picked up by a processor which is identifying the schema and converting to docbook. It works the way its implemented above as fromHash()
is taking care of it.
8a29ed0
to
c7db8a1
Compare
c7db8a1
to
3b1471d
Compare
3b1471d
to
c2d6fe5
Compare
Description
This PR provides basic editing support for:
ezrichtext
EZP-27628: Implement editing support for RichText FieldTypeIt exposes
<textarea></textarea>
element accepting RichText's XML markup.Please note it isn't prepared for Content translation yet. It also requires JS enrichment done in Hybrid UI.