Opened 12 years ago
Closed 12 years ago
#9636 closed Bug (fixed)
Do not extend the toolbarGroups config object
Reported by: | Frederico Caldeira Knabben | Owned by: | Piotrek Koszuliński |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 4.0 |
Component: | UI : Toolbar | Version: | 4.0 |
Keywords: | Cc: |
Description
Change the appendto.html sample with the following:
var globalConfig = { height: 50, toolbarGroups : [ { name: 'basicstyles', groups: [ 'basicstyles' ] } ] }; CKEDITOR.appendTo( 'section1', globalConfig ); CKEDITOR.appendTo( 'section1', globalConfig ); CKEDITOR.appendTo( 'section1', globalConfig );
Check the results :|
It seems that we're touching the original toolbarGroups configuration object internally. This brings troubles when there is a global configuration option in the application, which is reused by several editors.
If we want to use the original toolbarGroups object internally, we should make a depth copy of it instead.
Attachments (1)
Change History (6)
comment:1 Changed 12 years ago by
Owner: | set to Piotrek Koszuliński |
---|---|
Status: | new → assigned |
comment:2 Changed 12 years ago by
Status: | assigned → review |
---|
comment:3 Changed 12 years ago by
Status: | review → review_failed |
---|
To be bulletproof on other object based configuration as well, let's have it fixed it in the editor creation instead.
Changed 12 years ago by
Attachment: | 9636b.html added |
---|
comment:4 Changed 12 years ago by
Status: | review_failed → review |
---|
Sample 9636b.html shows that t/9636b solves only problem with sharing instance configs - global config is still shared. Thus t/9636 is still required to fix this completely. So we should use both patches. Original one to fix this exact issue and t/9636b to prevent some of the future issue with instance config sharing. But this still won't be enough to ensure 100% safety which can be achieved only by deep cloning of the entire config object.
comment:5 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | review → closed |
Pushed t/9636 on dev and tests.