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

Values returned from editor.config should not alter config store #5006

Closed
jodator opened this issue Nov 24, 2018 · 0 comments · Fixed by ckeditor/ckeditor5-utils#259
Closed
Assignees
Labels
package:utils type:bug This issue reports a buggy (incorrect) behavior. type:improvement This issue reports a possible enhancement of an existing feature.
Milestone

Comments

@jodator
Copy link
Contributor

jodator commented Nov 24, 2018

It happens to me from time to time and it probably will happen to devs outside the team.

editor.config.set( 'foo.bar', 'bar' );
const foo = editor.config.get( 'foo' );

foo.bar = 'baz';

console.log( editor.config.get( 'foo.bar' ) );
// will log 'baz' not 'bar' :/

I think that values returned from config should be cloned (at least for Objects & Arrays).

This is already handled by every plugin but I tend to forget about that - it's a side effect for me:

@jodator jodator self-assigned this Dec 3, 2018
oleq referenced this issue in ckeditor/ckeditor5-utils Dec 19, 2018
Other: Configuration options should be cloned to prevent features from altering the original values. Closes #257.
oleq referenced this issue in ckeditor/ckeditor5-ckfinder Dec 19, 2018
Internal: Simplified the way editor configuration is accessed (see ckeditor/ckeditor5-utils#257).
oleq referenced this issue in ckeditor/ckeditor5-heading Dec 19, 2018
Internal: Simplified the way editor configuration is accessed (see ckeditor/ckeditor5-utils#257).
oleq referenced this issue in ckeditor/ckeditor5-image Dec 19, 2018
Internal: Simplified the way editor configuration is accessed (see ckeditor/ckeditor5-utils#257).
oleq referenced this issue in ckeditor/ckeditor5-media-embed Dec 19, 2018
…ned values (see ckeditor/ckeditor5-utils#257).
oleq referenced this issue in ckeditor/ckeditor5-editor-balloon Dec 19, 2018
…list because Config#get started cloning returned values (see ckeditor/ckeditor5-utils#257).
@mlewand mlewand transferred this issue from ckeditor/ckeditor5-utils Oct 9, 2019
@mlewand mlewand added this to the iteration 22 milestone Oct 9, 2019
@mlewand mlewand added status:confirmed type:bug This issue reports a buggy (incorrect) behavior. type:improvement This issue reports a possible enhancement of an existing feature. package:utils labels Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:utils type:bug This issue reports a buggy (incorrect) behavior. type:improvement This issue reports a possible enhancement of an existing feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants