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

Unify values returned in data.output during view-to-model conversion #4056

Closed
scofalik opened this issue Apr 24, 2017 · 1 comment · Fixed by ckeditor/ckeditor5-engine#933
Assignees
Labels
package:engine type:bug This issue reports a buggy (incorrect) behavior.
Milestone

Comments

@scofalik
Copy link
Contributor

ViewConverterBuilder#toAttribute() may return array as conversion result. This may happen when view element is converted to model attribute: https://github.com/ckeditor/ckeditor5-engine/blob/master/src/conversion/buildviewconverter.js#L369

Here, convertChildren returns array which is then passed as data.output.

The solution is to wrap convertChildren result in model.DocumentFragment.

@scofalik scofalik self-assigned this Apr 24, 2017
Reinmar referenced this issue in ckeditor/ckeditor5-engine Apr 25, 2017
Fix: Unified values returned in `data.output` during view-to-model conversion. See breaking changes. Closes #932.

BREAKING CHANGE: `ViewConversionDispatcher#convert()` will always return `model.DocumentFragment` (which may be empty in various cases). `conversionApi#convertItem()` will log a warning if `data.output` contains a different value than `model.Node` or `model.DocumentFragment` or `null`. `conversionApi#convertChildren()` will always return `model.DocumentFragment`.
@Reinmar Reinmar changed the title ViewConverterBuilder#toAttribute may return array as conversion result. Unify values returned in data.output during view-to-model conversion Apr 25, 2017
@Reinmar
Copy link
Member

Reinmar commented Apr 25, 2017

We changed the scope of this ticket during the review ckeditor/ckeditor5-engine#933 (comment).

@mlewand mlewand transferred this issue from ckeditor/ckeditor5-engine Oct 9, 2019
@mlewand mlewand added this to the iteration 10 milestone Oct 9, 2019
@mlewand mlewand added type:bug This issue reports a buggy (incorrect) behavior. package:engine labels Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:engine type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants